0
class Test: UIViewController{

    func abc() {
        print("This is ABC")
    }
}

extension Test {
    func def(){
        print("This is DEF")
     }
}

我的问题是

  1. 声明的两种方法有什么区别?
  2. 方法def是静态方法吗?
  3. 扩展类以使用协议影响内存管理?
4

1 回答 1

0

what is the difference between both the methods declared?

没有,除了两件事

  1. 一个打印ABC另一个DEF,他们有不同的名字
  2. 您将无法覆盖扩展中的方法

Is method def a static method?

不,为此,你应该说static

extending class to use protocols effects memory management?

没有

于 2018-10-22T07:10:37.270 回答