Swift导入两个同名模块

huangapple go评论56阅读模式
英文:

Swift import two modules with same name

问题

对于我使用的iOS应用程序,我使用了Daniel Gindi的Charts库。我目前正在从UIKit迁移到SwiftUI,并希望使用苹果的iOS Charts,该库从iOS 16及以后版本提供。该应用程序的目标是iOS 15及以上版本,这迫使我保留Daniel的Charts库。

所以基本上我有两个具有相同名称的模块,并且在导入语句方面无法区分它们。我该怎么办?

英文:

For an iOS app I use the Charts library from Daniel Gindi. I am currently migrating from UIKit to SwiftUI and would like to use iOS Charts from Apple which is available from iOS 16 onwards. The app targets iOS 15 + which forces me to keep Daniels Charts library also.

So basically I have two modules with the same name and concerning import statements cannot differentiate between the two. What can I do?

答案1

得分: 1

Module aliases 在 5.7 中添加,完全处理了这种情况。

英文:

Module aliases we’re added 5.7 which exactly handle this situation.

huangapple
  • 本文由 发表于 2023年2月6日 17:33:23
  • 转载请务必保留本文链接:https://go.coder-hub.com/75359517.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定