Type “myViewController” does not conform to protocol UIPIckerDataSource in Swift

前端 未结 5 729
盖世英雄少女心
盖世英雄少女心 2020-12-13 23:50

I just create a new class in Swift, it\'s called myViewController and it\'s a UIViewController. Now I\'m trying to make it a UIPickerViewDelegate

5条回答
  •  盖世英雄少女心
    2020-12-14 00:41

    My problem was that I had override in front of the implementation function, where Swift doesn't consider protocol method implementations to be overrides (same). Just taking out the override keyword fixed the issue.

提交回复
热议问题