简体   繁体   English

如何在 Swift 5 中将一个包与另一个自定义包捆绑在一起?

[英]How can I bundle a Package with another custom Package in Swift 5?

I created a custom Package MyCustomPackage and would like to mimic the following UIKit / SwiftUI behavior.我创建了一个自定义 Package MyCustomPackage并想模仿以下UIKit / SwiftUI行为。

import SwiftUI / UIKit      // Already imports Foundation

import Foundation           //
import MyCustomPackage      // I have to manually import Foundation 

How can I achieve my goal of already bundling MyCustomPackage with Foundation ?如何实现已经将MyCustomPackageFoundation捆绑在一起的目标?

import Foundation
import MyCustomPackage

class BaseVC: UIViewController {

}

Then, use this BaseVc any where in the project然后,在项目的任何地方使用这个 BaseVc

import UIKit

class LoginVC: BaseVC {

}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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