Initializer is inaccessable due to 'internal' protection level

前端 未结 2 866
生来不讨喜
生来不讨喜 2021-02-02 04:36

I have some protocols

LoginStrategy

public protocol LoginStrategy {
    func login(_ viewController: UIViewController)
    func getUserI         


        
2条回答
  •  感情败类
    2021-02-02 05:24

    Just add to your FacebookLoginStrategy:

    public init() {}
    

    As long as you do not implement init() explicitly, it is marked as internal by default. You need to overwrite that permission level to be able to instantiate from outside your framework.

提交回复
热议问题