Swift: declaration 'description' cannot override more than one superclass declaration

前端 未结 4 1761
深忆病人
深忆病人 2021-02-08 10:07

I have a structure of inheritance similar to the one below. I\'m adopting the Printable protocol and diligently override description property. I have encountered a bizarre error

4条回答
  •  耶瑟儿~
    2021-02-08 10:38

    What is the Printable Protocol? ;-)

    You could use a Getter of a property as

    var description: String {
        get {
            return "This is a test";
        }
    }
    

提交回复
热议问题