Class-Only Protocols in Swift

后端 未结 4 1378
攒了一身酷
攒了一身酷 2021-02-03 20:51

I want some of my classes (not all) to conform using \'Class-Only Protocols\' from docs. What I am doing is

protocol RefreshData: class, ClassA, ClassB
{
    fun         


        
4条回答
  •  滥情空心
    2021-02-03 21:21

    protocol RefreshData : class
    {
        func updateController()
    }
    
    class ClassA : RefreshData
    {
        func updateController() {}
    }
    
    class ClassB : RefreshData
    {
        func updateController() {}
    }
    

提交回复
热议问题