5

Maui.Nuke: native image caching for iOS

 1 year ago
source link: https://www.sharpnado.com/maui-nuke/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Maui.Nuke: native image caching for iOS

Jean-Marie Alfonsi

Feb 14, 2023 • 2 min read
Maui.Nuke: native image caching for iOS

Nuke image caching library for dotnet MAUI.

46e3fd4f-6f9c-426a-a436-4fbad141e17c

Get it from NuGet:

Nuget

Before, in Xamarin.Forms, to speed up our image loading we could use GlideX on Android, and Xamarin.Forms.Nuke on iOS.

With this solution, we achieved a perfect efficient native image caching solution for both platform.

But since MAUI, the Android platform has integrated the Glide native library. No need to use GlideX now.
Unfortunately on iOS there is no integrated native caching...

It means the caching and performance of using images on iOS is not so great in terms of speed and memory usage.

But rejoice!

Maui.Nuke is here to repair this injustice by implementing image caching with the fastest and most popular ios native caching library: Nuke \o/

monty-python-rejoice-1.gif

Moreover, once installed, it is completely transparent to the user, you use your Image views just like before, all the work is done under the hood.

This project is using the NukeProxy library, which is a Swift .net6 proxy to the nuke native library. The new binding and the packaging has been done by the great @cheesebaron. Hail to the Cheese!

Current version of the Nuke library is 10.3.1.

Installation

public static MauiApp CreateMauiApp()
{
    var builder = MauiApp.CreateBuilder();
    builder
        .UseMauiApp<App>()
        .UseNuke(showDebugLogs: false);
}

You just achieved 90%+ memory reduction when manipulating Image views.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK