Hi all, I've created an action sheet and am trying to push to a viewController that I've already created and am having some troubles. I get as far as entering the function to push to a view controller but cannot work out how to add my actual viewController that it needs to push to. This code works perfectly to bring up my action sheet with the buttons options I require.
This is my current code but I'm looking for suggestions on how to make it push to a pre-made viewController:
@IBAction func displayActionSheet(_ sender: Any) {
let Menu = UIAlertController(title: nil, message: "Get Your Roast On", preferredStyle: .actionSheet)
let phone = UIAlertAction(title: "Call Us Now", style: .default, handler: {(alert: UIAlertAction!)->Void in print("Call Now")
})
let social = UIAlertAction(title: "Follow Us", style: .default, handler: {(alert: UIAlertAction!)-> Void in print("Follow")
})
let shop = UIAlertAction(title: "Merchandise", style: .default, handler: {(alert: UIAlertAction!)-> Void in print ("Open Shop")
})
let cancel = UIAlertAction(title: "Cancel", style: .cancel, handler: {(alert: UIAlertAction!)in print("Cancel Button Tapped")
})
Menu.addAction(phone)
Menu.addAction(social)
Menu.addAction(shop)
Menu.addAction(cancel)
present(Menu, animated: true, completion: nil)
}
Thanks!