【发布时间】:2018-07-17 09:27:31
【问题描述】:
我有以下代码在注释标注的左侧附件视图中放置一个开关,但是当我点击它时开关不会改变
let switchDemo = UISwitch()
switchDemo.isOn = true
switchDemo.isEnabled = true;
switchDemo.setOn(true, animated: false)
switchDemo.addTarget(self, action: #selector(switchValueDidChange(_:)), for: .valueChanged)
annotationView.leftCalloutAccessoryView = switchDemo
我错过了什么吗?
【问题讨论】:
标签: ios swift4 mkannotation uiswitch