Post

Replies

Boosts

Views

Activity

Reply to How to add different actions to rightCalloutAcessoryView button for each annotation?
@Claude31 Should I add that kind of switch? If yes it is still showing only first VC: switch annotation.title!! {         case "0-One":             annotationView.markerTintColor = UIColor.gray             annotationView.glyphImage = UIImage(named: "one")         case "1-Two":             annotationView.markerTintColor = UIColor.black             annotationView.glyphImage = UIImage(named: "white_flag")             rightButton.addTarget(self, action: #selector(didClickDetailDisclosure2(button:)), for: .touchUpInside)// it should show the second VC but it still shows just this one When I do this:  switch annotation.title {         case 0:            annotationView.markerTintColor = UIColor.gray            annotationView.glyphImage = UIImage(named: "kopula")            rightButton.addTarget(self, action: #selector(didClickDetailDisclosure(button:)), for: .touchUpInside)         case 1:            annotationView.markerTintColor = UIColor.black            annotationView.glyphImage = UIImage(named: "white_flag")            rightButton.addTarget(self, action: #selector(didClickDetailDisclosure2(button:)), for: .touchUpInside)                      } It shows me Expression pattern of type 'Int' cannot match values of type 'String??'
Topic: UI Frameworks SubTopic: UIKit Tags:
Oct ’21
Reply to How to add different actions to rightCalloutAcessoryView button for each annotation?
@Claude31 I did sth like this and it changes the icon, but it does not change the VC: switch annotation.title!! {         case "One":             annotationView.markerTintColor = UIColor.gray             annotationView.glyphImage = UIImage(named: "one")         case "Two":             annotationView.markerTintColor = UIColor.black             annotationView.glyphImage = UIImage(named: "two")             rightButton.addTarget(self, action: #selector(didClickDetailDisclosure2(button:)), for: .touchUpInside) What do you mean by setting a tag to each annotation? Is it impossible to do it this way like icon style? Thank you in advance for your help.
Topic: UI Frameworks SubTopic: UIKit Tags:
Oct ’21
Reply to Open second ViewController with a button in annotationView
Ok, so I've added this and it works with objc function:  @objc func didClickDetailDisclosure(button: UIButton) {         guard let vc = storyboard?.instantiateViewController(withIdentifier: "second_vc") as? SecondController else {                     return                 }                 present(vc, animated: true)     } and this in my mapView func: rightButton.addTarget(self, action: #selector(didClickDetailDisclosure(button:)), for: .touchUpInside) But still I would like each annotation to open each VC. Thank you in advance for your help.
Topic: UI Frameworks SubTopic: UIKit Tags:
Oct ’21
Reply to How to add different actions to rightCalloutAcessoryView button for each annotation?
@Claude31 Should I add that kind of switch? If yes it is still showing only first VC: switch annotation.title!! {         case "0-One":             annotationView.markerTintColor = UIColor.gray             annotationView.glyphImage = UIImage(named: "one")         case "1-Two":             annotationView.markerTintColor = UIColor.black             annotationView.glyphImage = UIImage(named: "white_flag")             rightButton.addTarget(self, action: #selector(didClickDetailDisclosure2(button:)), for: .touchUpInside)// it should show the second VC but it still shows just this one When I do this:  switch annotation.title {         case 0:            annotationView.markerTintColor = UIColor.gray            annotationView.glyphImage = UIImage(named: "kopula")            rightButton.addTarget(self, action: #selector(didClickDetailDisclosure(button:)), for: .touchUpInside)         case 1:            annotationView.markerTintColor = UIColor.black            annotationView.glyphImage = UIImage(named: "white_flag")            rightButton.addTarget(self, action: #selector(didClickDetailDisclosure2(button:)), for: .touchUpInside)                      } It shows me Expression pattern of type 'Int' cannot match values of type 'String??'
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to How to add different actions to rightCalloutAcessoryView button for each annotation?
@Claude31 I did sth like this and it changes the icon, but it does not change the VC: switch annotation.title!! {         case "One":             annotationView.markerTintColor = UIColor.gray             annotationView.glyphImage = UIImage(named: "one")         case "Two":             annotationView.markerTintColor = UIColor.black             annotationView.glyphImage = UIImage(named: "two")             rightButton.addTarget(self, action: #selector(didClickDetailDisclosure2(button:)), for: .touchUpInside) What do you mean by setting a tag to each annotation? Is it impossible to do it this way like icon style? Thank you in advance for your help.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Open second ViewController with a button in annotationView
Ok, so I've added this and it works with objc function:  @objc func didClickDetailDisclosure(button: UIButton) {         guard let vc = storyboard?.instantiateViewController(withIdentifier: "second_vc") as? SecondController else {                     return                 }                 present(vc, animated: true)     } and this in my mapView func: rightButton.addTarget(self, action: #selector(didClickDetailDisclosure(button:)), for: .touchUpInside) But still I would like each annotation to open each VC. Thank you in advance for your help.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Oct ’21