Make property of type and also conform to protocol in Swift

前端 未结 2 641
不思量自难忘°
不思量自难忘° 2020-12-10 05:01

I would like to make a property that is of a certain type and also conforms to a protocol, which I would have done in Objective-C like this:

@property (nonat         


        
2条回答
  •  借酒劲吻你
    2020-12-10 05:34

    This is now possible using the built-in composition:

    var children = [UIViewController & NavigationScrollable]()

提交回复
热议问题