Hello, I am pretty new to swift programming and was watching a video made by apple on how to make an app. It seems as though the video is a little outdated, as one of the lines of code has an error. I will post the code below. Next to the code I will also write where the error is. If needed I can upload the files to the project. Thanks and I hope someone can help me fix this problem! (Value of optional type "UIImage?" not unwrapped' did you mean to use "!" or "?"?)
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var photoimageView: UIImageView!
let context = CIContext(options: nil)
@IBAction func applyFilter(_ sender: AnyObject) {
let inputImage = CIImage(image: photoimageView.image) This is where the error occurs
let randomColor = [kCIInputAngleKey: (Double(arc4random_uniform(314)) / 100)]
let filteredImage = inputImage.imageByApplyingFilter("CIHueAdjust", withInputPeramiters: randomColor)
let renderedImage = context.createCGImage(filteredImage, fromRect: filteredImage.extent())
photoimageView.image = UIImage(CGImage: renderedImage)
}
override func viewDidLoad() {
super.viewDidLoad()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
}
}