Да, вы можете реализовать метод FusumaDelegate
fusumaImageSelected
(или fusumaMultipleImageSelected
, написать там любой код навигации (например, segues, метод pushViewController для navigationController или представление viewControllers) и пропустить через него свое изображение.
import UIKit
import Fusuma
class ViewController: UIViewController {
@IBOutlet weak var photoLibraryButton: UIButton!
let fusuma = FusumaViewController()
override func viewDidLoad() {
super.viewDidLoad()
fusuma.delegate = self
fusuma.allowMultipleSelection = true
}
@IBAction
func showPhotoLibrary() {
self.present(fusuma, animated: true, completion: nil)
}
}
extension ViewController: FusumaDelegate {
func fusumaImageSelected(_ image: UIImage, source: FusumaMode) {
let vc = UploadViewController()
vc.image = image
self.navigationController?.pushViewController(vc, animated: true)
}
func fusumaMultipleImageSelected(_ images: [UIImage], source: FusumaMode) {
let vc = UploadViewController()
guard let firstImage = images.first else { return }
vc.image = firstImage
self.navigationController?.pushViewController(vc, animated: true)
}
func fusumaVideoCompleted(withFileURL fileURL: URL) {
}
func fusumaCameraRollUnauthorized() {
}
}
А затем в UploadViewController вы можете делать все, что захотите:
import UIKit
class UploadViewController: ViewController {
public var image = UIImage()
var imageView: UIImageView!
override func viewDidLoad() {
super.viewDidLoad()
imageView = UIImageView(frame: view.frame)
imageView.image = self.image
view.addSubview(imageView)
}
}