I've just downloaded the Incognito starter project and after I opened it, I converted it to the latest Swift syntax as the option was there. After that I got an error of linker command failed with exit code 1 (use -v to see invocation)
which I tried to fix using the advices from here. It helped me to fix the error. Then there were two other errors like this:
value of optional type 'NSData?' not unwrapped, did you mean to use '!' or '?'
and this:
value of optional type 'CGContext?' not unwrapped, did you mean to use '!' or '?'
For this function:
func snapshot() -> NSData {
UIGraphicsBeginImageContext(self.view.frame.size)
self.view.layer.renderInContext(UIGraphicsGetCurrentContext())
let fullScreenshot = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
UIImageWriteToSavedPhotosAlbum(fullScreenshot, nil, nil, nil)
return UIImageJPEGRepresentation(fullScreenshot, 0.5)
}
After listening to the constructor and fixing it, it turned out to be:
func snapshot() -> NSData {
UIGraphicsBeginImageContext(self.view.frame.size)
self.view.layer.renderInContext(UIGraphicsGetCurrentContext()!)
let fullScreenshot = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
UIImageWriteToSavedPhotosAlbum(fullScreenshot, nil, nil, nil)
return UIImageJPEGRepresentation(fullScreenshot, 0.5)!
}
But now I get the same error as in the beginning:
linker command failed with exit code 1 (use -v to see invocation)
Any help would be really appreciated!