├── LICENSE ├── README.md ├── Static Widget ├── Assets.xcassets │ ├── AccentColor.colorset │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ ├── WidgetBackground.colorset │ │ └── Contents.json │ └── weight.imageset │ │ ├── Contents.json │ │ └── weight.png ├── Info.plist ├── Static_Widget.swift └── WidgetView.swift ├── SwiftUI Widgets.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ │ └── akashlal.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── akashlal.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist └── SwiftUI Widgets ├── Assets.xcassets ├── AccentColor.colorset │ └── Contents.json ├── AppIcon.appiconset │ └── Contents.json └── Contents.json ├── ContentView.swift ├── Info.plist ├── Preview Content └── Preview Assets.xcassets │ └── Contents.json └── SwiftUI_WidgetsApp.swift /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Akashlal Bathe 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SwiftUI-Widgets 2 | Building Your First iOS Widget with WidgetKit 3 | -------------------------------------------------------------------------------- /Static Widget/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Static Widget/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "scale" : "1x", 46 | "size" : "20x20" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "scale" : "2x", 51 | "size" : "20x20" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "scale" : "1x", 56 | "size" : "29x29" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "scale" : "2x", 61 | "size" : "29x29" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "scale" : "1x", 66 | "size" : "40x40" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "scale" : "2x", 71 | "size" : "40x40" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "scale" : "1x", 76 | "size" : "76x76" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "scale" : "2x", 81 | "size" : "76x76" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "scale" : "2x", 86 | "size" : "83.5x83.5" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "scale" : "1x", 91 | "size" : "1024x1024" 92 | } 93 | ], 94 | "info" : { 95 | "author" : "xcode", 96 | "version" : 1 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /Static Widget/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Static Widget/Assets.xcassets/WidgetBackground.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Static Widget/Assets.xcassets/weight.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "weight.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Static Widget/Assets.xcassets/weight.imageset/weight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAkashlal/SwiftUI-Widgets/812f1631c894482044ca97bebfa82a6a4d5c3f62/Static Widget/Assets.xcassets/weight.imageset/weight.png -------------------------------------------------------------------------------- /Static Widget/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | Static Widget 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | NSExtension 24 | 25 | NSExtensionPointIdentifier 26 | com.apple.widgetkit-extension 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /Static Widget/Static_Widget.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Static_Widget.swift 3 | // Static Widget 4 | // 5 | // Created by Akashlal Bathe on 15/07/20. 6 | // 7 | 8 | import WidgetKit 9 | import SwiftUI 10 | 11 | struct Provider: TimelineProvider { 12 | public typealias Entry = SimpleEntry 13 | 14 | public func snapshot(with context: Context, completion: @escaping (SimpleEntry) -> ()) { 15 | let entry = SimpleEntry(date: Date()) 16 | completion(entry) 17 | } 18 | 19 | public func timeline(with context: Context, completion: @escaping (Timeline) -> ()) { 20 | var entries: [SimpleEntry] = [] 21 | 22 | // Generate a timeline consisting of five entries an hour apart, starting from the current date. 23 | let currentDate = Date() 24 | for hourOffset in 0 ..< 5 { 25 | let entryDate = Calendar.current.date(byAdding: .hour, value: hourOffset, to: currentDate)! 26 | let entry = SimpleEntry(date: entryDate) 27 | entries.append(entry) 28 | } 29 | 30 | let timeline = Timeline(entries: entries, policy: .atEnd) 31 | completion(timeline) 32 | } 33 | } 34 | 35 | struct SimpleEntry: TimelineEntry { 36 | public let date: Date 37 | } 38 | 39 | struct PlaceholderView : View { 40 | var body: some View { 41 | Text("Placeholder View") 42 | } 43 | } 44 | 45 | struct Static_WidgetEntryView : View { 46 | var entry: Provider.Entry 47 | 48 | var body: some View { 49 | Text(entry.date, style: .time) 50 | } 51 | } 52 | 53 | @main 54 | struct Static_Widget: Widget { 55 | private let kind: String = "Static_Widget" 56 | 57 | public var body: some WidgetConfiguration { 58 | StaticConfiguration(kind: kind, provider: Provider(), placeholder: PlaceholderView()) { entry in 59 | WidgetView(data: .previewData) 60 | } 61 | .supportedFamilies([.systemSmall, .systemMedium]) 62 | .configurationDisplayName("Weight Display") 63 | .description("Your weight will be shown, as added in the app.") 64 | 65 | } 66 | } 67 | 68 | struct Static_Widget_Previews: PreviewProvider { 69 | static var previews: some View { 70 | /*@START_MENU_TOKEN@*/Text("Hello, World!")/*@END_MENU_TOKEN@*/ 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /Static Widget/WidgetView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WidgetView.swift 3 | // SwiftUI Widgets 4 | // 5 | // Created by Akashlal Bathe on 16/07/20. 6 | // 7 | 8 | import SwiftUI 9 | import WidgetKit 10 | 11 | struct WidgetData{ 12 | let weight: Measurement 13 | let date: Date 14 | } 15 | 16 | extension WidgetData{ 17 | static let previewData = WidgetData(weight: Measurement(value: 66.99, unit: .kilograms), date: Date().advanced(by: (-60*29))) 18 | } 19 | 20 | struct WidgetView: View { 21 | let data: WidgetData 22 | @Environment(\.widgetFamily) var widgetFamily 23 | 24 | var body: some View { 25 | ZStack{ 26 | Color(.yellow) 27 | HStack{ 28 | VStack(alignment: .leading) { 29 | WeightView(data: data) 30 | Spacer() 31 | LastUpdatedView(data: data) 32 | } 33 | .padding(.all) 34 | if widgetFamily == .systemMedium{ 35 | Image("weight").resizable() 36 | } 37 | } 38 | } 39 | 40 | } 41 | } 42 | 43 | struct WidgetView_Previews: PreviewProvider { 44 | static var previews: some View { 45 | Group{ 46 | WidgetView(data: .previewData).previewContext(WidgetPreviewContext(family: .systemSmall)) 47 | WidgetView(data: .previewData).previewContext(WidgetPreviewContext(family: .systemMedium)) 48 | WidgetView(data: .previewData).previewContext(WidgetPreviewContext(family: .systemLarge)) 49 | } 50 | } 51 | } 52 | 53 | 54 | 55 | struct WeightView: View { 56 | var data: WidgetData 57 | var body: some View { 58 | HStack{ 59 | VStack(alignment: .leading){ 60 | Text("Weight") 61 | .font(.body) 62 | .foregroundColor(.purple) 63 | .bold() 64 | Spacer() 65 | Text(measurementFormatter.string(from: data.weight)) 66 | .font(.title) 67 | .foregroundColor(.purple) 68 | .bold() 69 | .minimumScaleFactor(0.7) 70 | } 71 | Spacer() 72 | } 73 | .padding(.all, 8) 74 | .background(ContainerRelativeShape().fill(Color(.cyan))) 75 | } 76 | } 77 | 78 | extension WeightView{ 79 | var measurementFormatter : MeasurementFormatter { 80 | let mf = MeasurementFormatter() 81 | mf.locale = Locale(identifier: "en_GB") 82 | return mf 83 | } 84 | } 85 | 86 | struct LastUpdatedView: View { 87 | let data: WidgetData 88 | var body: some View { 89 | VStack(alignment: .leading){ 90 | Text("Last Updated") 91 | .font(.body) 92 | .bold() 93 | .foregroundColor(.purple) 94 | Text("\(data.date, style: .relative)") 95 | .font(.caption) 96 | .foregroundColor(.purple) 97 | .minimumScaleFactor(0.7) 98 | .redacted(reason: .placeholder) 99 | } 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /SwiftUI Widgets.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 767C75BA24C08198008557CD /* WidgetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 767C75B924C08198008557CD /* WidgetView.swift */; }; 11 | 767C75BB24C08198008557CD /* WidgetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 767C75B924C08198008557CD /* WidgetView.swift */; }; 12 | 76911B7424BED3FF00FF2E0A /* SwiftUI_WidgetsApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76911B7324BED3FF00FF2E0A /* SwiftUI_WidgetsApp.swift */; }; 13 | 76911B7624BED3FF00FF2E0A /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76911B7524BED3FF00FF2E0A /* ContentView.swift */; }; 14 | 76911B7824BED40100FF2E0A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 76911B7724BED40100FF2E0A /* Assets.xcassets */; }; 15 | 76911B7B24BED40100FF2E0A /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 76911B7A24BED40100FF2E0A /* Preview Assets.xcassets */; }; 16 | 76911B8924BED9EA00FF2E0A /* WidgetKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 76911B8824BED9EA00FF2E0A /* WidgetKit.framework */; }; 17 | 76911B8B24BED9EA00FF2E0A /* SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 76911B8A24BED9EA00FF2E0A /* SwiftUI.framework */; }; 18 | 76911B8E24BED9EA00FF2E0A /* Static_Widget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76911B8D24BED9EA00FF2E0A /* Static_Widget.swift */; }; 19 | 76911B9024BED9EE00FF2E0A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 76911B8F24BED9EE00FF2E0A /* Assets.xcassets */; }; 20 | 76911B9424BED9EE00FF2E0A /* Static WidgetExtension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 76911B8624BED9EA00FF2E0A /* Static WidgetExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 21 | /* End PBXBuildFile section */ 22 | 23 | /* Begin PBXContainerItemProxy section */ 24 | 76911B9224BED9EE00FF2E0A /* PBXContainerItemProxy */ = { 25 | isa = PBXContainerItemProxy; 26 | containerPortal = 76911B6824BED3FF00FF2E0A /* Project object */; 27 | proxyType = 1; 28 | remoteGlobalIDString = 76911B8524BED9EA00FF2E0A; 29 | remoteInfo = "Static WidgetExtension"; 30 | }; 31 | /* End PBXContainerItemProxy section */ 32 | 33 | /* Begin PBXCopyFilesBuildPhase section */ 34 | 76911B9824BED9EE00FF2E0A /* Embed App Extensions */ = { 35 | isa = PBXCopyFilesBuildPhase; 36 | buildActionMask = 2147483647; 37 | dstPath = ""; 38 | dstSubfolderSpec = 13; 39 | files = ( 40 | 76911B9424BED9EE00FF2E0A /* Static WidgetExtension.appex in Embed App Extensions */, 41 | ); 42 | name = "Embed App Extensions"; 43 | runOnlyForDeploymentPostprocessing = 0; 44 | }; 45 | /* End PBXCopyFilesBuildPhase section */ 46 | 47 | /* Begin PBXFileReference section */ 48 | 767C75B924C08198008557CD /* WidgetView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WidgetView.swift; sourceTree = ""; }; 49 | 76911B7024BED3FF00FF2E0A /* SwiftUI Widgets.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "SwiftUI Widgets.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | 76911B7324BED3FF00FF2E0A /* SwiftUI_WidgetsApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftUI_WidgetsApp.swift; sourceTree = ""; }; 51 | 76911B7524BED3FF00FF2E0A /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 52 | 76911B7724BED40100FF2E0A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 53 | 76911B7A24BED40100FF2E0A /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 54 | 76911B7C24BED40100FF2E0A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 55 | 76911B8624BED9EA00FF2E0A /* Static WidgetExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "Static WidgetExtension.appex"; sourceTree = BUILT_PRODUCTS_DIR; }; 56 | 76911B8824BED9EA00FF2E0A /* WidgetKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WidgetKit.framework; path = System/Library/Frameworks/WidgetKit.framework; sourceTree = SDKROOT; }; 57 | 76911B8A24BED9EA00FF2E0A /* SwiftUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = System/Library/Frameworks/SwiftUI.framework; sourceTree = SDKROOT; }; 58 | 76911B8D24BED9EA00FF2E0A /* Static_Widget.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Static_Widget.swift; sourceTree = ""; }; 59 | 76911B8F24BED9EE00FF2E0A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 60 | 76911B9124BED9EE00FF2E0A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 61 | /* End PBXFileReference section */ 62 | 63 | /* Begin PBXFrameworksBuildPhase section */ 64 | 76911B6D24BED3FF00FF2E0A /* Frameworks */ = { 65 | isa = PBXFrameworksBuildPhase; 66 | buildActionMask = 2147483647; 67 | files = ( 68 | ); 69 | runOnlyForDeploymentPostprocessing = 0; 70 | }; 71 | 76911B8324BED9EA00FF2E0A /* Frameworks */ = { 72 | isa = PBXFrameworksBuildPhase; 73 | buildActionMask = 2147483647; 74 | files = ( 75 | 76911B8B24BED9EA00FF2E0A /* SwiftUI.framework in Frameworks */, 76 | 76911B8924BED9EA00FF2E0A /* WidgetKit.framework in Frameworks */, 77 | ); 78 | runOnlyForDeploymentPostprocessing = 0; 79 | }; 80 | /* End PBXFrameworksBuildPhase section */ 81 | 82 | /* Begin PBXGroup section */ 83 | 76911B6724BED3FF00FF2E0A = { 84 | isa = PBXGroup; 85 | children = ( 86 | 76911B7224BED3FF00FF2E0A /* SwiftUI Widgets */, 87 | 76911B8C24BED9EA00FF2E0A /* Static Widget */, 88 | 76911B8724BED9EA00FF2E0A /* Frameworks */, 89 | 76911B7124BED3FF00FF2E0A /* Products */, 90 | ); 91 | sourceTree = ""; 92 | }; 93 | 76911B7124BED3FF00FF2E0A /* Products */ = { 94 | isa = PBXGroup; 95 | children = ( 96 | 76911B7024BED3FF00FF2E0A /* SwiftUI Widgets.app */, 97 | 76911B8624BED9EA00FF2E0A /* Static WidgetExtension.appex */, 98 | ); 99 | name = Products; 100 | sourceTree = ""; 101 | }; 102 | 76911B7224BED3FF00FF2E0A /* SwiftUI Widgets */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | 76911B7324BED3FF00FF2E0A /* SwiftUI_WidgetsApp.swift */, 106 | 76911B7524BED3FF00FF2E0A /* ContentView.swift */, 107 | 76911B7724BED40100FF2E0A /* Assets.xcassets */, 108 | 76911B7C24BED40100FF2E0A /* Info.plist */, 109 | 76911B7924BED40100FF2E0A /* Preview Content */, 110 | ); 111 | path = "SwiftUI Widgets"; 112 | sourceTree = ""; 113 | }; 114 | 76911B7924BED40100FF2E0A /* Preview Content */ = { 115 | isa = PBXGroup; 116 | children = ( 117 | 76911B7A24BED40100FF2E0A /* Preview Assets.xcassets */, 118 | ); 119 | path = "Preview Content"; 120 | sourceTree = ""; 121 | }; 122 | 76911B8724BED9EA00FF2E0A /* Frameworks */ = { 123 | isa = PBXGroup; 124 | children = ( 125 | 76911B8824BED9EA00FF2E0A /* WidgetKit.framework */, 126 | 76911B8A24BED9EA00FF2E0A /* SwiftUI.framework */, 127 | ); 128 | name = Frameworks; 129 | sourceTree = ""; 130 | }; 131 | 76911B8C24BED9EA00FF2E0A /* Static Widget */ = { 132 | isa = PBXGroup; 133 | children = ( 134 | 767C75B924C08198008557CD /* WidgetView.swift */, 135 | 76911B8D24BED9EA00FF2E0A /* Static_Widget.swift */, 136 | 76911B8F24BED9EE00FF2E0A /* Assets.xcassets */, 137 | 76911B9124BED9EE00FF2E0A /* Info.plist */, 138 | ); 139 | path = "Static Widget"; 140 | sourceTree = ""; 141 | }; 142 | /* End PBXGroup section */ 143 | 144 | /* Begin PBXNativeTarget section */ 145 | 76911B6F24BED3FF00FF2E0A /* SwiftUI Widgets */ = { 146 | isa = PBXNativeTarget; 147 | buildConfigurationList = 76911B7F24BED40100FF2E0A /* Build configuration list for PBXNativeTarget "SwiftUI Widgets" */; 148 | buildPhases = ( 149 | 76911B6C24BED3FF00FF2E0A /* Sources */, 150 | 76911B6D24BED3FF00FF2E0A /* Frameworks */, 151 | 76911B6E24BED3FF00FF2E0A /* Resources */, 152 | 76911B9824BED9EE00FF2E0A /* Embed App Extensions */, 153 | ); 154 | buildRules = ( 155 | ); 156 | dependencies = ( 157 | 76911B9324BED9EE00FF2E0A /* PBXTargetDependency */, 158 | ); 159 | name = "SwiftUI Widgets"; 160 | productName = "SwiftUI Widgets"; 161 | productReference = 76911B7024BED3FF00FF2E0A /* SwiftUI Widgets.app */; 162 | productType = "com.apple.product-type.application"; 163 | }; 164 | 76911B8524BED9EA00FF2E0A /* Static WidgetExtension */ = { 165 | isa = PBXNativeTarget; 166 | buildConfigurationList = 76911B9524BED9EE00FF2E0A /* Build configuration list for PBXNativeTarget "Static WidgetExtension" */; 167 | buildPhases = ( 168 | 76911B8224BED9EA00FF2E0A /* Sources */, 169 | 76911B8324BED9EA00FF2E0A /* Frameworks */, 170 | 76911B8424BED9EA00FF2E0A /* Resources */, 171 | ); 172 | buildRules = ( 173 | ); 174 | dependencies = ( 175 | ); 176 | name = "Static WidgetExtension"; 177 | productName = "Static WidgetExtension"; 178 | productReference = 76911B8624BED9EA00FF2E0A /* Static WidgetExtension.appex */; 179 | productType = "com.apple.product-type.app-extension"; 180 | }; 181 | /* End PBXNativeTarget section */ 182 | 183 | /* Begin PBXProject section */ 184 | 76911B6824BED3FF00FF2E0A /* Project object */ = { 185 | isa = PBXProject; 186 | attributes = { 187 | LastSwiftUpdateCheck = 1200; 188 | LastUpgradeCheck = 1200; 189 | TargetAttributes = { 190 | 76911B6F24BED3FF00FF2E0A = { 191 | CreatedOnToolsVersion = 12.0; 192 | }; 193 | 76911B8524BED9EA00FF2E0A = { 194 | CreatedOnToolsVersion = 12.0; 195 | }; 196 | }; 197 | }; 198 | buildConfigurationList = 76911B6B24BED3FF00FF2E0A /* Build configuration list for PBXProject "SwiftUI Widgets" */; 199 | compatibilityVersion = "Xcode 9.3"; 200 | developmentRegion = en; 201 | hasScannedForEncodings = 0; 202 | knownRegions = ( 203 | en, 204 | Base, 205 | ); 206 | mainGroup = 76911B6724BED3FF00FF2E0A; 207 | productRefGroup = 76911B7124BED3FF00FF2E0A /* Products */; 208 | projectDirPath = ""; 209 | projectRoot = ""; 210 | targets = ( 211 | 76911B6F24BED3FF00FF2E0A /* SwiftUI Widgets */, 212 | 76911B8524BED9EA00FF2E0A /* Static WidgetExtension */, 213 | ); 214 | }; 215 | /* End PBXProject section */ 216 | 217 | /* Begin PBXResourcesBuildPhase section */ 218 | 76911B6E24BED3FF00FF2E0A /* Resources */ = { 219 | isa = PBXResourcesBuildPhase; 220 | buildActionMask = 2147483647; 221 | files = ( 222 | 76911B7B24BED40100FF2E0A /* Preview Assets.xcassets in Resources */, 223 | 76911B7824BED40100FF2E0A /* Assets.xcassets in Resources */, 224 | ); 225 | runOnlyForDeploymentPostprocessing = 0; 226 | }; 227 | 76911B8424BED9EA00FF2E0A /* Resources */ = { 228 | isa = PBXResourcesBuildPhase; 229 | buildActionMask = 2147483647; 230 | files = ( 231 | 76911B9024BED9EE00FF2E0A /* Assets.xcassets in Resources */, 232 | ); 233 | runOnlyForDeploymentPostprocessing = 0; 234 | }; 235 | /* End PBXResourcesBuildPhase section */ 236 | 237 | /* Begin PBXSourcesBuildPhase section */ 238 | 76911B6C24BED3FF00FF2E0A /* Sources */ = { 239 | isa = PBXSourcesBuildPhase; 240 | buildActionMask = 2147483647; 241 | files = ( 242 | 767C75BA24C08198008557CD /* WidgetView.swift in Sources */, 243 | 76911B7624BED3FF00FF2E0A /* ContentView.swift in Sources */, 244 | 76911B7424BED3FF00FF2E0A /* SwiftUI_WidgetsApp.swift in Sources */, 245 | ); 246 | runOnlyForDeploymentPostprocessing = 0; 247 | }; 248 | 76911B8224BED9EA00FF2E0A /* Sources */ = { 249 | isa = PBXSourcesBuildPhase; 250 | buildActionMask = 2147483647; 251 | files = ( 252 | 767C75BB24C08198008557CD /* WidgetView.swift in Sources */, 253 | 76911B8E24BED9EA00FF2E0A /* Static_Widget.swift in Sources */, 254 | ); 255 | runOnlyForDeploymentPostprocessing = 0; 256 | }; 257 | /* End PBXSourcesBuildPhase section */ 258 | 259 | /* Begin PBXTargetDependency section */ 260 | 76911B9324BED9EE00FF2E0A /* PBXTargetDependency */ = { 261 | isa = PBXTargetDependency; 262 | target = 76911B8524BED9EA00FF2E0A /* Static WidgetExtension */; 263 | targetProxy = 76911B9224BED9EE00FF2E0A /* PBXContainerItemProxy */; 264 | }; 265 | /* End PBXTargetDependency section */ 266 | 267 | /* Begin XCBuildConfiguration section */ 268 | 76911B7D24BED40100FF2E0A /* Debug */ = { 269 | isa = XCBuildConfiguration; 270 | buildSettings = { 271 | ALWAYS_SEARCH_USER_PATHS = NO; 272 | CLANG_ANALYZER_NONNULL = YES; 273 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 274 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 275 | CLANG_CXX_LIBRARY = "libc++"; 276 | CLANG_ENABLE_MODULES = YES; 277 | CLANG_ENABLE_OBJC_ARC = YES; 278 | CLANG_ENABLE_OBJC_WEAK = YES; 279 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 280 | CLANG_WARN_BOOL_CONVERSION = YES; 281 | CLANG_WARN_COMMA = YES; 282 | CLANG_WARN_CONSTANT_CONVERSION = YES; 283 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 284 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 285 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 286 | CLANG_WARN_EMPTY_BODY = YES; 287 | CLANG_WARN_ENUM_CONVERSION = YES; 288 | CLANG_WARN_INFINITE_RECURSION = YES; 289 | CLANG_WARN_INT_CONVERSION = YES; 290 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 291 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 292 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 293 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 294 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 295 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 296 | CLANG_WARN_STRICT_PROTOTYPES = YES; 297 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 298 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 299 | CLANG_WARN_UNREACHABLE_CODE = YES; 300 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 301 | COPY_PHASE_STRIP = NO; 302 | DEBUG_INFORMATION_FORMAT = dwarf; 303 | ENABLE_STRICT_OBJC_MSGSEND = YES; 304 | ENABLE_TESTABILITY = YES; 305 | GCC_C_LANGUAGE_STANDARD = gnu11; 306 | GCC_DYNAMIC_NO_PIC = NO; 307 | GCC_NO_COMMON_BLOCKS = YES; 308 | GCC_OPTIMIZATION_LEVEL = 0; 309 | GCC_PREPROCESSOR_DEFINITIONS = ( 310 | "DEBUG=1", 311 | "$(inherited)", 312 | ); 313 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 314 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 315 | GCC_WARN_UNDECLARED_SELECTOR = YES; 316 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 317 | GCC_WARN_UNUSED_FUNCTION = YES; 318 | GCC_WARN_UNUSED_VARIABLE = YES; 319 | IPHONEOS_DEPLOYMENT_TARGET = 14.0; 320 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 321 | MTL_FAST_MATH = YES; 322 | ONLY_ACTIVE_ARCH = YES; 323 | SDKROOT = iphoneos; 324 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 325 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 326 | }; 327 | name = Debug; 328 | }; 329 | 76911B7E24BED40100FF2E0A /* Release */ = { 330 | isa = XCBuildConfiguration; 331 | buildSettings = { 332 | ALWAYS_SEARCH_USER_PATHS = NO; 333 | CLANG_ANALYZER_NONNULL = YES; 334 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 335 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 336 | CLANG_CXX_LIBRARY = "libc++"; 337 | CLANG_ENABLE_MODULES = YES; 338 | CLANG_ENABLE_OBJC_ARC = YES; 339 | CLANG_ENABLE_OBJC_WEAK = YES; 340 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 341 | CLANG_WARN_BOOL_CONVERSION = YES; 342 | CLANG_WARN_COMMA = YES; 343 | CLANG_WARN_CONSTANT_CONVERSION = YES; 344 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 345 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 346 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 347 | CLANG_WARN_EMPTY_BODY = YES; 348 | CLANG_WARN_ENUM_CONVERSION = YES; 349 | CLANG_WARN_INFINITE_RECURSION = YES; 350 | CLANG_WARN_INT_CONVERSION = YES; 351 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 352 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 353 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 354 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 355 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 356 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 357 | CLANG_WARN_STRICT_PROTOTYPES = YES; 358 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 359 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 360 | CLANG_WARN_UNREACHABLE_CODE = YES; 361 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 362 | COPY_PHASE_STRIP = NO; 363 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 364 | ENABLE_NS_ASSERTIONS = NO; 365 | ENABLE_STRICT_OBJC_MSGSEND = YES; 366 | GCC_C_LANGUAGE_STANDARD = gnu11; 367 | GCC_NO_COMMON_BLOCKS = YES; 368 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 369 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 370 | GCC_WARN_UNDECLARED_SELECTOR = YES; 371 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 372 | GCC_WARN_UNUSED_FUNCTION = YES; 373 | GCC_WARN_UNUSED_VARIABLE = YES; 374 | IPHONEOS_DEPLOYMENT_TARGET = 14.0; 375 | MTL_ENABLE_DEBUG_INFO = NO; 376 | MTL_FAST_MATH = YES; 377 | SDKROOT = iphoneos; 378 | SWIFT_COMPILATION_MODE = wholemodule; 379 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 380 | VALIDATE_PRODUCT = YES; 381 | }; 382 | name = Release; 383 | }; 384 | 76911B8024BED40100FF2E0A /* Debug */ = { 385 | isa = XCBuildConfiguration; 386 | buildSettings = { 387 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 388 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 389 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 390 | CODE_SIGN_STYLE = Automatic; 391 | DEVELOPMENT_ASSET_PATHS = "\"SwiftUI Widgets/Preview Content\""; 392 | ENABLE_PREVIEWS = YES; 393 | INFOPLIST_FILE = "SwiftUI Widgets/Info.plist"; 394 | IPHONEOS_DEPLOYMENT_TARGET = 14.0; 395 | LD_RUNPATH_SEARCH_PATHS = ( 396 | "$(inherited)", 397 | "@executable_path/Frameworks", 398 | ); 399 | PRODUCT_BUNDLE_IDENTIFIER = "com.akash.SwiftUI-Widgets"; 400 | PRODUCT_NAME = "$(TARGET_NAME)"; 401 | SWIFT_VERSION = 5.0; 402 | TARGETED_DEVICE_FAMILY = "1,2"; 403 | }; 404 | name = Debug; 405 | }; 406 | 76911B8124BED40100FF2E0A /* Release */ = { 407 | isa = XCBuildConfiguration; 408 | buildSettings = { 409 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 410 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 411 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 412 | CODE_SIGN_STYLE = Automatic; 413 | DEVELOPMENT_ASSET_PATHS = "\"SwiftUI Widgets/Preview Content\""; 414 | ENABLE_PREVIEWS = YES; 415 | INFOPLIST_FILE = "SwiftUI Widgets/Info.plist"; 416 | IPHONEOS_DEPLOYMENT_TARGET = 14.0; 417 | LD_RUNPATH_SEARCH_PATHS = ( 418 | "$(inherited)", 419 | "@executable_path/Frameworks", 420 | ); 421 | PRODUCT_BUNDLE_IDENTIFIER = "com.akash.SwiftUI-Widgets"; 422 | PRODUCT_NAME = "$(TARGET_NAME)"; 423 | SWIFT_VERSION = 5.0; 424 | TARGETED_DEVICE_FAMILY = "1,2"; 425 | }; 426 | name = Release; 427 | }; 428 | 76911B9624BED9EE00FF2E0A /* Debug */ = { 429 | isa = XCBuildConfiguration; 430 | buildSettings = { 431 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 432 | ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; 433 | CODE_SIGN_STYLE = Automatic; 434 | INFOPLIST_FILE = "Static Widget/Info.plist"; 435 | LD_RUNPATH_SEARCH_PATHS = ( 436 | "$(inherited)", 437 | "@executable_path/Frameworks", 438 | "@executable_path/../../Frameworks", 439 | ); 440 | PRODUCT_BUNDLE_IDENTIFIER = "com.akash.SwiftUI-Widgets.Static-Widget"; 441 | PRODUCT_NAME = "$(TARGET_NAME)"; 442 | SKIP_INSTALL = YES; 443 | SWIFT_VERSION = 5.0; 444 | TARGETED_DEVICE_FAMILY = "1,2"; 445 | }; 446 | name = Debug; 447 | }; 448 | 76911B9724BED9EE00FF2E0A /* Release */ = { 449 | isa = XCBuildConfiguration; 450 | buildSettings = { 451 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 452 | ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; 453 | CODE_SIGN_STYLE = Automatic; 454 | INFOPLIST_FILE = "Static Widget/Info.plist"; 455 | LD_RUNPATH_SEARCH_PATHS = ( 456 | "$(inherited)", 457 | "@executable_path/Frameworks", 458 | "@executable_path/../../Frameworks", 459 | ); 460 | PRODUCT_BUNDLE_IDENTIFIER = "com.akash.SwiftUI-Widgets.Static-Widget"; 461 | PRODUCT_NAME = "$(TARGET_NAME)"; 462 | SKIP_INSTALL = YES; 463 | SWIFT_VERSION = 5.0; 464 | TARGETED_DEVICE_FAMILY = "1,2"; 465 | }; 466 | name = Release; 467 | }; 468 | /* End XCBuildConfiguration section */ 469 | 470 | /* Begin XCConfigurationList section */ 471 | 76911B6B24BED3FF00FF2E0A /* Build configuration list for PBXProject "SwiftUI Widgets" */ = { 472 | isa = XCConfigurationList; 473 | buildConfigurations = ( 474 | 76911B7D24BED40100FF2E0A /* Debug */, 475 | 76911B7E24BED40100FF2E0A /* Release */, 476 | ); 477 | defaultConfigurationIsVisible = 0; 478 | defaultConfigurationName = Release; 479 | }; 480 | 76911B7F24BED40100FF2E0A /* Build configuration list for PBXNativeTarget "SwiftUI Widgets" */ = { 481 | isa = XCConfigurationList; 482 | buildConfigurations = ( 483 | 76911B8024BED40100FF2E0A /* Debug */, 484 | 76911B8124BED40100FF2E0A /* Release */, 485 | ); 486 | defaultConfigurationIsVisible = 0; 487 | defaultConfigurationName = Release; 488 | }; 489 | 76911B9524BED9EE00FF2E0A /* Build configuration list for PBXNativeTarget "Static WidgetExtension" */ = { 490 | isa = XCConfigurationList; 491 | buildConfigurations = ( 492 | 76911B9624BED9EE00FF2E0A /* Debug */, 493 | 76911B9724BED9EE00FF2E0A /* Release */, 494 | ); 495 | defaultConfigurationIsVisible = 0; 496 | defaultConfigurationName = Release; 497 | }; 498 | /* End XCConfigurationList section */ 499 | }; 500 | rootObject = 76911B6824BED3FF00FF2E0A /* Project object */; 501 | } 502 | -------------------------------------------------------------------------------- /SwiftUI Widgets.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SwiftUI Widgets.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /SwiftUI Widgets.xcodeproj/project.xcworkspace/xcuserdata/akashlal.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAkashlal/SwiftUI-Widgets/812f1631c894482044ca97bebfa82a6a4d5c3f62/SwiftUI Widgets.xcodeproj/project.xcworkspace/xcuserdata/akashlal.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /SwiftUI Widgets.xcodeproj/xcuserdata/akashlal.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Static WidgetExtension.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 1 11 | 12 | SwiftUI Widgets.xcscheme_^#shared#^_ 13 | 14 | orderHint 15 | 0 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /SwiftUI Widgets/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /SwiftUI Widgets/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "scale" : "1x", 46 | "size" : "20x20" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "scale" : "2x", 51 | "size" : "20x20" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "scale" : "1x", 56 | "size" : "29x29" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "scale" : "2x", 61 | "size" : "29x29" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "scale" : "1x", 66 | "size" : "40x40" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "scale" : "2x", 71 | "size" : "40x40" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "scale" : "1x", 76 | "size" : "76x76" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "scale" : "2x", 81 | "size" : "76x76" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "scale" : "2x", 86 | "size" : "83.5x83.5" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "scale" : "1x", 91 | "size" : "1024x1024" 92 | } 93 | ], 94 | "info" : { 95 | "author" : "xcode", 96 | "version" : 1 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /SwiftUI Widgets/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /SwiftUI Widgets/ContentView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // SwiftUI Widgets 4 | // 5 | // Created by Akashlal Bathe on 15/07/20. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct ContentView: View { 11 | var body: some View { 12 | Text("Hello, world!").padding() 13 | } 14 | } 15 | 16 | struct ContentView_Previews: PreviewProvider { 17 | static var previews: some View { 18 | ContentView() 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /SwiftUI Widgets/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UIApplicationSceneManifest 24 | 25 | UIApplicationSupportsMultipleScenes 26 | 27 | 28 | UIApplicationSupportsIndirectInputEvents 29 | 30 | UILaunchScreen 31 | 32 | UIRequiredDeviceCapabilities 33 | 34 | armv7 35 | 36 | UISupportedInterfaceOrientations 37 | 38 | UIInterfaceOrientationPortrait 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UISupportedInterfaceOrientations~ipad 43 | 44 | UIInterfaceOrientationPortrait 45 | UIInterfaceOrientationPortraitUpsideDown 46 | UIInterfaceOrientationLandscapeLeft 47 | UIInterfaceOrientationLandscapeRight 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /SwiftUI Widgets/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /SwiftUI Widgets/SwiftUI_WidgetsApp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SwiftUI_WidgetsApp.swift 3 | // SwiftUI Widgets 4 | // 5 | // Created by Akashlal Bathe on 15/07/20. 6 | // 7 | 8 | import SwiftUI 9 | 10 | @main 11 | struct SwiftUI_WidgetsApp: App { 12 | var body: some Scene { 13 | WindowGroup { 14 | ContentView() 15 | } 16 | } 17 | } 18 | --------------------------------------------------------------------------------