Open ng-ha opened 1 week ago
@ng-ha yes, it's pretty trivial to add. I'll have more time next week to do it.
// ios/FasterImageViewManager.swift
@objc
func prefetch(_ sources: [String],
resolve: @escaping RCTPromiseResolveBlock,
reject: @escaping RCTPromiseRejectBlock) {
do {
let prefetcher = ImagePrefetcher()
let urls = sources.map { url in URL(string: url )}.compactMap{ $0 }
prefetcher.startPrefetching(with: urls)
resolve(true)
} catch { reject() }
}
Does this library support to preload images or plan to support this feature in the future?