From b58ea013412adafee937124e8888b14b6081c4ad Mon Sep 17 00:00:00 2001 From: Stefan Nebel Date: Sun, 28 Jun 2020 20:23:46 +0200 Subject: [PATCH] add objc support --- BIASystemKit.podspec | 2 +- .../BIASystemKitExampleObjC_Info.plist | 0 .../BIASystemKitExampleSwift_Info.plist | 44 ++++ BIASystemKit.xcodeproj/project.pbxproj | 227 ++++++++++++++++-- .../xcschemes/BIASystemKit.xcscheme | 77 ++++++ .../xcschemes/Example ObjC.xcscheme | 88 +++++++ ...xample.xcscheme => Example Swift.xcscheme} | 12 +- .../xcschemes/xcschememanagement.plist | 22 +- BIASystemKit/UIDevice/DeviceHelper.swift | 2 +- BIASystemKit/UIDevice/UIDevice.swift | 2 + Example/ObjC/AppDelegate.h | 11 + Example/ObjC/AppDelegate.m | 26 ++ .../AppIcon.appiconset/Contents.json | 0 .../{ => ObjC}/Assets.xcassets/Contents.json | 0 .../Base.lproj/LaunchScreen.storyboard | 0 Example/ObjC/ExampleViewController.h | 16 ++ Example/ObjC/ExampleViewController.m | 31 +++ Example/ObjC/ExampleViewModel.h | 14 ++ Example/ObjC/ExampleViewModel.m | 20 ++ Example/ObjC/main.m | 19 ++ Example/{ => Swift}/AppDelegate.swift | 0 .../AppIcon.appiconset/Contents.json | 98 ++++++++ Example/Swift/Assets.xcassets/Contents.json | 6 + .../Swift/Base.lproj/LaunchScreen.storyboard | 25 ++ .../{ => Swift}/ExampleViewController.swift | 0 Example/{ => Swift}/ExampleViewModel.swift | 0 Package.swift | 8 +- Tests/BIASystemKitTests/Tests.swift | 4 + 28 files changed, 720 insertions(+), 34 deletions(-) rename Example/Info.plist => BIASystemKit.xcodeproj/BIASystemKitExampleObjC_Info.plist (100%) create mode 100644 BIASystemKit.xcodeproj/BIASystemKitExampleSwift_Info.plist create mode 100644 BIASystemKit.xcodeproj/xcshareddata/xcschemes/BIASystemKit.xcscheme create mode 100644 BIASystemKit.xcodeproj/xcshareddata/xcschemes/Example ObjC.xcscheme rename BIASystemKit.xcodeproj/xcshareddata/xcschemes/{Example.xcscheme => Example Swift.xcscheme} (90%) create mode 100644 Example/ObjC/AppDelegate.h create mode 100644 Example/ObjC/AppDelegate.m rename Example/{ => ObjC}/Assets.xcassets/AppIcon.appiconset/Contents.json (100%) rename Example/{ => ObjC}/Assets.xcassets/Contents.json (100%) rename Example/{ => ObjC}/Base.lproj/LaunchScreen.storyboard (100%) create mode 100644 Example/ObjC/ExampleViewController.h create mode 100644 Example/ObjC/ExampleViewController.m create mode 100644 Example/ObjC/ExampleViewModel.h create mode 100644 Example/ObjC/ExampleViewModel.m create mode 100644 Example/ObjC/main.m rename Example/{ => Swift}/AppDelegate.swift (100%) create mode 100644 Example/Swift/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 Example/Swift/Assets.xcassets/Contents.json create mode 100644 Example/Swift/Base.lproj/LaunchScreen.storyboard rename Example/{ => Swift}/ExampleViewController.swift (100%) rename Example/{ => Swift}/ExampleViewModel.swift (100%) diff --git a/BIASystemKit.podspec b/BIASystemKit.podspec index 7390d15..5e39474 100644 --- a/BIASystemKit.podspec +++ b/BIASystemKit.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'BIASystemKit' - s.version = '0.1.1' + s.version = '1.0' s.license = 'MIT' s.summary = 'iOS SystemKit Framework (best-ios-apps.de)' s.homepage = 'https://www.best-ios-apps.de' diff --git a/Example/Info.plist b/BIASystemKit.xcodeproj/BIASystemKitExampleObjC_Info.plist similarity index 100% rename from Example/Info.plist rename to BIASystemKit.xcodeproj/BIASystemKitExampleObjC_Info.plist diff --git a/BIASystemKit.xcodeproj/BIASystemKitExampleSwift_Info.plist b/BIASystemKit.xcodeproj/BIASystemKitExampleSwift_Info.plist new file mode 100644 index 0000000..2c0a673 --- /dev/null +++ b/BIASystemKit.xcodeproj/BIASystemKitExampleSwift_Info.plist @@ -0,0 +1,44 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + $(MARKETING_VERSION) + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + UIInterfaceOrientationPortraitUpsideDown + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/BIASystemKit.xcodeproj/project.pbxproj b/BIASystemKit.xcodeproj/project.pbxproj index bcca260..5d57fe1 100644 --- a/BIASystemKit.xcodeproj/project.pbxproj +++ b/BIASystemKit.xcodeproj/project.pbxproj @@ -7,7 +7,20 @@ objects = { /* Begin PBXBuildFile section */ + 3629E5FC24A6B4300096E54D /* device-map-ipad.json in Resources */ = {isa = PBXBuildFile; fileRef = 36FA0D9D2496EF6E007268F7 /* device-map-ipad.json */; }; + 3629E5FD24A6B4330096E54D /* device-map-iphone.json in Resources */ = {isa = PBXBuildFile; fileRef = 36FA0D9F2496EF6E007268F7 /* device-map-iphone.json */; }; + 3629E5FE24A6B4350096E54D /* device-map-ipod.json in Resources */ = {isa = PBXBuildFile; fileRef = 36FA0D9E2496EF6E007268F7 /* device-map-ipod.json */; }; + 3629E5FF24A6B4370096E54D /* device-map-iwatch.json in Resources */ = {isa = PBXBuildFile; fileRef = 36FA0DA02496EF6E007268F7 /* device-map-iwatch.json */; }; + 3629E60024A6B4390096E54D /* device-map-simulator.json in Resources */ = {isa = PBXBuildFile; fileRef = 36FA0DA12496EF6E007268F7 /* device-map-simulator.json */; }; 3661A8AD2496C43E00E08AAA /* UIDevice.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3661A8AC2496C43E00E08AAA /* UIDevice.swift */; }; + 368281C624A90D4200C196D6 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 368281C524A90D4200C196D6 /* AppDelegate.m */; }; + 368281CC24A90D4200C196D6 /* ExampleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 368281CB24A90D4200C196D6 /* ExampleViewController.m */; }; + 368281D124A90D4200C196D6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 368281D024A90D4200C196D6 /* Assets.xcassets */; }; + 368281D424A90D4200C196D6 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 368281D224A90D4200C196D6 /* LaunchScreen.storyboard */; }; + 368281D724A90D4200C196D6 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 368281D624A90D4200C196D6 /* main.m */; }; + 368281DB24A90D8300C196D6 /* BIASystemKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 369E579D2496C10900253C90 /* BIASystemKit.framework */; }; + 368281DC24A90D8300C196D6 /* BIASystemKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 369E579D2496C10900253C90 /* BIASystemKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 368281E224A90E0000C196D6 /* ExampleViewModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 368281E124A90E0000C196D6 /* ExampleViewModel.m */; }; 368B149324A6A400001E8D8C /* Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36DF030E24A6A22A00C58759 /* Tests.swift */; }; 369E57A22496C10900253C90 /* BIASystemKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 369E57A02496C10900253C90 /* BIASystemKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; 369E57AF2496C11B00253C90 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 369E57AE2496C11B00253C90 /* AppDelegate.swift */; }; @@ -27,6 +40,13 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + 368281DD24A90D8300C196D6 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 369E57942496C10900253C90 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 369E579C2496C10900253C90; + remoteInfo = BIASystemKit; + }; 36A02A662496CE2A00DBDEB6 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 369E57942496C10900253C90 /* Project object */; @@ -44,6 +64,17 @@ /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ + 368281DF24A90D8300C196D6 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 368281DC24A90D8300C196D6 /* BIASystemKit.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; 36A02A4F2496CABB00DBDEB6 /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; @@ -61,16 +92,25 @@ 3604F3012496E1D1005276A7 /* .gitignore */ = {isa = PBXFileReference; lastKnownFileType = text; path = .gitignore; sourceTree = SOURCE_ROOT; }; 362BE4972496E26B00C7CDDD /* .swiftlint.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = .swiftlint.yml; sourceTree = SOURCE_ROOT; }; 3661A8AC2496C43E00E08AAA /* UIDevice.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIDevice.swift; sourceTree = ""; }; + 368281C224A90D4100C196D6 /* Example ObjC.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Example ObjC.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 368281C424A90D4200C196D6 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 368281C524A90D4200C196D6 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 368281CA24A90D4200C196D6 /* ExampleViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ExampleViewController.h; sourceTree = ""; }; + 368281CB24A90D4200C196D6 /* ExampleViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ExampleViewController.m; sourceTree = ""; }; + 368281D024A90D4200C196D6 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 368281D324A90D4200C196D6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 368281D624A90D4200C196D6 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 368281E024A90E0000C196D6 /* ExampleViewModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ExampleViewModel.h; sourceTree = ""; }; + 368281E124A90E0000C196D6 /* ExampleViewModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ExampleViewModel.m; sourceTree = ""; }; 36992DBA2496E29B002CFC19 /* BIASystemKit.podspec */ = {isa = PBXFileReference; lastKnownFileType = text; path = BIASystemKit.podspec; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 36992DBB2496E304002CFC19 /* LICENCE */ = {isa = PBXFileReference; lastKnownFileType = text; path = LICENCE; sourceTree = SOURCE_ROOT; }; 369E579D2496C10900253C90 /* BIASystemKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = BIASystemKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 369E57A02496C10900253C90 /* BIASystemKit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BIASystemKit.h; sourceTree = ""; }; - 369E57AC2496C11B00253C90 /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 369E57AC2496C11B00253C90 /* Example Swift.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Example Swift.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 369E57AE2496C11B00253C90 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 369E57B22496C11B00253C90 /* ExampleViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleViewController.swift; sourceTree = ""; }; 369E57B72496C11E00253C90 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 369E57BA2496C11E00253C90 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 369E57BC2496C11E00253C90 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 369E57C32496C21000253C90 /* Project-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Project-Debug.xcconfig"; sourceTree = ""; }; 369E57C42496C22A00253C90 /* Project-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Project-Release.xcconfig"; sourceTree = ""; }; 369E57C72496C34E00253C90 /* ExampleViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleViewModel.swift; sourceTree = ""; }; @@ -86,6 +126,14 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 368281BF24A90D4100C196D6 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 368281DB24A90D8300C196D6 /* BIASystemKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 369E579A2496C10900253C90 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -123,6 +171,34 @@ path = Maintenance; sourceTree = ""; }; + 368281A524A90CBE00C196D6 /* Swift */ = { + isa = PBXGroup; + children = ( + 369E57AE2496C11B00253C90 /* AppDelegate.swift */, + 369E57B22496C11B00253C90 /* ExampleViewController.swift */, + 369E57C72496C34E00253C90 /* ExampleViewModel.swift */, + 369E57B72496C11E00253C90 /* Assets.xcassets */, + 369E57B92496C11E00253C90 /* LaunchScreen.storyboard */, + ); + path = Swift; + sourceTree = ""; + }; + 368281C324A90D4200C196D6 /* ObjC */ = { + isa = PBXGroup; + children = ( + 368281C424A90D4200C196D6 /* AppDelegate.h */, + 368281C524A90D4200C196D6 /* AppDelegate.m */, + 368281E024A90E0000C196D6 /* ExampleViewModel.h */, + 368281E124A90E0000C196D6 /* ExampleViewModel.m */, + 368281CA24A90D4200C196D6 /* ExampleViewController.h */, + 368281CB24A90D4200C196D6 /* ExampleViewController.m */, + 368281D024A90D4200C196D6 /* Assets.xcassets */, + 368281D224A90D4200C196D6 /* LaunchScreen.storyboard */, + 368281D624A90D4200C196D6 /* main.m */, + ); + path = ObjC; + sourceTree = ""; + }; 369E57932496C10900253C90 = { isa = PBXGroup; children = ( @@ -140,8 +216,9 @@ isa = PBXGroup; children = ( 369E579D2496C10900253C90 /* BIASystemKit.framework */, - 369E57AC2496C11B00253C90 /* Example.app */, + 369E57AC2496C11B00253C90 /* Example Swift.app */, 36A02A602496CE2A00DBDEB6 /* BIASystemKitTests.xctest */, + 368281C224A90D4100C196D6 /* Example ObjC.app */, ); name = Products; sourceTree = ""; @@ -158,12 +235,8 @@ 369E57AD2496C11B00253C90 /* Example */ = { isa = PBXGroup; children = ( - 369E57BC2496C11E00253C90 /* Info.plist */, - 369E57AE2496C11B00253C90 /* AppDelegate.swift */, - 369E57B22496C11B00253C90 /* ExampleViewController.swift */, - 369E57C72496C34E00253C90 /* ExampleViewModel.swift */, - 369E57B72496C11E00253C90 /* Assets.xcassets */, - 369E57B92496C11E00253C90 /* LaunchScreen.storyboard */, + 368281C324A90D4200C196D6 /* ObjC */, + 368281A524A90CBE00C196D6 /* Swift */, ); path = Example; sourceTree = ""; @@ -246,6 +319,25 @@ /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ + 368281C124A90D4100C196D6 /* Example ObjC */ = { + isa = PBXNativeTarget; + buildConfigurationList = 368281D824A90D4200C196D6 /* Build configuration list for PBXNativeTarget "Example ObjC" */; + buildPhases = ( + 368281BE24A90D4100C196D6 /* Sources */, + 368281BF24A90D4100C196D6 /* Frameworks */, + 368281C024A90D4100C196D6 /* Resources */, + 368281DF24A90D8300C196D6 /* Embed Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 368281DE24A90D8300C196D6 /* PBXTargetDependency */, + ); + name = "Example ObjC"; + productName = "Example ObjC"; + productReference = 368281C224A90D4100C196D6 /* Example ObjC.app */; + productType = "com.apple.product-type.application"; + }; 369E579C2496C10900253C90 /* BIASystemKit */ = { isa = PBXNativeTarget; buildConfigurationList = 369E57A52496C10900253C90 /* Build configuration list for PBXNativeTarget "BIASystemKit" */; @@ -264,9 +356,9 @@ productReference = 369E579D2496C10900253C90 /* BIASystemKit.framework */; productType = "com.apple.product-type.framework"; }; - 369E57AB2496C11B00253C90 /* Example */ = { + 369E57AB2496C11B00253C90 /* Example Swift */ = { isa = PBXNativeTarget; - buildConfigurationList = 369E57BD2496C11E00253C90 /* Build configuration list for PBXNativeTarget "Example" */; + buildConfigurationList = 369E57BD2496C11E00253C90 /* Build configuration list for PBXNativeTarget "Example Swift" */; buildPhases = ( 369E57A82496C11B00253C90 /* Sources */, 369E57A92496C11B00253C90 /* Frameworks */, @@ -279,9 +371,9 @@ dependencies = ( 36A2457524A6A58C00203EC8 /* PBXTargetDependency */, ); - name = Example; + name = "Example Swift"; productName = Example; - productReference = 369E57AC2496C11B00253C90 /* Example.app */; + productReference = 369E57AC2496C11B00253C90 /* Example Swift.app */; productType = "com.apple.product-type.application"; }; 36A02A5F2496CE2A00DBDEB6 /* BIASystemKitTests */ = { @@ -312,6 +404,9 @@ LastUpgradeCheck = 1150; ORGANIZATIONNAME = "Best-iOS-Apps"; TargetAttributes = { + 368281C124A90D4100C196D6 = { + CreatedOnToolsVersion = 11.5; + }; 369E579C2496C10900253C90 = { CreatedOnToolsVersion = 11.5; LastSwiftMigration = 1150; @@ -337,7 +432,8 @@ projectDirPath = ""; projectRoot = ""; targets = ( - 369E57AB2496C11B00253C90 /* Example */, + 369E57AB2496C11B00253C90 /* Example Swift */, + 368281C124A90D4100C196D6 /* Example ObjC */, 369E579C2496C10900253C90 /* BIASystemKit */, 36A02A5F2496CE2A00DBDEB6 /* BIASystemKitTests */, ); @@ -345,6 +441,15 @@ /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ + 368281C024A90D4100C196D6 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 368281D424A90D4200C196D6 /* LaunchScreen.storyboard in Resources */, + 368281D124A90D4200C196D6 /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 369E579B2496C10900253C90 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -370,6 +475,11 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 3629E5FC24A6B4300096E54D /* device-map-ipad.json in Resources */, + 3629E5FE24A6B4350096E54D /* device-map-ipod.json in Resources */, + 3629E5FF24A6B4370096E54D /* device-map-iwatch.json in Resources */, + 3629E5FD24A6B4330096E54D /* device-map-iphone.json in Resources */, + 3629E60024A6B4390096E54D /* device-map-simulator.json in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -396,6 +506,17 @@ /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + 368281BE24A90D4100C196D6 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 368281CC24A90D4200C196D6 /* ExampleViewController.m in Sources */, + 368281E224A90E0000C196D6 /* ExampleViewModel.m in Sources */, + 368281C624A90D4200C196D6 /* AppDelegate.m in Sources */, + 368281D724A90D4200C196D6 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 369E57992496C10900253C90 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -426,6 +547,11 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + 368281DE24A90D8300C196D6 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 369E579C2496C10900253C90 /* BIASystemKit */; + targetProxy = 368281DD24A90D8300C196D6 /* PBXContainerItemProxy */; + }; 36A02A672496CE2A00DBDEB6 /* PBXTargetDependency */ = { isa = PBXTargetDependency; platformFilter = ios; @@ -440,6 +566,14 @@ /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ + 368281D224A90D4200C196D6 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 368281D324A90D4200C196D6 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; 369E57B92496C11E00253C90 /* LaunchScreen.storyboard */ = { isa = PBXVariantGroup; children = ( @@ -451,6 +585,46 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ + 368281D924A90D4200C196D6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = MPTU3DH5MH; + INFOPLIST_FILE = BIASystemKit.xcodeproj/BIASystemKitExampleObjC_Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "de.best-ios-apps.system-kit.example-objc"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 368281DA24A90D4200C196D6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = MPTU3DH5MH; + INFOPLIST_FILE = BIASystemKit.xcodeproj/BIASystemKitExampleObjC_Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "de.best-ios-apps.system-kit.example-objc"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; 369E57A32496C10900253C90 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -509,6 +683,7 @@ SDKROOT = iphoneos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -565,6 +740,7 @@ SDKROOT = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; + SWIFT_VERSION = 5.0; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -632,13 +808,13 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = MPTU3DH5MH; - INFOPLIST_FILE = "$(SRCROOT)/Example/Info.plist"; + INFOPLIST_FILE = BIASystemKit.xcodeproj/BIASystemKitExampleSwift_Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 0.1.0; - PRODUCT_BUNDLE_IDENTIFIER = "de.best-ios-apps.system-kit.Example"; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "de.best-ios-apps.system-kit.example-swift"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -651,13 +827,13 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = MPTU3DH5MH; - INFOPLIST_FILE = "$(SRCROOT)/Example/Info.plist"; + INFOPLIST_FILE = BIASystemKit.xcodeproj/BIASystemKitExampleSwift_Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 0.1.0; - PRODUCT_BUNDLE_IDENTIFIER = "de.best-ios-apps.system-kit.Example"; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "de.best-ios-apps.system-kit.example-swift"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -703,6 +879,15 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 368281D824A90D4200C196D6 /* Build configuration list for PBXNativeTarget "Example ObjC" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 368281D924A90D4200C196D6 /* Debug */, + 368281DA24A90D4200C196D6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 369E57972496C10900253C90 /* Build configuration list for PBXProject "BIASystemKit" */ = { isa = XCConfigurationList; buildConfigurations = ( @@ -721,7 +906,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 369E57BD2496C11E00253C90 /* Build configuration list for PBXNativeTarget "Example" */ = { + 369E57BD2496C11E00253C90 /* Build configuration list for PBXNativeTarget "Example Swift" */ = { isa = XCConfigurationList; buildConfigurations = ( 369E57BE2496C11E00253C90 /* Debug */, diff --git a/BIASystemKit.xcodeproj/xcshareddata/xcschemes/BIASystemKit.xcscheme b/BIASystemKit.xcodeproj/xcshareddata/xcschemes/BIASystemKit.xcscheme new file mode 100644 index 0000000..329ebc5 --- /dev/null +++ b/BIASystemKit.xcodeproj/xcshareddata/xcschemes/BIASystemKit.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BIASystemKit.xcodeproj/xcshareddata/xcschemes/Example ObjC.xcscheme b/BIASystemKit.xcodeproj/xcshareddata/xcschemes/Example ObjC.xcscheme new file mode 100644 index 0000000..5e56c9a --- /dev/null +++ b/BIASystemKit.xcodeproj/xcshareddata/xcschemes/Example ObjC.xcscheme @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BIASystemKit.xcodeproj/xcshareddata/xcschemes/Example.xcscheme b/BIASystemKit.xcodeproj/xcshareddata/xcschemes/Example Swift.xcscheme similarity index 90% rename from BIASystemKit.xcodeproj/xcshareddata/xcschemes/Example.xcscheme rename to BIASystemKit.xcodeproj/xcshareddata/xcschemes/Example Swift.xcscheme index cedf948..a5462f2 100644 --- a/BIASystemKit.xcodeproj/xcshareddata/xcschemes/Example.xcscheme +++ b/BIASystemKit.xcodeproj/xcshareddata/xcschemes/Example Swift.xcscheme @@ -15,8 +15,8 @@ @@ -45,8 +45,8 @@ @@ -62,8 +62,8 @@ diff --git a/BIASystemKit.xcodeproj/xcuserdata/stefannebel.xcuserdatad/xcschemes/xcschememanagement.plist b/BIASystemKit.xcodeproj/xcuserdata/stefannebel.xcuserdatad/xcschemes/xcschememanagement.plist index 9a7eb0e..90c85a7 100644 --- a/BIASystemKit.xcodeproj/xcuserdata/stefannebel.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/BIASystemKit.xcodeproj/xcuserdata/stefannebel.xcuserdatad/xcschemes/xcschememanagement.plist @@ -5,11 +5,16 @@ SchemeUserState BIASystemKit.xcscheme_^#shared#^_ + + orderHint + 2 + + Example ObjC.xcscheme_^#shared#^_ orderHint 1 - Example.xcscheme_^#shared#^_ + Example Swift.xcscheme_^#shared#^_ orderHint 0 @@ -22,11 +27,26 @@ SuppressBuildableAutocreation + 368281C124A90D4100C196D6 + + primary + + + 369E579C2496C10900253C90 + + primary + + 369E57AB2496C11B00253C90 primary + 36A02A5F2496CE2A00DBDEB6 + + primary + + diff --git a/BIASystemKit/UIDevice/DeviceHelper.swift b/BIASystemKit/UIDevice/DeviceHelper.swift index 80b8717..a826044 100644 --- a/BIASystemKit/UIDevice/DeviceHelper.swift +++ b/BIASystemKit/UIDevice/DeviceHelper.swift @@ -34,7 +34,7 @@ private extension DeviceHelper { static let simulatorList = devices(filename: "device-map-simulator") private static func devices(filename: String) -> [DeviceMap] { - guard let url = Bundle(for: DeviceHelper.self).url(forResource: filename, withExtension: "json") else { return [] } + guard let url = Bundle(for: self).url(forResource: filename, withExtension: "json") else { return [] } do { let data = try Data(contentsOf: url) diff --git a/BIASystemKit/UIDevice/UIDevice.swift b/BIASystemKit/UIDevice/UIDevice.swift index c8248a5..6f2d1b1 100644 --- a/BIASystemKit/UIDevice/UIDevice.swift +++ b/BIASystemKit/UIDevice/UIDevice.swift @@ -5,8 +5,10 @@ import UIKit + public extension UIDevice { + @objc var formattedName: String { return DeviceHelper(modelName: modelName).formattedName } diff --git a/Example/ObjC/AppDelegate.h b/Example/ObjC/AppDelegate.h new file mode 100644 index 0000000..0a49d64 --- /dev/null +++ b/Example/ObjC/AppDelegate.h @@ -0,0 +1,11 @@ +// +// Created by Stefan Nebel on 28.06.20. +// Copyright © 2020 Best-iOS-Apps. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder +@property (strong, nonatomic) UIWindow *window; +@end + diff --git a/Example/ObjC/AppDelegate.m b/Example/ObjC/AppDelegate.m new file mode 100644 index 0000000..be76ca0 --- /dev/null +++ b/Example/ObjC/AppDelegate.m @@ -0,0 +1,26 @@ +// +// Created by Stefan Nebel on 28.06.20. +// Copyright © 2020 Best-iOS-Apps. All rights reserved. +// + +#import "AppDelegate.h" +#import "ExampleViewModel.h" +#import "ExampleViewController.h" + +@interface AppDelegate () +@end + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + + ExampleViewModel *viewModel = [[ExampleViewModel alloc] init]; + ExampleViewController *viewController = [[ExampleViewController alloc] initWithModel:viewModel]; + self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; + [self.window setRootViewController:viewController]; + [self.window makeKeyAndVisible]; + + return YES; +} + +@end diff --git a/Example/Assets.xcassets/AppIcon.appiconset/Contents.json b/Example/ObjC/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from Example/Assets.xcassets/AppIcon.appiconset/Contents.json rename to Example/ObjC/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/Example/Assets.xcassets/Contents.json b/Example/ObjC/Assets.xcassets/Contents.json similarity index 100% rename from Example/Assets.xcassets/Contents.json rename to Example/ObjC/Assets.xcassets/Contents.json diff --git a/Example/Base.lproj/LaunchScreen.storyboard b/Example/ObjC/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from Example/Base.lproj/LaunchScreen.storyboard rename to Example/ObjC/Base.lproj/LaunchScreen.storyboard diff --git a/Example/ObjC/ExampleViewController.h b/Example/ObjC/ExampleViewController.h new file mode 100644 index 0000000..384bf09 --- /dev/null +++ b/Example/ObjC/ExampleViewController.h @@ -0,0 +1,16 @@ +// +// Created by Stefan Nebel on 28.06.20. +// Copyright © 2020 Best-iOS-Apps. All rights reserved. +// + +@import UIKit; +#import "ExampleViewModel.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface ExampleViewController : UIViewController +- (nonnull instancetype)initWithModel:(ExampleViewModel *)viewModel; +@end + +NS_ASSUME_NONNULL_END + diff --git a/Example/ObjC/ExampleViewController.m b/Example/ObjC/ExampleViewController.m new file mode 100644 index 0000000..069025a --- /dev/null +++ b/Example/ObjC/ExampleViewController.m @@ -0,0 +1,31 @@ +// +// Created by Stefan Nebel on 28.06.20. +// Copyright © 2020 Best-iOS-Apps. All rights reserved. +// + +#import "ExampleViewController.h" + +@interface ExampleViewController () +@property ExampleViewModel *viewModel; +@end + +@implementation ExampleViewController + +- (nonnull instancetype)initWithModel:(ExampleViewModel *)viewModel { + self = [super init]; + if (self) { + self.viewModel = viewModel; + } + return self; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + + for (NSString *content in _viewModel.deviceInfos) { + NSLog(@"%@", content); + } +} + + +@end diff --git a/Example/ObjC/ExampleViewModel.h b/Example/ObjC/ExampleViewModel.h new file mode 100644 index 0000000..dae5287 --- /dev/null +++ b/Example/ObjC/ExampleViewModel.h @@ -0,0 +1,14 @@ +// +// Created by Stefan Nebel on 28.06.20. +// Copyright © 2020 Best-iOS-Apps. All rights reserved. +// + +@import Foundation; + +NS_ASSUME_NONNULL_BEGIN + +@interface ExampleViewModel : NSObject +@property NSMutableArray * deviceInfos; +@end + +NS_ASSUME_NONNULL_END diff --git a/Example/ObjC/ExampleViewModel.m b/Example/ObjC/ExampleViewModel.m new file mode 100644 index 0000000..70906b8 --- /dev/null +++ b/Example/ObjC/ExampleViewModel.m @@ -0,0 +1,20 @@ +// +// Created by Stefan Nebel on 28.06.20. +// Copyright © 2020 Best-iOS-Apps. All rights reserved. +// + +#import "ExampleViewModel.h" +@import BIASystemKit; +@import UIKit; + +@implementation ExampleViewModel + +- (nonnull instancetype)init { + self = [super init]; + if (self) { + self.deviceInfos = [[NSMutableArray alloc] init]; + [self.deviceInfos addObject:[[NSString alloc] initWithFormat:@"You are using a '%@'", [UIDevice currentDevice].formattedName]]; + } + return self; +} +@end diff --git a/Example/ObjC/main.m b/Example/ObjC/main.m new file mode 100644 index 0000000..cedcd3a --- /dev/null +++ b/Example/ObjC/main.m @@ -0,0 +1,19 @@ +// +// main.m +// Example ObjC +// +// Created by Stefan Nebel on 28.06.20. +// Copyright © 2020 Best-iOS-Apps. All rights reserved. +// + +#import +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + NSString * appDelegateClassName; + @autoreleasepool { + // Setup code that might create autoreleased objects goes here. + appDelegateClassName = NSStringFromClass([AppDelegate class]); + } + return UIApplicationMain(argc, argv, nil, appDelegateClassName); +} diff --git a/Example/AppDelegate.swift b/Example/Swift/AppDelegate.swift similarity index 100% rename from Example/AppDelegate.swift rename to Example/Swift/AppDelegate.swift diff --git a/Example/Swift/Assets.xcassets/AppIcon.appiconset/Contents.json b/Example/Swift/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..9221b9b --- /dev/null +++ b/Example/Swift/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Swift/Assets.xcassets/Contents.json b/Example/Swift/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/Example/Swift/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Swift/Base.lproj/LaunchScreen.storyboard b/Example/Swift/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..865e932 --- /dev/null +++ b/Example/Swift/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Example/ExampleViewController.swift b/Example/Swift/ExampleViewController.swift similarity index 100% rename from Example/ExampleViewController.swift rename to Example/Swift/ExampleViewController.swift diff --git a/Example/ExampleViewModel.swift b/Example/Swift/ExampleViewModel.swift similarity index 100% rename from Example/ExampleViewModel.swift rename to Example/Swift/ExampleViewModel.swift diff --git a/Package.swift b/Package.swift index 9b0f2e6..2f0b530 100644 --- a/Package.swift +++ b/Package.swift @@ -1,5 +1,4 @@ -// swift-tools-version:5.0 -// The swift-tools-version declares the minimum version of Swift required to build this package. +// swift-tools-version:5.2 import PackageDescription @@ -11,12 +10,13 @@ let package = Package( products: [ .library(name: "BIASystemKit", targets: ["BIASystemKit"]) ], - dependencies: [ - ], targets: [ .target(name: "BIASystemKit", path: "BIASystemKit"), .testTarget(name: "BIASystemKitTests", dependencies: [ "BIASystemKit" ]) + ], + swiftLanguageVersions: [ + .v5 ] ) diff --git a/Tests/BIASystemKitTests/Tests.swift b/Tests/BIASystemKitTests/Tests.swift index ecbccfb..816c891 100644 --- a/Tests/BIASystemKitTests/Tests.swift +++ b/Tests/BIASystemKitTests/Tests.swift @@ -11,4 +11,8 @@ import BIASystemKit class Tests: XCTestCase { + func testName() { + print(UIDevice.current.formattedName) + XCTAssertTrue(UIDevice.current.formattedName.lowercased().contains("simulator")) + } }