简体   繁体   中英

Swift can't use protocol from framework

I create simple framework in Swift that contain public protocol. I did add it to my project, added import, and try to add variable to my class that is actually a protocol that my framework declare. However, i got an error:

 Use of undeclared type 'PaymentTerminal'

I declare it like this:

public protocol PaymentTerminal: class {

}

In my class, i add import my framework :

import PaymentTerminalInterface

Then try to:

var terminal: PaymentTerminal!

And got an error i describe above.

When i try to cmd+press on PaymentTerminal in var terminal: PaymentTerminal! i successfully dig in protocol declaration.

我将框架中的部署iOS目标版本更改为与我的应用程序相同后,问题已解决。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM