简体   繁体   中英

A class name can be the same as a protocol name in Swift?

A class name can be the same as a protocol name in Swift? I want to implement a protocol that has the same name as another class.

A class name can only be the same as a protocol name if they are in different modules, or if the class is nested inside another type. Even then, it will probably be confusing.

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