@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: