我仍然是Swift编程的初学者,我正在尝试构建一个非常基本的iOS应用程序。该应用程序要求用户拍照并在照片编辑器上进行编辑。我遇到使用editor.photoEditorDelegate = self
的问题。我该如何纠正editor.photoEditorDelegate = self?
这是他的例子中使用的照片编辑器的开发人员,它没有给出任何问题,但它不适合我。它给出了一个错误:
无法指定类型'PhotosViewController?'的值键入'PhotoEditorDelegate?'
我试图与修复:
editor.photoEditorDelegate = self as? PhotoEditorDelegate
,但它只是让当编辑器被称为应用程序崩溃。
我宣布与编辑:
let editor = PhotoEditorViewController(nibName:"PhotoEditorViewController",bundle: Bundle(for: PhotoEditorViewController.self))
这是一个质量很低的答案。 –