I have the following code
import Foundation
let url = NSURL(string: copiedURL)
let data = NSData(contentsOfURL: url!)
print("\(data)")
let image2 = UIImage(data: data!)
When I build and run, I get the following error fatal error: unexpectedly found nil while unwrapping an Optional value
referring to
let image2 = UIImage(data: data!)
I tried to modify my Info.plist
with the following
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
But the error is still there. Is there any more possible solutions I can try?