Using CoreGraphics , I am able to get click location.
My requirement is to open different UIViewController
base on clicks on different areas of an image.
You need to create a new UIViewController
base on location of your touch using one of the following:
Create it manually
let controller = SubclassViewController() //prepare your view controller here
Instantiate controller from storyboard
if let controller = storyboard.instantiateViewControllerWithIdentifier("identifier") as? SubclassViewController { //prepare your view controller here }
Perform segue to new view controller
performSegueWithIdentifier("segueIdentifier")
Then prepare your view controller within prepareForSegue:
if let controller = segue.destinationViewController as? SubclassViewController { //prepare your controller here }
Depending on what your app is doing, you can either to push your new view controller or present it manually
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.