image with name in swift 5 || fetch image by name in iOS

Solution:

 In swift 4 we can use the below code to fetch image by name

UIImagePNGRepresentation(UIImage(named: "imageName")!)!

Swift 5:

return UIImage(named: "imageName")!.pngData()!

Comments

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

Saved Image in document directory and save path in coredata not able to fetch the image file iOS swift