Answer the question
In order to leave comments, you need to log in
Xib on button click switch to view controller?
There is xib that appears when you click on a marker on the map.
It is defined as uiview, there is a button in this xib.
How to make a transition to another screen.
Answer the question
In order to leave comments, you need to log in
Resolved the issue.
Added a button in the XIB class as @IBOutlet.
func mapView(_ mapView: MKMapView,
didSelect view: MKAnnotationView)
{
let button2 = UIButton(frame: calloutView.GotoProfileUsr.frame)
button2.addTarget(self, action: #selector(ViewController.ProfileInfo(sender:)), for: . touchUpInside)
calloutView.addSubview(button2)
}
And hung up the handler.
func ProfileInfo(sender: UIButton){
performSegue(withIdentifier: "id", sender: self)
func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
let vc = segue.destination as? ProfileUsersViewController
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question