This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SDKROOT = iphoneos | |
SUPPORTED_PLATFORMS = iphonesimulator iphoneos | |
IPHONEOS_DEPLOYMENT_TARGET = 12.0 | |
ARCHS = $(ARCHS_STANDARD) | |
VALID_ARCHS = $(ARCHS_STANDARD) | |
VALIDATE_PRODUCT = YES | |
LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks | |
TARGETED_DEVICE_FAMILY = 1, 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import XCTest | |
#if !os(macOS) && !os(iOS) | |
public func allTests() -> [XCTestCaseEntry] { | |
return [ | |
testCase(spm_tutorialTests.allTests), | |
] | |
} | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
public final class FrameworkPackage { | |
public init () { } | |
public func randomColor() -> UIColor { | |
return UIColor.random | |
} | |
} | |
public extension UIColor { | |
public static var random: UIColor { | |
return UIColor(red: .random(in: 0...1), green: .random(in: 0...1), blue: .random(in: 0...1), alpha: 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
import class ios_framework_package.FrameworkPackage | |
class ViewController: UIViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
self.view.backgroundColor = FrameworkPackage().randomColor() | |
} | |
@IBAction func pressed(_ button: UIButton) { | |
self.view.backgroundColor = FrameworkPackage().randomColor() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Compile Swift Module 'ios_framework_package' (1 sources) | |
./spm-ios-example/ios-framework-package/Sources/ios-framework-package/ios_framework_package.swift:1:8: | |
error: no such module 'UIKit' | |
import UIKit | |
^ | |
error: terminated(1): /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool | |
-f./spm-ios-example/ios-framework-package/.build/debug.yaml main output: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
swift build \ | |
-Xswiftc "-sdk" -Xswiftc "`xcrun - sdk iphonesimulator - show-sdk-path`" \ | |
-Xswiftc "-target" -Xswiftc "x86_64-apple-ios12.1-simulator" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Compile Swift Module 'ios_framework_package' (1 sources) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ lipo -archs .build/x86_64-apple-macosx10.10/debug/ios_framework_package.build/ios_framework_package.swift.o | |
x86_64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ nm -extern-only -defined-only -just-symbol-name .build/x86_64-apple-macosx10.10/debug/ios_framework_package.build/ios_framework_package.swift.o | |
_$S12CoreGraphics7CGFloatVACSBAAWL | |
_$S12CoreGraphics7CGFloatVACSBAAWl | |
_$S12CoreGraphics7CGFloatVACSLAAWL | |
_$S12CoreGraphics7CGFloatVACSLAAWl | |
_$S21ios_framework_package16FrameworkPackageC11randomColorSo7UIColorCyF | |
_$S21ios_framework_package16FrameworkPackageCACycfC | |
_$S21ios_framework_package16FrameworkPackageCACycfc | |
_$S21ios_framework_package16FrameworkPackageCMa | |
_$S21ios_framework_package16FrameworkPackageCMm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
swift test \ | |
-Xswiftc "-sdk" -Xswiftc "`xcrun --sdk iphonesimulator --show-sdk-path`" \ | |
-Xswiftc "-target" -Xswiftc "x86_64-apple-ios12.1-simulator" |