├── ClockWidget.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ │ └── pook.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── pook.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist ├── ClockWidget ├── Assets.xcassets │ ├── AccentColor.colorset │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ └── face.imageset │ │ ├── Contents.json │ │ ├── face-1.png │ │ ├── face-2.png │ │ └── face.png ├── ClockWidget.entitlements ├── ClockWidgetApp.swift ├── ContentView.swift ├── Info.plist └── Preview Content │ └── Preview Assets.xcassets │ └── Contents.json ├── ClockWidgetExt ├── Assets.xcassets │ ├── AccentColor.colorset │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ └── WidgetBackground.colorset │ │ └── Contents.json ├── ClockWidgetExt.swift └── Info.plist ├── README.md └── image.png /ClockWidget.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | F3D42DBB24B1C3AE00FF7835 /* ClockWidgetApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3D42DBA24B1C3AE00FF7835 /* ClockWidgetApp.swift */; }; 11 | F3D42DBD24B1C3AE00FF7835 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3D42DBC24B1C3AE00FF7835 /* ContentView.swift */; }; 12 | F3D42DBF24B1C3B000FF7835 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F3D42DBE24B1C3B000FF7835 /* Assets.xcassets */; }; 13 | F3D42DC224B1C3B000FF7835 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F3D42DC124B1C3B000FF7835 /* Preview Assets.xcassets */; }; 14 | F3D42DD024B1C3C900FF7835 /* WidgetKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F3D42DCF24B1C3C900FF7835 /* WidgetKit.framework */; }; 15 | F3D42DD224B1C3C900FF7835 /* SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F3D42DD124B1C3C900FF7835 /* SwiftUI.framework */; }; 16 | F3D42DD524B1C3C900FF7835 /* ClockWidgetExt.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3D42DD424B1C3C900FF7835 /* ClockWidgetExt.swift */; }; 17 | F3D42DD724B1C3CA00FF7835 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F3D42DD624B1C3CA00FF7835 /* Assets.xcassets */; }; 18 | F3D42DDB24B1C3CA00FF7835 /* ClockWidgetExtExtension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = F3D42DCD24B1C3C900FF7835 /* ClockWidgetExtExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 19 | F3D42DE024B1C3EA00FF7835 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F3D42DBE24B1C3B000FF7835 /* Assets.xcassets */; }; 20 | F3D42DE124B1C4C600FF7835 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3D42DBC24B1C3AE00FF7835 /* ContentView.swift */; }; 21 | F3D42DE624B1D3FF00FF7835 /* image.png in Resources */ = {isa = PBXBuildFile; fileRef = F3D42DE424B1D3FF00FF7835 /* image.png */; }; 22 | F3D42DE724B1D3FF00FF7835 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = F3D42DE524B1D3FF00FF7835 /* README.md */; }; 23 | /* End PBXBuildFile section */ 24 | 25 | /* Begin PBXContainerItemProxy section */ 26 | F3D42DD924B1C3CA00FF7835 /* PBXContainerItemProxy */ = { 27 | isa = PBXContainerItemProxy; 28 | containerPortal = F3D42DAF24B1C3AE00FF7835 /* Project object */; 29 | proxyType = 1; 30 | remoteGlobalIDString = F3D42DCC24B1C3C900FF7835; 31 | remoteInfo = ClockWidgetExtExtension; 32 | }; 33 | /* End PBXContainerItemProxy section */ 34 | 35 | /* Begin PBXCopyFilesBuildPhase section */ 36 | F3D42DDF24B1C3CA00FF7835 /* Embed App Extensions */ = { 37 | isa = PBXCopyFilesBuildPhase; 38 | buildActionMask = 2147483647; 39 | dstPath = ""; 40 | dstSubfolderSpec = 13; 41 | files = ( 42 | F3D42DDB24B1C3CA00FF7835 /* ClockWidgetExtExtension.appex in Embed App Extensions */, 43 | ); 44 | name = "Embed App Extensions"; 45 | runOnlyForDeploymentPostprocessing = 0; 46 | }; 47 | /* End PBXCopyFilesBuildPhase section */ 48 | 49 | /* Begin PBXFileReference section */ 50 | F3D42DB724B1C3AE00FF7835 /* ClockWidget.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ClockWidget.app; sourceTree = BUILT_PRODUCTS_DIR; }; 51 | F3D42DBA24B1C3AE00FF7835 /* ClockWidgetApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClockWidgetApp.swift; sourceTree = ""; }; 52 | F3D42DBC24B1C3AE00FF7835 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 53 | F3D42DBE24B1C3B000FF7835 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 54 | F3D42DC124B1C3B000FF7835 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 55 | F3D42DC324B1C3B000FF7835 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 56 | F3D42DCD24B1C3C900FF7835 /* ClockWidgetExtExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = ClockWidgetExtExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; 57 | F3D42DCF24B1C3C900FF7835 /* WidgetKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WidgetKit.framework; path = System/Library/Frameworks/WidgetKit.framework; sourceTree = SDKROOT; }; 58 | F3D42DD124B1C3C900FF7835 /* SwiftUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = System/Library/Frameworks/SwiftUI.framework; sourceTree = SDKROOT; }; 59 | F3D42DD424B1C3C900FF7835 /* ClockWidgetExt.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClockWidgetExt.swift; sourceTree = ""; }; 60 | F3D42DD624B1C3CA00FF7835 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 61 | F3D42DD824B1C3CA00FF7835 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 62 | F3D42DE224B1C5BE00FF7835 /* ClockWidget.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = ClockWidget.entitlements; sourceTree = ""; }; 63 | F3D42DE424B1D3FF00FF7835 /* image.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = image.png; sourceTree = ""; }; 64 | F3D42DE524B1D3FF00FF7835 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 65 | /* End PBXFileReference section */ 66 | 67 | /* Begin PBXFrameworksBuildPhase section */ 68 | F3D42DB424B1C3AE00FF7835 /* Frameworks */ = { 69 | isa = PBXFrameworksBuildPhase; 70 | buildActionMask = 2147483647; 71 | files = ( 72 | ); 73 | runOnlyForDeploymentPostprocessing = 0; 74 | }; 75 | F3D42DCA24B1C3C900FF7835 /* Frameworks */ = { 76 | isa = PBXFrameworksBuildPhase; 77 | buildActionMask = 2147483647; 78 | files = ( 79 | F3D42DD224B1C3C900FF7835 /* SwiftUI.framework in Frameworks */, 80 | F3D42DD024B1C3C900FF7835 /* WidgetKit.framework in Frameworks */, 81 | ); 82 | runOnlyForDeploymentPostprocessing = 0; 83 | }; 84 | /* End PBXFrameworksBuildPhase section */ 85 | 86 | /* Begin PBXGroup section */ 87 | F3D42DAE24B1C3AE00FF7835 = { 88 | isa = PBXGroup; 89 | children = ( 90 | F3D42DE424B1D3FF00FF7835 /* image.png */, 91 | F3D42DE524B1D3FF00FF7835 /* README.md */, 92 | F3D42DB924B1C3AE00FF7835 /* ClockWidget */, 93 | F3D42DD324B1C3C900FF7835 /* ClockWidgetExt */, 94 | F3D42DCE24B1C3C900FF7835 /* Frameworks */, 95 | F3D42DB824B1C3AE00FF7835 /* Products */, 96 | ); 97 | sourceTree = ""; 98 | }; 99 | F3D42DB824B1C3AE00FF7835 /* Products */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | F3D42DB724B1C3AE00FF7835 /* ClockWidget.app */, 103 | F3D42DCD24B1C3C900FF7835 /* ClockWidgetExtExtension.appex */, 104 | ); 105 | name = Products; 106 | sourceTree = ""; 107 | }; 108 | F3D42DB924B1C3AE00FF7835 /* ClockWidget */ = { 109 | isa = PBXGroup; 110 | children = ( 111 | F3D42DE224B1C5BE00FF7835 /* ClockWidget.entitlements */, 112 | F3D42DBA24B1C3AE00FF7835 /* ClockWidgetApp.swift */, 113 | F3D42DBC24B1C3AE00FF7835 /* ContentView.swift */, 114 | F3D42DBE24B1C3B000FF7835 /* Assets.xcassets */, 115 | F3D42DC324B1C3B000FF7835 /* Info.plist */, 116 | F3D42DC024B1C3B000FF7835 /* Preview Content */, 117 | ); 118 | path = ClockWidget; 119 | sourceTree = ""; 120 | }; 121 | F3D42DC024B1C3B000FF7835 /* Preview Content */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | F3D42DC124B1C3B000FF7835 /* Preview Assets.xcassets */, 125 | ); 126 | path = "Preview Content"; 127 | sourceTree = ""; 128 | }; 129 | F3D42DCE24B1C3C900FF7835 /* Frameworks */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | F3D42DCF24B1C3C900FF7835 /* WidgetKit.framework */, 133 | F3D42DD124B1C3C900FF7835 /* SwiftUI.framework */, 134 | ); 135 | name = Frameworks; 136 | sourceTree = ""; 137 | }; 138 | F3D42DD324B1C3C900FF7835 /* ClockWidgetExt */ = { 139 | isa = PBXGroup; 140 | children = ( 141 | F3D42DD424B1C3C900FF7835 /* ClockWidgetExt.swift */, 142 | F3D42DD624B1C3CA00FF7835 /* Assets.xcassets */, 143 | F3D42DD824B1C3CA00FF7835 /* Info.plist */, 144 | ); 145 | path = ClockWidgetExt; 146 | sourceTree = ""; 147 | }; 148 | /* End PBXGroup section */ 149 | 150 | /* Begin PBXNativeTarget section */ 151 | F3D42DB624B1C3AE00FF7835 /* ClockWidget */ = { 152 | isa = PBXNativeTarget; 153 | buildConfigurationList = F3D42DC624B1C3B000FF7835 /* Build configuration list for PBXNativeTarget "ClockWidget" */; 154 | buildPhases = ( 155 | F3D42DB324B1C3AE00FF7835 /* Sources */, 156 | F3D42DB424B1C3AE00FF7835 /* Frameworks */, 157 | F3D42DB524B1C3AE00FF7835 /* Resources */, 158 | F3D42DDF24B1C3CA00FF7835 /* Embed App Extensions */, 159 | ); 160 | buildRules = ( 161 | ); 162 | dependencies = ( 163 | F3D42DDA24B1C3CA00FF7835 /* PBXTargetDependency */, 164 | ); 165 | name = ClockWidget; 166 | productName = ClockWidget; 167 | productReference = F3D42DB724B1C3AE00FF7835 /* ClockWidget.app */; 168 | productType = "com.apple.product-type.application"; 169 | }; 170 | F3D42DCC24B1C3C900FF7835 /* ClockWidgetExtExtension */ = { 171 | isa = PBXNativeTarget; 172 | buildConfigurationList = F3D42DDC24B1C3CA00FF7835 /* Build configuration list for PBXNativeTarget "ClockWidgetExtExtension" */; 173 | buildPhases = ( 174 | F3D42DC924B1C3C900FF7835 /* Sources */, 175 | F3D42DCA24B1C3C900FF7835 /* Frameworks */, 176 | F3D42DCB24B1C3C900FF7835 /* Resources */, 177 | ); 178 | buildRules = ( 179 | ); 180 | dependencies = ( 181 | ); 182 | name = ClockWidgetExtExtension; 183 | productName = ClockWidgetExtExtension; 184 | productReference = F3D42DCD24B1C3C900FF7835 /* ClockWidgetExtExtension.appex */; 185 | productType = "com.apple.product-type.app-extension"; 186 | }; 187 | /* End PBXNativeTarget section */ 188 | 189 | /* Begin PBXProject section */ 190 | F3D42DAF24B1C3AE00FF7835 /* Project object */ = { 191 | isa = PBXProject; 192 | attributes = { 193 | LastSwiftUpdateCheck = 1200; 194 | LastUpgradeCheck = 1200; 195 | TargetAttributes = { 196 | F3D42DB624B1C3AE00FF7835 = { 197 | CreatedOnToolsVersion = 12.0; 198 | }; 199 | F3D42DCC24B1C3C900FF7835 = { 200 | CreatedOnToolsVersion = 12.0; 201 | }; 202 | }; 203 | }; 204 | buildConfigurationList = F3D42DB224B1C3AE00FF7835 /* Build configuration list for PBXProject "ClockWidget" */; 205 | compatibilityVersion = "Xcode 9.3"; 206 | developmentRegion = en; 207 | hasScannedForEncodings = 0; 208 | knownRegions = ( 209 | en, 210 | Base, 211 | ); 212 | mainGroup = F3D42DAE24B1C3AE00FF7835; 213 | productRefGroup = F3D42DB824B1C3AE00FF7835 /* Products */; 214 | projectDirPath = ""; 215 | projectRoot = ""; 216 | targets = ( 217 | F3D42DB624B1C3AE00FF7835 /* ClockWidget */, 218 | F3D42DCC24B1C3C900FF7835 /* ClockWidgetExtExtension */, 219 | ); 220 | }; 221 | /* End PBXProject section */ 222 | 223 | /* Begin PBXResourcesBuildPhase section */ 224 | F3D42DB524B1C3AE00FF7835 /* Resources */ = { 225 | isa = PBXResourcesBuildPhase; 226 | buildActionMask = 2147483647; 227 | files = ( 228 | F3D42DC224B1C3B000FF7835 /* Preview Assets.xcassets in Resources */, 229 | F3D42DBF24B1C3B000FF7835 /* Assets.xcassets in Resources */, 230 | F3D42DE724B1D3FF00FF7835 /* README.md in Resources */, 231 | F3D42DE624B1D3FF00FF7835 /* image.png in Resources */, 232 | ); 233 | runOnlyForDeploymentPostprocessing = 0; 234 | }; 235 | F3D42DCB24B1C3C900FF7835 /* Resources */ = { 236 | isa = PBXResourcesBuildPhase; 237 | buildActionMask = 2147483647; 238 | files = ( 239 | F3D42DE024B1C3EA00FF7835 /* Assets.xcassets in Resources */, 240 | F3D42DD724B1C3CA00FF7835 /* Assets.xcassets in Resources */, 241 | ); 242 | runOnlyForDeploymentPostprocessing = 0; 243 | }; 244 | /* End PBXResourcesBuildPhase section */ 245 | 246 | /* Begin PBXSourcesBuildPhase section */ 247 | F3D42DB324B1C3AE00FF7835 /* Sources */ = { 248 | isa = PBXSourcesBuildPhase; 249 | buildActionMask = 2147483647; 250 | files = ( 251 | F3D42DBD24B1C3AE00FF7835 /* ContentView.swift in Sources */, 252 | F3D42DBB24B1C3AE00FF7835 /* ClockWidgetApp.swift in Sources */, 253 | ); 254 | runOnlyForDeploymentPostprocessing = 0; 255 | }; 256 | F3D42DC924B1C3C900FF7835 /* Sources */ = { 257 | isa = PBXSourcesBuildPhase; 258 | buildActionMask = 2147483647; 259 | files = ( 260 | F3D42DE124B1C4C600FF7835 /* ContentView.swift in Sources */, 261 | F3D42DD524B1C3C900FF7835 /* ClockWidgetExt.swift in Sources */, 262 | ); 263 | runOnlyForDeploymentPostprocessing = 0; 264 | }; 265 | /* End PBXSourcesBuildPhase section */ 266 | 267 | /* Begin PBXTargetDependency section */ 268 | F3D42DDA24B1C3CA00FF7835 /* PBXTargetDependency */ = { 269 | isa = PBXTargetDependency; 270 | target = F3D42DCC24B1C3C900FF7835 /* ClockWidgetExtExtension */; 271 | targetProxy = F3D42DD924B1C3CA00FF7835 /* PBXContainerItemProxy */; 272 | }; 273 | /* End PBXTargetDependency section */ 274 | 275 | /* Begin XCBuildConfiguration section */ 276 | F3D42DC424B1C3B000FF7835 /* Debug */ = { 277 | isa = XCBuildConfiguration; 278 | buildSettings = { 279 | ALWAYS_SEARCH_USER_PATHS = NO; 280 | CLANG_ANALYZER_NONNULL = YES; 281 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 282 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 283 | CLANG_CXX_LIBRARY = "libc++"; 284 | CLANG_ENABLE_MODULES = YES; 285 | CLANG_ENABLE_OBJC_ARC = YES; 286 | CLANG_ENABLE_OBJC_WEAK = YES; 287 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 288 | CLANG_WARN_BOOL_CONVERSION = YES; 289 | CLANG_WARN_COMMA = YES; 290 | CLANG_WARN_CONSTANT_CONVERSION = YES; 291 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 292 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 293 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 294 | CLANG_WARN_EMPTY_BODY = YES; 295 | CLANG_WARN_ENUM_CONVERSION = YES; 296 | CLANG_WARN_INFINITE_RECURSION = YES; 297 | CLANG_WARN_INT_CONVERSION = YES; 298 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 299 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 300 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 301 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 302 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 303 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 304 | CLANG_WARN_STRICT_PROTOTYPES = YES; 305 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 306 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 307 | CLANG_WARN_UNREACHABLE_CODE = YES; 308 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 309 | COPY_PHASE_STRIP = NO; 310 | DEBUG_INFORMATION_FORMAT = dwarf; 311 | ENABLE_STRICT_OBJC_MSGSEND = YES; 312 | ENABLE_TESTABILITY = YES; 313 | GCC_C_LANGUAGE_STANDARD = gnu11; 314 | GCC_DYNAMIC_NO_PIC = NO; 315 | GCC_NO_COMMON_BLOCKS = YES; 316 | GCC_OPTIMIZATION_LEVEL = 0; 317 | GCC_PREPROCESSOR_DEFINITIONS = ( 318 | "DEBUG=1", 319 | "$(inherited)", 320 | ); 321 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 322 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 323 | GCC_WARN_UNDECLARED_SELECTOR = YES; 324 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 325 | GCC_WARN_UNUSED_FUNCTION = YES; 326 | GCC_WARN_UNUSED_VARIABLE = YES; 327 | IPHONEOS_DEPLOYMENT_TARGET = 14.0; 328 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 329 | MTL_FAST_MATH = YES; 330 | ONLY_ACTIVE_ARCH = YES; 331 | SDKROOT = iphoneos; 332 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 333 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 334 | }; 335 | name = Debug; 336 | }; 337 | F3D42DC524B1C3B000FF7835 /* Release */ = { 338 | isa = XCBuildConfiguration; 339 | buildSettings = { 340 | ALWAYS_SEARCH_USER_PATHS = NO; 341 | CLANG_ANALYZER_NONNULL = YES; 342 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 343 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 344 | CLANG_CXX_LIBRARY = "libc++"; 345 | CLANG_ENABLE_MODULES = YES; 346 | CLANG_ENABLE_OBJC_ARC = YES; 347 | CLANG_ENABLE_OBJC_WEAK = YES; 348 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 349 | CLANG_WARN_BOOL_CONVERSION = YES; 350 | CLANG_WARN_COMMA = YES; 351 | CLANG_WARN_CONSTANT_CONVERSION = YES; 352 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 353 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 354 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 355 | CLANG_WARN_EMPTY_BODY = YES; 356 | CLANG_WARN_ENUM_CONVERSION = YES; 357 | CLANG_WARN_INFINITE_RECURSION = YES; 358 | CLANG_WARN_INT_CONVERSION = YES; 359 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 360 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 361 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 362 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 363 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 364 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 365 | CLANG_WARN_STRICT_PROTOTYPES = YES; 366 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 367 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 368 | CLANG_WARN_UNREACHABLE_CODE = YES; 369 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 370 | COPY_PHASE_STRIP = NO; 371 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 372 | ENABLE_NS_ASSERTIONS = NO; 373 | ENABLE_STRICT_OBJC_MSGSEND = YES; 374 | GCC_C_LANGUAGE_STANDARD = gnu11; 375 | GCC_NO_COMMON_BLOCKS = YES; 376 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 377 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 378 | GCC_WARN_UNDECLARED_SELECTOR = YES; 379 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 380 | GCC_WARN_UNUSED_FUNCTION = YES; 381 | GCC_WARN_UNUSED_VARIABLE = YES; 382 | IPHONEOS_DEPLOYMENT_TARGET = 14.0; 383 | MTL_ENABLE_DEBUG_INFO = NO; 384 | MTL_FAST_MATH = YES; 385 | SDKROOT = iphoneos; 386 | SWIFT_COMPILATION_MODE = wholemodule; 387 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 388 | VALIDATE_PRODUCT = YES; 389 | }; 390 | name = Release; 391 | }; 392 | F3D42DC724B1C3B000FF7835 /* Debug */ = { 393 | isa = XCBuildConfiguration; 394 | buildSettings = { 395 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 396 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 397 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 398 | CODE_SIGN_ENTITLEMENTS = ClockWidget/ClockWidget.entitlements; 399 | CODE_SIGN_STYLE = Automatic; 400 | DEVELOPMENT_ASSET_PATHS = "\"ClockWidget/Preview Content\""; 401 | DEVELOPMENT_TEAM = 6Q9SP4M9H4; 402 | ENABLE_PREVIEWS = YES; 403 | INFOPLIST_FILE = ClockWidget/Info.plist; 404 | IPHONEOS_DEPLOYMENT_TARGET = 14.0; 405 | LD_RUNPATH_SEARCH_PATHS = ( 406 | "$(inherited)", 407 | "@executable_path/Frameworks", 408 | ); 409 | PRODUCT_BUNDLE_IDENTIFIER = com.jinwoopeter.ClockWidget; 410 | PRODUCT_NAME = "$(TARGET_NAME)"; 411 | SUPPORTS_MACCATALYST = NO; 412 | SWIFT_VERSION = 5.0; 413 | TARGETED_DEVICE_FAMILY = "1,2"; 414 | }; 415 | name = Debug; 416 | }; 417 | F3D42DC824B1C3B000FF7835 /* Release */ = { 418 | isa = XCBuildConfiguration; 419 | buildSettings = { 420 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 421 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 422 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 423 | CODE_SIGN_ENTITLEMENTS = ClockWidget/ClockWidget.entitlements; 424 | CODE_SIGN_STYLE = Automatic; 425 | DEVELOPMENT_ASSET_PATHS = "\"ClockWidget/Preview Content\""; 426 | DEVELOPMENT_TEAM = 6Q9SP4M9H4; 427 | ENABLE_PREVIEWS = YES; 428 | INFOPLIST_FILE = ClockWidget/Info.plist; 429 | IPHONEOS_DEPLOYMENT_TARGET = 14.0; 430 | LD_RUNPATH_SEARCH_PATHS = ( 431 | "$(inherited)", 432 | "@executable_path/Frameworks", 433 | ); 434 | PRODUCT_BUNDLE_IDENTIFIER = com.jinwoopeter.ClockWidget; 435 | PRODUCT_NAME = "$(TARGET_NAME)"; 436 | SUPPORTS_MACCATALYST = NO; 437 | SWIFT_VERSION = 5.0; 438 | TARGETED_DEVICE_FAMILY = "1,2"; 439 | }; 440 | name = Release; 441 | }; 442 | F3D42DDD24B1C3CA00FF7835 /* Debug */ = { 443 | isa = XCBuildConfiguration; 444 | buildSettings = { 445 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 446 | ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; 447 | CODE_SIGN_ENTITLEMENTS = ""; 448 | CODE_SIGN_STYLE = Automatic; 449 | DEVELOPMENT_TEAM = 6Q9SP4M9H4; 450 | INFOPLIST_FILE = ClockWidgetExt/Info.plist; 451 | LD_RUNPATH_SEARCH_PATHS = ( 452 | "$(inherited)", 453 | "@executable_path/Frameworks", 454 | "@executable_path/../../Frameworks", 455 | ); 456 | PRODUCT_BUNDLE_IDENTIFIER = com.jinwoopeter.ClockWidget.ClockWidgetExt; 457 | PRODUCT_NAME = "$(TARGET_NAME)"; 458 | SKIP_INSTALL = YES; 459 | SUPPORTS_MACCATALYST = NO; 460 | SWIFT_VERSION = 5.0; 461 | TARGETED_DEVICE_FAMILY = "1,2"; 462 | }; 463 | name = Debug; 464 | }; 465 | F3D42DDE24B1C3CA00FF7835 /* Release */ = { 466 | isa = XCBuildConfiguration; 467 | buildSettings = { 468 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 469 | ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; 470 | CODE_SIGN_ENTITLEMENTS = ""; 471 | CODE_SIGN_STYLE = Automatic; 472 | DEVELOPMENT_TEAM = 6Q9SP4M9H4; 473 | INFOPLIST_FILE = ClockWidgetExt/Info.plist; 474 | LD_RUNPATH_SEARCH_PATHS = ( 475 | "$(inherited)", 476 | "@executable_path/Frameworks", 477 | "@executable_path/../../Frameworks", 478 | ); 479 | PRODUCT_BUNDLE_IDENTIFIER = com.jinwoopeter.ClockWidget.ClockWidgetExt; 480 | PRODUCT_NAME = "$(TARGET_NAME)"; 481 | SKIP_INSTALL = YES; 482 | SUPPORTS_MACCATALYST = NO; 483 | SWIFT_VERSION = 5.0; 484 | TARGETED_DEVICE_FAMILY = "1,2"; 485 | }; 486 | name = Release; 487 | }; 488 | /* End XCBuildConfiguration section */ 489 | 490 | /* Begin XCConfigurationList section */ 491 | F3D42DB224B1C3AE00FF7835 /* Build configuration list for PBXProject "ClockWidget" */ = { 492 | isa = XCConfigurationList; 493 | buildConfigurations = ( 494 | F3D42DC424B1C3B000FF7835 /* Debug */, 495 | F3D42DC524B1C3B000FF7835 /* Release */, 496 | ); 497 | defaultConfigurationIsVisible = 0; 498 | defaultConfigurationName = Release; 499 | }; 500 | F3D42DC624B1C3B000FF7835 /* Build configuration list for PBXNativeTarget "ClockWidget" */ = { 501 | isa = XCConfigurationList; 502 | buildConfigurations = ( 503 | F3D42DC724B1C3B000FF7835 /* Debug */, 504 | F3D42DC824B1C3B000FF7835 /* Release */, 505 | ); 506 | defaultConfigurationIsVisible = 0; 507 | defaultConfigurationName = Release; 508 | }; 509 | F3D42DDC24B1C3CA00FF7835 /* Build configuration list for PBXNativeTarget "ClockWidgetExtExtension" */ = { 510 | isa = XCConfigurationList; 511 | buildConfigurations = ( 512 | F3D42DDD24B1C3CA00FF7835 /* Debug */, 513 | F3D42DDE24B1C3CA00FF7835 /* Release */, 514 | ); 515 | defaultConfigurationIsVisible = 0; 516 | defaultConfigurationName = Release; 517 | }; 518 | /* End XCConfigurationList section */ 519 | }; 520 | rootObject = F3D42DAF24B1C3AE00FF7835 /* Project object */; 521 | } 522 | -------------------------------------------------------------------------------- /ClockWidget.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ClockWidget.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ClockWidget.xcodeproj/project.xcworkspace/xcuserdata/pook.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pookjw/ClockWidget/6d59b621e86e3d816764023bc960a5a327c34a9f/ClockWidget.xcodeproj/project.xcworkspace/xcuserdata/pook.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /ClockWidget.xcodeproj/xcuserdata/pook.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ClockWidget.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 1 11 | 12 | ClockWidgetExtExtension.xcscheme_^#shared#^_ 13 | 14 | orderHint 15 | 0 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /ClockWidget/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 | -------------------------------------------------------------------------------- /ClockWidget/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 | -------------------------------------------------------------------------------- /ClockWidget/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ClockWidget/Assets.xcassets/face.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "face.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "face-1.png", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "face-2.png", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ClockWidget/Assets.xcassets/face.imageset/face-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pookjw/ClockWidget/6d59b621e86e3d816764023bc960a5a327c34a9f/ClockWidget/Assets.xcassets/face.imageset/face-1.png -------------------------------------------------------------------------------- /ClockWidget/Assets.xcassets/face.imageset/face-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pookjw/ClockWidget/6d59b621e86e3d816764023bc960a5a327c34a9f/ClockWidget/Assets.xcassets/face.imageset/face-2.png -------------------------------------------------------------------------------- /ClockWidget/Assets.xcassets/face.imageset/face.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pookjw/ClockWidget/6d59b621e86e3d816764023bc960a5a327c34a9f/ClockWidget/Assets.xcassets/face.imageset/face.png -------------------------------------------------------------------------------- /ClockWidget/ClockWidget.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.network.client 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ClockWidget/ClockWidgetApp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ClockWidgetApp.swift 3 | // ClockWidget 4 | // 5 | // Created by pook on 7/5/20. 6 | // 7 | 8 | import SwiftUI 9 | 10 | @main 11 | struct ClockWidgetApp: App { 12 | var body: some Scene { 13 | WindowGroup { 14 | ContentView() 15 | .frame(width: 160, height: 160, alignment: /*@START_MENU_TOKEN@*/.center/*@END_MENU_TOKEN@*/) 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ClockWidget/ContentView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // ClockWidget 4 | // 5 | // Created by pook on 7/5/20. 6 | // 7 | 8 | import SwiftUI 9 | import WidgetKit 10 | 11 | struct ContentView: View { 12 | var body: some View { 13 | ZStack{ 14 | Image("face") 15 | .resizable(capInsets: /*@START_MENU_TOKEN@*/EdgeInsets()/*@END_MENU_TOKEN@*/, resizingMode: /*@START_MENU_TOKEN@*/.stretch/*@END_MENU_TOKEN@*/) 16 | VStack(alignment: .center) { 17 | Rectangle().fill(Color.gray).frame(width: 3, height: 25) 18 | Spacer().frame(width: 3, height: 25) 19 | }._clockHandRotationEffect(.hourHand, in: .current, anchor: .center) 20 | VStack(alignment: .center) { 21 | Rectangle().fill(Color.gray).frame(width: 2, height: 40) 22 | Spacer().frame(width: 2, height: 40) 23 | }._clockHandRotationEffect(.minuteHand, in: .current, anchor: .center) 24 | VStack(alignment: .center) { 25 | Rectangle().fill(Color.red).frame(width: 1, height: 50) 26 | Spacer().frame(width: 1, height: 50) 27 | }._clockHandRotationEffect(.secondHand, in: .current, anchor: .center) 28 | } 29 | } 30 | } 31 | 32 | struct ContentView_Previews: PreviewProvider { 33 | static var previews: some View { 34 | ContentView() 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /ClockWidget/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 | -------------------------------------------------------------------------------- /ClockWidget/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ClockWidgetExt/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 | -------------------------------------------------------------------------------- /ClockWidgetExt/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 | -------------------------------------------------------------------------------- /ClockWidgetExt/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ClockWidgetExt/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 | -------------------------------------------------------------------------------- /ClockWidgetExt/ClockWidgetExt.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ClockWidgetExt.swift 3 | // ClockWidgetExt 4 | // 5 | // Created by pook on 7/5/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 ClockWidgetExtEntryView : 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 ClockWidgetExt: Widget { 55 | private let kind: String = "ClockWidgetExt" 56 | 57 | public var body: some WidgetConfiguration { 58 | StaticConfiguration(kind: kind, provider: Provider(), placeholder: PlaceholderView()) { entry in 59 | ContentView() 60 | } 61 | .configurationDisplayName("My Widget") 62 | .description("This is an example widget.") 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /ClockWidgetExt/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | ClockWidgetExt 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ClockWidget 2 | 3 | iOS 14 Clock Widget 4 | 5 | Idea : https://twitter.com/zhuowei/status/1277066951572013057 6 | 7 | Clock Face : https://www.pinterest.com/pin/165648092528568853/ 8 | 9 | ![1](image.png) 10 | -------------------------------------------------------------------------------- /image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pookjw/ClockWidget/6d59b621e86e3d816764023bc960a5a327c34a9f/image.png --------------------------------------------------------------------------------