Cannot specialize non-generic type 'UIViewController'

时间:2015-05-04 19:25:42

标签: ios uiscrollviewdelegate

I am trying to use UIScrollViewDelegate:

class ViewController: UIViewController <UIScrollViewDelegate> {}

But I have error: Cannot specialize non-generic type 'UIViewController'

1 个答案:

答案 0 :(得分:17)

Your syntax is incorrect. You don't use the brackets in Swift,

class ViewController: UIViewController, UIScrollViewDelegate {}