@IBAction func savePicture(sender: AnyObject) {
UIGraphicsBeginImageContextWithOptions(mainImageView.frame.size,false,0.0)
mainImageView.layer.renderInContext(UIGraphicsGetCurrentContext())
let image = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
let alert = SCLAlertView()
alert.addButton("YES", action: {
UIImageWriteToSavedPhotosAlbum(image,nil,nil,nil)
//Save pop success tips
let alert1 = SCLAlertView()
alert1.showSuccess(self, title: "Saved successfully", subTitle: "^_^", closeButtonTitle: "OK", duration: 0)
//I want to link to another View controller
})
alert.showInfo(self, title: "Okay to save?", subTitle: "Pictures will be saved to the album", closeButtonTitle: "NO", duration: 0)
}
我需要鏈接到另一個TableViewController後,他們已經成功地保存在照片庫中的圖片。斯威夫特imageview的控制器需要幫助的另一個視圖控制器
**我曾嘗試推動這個代碼,但它不工作
var VC1 = self.storyboard?.instantiateViewControllerWithIdentifier("MyViewController") as ViewController
let navController = UINavigationController(rootViewController: VC1) // Creating a navigation controller with VC1 at the root of the navigation stack.
self.presentViewController(navController, animated:true, completion: nil)
請幫我謝謝!
你不能只執行一個segue嗎? –
你是否想將圖像傳遞給下一個視圖控制器? – iAnurag
我們需要更多信息。什麼沒有奏效?你看到了什麼?是否有任何錯誤輸出到控制檯? – dasdom