'Switch Case not executing - No case is met
I have the following code to check which radio button is clicked by the user.
@IBAction func text_radio_changed(_ sender: Any) {
var text_position:WatermarkPosition
let button:NSButton = sender as! NSButton
let id:String = button.identifier!.rawValue
switch id {
case "topleft":
text_position=WatermarkPosition.topleft
case "topcenter":
text_position=WatermarkPosition.topcenter
case "topright":
text_position=WatermarkPosition.topright
case "leftsidecenter":
text_position=WatermarkPosition.leftsidecenter
case "center":
text_position=WatermarkPosition.center
case "rightsidecenter":
text_position=WatermarkPosition.rightsidecenter
case "bottomleft":
text_position=WatermarkPosition.bottomleft
case "bottomcenter":
text_position=WatermarkPosition.bottomcenter
case "bottomright":
text_position=WatermarkPosition.bottomright
default:
text_position=WatermarkPosition.center
}
}
On debugging I can find the the value of id is properly passed but does not enter any switch

Setting identifier
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

