diff --git a/README.md b/README.md index 23e82f1..bdd5df3 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,16 @@ # SwiftUI Kit -A SwiftUI system components and interactions demo app based on iOS 14, macOS Big Sur, and watchOS 7. +A SwiftUI system components and interactions demo app based on iOS 14, macOS Big Sur, watchOS 7, and tvOS 14. ![SwiftUI Kit](https://user-images.githubusercontent.com/110813/87210094-5accf380-c2e2-11ea-91c9-4f21aa313bc6.png) Use the SwiftUI Kit app to see how SwiftUI views appear and interact when using the system defaults. You can view the source to see how particular examples work. -Includes Buttons, Colors, Controls, Fonts, Haptics, Images, Indicators, Shapes, and Text. +Includes Buttons, Colors, Controls, Fonts, Haptics, Images, Indicators, Shapes, Text, and more. ![SwiftUI Kit examples](https://user-images.githubusercontent.com/110813/87210295-00806280-c2e3-11ea-91e3-4ea6da79f73e.png) #### To run -Make sure you're using [Xcode 12+](https://developer.apple.com/xcode/) as well as a device running iOS 14+. Works on iPhone, iPad, and Mac. +Make sure you're using [Xcode 12+](https://developer.apple.com/xcode/) as well as a device running iOS 14+. Works on iPhone, iPad, Mac, Apple Watch, and Apple TV. #### Accent color To change the accent color and see how it affects the system components, go to the AccentColor section of Assets.xcassets in Xcode. You can then change the Light and Dark accent colors that will be applied to the app. diff --git a/Shared/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Content.imageset/Contents.json b/Shared/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 0000000..2e00335 --- /dev/null +++ b/Shared/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,11 @@ +{ + "images" : [ + { + "idiom" : "tv" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/watchOS Extension/Assets.xcassets/Contents.json b/Shared/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Contents.json similarity index 100% rename from watchOS Extension/Assets.xcassets/Contents.json rename to Shared/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Contents.json diff --git a/Shared/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Contents.json b/Shared/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Contents.json new file mode 100644 index 0000000..de59d88 --- /dev/null +++ b/Shared/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Contents.json @@ -0,0 +1,17 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + }, + "layers" : [ + { + "filename" : "Front.imagestacklayer" + }, + { + "filename" : "Middle.imagestacklayer" + }, + { + "filename" : "Back.imagestacklayer" + } + ] +} diff --git a/Shared/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Content.imageset/Contents.json b/Shared/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 0000000..2e00335 --- /dev/null +++ b/Shared/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,11 @@ +{ + "images" : [ + { + "idiom" : "tv" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/watchOS Extension/Preview Content/Preview Assets.xcassets/Contents.json b/Shared/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Contents.json similarity index 100% rename from watchOS Extension/Preview Content/Preview Assets.xcassets/Contents.json rename to Shared/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Contents.json diff --git a/Shared/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json b/Shared/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 0000000..2e00335 --- /dev/null +++ b/Shared/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,11 @@ +{ + "images" : [ + { + "idiom" : "tv" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Shared/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Contents.json b/Shared/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/Shared/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Shared/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json b/Shared/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 0000000..795cce1 --- /dev/null +++ b/Shared/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,16 @@ +{ + "images" : [ + { + "idiom" : "tv", + "scale" : "1x" + }, + { + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Shared/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Back.imagestacklayer/Contents.json b/Shared/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Back.imagestacklayer/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/Shared/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Back.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Shared/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Contents.json b/Shared/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Contents.json new file mode 100644 index 0000000..de59d88 --- /dev/null +++ b/Shared/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Contents.json @@ -0,0 +1,17 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + }, + "layers" : [ + { + "filename" : "Front.imagestacklayer" + }, + { + "filename" : "Middle.imagestacklayer" + }, + { + "filename" : "Back.imagestacklayer" + } + ] +} diff --git a/Shared/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json b/Shared/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 0000000..795cce1 --- /dev/null +++ b/Shared/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,16 @@ +{ + "images" : [ + { + "idiom" : "tv", + "scale" : "1x" + }, + { + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Shared/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Front.imagestacklayer/Contents.json b/Shared/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Front.imagestacklayer/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/Shared/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Front.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Shared/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json b/Shared/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 0000000..795cce1 --- /dev/null +++ b/Shared/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,16 @@ +{ + "images" : [ + { + "idiom" : "tv", + "scale" : "1x" + }, + { + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Shared/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Middle.imagestacklayer/Contents.json b/Shared/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Middle.imagestacklayer/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/Shared/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Middle.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Shared/Assets.xcassets/Brand Assets.brandassets/Contents.json b/Shared/Assets.xcassets/Brand Assets.brandassets/Contents.json new file mode 100644 index 0000000..f47ba43 --- /dev/null +++ b/Shared/Assets.xcassets/Brand Assets.brandassets/Contents.json @@ -0,0 +1,32 @@ +{ + "assets" : [ + { + "filename" : "App Icon - App Store.imagestack", + "idiom" : "tv", + "role" : "primary-app-icon", + "size" : "1280x768" + }, + { + "filename" : "App Icon.imagestack", + "idiom" : "tv", + "role" : "primary-app-icon", + "size" : "400x240" + }, + { + "filename" : "Top Shelf Image Wide.imageset", + "idiom" : "tv", + "role" : "top-shelf-image-wide", + "size" : "2320x720" + }, + { + "filename" : "Top Shelf Image.imageset", + "idiom" : "tv", + "role" : "top-shelf-image", + "size" : "1920x720" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Shared/Assets.xcassets/Brand Assets.brandassets/Top Shelf Image Wide.imageset/Contents.json b/Shared/Assets.xcassets/Brand Assets.brandassets/Top Shelf Image Wide.imageset/Contents.json new file mode 100644 index 0000000..795cce1 --- /dev/null +++ b/Shared/Assets.xcassets/Brand Assets.brandassets/Top Shelf Image Wide.imageset/Contents.json @@ -0,0 +1,16 @@ +{ + "images" : [ + { + "idiom" : "tv", + "scale" : "1x" + }, + { + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Shared/Assets.xcassets/Brand Assets.brandassets/Top Shelf Image.imageset/Contents.json b/Shared/Assets.xcassets/Brand Assets.brandassets/Top Shelf Image.imageset/Contents.json new file mode 100644 index 0000000..795cce1 --- /dev/null +++ b/Shared/Assets.xcassets/Brand Assets.brandassets/Top Shelf Image.imageset/Contents.json @@ -0,0 +1,16 @@ +{ + "images" : [ + { + "idiom" : "tv", + "scale" : "1x" + }, + { + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Shared/ContentView.swift b/Shared/ContentView.swift index f67a390..345a7f3 100644 --- a/Shared/ContentView.swift +++ b/Shared/ContentView.swift @@ -27,7 +27,7 @@ struct ContentView: View { var body: some View { NavigationView { - #if os(iOS) || os(watchOS) + #if os(iOS) || os(watchOS) || os(tvOS) list.navigationBarTitle("SwiftUI") Text("Select a group") #elseif os(OSX) diff --git a/Shared/Groupings/ButtonsGroup.swift b/Shared/Groupings/ButtonsGroup.swift index 1240961..2324322 100644 --- a/Shared/Groupings/ButtonsGroup.swift +++ b/Shared/Groupings/ButtonsGroup.swift @@ -45,7 +45,7 @@ struct ButtonsGroup: View { #endif } - #if os(iOS) + #if !os(OSX) Button(action: { self.showingActionSheet = true }) { @@ -64,7 +64,7 @@ struct ButtonsGroup: View { } ) - #if os(iOS) || os(OSX) + #if !os(watchOS) && !os(tvOS) SectionView( title: "Link", description: "A control for navigating to a URL.", @@ -74,7 +74,7 @@ struct ButtonsGroup: View { ) #endif - #if !os(watchOS) + #if !os(watchOS) && !os(tvOS) SectionView( title: "Menu", description: "A control for presenting a contextually-appropriate menu of buttons.", diff --git a/Shared/Groupings/ControlsGroup.swift b/Shared/Groupings/ControlsGroup.swift index 13b79d6..331b9e6 100644 --- a/Shared/Groupings/ControlsGroup.swift +++ b/Shared/Groupings/ControlsGroup.swift @@ -24,8 +24,10 @@ struct ControlsGroup: View { Group { Toggle("Vibrate on Ring", isOn: $vibrateOnRing) + #if !os(tvOS) Toggle("Vibrate on Silent", isOn: $vibrateOnSilent) .toggleStyle(SwitchToggleStyle()) + #endif } } @@ -69,6 +71,7 @@ struct ControlsGroup: View { } #endif + #if !os(tvOS) SectionView(title: "Slider", description: "A control for selecting a value from a bounded linear range of values. It can slide continuously, or snap to fixed increments.") { Group { Slider(value: $volume, in: 0...100, minimumValueLabel: Text("0%"), maximumValueLabel: Text("100%"), label: { Text("Volume") }) @@ -76,6 +79,7 @@ struct ControlsGroup: View { Slider(value: $rating, in: 1...10, step: 1, minimumValueLabel: Text("0"), maximumValueLabel: Text("10"), label: { Text("Rating") }) } } + #endif #if os(iOS) || os(OSX) SectionView(title: "Stepper", description: "A control used to perform semantic increment and decrement actions.") { diff --git a/Shared/Groupings/ShapesGroup.swift b/Shared/Groupings/ShapesGroup.swift index b4ba962..fc10faa 100644 --- a/Shared/Groupings/ShapesGroup.swift +++ b/Shared/Groupings/ShapesGroup.swift @@ -8,6 +8,7 @@ import SwiftUI struct ShapesGroup: View { + // Define constraints for the shape frames so they don’t stretch out too much on macOS let frameMinWidth: CGFloat = 16 let frameMaxWidth: CGFloat = 256 diff --git a/SwiftUI Kit.xcodeproj/project.pbxproj b/SwiftUI Kit.xcodeproj/project.pbxproj index 5a78ff0..fbcbc47 100644 --- a/SwiftUI Kit.xcodeproj/project.pbxproj +++ b/SwiftUI Kit.xcodeproj/project.pbxproj @@ -9,8 +9,6 @@ /* Begin PBXBuildFile section */ 2D8F82FD24BA011800E90F0B /* SwiftUI Kit watchOS Extension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 2D8F82FC24BA011800E90F0B /* SwiftUI Kit watchOS Extension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 2D8F830624BA011800E90F0B /* ComplicationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D8F830524BA011800E90F0B /* ComplicationController.swift */; }; - 2D8F830824BA011800E90F0B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2D8F830724BA011800E90F0B /* Assets.xcassets */; }; - 2D8F830B24BA011900E90F0B /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2D8F830A24BA011900E90F0B /* Preview Assets.xcassets */; }; 2D8F830F24BA011900E90F0B /* SwiftUI Kit watchOS.app in Embed Watch Content */ = {isa = PBXBuildFile; fileRef = 2D8F82F324BA011700E90F0B /* SwiftUI Kit watchOS.app */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 2D8F831824BA013E00E90F0B /* GroupView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 861EC65524B90E16005C2F44 /* GroupView.swift */; }; 2D8F831924BA013E00E90F0B /* ShapesGroup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 861EC66024B912C9005C2F44 /* ShapesGroup.swift */; }; @@ -24,6 +22,19 @@ 2D8F832224BA013E00E90F0B /* ButtonsGroup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 861EC66624B91AE8005C2F44 /* ButtonsGroup.swift */; }; 2DC7DE5624BA0D9A00A84252 /* SwiftUI_KitApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 861EC64524B90DD9005C2F44 /* SwiftUI_KitApp.swift */; }; 2DC7DE5724BA0D9A00A84252 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 861EC64724B90DD9005C2F44 /* ContentView.swift */; }; + 2DF330AF24BAA8C60034C8D0 /* ControlsGroup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 861EC65C24B9106E005C2F44 /* ControlsGroup.swift */; }; + 2DF330B024BAA8C60034C8D0 /* ShapesGroup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 861EC66024B912C9005C2F44 /* ShapesGroup.swift */; }; + 2DF330B124BAA8C60034C8D0 /* IndicatorsGroup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 861EC66824B91D4E005C2F44 /* IndicatorsGroup.swift */; }; + 2DF330B224BAA8C60034C8D0 /* TextGroup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 861EC65A24B91065005C2F44 /* TextGroup.swift */; }; + 2DF330B324BAA8C60034C8D0 /* FontsGroup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 861EC65E24B91075005C2F44 /* FontsGroup.swift */; }; + 2DF330B424BAA8C60034C8D0 /* ImagesGroup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 861EC66A24B91E1D005C2F44 /* ImagesGroup.swift */; }; + 2DF330B524BAA8C60034C8D0 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 861EC64724B90DD9005C2F44 /* ContentView.swift */; }; + 2DF330B624BAA8C60034C8D0 /* ButtonsGroup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 861EC66624B91AE8005C2F44 /* ButtonsGroup.swift */; }; + 2DF330B724BAA8C60034C8D0 /* GroupView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 861EC65524B90E16005C2F44 /* GroupView.swift */; }; + 2DF330B824BAA8C60034C8D0 /* ColorsGroup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 861EC66224B912D2005C2F44 /* ColorsGroup.swift */; }; + 2DF330B924BAA8C60034C8D0 /* SectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 861EC66424B914FB005C2F44 /* SectionView.swift */; }; + 2DF330BA24BAA8C60034C8D0 /* SwiftUI_KitApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 861EC64524B90DD9005C2F44 /* SwiftUI_KitApp.swift */; }; + 2DF330BB24BAAD720034C8D0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 861EC64924B90DDB005C2F44 /* Assets.xcassets */; }; 861EC64624B90DD9005C2F44 /* SwiftUI_KitApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 861EC64524B90DD9005C2F44 /* SwiftUI_KitApp.swift */; }; 861EC64824B90DD9005C2F44 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 861EC64724B90DD9005C2F44 /* ContentView.swift */; }; 861EC64A24B90DDB005C2F44 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 861EC64924B90DDB005C2F44 /* Assets.xcassets */; }; @@ -101,9 +112,9 @@ 2D8F82F724BA011800E90F0B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 2D8F82FC24BA011800E90F0B /* SwiftUI Kit watchOS Extension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "SwiftUI Kit watchOS Extension.appex"; sourceTree = BUILT_PRODUCTS_DIR; }; 2D8F830524BA011800E90F0B /* ComplicationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ComplicationController.swift; sourceTree = ""; }; - 2D8F830724BA011800E90F0B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 2D8F830A24BA011900E90F0B /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 2D8F830C24BA011900E90F0B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 2DF330A024BAA8B80034C8D0 /* SwiftUI Kit tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "SwiftUI Kit tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 2DF330AB24BAA8B90034C8D0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 861EC64224B90DD9005C2F44 /* SwiftUI Kit iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "SwiftUI Kit iOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 861EC64524B90DD9005C2F44 /* SwiftUI_KitApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftUI_KitApp.swift; sourceTree = ""; }; 861EC64724B90DD9005C2F44 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; @@ -134,6 +145,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 2DF3309D24BAA8B80034C8D0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 861EC63F24B90DD9005C2F44 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -163,19 +181,17 @@ isa = PBXGroup; children = ( 2D8F830524BA011800E90F0B /* ComplicationController.swift */, - 2D8F830724BA011800E90F0B /* Assets.xcassets */, 2D8F830C24BA011900E90F0B /* Info.plist */, - 2D8F830924BA011900E90F0B /* Preview Content */, ); path = "watchOS Extension"; sourceTree = ""; }; - 2D8F830924BA011900E90F0B /* Preview Content */ = { + 2DF330A124BAA8B80034C8D0 /* tvOS */ = { isa = PBXGroup; children = ( - 2D8F830A24BA011900E90F0B /* Preview Assets.xcassets */, + 2DF330AB24BAA8B90034C8D0 /* Info.plist */, ); - path = "Preview Content"; + path = tvOS; sourceTree = ""; }; 861EC63924B90DD9005C2F44 = { @@ -186,6 +202,7 @@ F95A4E1024B9932000697538 /* macOS */, 2D8F82F424BA011700E90F0B /* watchOS */, 2D8F830024BA011800E90F0B /* watchOS Extension */, + 2DF330A124BAA8B80034C8D0 /* tvOS */, 861EC64324B90DD9005C2F44 /* Products */, ); sourceTree = ""; @@ -197,6 +214,7 @@ F95A4E0F24B9932000697538 /* SwiftUI Kit Mac.app */, 2D8F82F324BA011700E90F0B /* SwiftUI Kit watchOS.app */, 2D8F82FC24BA011800E90F0B /* SwiftUI Kit watchOS Extension.appex */, + 2DF330A024BAA8B80034C8D0 /* SwiftUI Kit tvOS.app */, ); name = Products; sourceTree = ""; @@ -226,15 +244,15 @@ 861EC65424B90DF1005C2F44 /* Groupings */ = { isa = PBXGroup; children = ( - 861EC65A24B91065005C2F44 /* TextGroup.swift */, + 861EC66624B91AE8005C2F44 /* ButtonsGroup.swift */, + 861EC66224B912D2005C2F44 /* ColorsGroup.swift */, 861EC65C24B9106E005C2F44 /* ControlsGroup.swift */, 861EC65E24B91075005C2F44 /* FontsGroup.swift */, - 861EC66024B912C9005C2F44 /* ShapesGroup.swift */, - 861EC66224B912D2005C2F44 /* ColorsGroup.swift */, - 861EC66624B91AE8005C2F44 /* ButtonsGroup.swift */, - 861EC66824B91D4E005C2F44 /* IndicatorsGroup.swift */, - 861EC66A24B91E1D005C2F44 /* ImagesGroup.swift */, 861EC66C24B91F19005C2F44 /* HapticsGroup.swift */, + 861EC66A24B91E1D005C2F44 /* ImagesGroup.swift */, + 861EC66824B91D4E005C2F44 /* IndicatorsGroup.swift */, + 861EC66024B912C9005C2F44 /* ShapesGroup.swift */, + 861EC65A24B91065005C2F44 /* TextGroup.swift */, ); path = Groupings; sourceTree = ""; @@ -293,6 +311,23 @@ productReference = 2D8F82FC24BA011800E90F0B /* SwiftUI Kit watchOS Extension.appex */; productType = "com.apple.product-type.watchkit2-extension"; }; + 2DF3309F24BAA8B80034C8D0 /* SwiftUI Kit tvOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 2DF330AE24BAA8B90034C8D0 /* Build configuration list for PBXNativeTarget "SwiftUI Kit tvOS" */; + buildPhases = ( + 2DF3309C24BAA8B80034C8D0 /* Sources */, + 2DF3309D24BAA8B80034C8D0 /* Frameworks */, + 2DF3309E24BAA8B80034C8D0 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "SwiftUI Kit tvOS"; + productName = "SwiftUI Kit tvOS"; + productReference = 2DF330A024BAA8B80034C8D0 /* SwiftUI Kit tvOS.app */; + productType = "com.apple.product-type.application"; + }; 861EC64124B90DD9005C2F44 /* SwiftUI Kit iOS */ = { isa = PBXNativeTarget; buildConfigurationList = 861EC65124B90DDB005C2F44 /* Build configuration list for PBXNativeTarget "SwiftUI Kit iOS" */; @@ -344,6 +379,9 @@ 2D8F82FB24BA011800E90F0B = { CreatedOnToolsVersion = 12.0; }; + 2DF3309F24BAA8B80034C8D0 = { + CreatedOnToolsVersion = 12.0; + }; 861EC64124B90DD9005C2F44 = { CreatedOnToolsVersion = 12.0; }; @@ -369,6 +407,7 @@ F95A4E0E24B9932000697538 /* SwiftUI Kit Mac */, 2D8F82F224BA011700E90F0B /* SwiftUI Kit watchOS */, 2D8F82FB24BA011800E90F0B /* SwiftUI Kit watchOS Extension */, + 2DF3309F24BAA8B80034C8D0 /* SwiftUI Kit tvOS */, ); }; /* End PBXProject section */ @@ -385,8 +424,14 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 2D8F830B24BA011900E90F0B /* Preview Assets.xcassets in Resources */, - 2D8F830824BA011800E90F0B /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 2DF3309E24BAA8B80034C8D0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2DF330BB24BAAD720034C8D0 /* Assets.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -430,6 +475,25 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 2DF3309C24BAA8B80034C8D0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2DF330B024BAA8C60034C8D0 /* ShapesGroup.swift in Sources */, + 2DF330B224BAA8C60034C8D0 /* TextGroup.swift in Sources */, + 2DF330B824BAA8C60034C8D0 /* ColorsGroup.swift in Sources */, + 2DF330BA24BAA8C60034C8D0 /* SwiftUI_KitApp.swift in Sources */, + 2DF330B624BAA8C60034C8D0 /* ButtonsGroup.swift in Sources */, + 2DF330AF24BAA8C60034C8D0 /* ControlsGroup.swift in Sources */, + 2DF330B124BAA8C60034C8D0 /* IndicatorsGroup.swift in Sources */, + 2DF330B524BAA8C60034C8D0 /* ContentView.swift in Sources */, + 2DF330B924BAA8C60034C8D0 /* SectionView.swift in Sources */, + 2DF330B324BAA8C60034C8D0 /* FontsGroup.swift in Sources */, + 2DF330B724BAA8C60034C8D0 /* GroupView.swift in Sources */, + 2DF330B424BAA8C60034C8D0 /* ImagesGroup.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 861EC63E24B90DD9005C2F44 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -528,7 +592,7 @@ buildSettings = { ASSETCATALOG_COMPILER_COMPLICATION_NAME = Complication; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_ASSET_PATHS = "\"watchOS Extension/Preview Content\""; + DEVELOPMENT_ASSET_PATHS = "\"Shared/Preview Content\""; ENABLE_PREVIEWS = YES; INFOPLIST_FILE = "watchOS Extension/Info.plist"; LD_RUNPATH_SEARCH_PATHS = ( @@ -551,7 +615,7 @@ buildSettings = { ASSETCATALOG_COMPILER_COMPLICATION_NAME = Complication; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_ASSET_PATHS = "\"watchOS Extension/Preview Content\""; + DEVELOPMENT_ASSET_PATHS = "\"Shared/Preview Content\""; ENABLE_PREVIEWS = YES; INFOPLIST_FILE = "watchOS Extension/Info.plist"; LD_RUNPATH_SEARCH_PATHS = ( @@ -569,6 +633,54 @@ }; name = Release; }; + 2DF330AC24BAA8B90034C8D0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = "Brand Assets"; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "Shared/Preview\\ Content"; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = tvOS/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRIVATE_HEADERS_FOLDER_PATH = tvOS/PrivateHeaders; + PRODUCT_BUNDLE_IDENTIFIER = "lilsoftware.SwiftUI-Kit-tvOS"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PUBLIC_HEADERS_FOLDER_PATH = tvOS/Headers; + SDKROOT = appletvos; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 3; + TVOS_DEPLOYMENT_TARGET = 14.0; + }; + name = Debug; + }; + 2DF330AD24BAA8B90034C8D0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = "Brand Assets"; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "Shared/Preview\\ Content"; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = tvOS/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRIVATE_HEADERS_FOLDER_PATH = tvOS/PrivateHeaders; + PRODUCT_BUNDLE_IDENTIFIER = "lilsoftware.SwiftUI-Kit-tvOS"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PUBLIC_HEADERS_FOLDER_PATH = tvOS/Headers; + SDKROOT = appletvos; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 3; + TVOS_DEPLOYMENT_TARGET = 14.0; + }; + name = Release; + }; 861EC64F24B90DDB005C2F44 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -794,6 +906,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 2DF330AE24BAA8B90034C8D0 /* Build configuration list for PBXNativeTarget "SwiftUI Kit tvOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2DF330AC24BAA8B90034C8D0 /* Debug */, + 2DF330AD24BAA8B90034C8D0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 861EC63D24B90DD9005C2F44 /* Build configuration list for PBXProject "SwiftUI Kit" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/tvOS/ContentView.swift b/tvOS/ContentView.swift new file mode 100644 index 0000000..b78bc5a --- /dev/null +++ b/tvOS/ContentView.swift @@ -0,0 +1,20 @@ +// +// ContentView.swift +// SwiftUI Kit tvOS +// +// Created by Ramy Majouji on 7/11/20. +// + +import SwiftUI + +struct ContentView: View { + var body: some View { + Text("Hello, world!").padding() + } +} + +struct ContentView_Previews: PreviewProvider { + static var previews: some View { + ContentView() + } +} diff --git a/tvOS/Info.plist b/tvOS/Info.plist new file mode 100644 index 0000000..16d307c --- /dev/null +++ b/tvOS/Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchScreen + + UIRequiredDeviceCapabilities + + arm64 + + UIUserInterfaceStyle + Automatic + + diff --git a/tvOS/SwiftUI_Kit_tvOSApp.swift b/tvOS/SwiftUI_Kit_tvOSApp.swift new file mode 100644 index 0000000..3652080 --- /dev/null +++ b/tvOS/SwiftUI_Kit_tvOSApp.swift @@ -0,0 +1,17 @@ +// +// SwiftUI_Kit_tvOSApp.swift +// SwiftUI Kit tvOS +// +// Created by Ramy Majouji on 7/11/20. +// + +import SwiftUI + +@main +struct SwiftUI_Kit_tvOSApp: App { + var body: some Scene { + WindowGroup { + ContentView() + } + } +} diff --git a/watchOS Extension/Assets.xcassets/Complication.complicationset/Circular.imageset/Contents.json b/watchOS Extension/Assets.xcassets/Complication.complicationset/Circular.imageset/Contents.json deleted file mode 100644 index ed7de25..0000000 --- a/watchOS Extension/Assets.xcassets/Complication.complicationset/Circular.imageset/Contents.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "images" : [ - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : "<=145" - }, - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">161" - }, - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">145" - }, - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">183" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/watchOS Extension/Assets.xcassets/Complication.complicationset/Contents.json b/watchOS Extension/Assets.xcassets/Complication.complicationset/Contents.json deleted file mode 100644 index e8b3252..0000000 --- a/watchOS Extension/Assets.xcassets/Complication.complicationset/Contents.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "assets" : [ - { - "filename" : "Circular.imageset", - "idiom" : "watch", - "role" : "circular" - }, - { - "filename" : "Extra Large.imageset", - "idiom" : "watch", - "role" : "extra-large" - }, - { - "filename" : "Graphic Bezel.imageset", - "idiom" : "watch", - "role" : "graphic-bezel" - }, - { - "filename" : "Graphic Circular.imageset", - "idiom" : "watch", - "role" : "graphic-circular" - }, - { - "filename" : "Graphic Corner.imageset", - "idiom" : "watch", - "role" : "graphic-corner" - }, - { - "filename" : "Graphic Extra Large.imageset", - "idiom" : "watch", - "role" : "graphic-extra-large" - }, - { - "filename" : "Graphic Large Rectangular.imageset", - "idiom" : "watch", - "role" : "graphic-large-rectangular" - }, - { - "filename" : "Modular.imageset", - "idiom" : "watch", - "role" : "modular" - }, - { - "filename" : "Utilitarian.imageset", - "idiom" : "watch", - "role" : "utilitarian" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/watchOS Extension/Assets.xcassets/Complication.complicationset/Extra Large.imageset/Contents.json b/watchOS Extension/Assets.xcassets/Complication.complicationset/Extra Large.imageset/Contents.json deleted file mode 100644 index ed7de25..0000000 --- a/watchOS Extension/Assets.xcassets/Complication.complicationset/Extra Large.imageset/Contents.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "images" : [ - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : "<=145" - }, - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">161" - }, - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">145" - }, - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">183" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/watchOS Extension/Assets.xcassets/Complication.complicationset/Graphic Bezel.imageset/Contents.json b/watchOS Extension/Assets.xcassets/Complication.complicationset/Graphic Bezel.imageset/Contents.json deleted file mode 100644 index 9685a7f..0000000 --- a/watchOS Extension/Assets.xcassets/Complication.complicationset/Graphic Bezel.imageset/Contents.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "images" : [ - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">161" - }, - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">183" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/watchOS Extension/Assets.xcassets/Complication.complicationset/Graphic Circular.imageset/Contents.json b/watchOS Extension/Assets.xcassets/Complication.complicationset/Graphic Circular.imageset/Contents.json deleted file mode 100644 index 9685a7f..0000000 --- a/watchOS Extension/Assets.xcassets/Complication.complicationset/Graphic Circular.imageset/Contents.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "images" : [ - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">161" - }, - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">183" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/watchOS Extension/Assets.xcassets/Complication.complicationset/Graphic Corner.imageset/Contents.json b/watchOS Extension/Assets.xcassets/Complication.complicationset/Graphic Corner.imageset/Contents.json deleted file mode 100644 index 9685a7f..0000000 --- a/watchOS Extension/Assets.xcassets/Complication.complicationset/Graphic Corner.imageset/Contents.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "images" : [ - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">161" - }, - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">183" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/watchOS Extension/Assets.xcassets/Complication.complicationset/Graphic Extra Large.imageset/Contents.json b/watchOS Extension/Assets.xcassets/Complication.complicationset/Graphic Extra Large.imageset/Contents.json deleted file mode 100644 index ed7de25..0000000 --- a/watchOS Extension/Assets.xcassets/Complication.complicationset/Graphic Extra Large.imageset/Contents.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "images" : [ - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : "<=145" - }, - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">161" - }, - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">145" - }, - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">183" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/watchOS Extension/Assets.xcassets/Complication.complicationset/Graphic Large Rectangular.imageset/Contents.json b/watchOS Extension/Assets.xcassets/Complication.complicationset/Graphic Large Rectangular.imageset/Contents.json deleted file mode 100644 index 9685a7f..0000000 --- a/watchOS Extension/Assets.xcassets/Complication.complicationset/Graphic Large Rectangular.imageset/Contents.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "images" : [ - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">161" - }, - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">183" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/watchOS Extension/Assets.xcassets/Complication.complicationset/Modular.imageset/Contents.json b/watchOS Extension/Assets.xcassets/Complication.complicationset/Modular.imageset/Contents.json deleted file mode 100644 index ed7de25..0000000 --- a/watchOS Extension/Assets.xcassets/Complication.complicationset/Modular.imageset/Contents.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "images" : [ - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : "<=145" - }, - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">161" - }, - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">145" - }, - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">183" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/watchOS Extension/Assets.xcassets/Complication.complicationset/Utilitarian.imageset/Contents.json b/watchOS Extension/Assets.xcassets/Complication.complicationset/Utilitarian.imageset/Contents.json deleted file mode 100644 index ed7de25..0000000 --- a/watchOS Extension/Assets.xcassets/Complication.complicationset/Utilitarian.imageset/Contents.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "images" : [ - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : "<=145" - }, - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">161" - }, - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">145" - }, - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">183" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -}