我对使用swift 3的swift编码很陌生。
我创建了我的应用程序来成功地从photolib中选择图像,现在我正在尝试选择多个图像,我想知道在我的应用程序中使用ELCImagePickerController
的步骤。
如何添加库和步骤,使我可以添加其相关代码并在Xcode中使用控制器及其所有功能?
简单地说,如何将第二方定制代码嵌入到我的代码中?
最佳答案
Download whole working project
工作代码
import UIKit
class ViewController: UIViewController, ELCImagePickerControllerDelegate {
var picker = ELCImagePickerController(imagePicker: ())
override func viewDidLoad() {
super.viewDidLoad()
}
override func viewDidAppear(animated: Bool) {
picker.maximumImagesCount = 5
picker.imagePickerDelegate = self
self.presentViewController(picker, animated: true, completion: nil)
}
func elcImagePickerController(picker: ELCImagePickerController!, didFinishPickingMediaWithInfo info: [AnyObject]!) {
}
func elcImagePickerControllerDidCancel(picker: ELCImagePickerController!) {
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
有一个愉快的编码。