-
Notifications
You must be signed in to change notification settings - Fork 376
iOS API
On iOS images can be loaded from Internet or File.
When the image is loaded from internet the image is cached on disk (by default 30 days but there is an optional TimeSpan so you can choose yours).
ImageService.LoadUrl(urlToImage).Into(_imageView);
On iOS9 you might need to configure ATS (App Transport Security): http://ste.vn/2015/06/10/configuring-app-transport-security-ios-9-osx-10-11/ By default ATS prevents requests to non HTTPS website. This is easily configurable.
when you want to load the image from a file or application bundle:
ImageService.LoadFile(fullPathToImage).Into(_imageView);
Remark: on iOS both ImageService.LoadFileFromApplicationBundle
and ImageService.CompiledResource
have the same effect as ImageService.LoadFile
.
The image can be loaded from an existing Stream. In this case the image is not cached in memory. Please note that the Stream is automatically closed.
ImageService.LoadStream(originalStream).Into(_imageView);
WebP is supported on iOS using WebP.Touch (included as a Nuget dependency). WebP.Touch is a wrapper around official WebP lib from Google. Requested URL or requested file must end with .webp to be correctly decoded.