Yassine Abou
07/04/2024, 3:15 PMactual fun downloadImageFromUrl(url: String, id: String): Flow<Boolean?> = flow {
// TODO: Call Swift code to download image and save to photo library in a custom album
}
Swift Code (to be called from Kotlin):
UIImage.load(from: URL(string: url)) { image in
if let image = image {
ThematicaPhotoAlbum.sharedInstance.createAlbum(image: image)
} else {
print("Image loading failed. Please try again.")
}
}