2016-09-28 154 views
0

我试图将我的库与Swift包管理器集成。 运行swift build之后,它成功下载的依赖,但后来它也给我下面的错误:未声明类型adter'swift build'

/Users/nikita/Documents/Projects/Projects/TestFramezilla/test/Packages/Framezilla-0.1.1/Sources/UIView+Installer.swift:14:18: error: use of undeclared type 'UIView' 
public extension UIView { 
       ^~~~~~ 
/Users/nikita/Documents/Projects/Projects/TestFramezilla/test/Packages/Framezilla-0.1.1/Sources/UIView+Installer.swift:29:18: error: use of undeclared type 'UIView' 
public extension UIView { 
       ^~~~~~ 
/Users/nikita/Documents/Projects/Projects/TestFramezilla/test/Packages/Framezilla-0.1.1/Sources/UIView+Relations.swift:27:11: error: use of undeclared type 'UIView' 
extension UIView { 
      ^~~~~~ 
/Users/nikita/Documents/Projects/Projects/TestFramezilla/test/Packages/Framezilla-0.1.1/Sources/UIView+Relations.swift:39:18: error: use of undeclared type 'UIView' 
public extension UIView { 

的CocoaPods和迦太基做工精细。我真的花了很多时间,不明白我做错了什么。希望可以有人帮帮我!

回答

1

看起来你正在尝试构建一个iOS框架。包管理器本身目前不支持直接针对其运行的其他平台(本例中为macOS)。

如果您想为iOS构建,您必须通过生成一个Xcode项目并从中编译(swift package generate-xcodeproj)。您可能仍然需要手动修改生成的项目以将其更改为使用iOS SDK。