我目前正在构建一个弹出模式视图的应用程序,其中包含 WkWebView。当我想在此模态视图中上传图像并出现“照片选择”时,模态视图会返回给启动它的视图控制器。
我怎样才能防止这种情况?
import UIKit
class PostWindow : UIViewController {
@IBAction func close(sender: AnyObject) {
dismissViewControllerAnimated(true, completion: nil)
}
override func viewDidLoad() {
super.viewDidLoad()
// do stuff here
let myWebView:UIWebView = UIWebView(frame: CGRectMake(0, 70, UIScreen.mainScreen().bounds.width, UIScreen.mainScreen().bounds.height))
myWebView.loadRequest(NSURLRequest(URL: NSURL(string: "https://m.facebook.com/")!))
self.view.addSubview(myWebView)
self.title = "News Feed"
UIApplication.sharedApplication().setStatusBarStyle(UIStatusBarStyle.Default, animated: true)
UIApplication.sharedApplication().statusBarHidden = false
/*let addButton: UIBarButtonItem = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.Search,
target: self,
action: #selector(self.openSearch(_:)))
self.navigationItem.setRightBarButtonItems([addButton], animated: true)*/
self.navigationController?.navigationBar.tintColor = UIColor.blackColor()
}
override func preferredStatusBarStyle() -> UIStatusBarStyle {
return UIStatusBarStyle.LightContent
}
}
谢谢!