Swift Package Manager - UIKit Dependency
Currently Swift Package Manager has full Xcode support. I was able to get around this error by specifying in my Package.swift manifest that the platform was iOS.
let package = Package(
name: "MyPackage",
platforms: [
.iOS(.v8)
],
Then you can open the Package.swift file in Xcode and it will just work.
How to create and build a swift package
UIKit
is a framework in iOS and won't be accessible.
#if canImport(UIKit)
// Code specific to platforms where UIKit is available
#endif
Related:
- Creating a Swift Package with Xcode
Related Topics
Programmatically Creating Constraints Bound to View Controller Margins
How Set Rootviewcontroller in Scene Delegate iOS 13
Implementing Nscopying in Swift with Subclasses
Grab Frames from Video Using Swift
Checking If Textfields Are Empty Swift
Swift 2 Protocol Extension Not Calling Overridden Method Correctly
Draw a Hole in a Rectangle with Spritekit
"Unrecognized Selector Sent to Instance" in Swift
How to Write Inline Assembly in Swift
How to Print a String from Plist Without "Optional"
Back Button Image - What Is It Called in Swift
Two Tables on One View in Swift
How to Open Your App in Settings iOS 11
How to Disable Vertical Scroll in Tabview with Swiftui
How to Implement Copy Constructor in Swift Subclass
What's the Difference Between Using or Not Using the 'Where' Clause with Generics