├── FloatingClock.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ │ └── wl.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── wl.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ └── xcschememanagement.plist ├── FloatingClock ├── AppDelegate.swift ├── Assets.xcassets │ ├── AccentColor.colorset │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── SceneDelegate.swift ├── VideoEditor │ ├── TimeVideoComposition.swift │ ├── TimeVideoCompositionInstruction.swift │ ├── VideoCreator.swift │ └── certificate.p12 ├── ViewController.swift └── temp.mov ├── FloatingClockTests ├── FloatingClockTests.swift └── Info.plist ├── FloatingClockUITests ├── FloatingClockUITests.swift └── Info.plist ├── Readme.md └── Resource └── demo.gif /FloatingClock.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 7744CF76258A1E7000AB2136 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7744CF75258A1E7000AB2136 /* AppDelegate.swift */; }; 11 | 7744CF78258A1E7000AB2136 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7744CF77258A1E7000AB2136 /* SceneDelegate.swift */; }; 12 | 7744CF7A258A1E7000AB2136 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7744CF79258A1E7000AB2136 /* ViewController.swift */; }; 13 | 7744CF7D258A1E7000AB2136 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7744CF7B258A1E7000AB2136 /* Main.storyboard */; }; 14 | 7744CF7F258A1E7100AB2136 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7744CF7E258A1E7100AB2136 /* Assets.xcassets */; }; 15 | 7744CF82258A1E7100AB2136 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7744CF80258A1E7100AB2136 /* LaunchScreen.storyboard */; }; 16 | 7744CF8D258A1E7200AB2136 /* FloatingClockTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7744CF8C258A1E7200AB2136 /* FloatingClockTests.swift */; }; 17 | 7744CF98258A1E7200AB2136 /* FloatingClockUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7744CF97258A1E7200AB2136 /* FloatingClockUITests.swift */; }; 18 | 7744CFBE258A2D6700AB2136 /* TimeVideoComposition.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7744CFBD258A2D6700AB2136 /* TimeVideoComposition.swift */; }; 19 | 7787D622258CB06F0052372E /* VideoCreator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7787D621258CB06F0052372E /* VideoCreator.swift */; }; 20 | 7787D627258CB9100052372E /* temp.mov in Resources */ = {isa = PBXBuildFile; fileRef = 7787D626258CB9100052372E /* temp.mov */; }; 21 | 77922053258B721F007ACC5F /* TimeVideoCompositionInstruction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 77922052258B721F007ACC5F /* TimeVideoCompositionInstruction.swift */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXContainerItemProxy section */ 25 | 7744CF89258A1E7200AB2136 /* PBXContainerItemProxy */ = { 26 | isa = PBXContainerItemProxy; 27 | containerPortal = 7744CF6A258A1E7000AB2136 /* Project object */; 28 | proxyType = 1; 29 | remoteGlobalIDString = 7744CF71258A1E7000AB2136; 30 | remoteInfo = FloatingClock; 31 | }; 32 | 7744CF94258A1E7200AB2136 /* PBXContainerItemProxy */ = { 33 | isa = PBXContainerItemProxy; 34 | containerPortal = 7744CF6A258A1E7000AB2136 /* Project object */; 35 | proxyType = 1; 36 | remoteGlobalIDString = 7744CF71258A1E7000AB2136; 37 | remoteInfo = FloatingClock; 38 | }; 39 | /* End PBXContainerItemProxy section */ 40 | 41 | /* Begin PBXFileReference section */ 42 | 7744CF72258A1E7000AB2136 /* FloatingClock.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FloatingClock.app; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | 7744CF75258A1E7000AB2136 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 44 | 7744CF77258A1E7000AB2136 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; 45 | 7744CF79258A1E7000AB2136 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 46 | 7744CF7C258A1E7000AB2136 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 47 | 7744CF7E258A1E7100AB2136 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 48 | 7744CF81258A1E7100AB2136 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 49 | 7744CF83258A1E7100AB2136 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 50 | 7744CF88258A1E7200AB2136 /* FloatingClockTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FloatingClockTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 51 | 7744CF8C258A1E7200AB2136 /* FloatingClockTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FloatingClockTests.swift; sourceTree = ""; }; 52 | 7744CF8E258A1E7200AB2136 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 53 | 7744CF93258A1E7200AB2136 /* FloatingClockUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FloatingClockUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 54 | 7744CF97258A1E7200AB2136 /* FloatingClockUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FloatingClockUITests.swift; sourceTree = ""; }; 55 | 7744CF99258A1E7200AB2136 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 56 | 7744CFBD258A2D6700AB2136 /* TimeVideoComposition.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimeVideoComposition.swift; sourceTree = ""; }; 57 | 7787D621258CB06F0052372E /* VideoCreator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoCreator.swift; sourceTree = ""; }; 58 | 7787D626258CB9100052372E /* temp.mov */ = {isa = PBXFileReference; lastKnownFileType = video.quicktime; path = temp.mov; sourceTree = ""; }; 59 | 77922052258B721F007ACC5F /* TimeVideoCompositionInstruction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimeVideoCompositionInstruction.swift; sourceTree = ""; }; 60 | /* End PBXFileReference section */ 61 | 62 | /* Begin PBXFrameworksBuildPhase section */ 63 | 7744CF6F258A1E7000AB2136 /* Frameworks */ = { 64 | isa = PBXFrameworksBuildPhase; 65 | buildActionMask = 2147483647; 66 | files = ( 67 | ); 68 | runOnlyForDeploymentPostprocessing = 0; 69 | }; 70 | 7744CF85258A1E7200AB2136 /* Frameworks */ = { 71 | isa = PBXFrameworksBuildPhase; 72 | buildActionMask = 2147483647; 73 | files = ( 74 | ); 75 | runOnlyForDeploymentPostprocessing = 0; 76 | }; 77 | 7744CF90258A1E7200AB2136 /* Frameworks */ = { 78 | isa = PBXFrameworksBuildPhase; 79 | buildActionMask = 2147483647; 80 | files = ( 81 | ); 82 | runOnlyForDeploymentPostprocessing = 0; 83 | }; 84 | /* End PBXFrameworksBuildPhase section */ 85 | 86 | /* Begin PBXGroup section */ 87 | 7744CF69258A1E7000AB2136 = { 88 | isa = PBXGroup; 89 | children = ( 90 | 7744CF74258A1E7000AB2136 /* FloatingClock */, 91 | 7744CF8B258A1E7200AB2136 /* FloatingClockTests */, 92 | 7744CF96258A1E7200AB2136 /* FloatingClockUITests */, 93 | 7744CF73258A1E7000AB2136 /* Products */, 94 | ); 95 | sourceTree = ""; 96 | }; 97 | 7744CF73258A1E7000AB2136 /* Products */ = { 98 | isa = PBXGroup; 99 | children = ( 100 | 7744CF72258A1E7000AB2136 /* FloatingClock.app */, 101 | 7744CF88258A1E7200AB2136 /* FloatingClockTests.xctest */, 102 | 7744CF93258A1E7200AB2136 /* FloatingClockUITests.xctest */, 103 | ); 104 | name = Products; 105 | sourceTree = ""; 106 | }; 107 | 7744CF74258A1E7000AB2136 /* FloatingClock */ = { 108 | isa = PBXGroup; 109 | children = ( 110 | 7787D626258CB9100052372E /* temp.mov */, 111 | 7744CFBC258A2D3A00AB2136 /* VideoEditor */, 112 | 7744CF75258A1E7000AB2136 /* AppDelegate.swift */, 113 | 7744CF77258A1E7000AB2136 /* SceneDelegate.swift */, 114 | 7744CF79258A1E7000AB2136 /* ViewController.swift */, 115 | 7744CF7B258A1E7000AB2136 /* Main.storyboard */, 116 | 7744CF7E258A1E7100AB2136 /* Assets.xcassets */, 117 | 7744CF80258A1E7100AB2136 /* LaunchScreen.storyboard */, 118 | 7744CF83258A1E7100AB2136 /* Info.plist */, 119 | ); 120 | path = FloatingClock; 121 | sourceTree = ""; 122 | }; 123 | 7744CF8B258A1E7200AB2136 /* FloatingClockTests */ = { 124 | isa = PBXGroup; 125 | children = ( 126 | 7744CF8C258A1E7200AB2136 /* FloatingClockTests.swift */, 127 | 7744CF8E258A1E7200AB2136 /* Info.plist */, 128 | ); 129 | path = FloatingClockTests; 130 | sourceTree = ""; 131 | }; 132 | 7744CF96258A1E7200AB2136 /* FloatingClockUITests */ = { 133 | isa = PBXGroup; 134 | children = ( 135 | 7744CF97258A1E7200AB2136 /* FloatingClockUITests.swift */, 136 | 7744CF99258A1E7200AB2136 /* Info.plist */, 137 | ); 138 | path = FloatingClockUITests; 139 | sourceTree = ""; 140 | }; 141 | 7744CFBC258A2D3A00AB2136 /* VideoEditor */ = { 142 | isa = PBXGroup; 143 | children = ( 144 | 7744CFBD258A2D6700AB2136 /* TimeVideoComposition.swift */, 145 | 77922052258B721F007ACC5F /* TimeVideoCompositionInstruction.swift */, 146 | 7787D621258CB06F0052372E /* VideoCreator.swift */, 147 | ); 148 | path = VideoEditor; 149 | sourceTree = ""; 150 | }; 151 | /* End PBXGroup section */ 152 | 153 | /* Begin PBXNativeTarget section */ 154 | 7744CF71258A1E7000AB2136 /* FloatingClock */ = { 155 | isa = PBXNativeTarget; 156 | buildConfigurationList = 7744CF9C258A1E7200AB2136 /* Build configuration list for PBXNativeTarget "FloatingClock" */; 157 | buildPhases = ( 158 | 7744CF6E258A1E7000AB2136 /* Sources */, 159 | 7744CF6F258A1E7000AB2136 /* Frameworks */, 160 | 7744CF70258A1E7000AB2136 /* Resources */, 161 | ); 162 | buildRules = ( 163 | ); 164 | dependencies = ( 165 | ); 166 | name = FloatingClock; 167 | packageProductDependencies = ( 168 | ); 169 | productName = FloatingClock; 170 | productReference = 7744CF72258A1E7000AB2136 /* FloatingClock.app */; 171 | productType = "com.apple.product-type.application"; 172 | }; 173 | 7744CF87258A1E7200AB2136 /* FloatingClockTests */ = { 174 | isa = PBXNativeTarget; 175 | buildConfigurationList = 7744CF9F258A1E7200AB2136 /* Build configuration list for PBXNativeTarget "FloatingClockTests" */; 176 | buildPhases = ( 177 | 7744CF84258A1E7200AB2136 /* Sources */, 178 | 7744CF85258A1E7200AB2136 /* Frameworks */, 179 | 7744CF86258A1E7200AB2136 /* Resources */, 180 | ); 181 | buildRules = ( 182 | ); 183 | dependencies = ( 184 | 7744CF8A258A1E7200AB2136 /* PBXTargetDependency */, 185 | ); 186 | name = FloatingClockTests; 187 | productName = FloatingClockTests; 188 | productReference = 7744CF88258A1E7200AB2136 /* FloatingClockTests.xctest */; 189 | productType = "com.apple.product-type.bundle.unit-test"; 190 | }; 191 | 7744CF92258A1E7200AB2136 /* FloatingClockUITests */ = { 192 | isa = PBXNativeTarget; 193 | buildConfigurationList = 7744CFA2258A1E7200AB2136 /* Build configuration list for PBXNativeTarget "FloatingClockUITests" */; 194 | buildPhases = ( 195 | 7744CF8F258A1E7200AB2136 /* Sources */, 196 | 7744CF90258A1E7200AB2136 /* Frameworks */, 197 | 7744CF91258A1E7200AB2136 /* Resources */, 198 | ); 199 | buildRules = ( 200 | ); 201 | dependencies = ( 202 | 7744CF95258A1E7200AB2136 /* PBXTargetDependency */, 203 | ); 204 | name = FloatingClockUITests; 205 | productName = FloatingClockUITests; 206 | productReference = 7744CF93258A1E7200AB2136 /* FloatingClockUITests.xctest */; 207 | productType = "com.apple.product-type.bundle.ui-testing"; 208 | }; 209 | /* End PBXNativeTarget section */ 210 | 211 | /* Begin PBXProject section */ 212 | 7744CF6A258A1E7000AB2136 /* Project object */ = { 213 | isa = PBXProject; 214 | attributes = { 215 | LastSwiftUpdateCheck = 1220; 216 | LastUpgradeCheck = 1220; 217 | TargetAttributes = { 218 | 7744CF71258A1E7000AB2136 = { 219 | CreatedOnToolsVersion = 12.2; 220 | }; 221 | 7744CF87258A1E7200AB2136 = { 222 | CreatedOnToolsVersion = 12.2; 223 | TestTargetID = 7744CF71258A1E7000AB2136; 224 | }; 225 | 7744CF92258A1E7200AB2136 = { 226 | CreatedOnToolsVersion = 12.2; 227 | TestTargetID = 7744CF71258A1E7000AB2136; 228 | }; 229 | }; 230 | }; 231 | buildConfigurationList = 7744CF6D258A1E7000AB2136 /* Build configuration list for PBXProject "FloatingClock" */; 232 | compatibilityVersion = "Xcode 9.3"; 233 | developmentRegion = en; 234 | hasScannedForEncodings = 0; 235 | knownRegions = ( 236 | en, 237 | Base, 238 | ); 239 | mainGroup = 7744CF69258A1E7000AB2136; 240 | packageReferences = ( 241 | ); 242 | productRefGroup = 7744CF73258A1E7000AB2136 /* Products */; 243 | projectDirPath = ""; 244 | projectRoot = ""; 245 | targets = ( 246 | 7744CF71258A1E7000AB2136 /* FloatingClock */, 247 | 7744CF87258A1E7200AB2136 /* FloatingClockTests */, 248 | 7744CF92258A1E7200AB2136 /* FloatingClockUITests */, 249 | ); 250 | }; 251 | /* End PBXProject section */ 252 | 253 | /* Begin PBXResourcesBuildPhase section */ 254 | 7744CF70258A1E7000AB2136 /* Resources */ = { 255 | isa = PBXResourcesBuildPhase; 256 | buildActionMask = 2147483647; 257 | files = ( 258 | 7787D627258CB9100052372E /* temp.mov in Resources */, 259 | 7744CF82258A1E7100AB2136 /* LaunchScreen.storyboard in Resources */, 260 | 7744CF7F258A1E7100AB2136 /* Assets.xcassets in Resources */, 261 | 7744CF7D258A1E7000AB2136 /* Main.storyboard in Resources */, 262 | ); 263 | runOnlyForDeploymentPostprocessing = 0; 264 | }; 265 | 7744CF86258A1E7200AB2136 /* Resources */ = { 266 | isa = PBXResourcesBuildPhase; 267 | buildActionMask = 2147483647; 268 | files = ( 269 | ); 270 | runOnlyForDeploymentPostprocessing = 0; 271 | }; 272 | 7744CF91258A1E7200AB2136 /* Resources */ = { 273 | isa = PBXResourcesBuildPhase; 274 | buildActionMask = 2147483647; 275 | files = ( 276 | ); 277 | runOnlyForDeploymentPostprocessing = 0; 278 | }; 279 | /* End PBXResourcesBuildPhase section */ 280 | 281 | /* Begin PBXSourcesBuildPhase section */ 282 | 7744CF6E258A1E7000AB2136 /* Sources */ = { 283 | isa = PBXSourcesBuildPhase; 284 | buildActionMask = 2147483647; 285 | files = ( 286 | 7744CFBE258A2D6700AB2136 /* TimeVideoComposition.swift in Sources */, 287 | 7744CF7A258A1E7000AB2136 /* ViewController.swift in Sources */, 288 | 7744CF76258A1E7000AB2136 /* AppDelegate.swift in Sources */, 289 | 7744CF78258A1E7000AB2136 /* SceneDelegate.swift in Sources */, 290 | 7787D622258CB06F0052372E /* VideoCreator.swift in Sources */, 291 | 77922053258B721F007ACC5F /* TimeVideoCompositionInstruction.swift in Sources */, 292 | ); 293 | runOnlyForDeploymentPostprocessing = 0; 294 | }; 295 | 7744CF84258A1E7200AB2136 /* Sources */ = { 296 | isa = PBXSourcesBuildPhase; 297 | buildActionMask = 2147483647; 298 | files = ( 299 | 7744CF8D258A1E7200AB2136 /* FloatingClockTests.swift in Sources */, 300 | ); 301 | runOnlyForDeploymentPostprocessing = 0; 302 | }; 303 | 7744CF8F258A1E7200AB2136 /* Sources */ = { 304 | isa = PBXSourcesBuildPhase; 305 | buildActionMask = 2147483647; 306 | files = ( 307 | 7744CF98258A1E7200AB2136 /* FloatingClockUITests.swift in Sources */, 308 | ); 309 | runOnlyForDeploymentPostprocessing = 0; 310 | }; 311 | /* End PBXSourcesBuildPhase section */ 312 | 313 | /* Begin PBXTargetDependency section */ 314 | 7744CF8A258A1E7200AB2136 /* PBXTargetDependency */ = { 315 | isa = PBXTargetDependency; 316 | target = 7744CF71258A1E7000AB2136 /* FloatingClock */; 317 | targetProxy = 7744CF89258A1E7200AB2136 /* PBXContainerItemProxy */; 318 | }; 319 | 7744CF95258A1E7200AB2136 /* PBXTargetDependency */ = { 320 | isa = PBXTargetDependency; 321 | target = 7744CF71258A1E7000AB2136 /* FloatingClock */; 322 | targetProxy = 7744CF94258A1E7200AB2136 /* PBXContainerItemProxy */; 323 | }; 324 | /* End PBXTargetDependency section */ 325 | 326 | /* Begin PBXVariantGroup section */ 327 | 7744CF7B258A1E7000AB2136 /* Main.storyboard */ = { 328 | isa = PBXVariantGroup; 329 | children = ( 330 | 7744CF7C258A1E7000AB2136 /* Base */, 331 | ); 332 | name = Main.storyboard; 333 | sourceTree = ""; 334 | }; 335 | 7744CF80258A1E7100AB2136 /* LaunchScreen.storyboard */ = { 336 | isa = PBXVariantGroup; 337 | children = ( 338 | 7744CF81258A1E7100AB2136 /* Base */, 339 | ); 340 | name = LaunchScreen.storyboard; 341 | sourceTree = ""; 342 | }; 343 | /* End PBXVariantGroup section */ 344 | 345 | /* Begin XCBuildConfiguration section */ 346 | 7744CF9A258A1E7200AB2136 /* Debug */ = { 347 | isa = XCBuildConfiguration; 348 | buildSettings = { 349 | ALWAYS_SEARCH_USER_PATHS = NO; 350 | CLANG_ANALYZER_NONNULL = YES; 351 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 352 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 353 | CLANG_CXX_LIBRARY = "libc++"; 354 | CLANG_ENABLE_MODULES = YES; 355 | CLANG_ENABLE_OBJC_ARC = YES; 356 | CLANG_ENABLE_OBJC_WEAK = YES; 357 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 358 | CLANG_WARN_BOOL_CONVERSION = YES; 359 | CLANG_WARN_COMMA = YES; 360 | CLANG_WARN_CONSTANT_CONVERSION = YES; 361 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 362 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 363 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 364 | CLANG_WARN_EMPTY_BODY = YES; 365 | CLANG_WARN_ENUM_CONVERSION = YES; 366 | CLANG_WARN_INFINITE_RECURSION = YES; 367 | CLANG_WARN_INT_CONVERSION = YES; 368 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 369 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 370 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 371 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 372 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 373 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 374 | CLANG_WARN_STRICT_PROTOTYPES = YES; 375 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 376 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 377 | CLANG_WARN_UNREACHABLE_CODE = YES; 378 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 379 | COPY_PHASE_STRIP = NO; 380 | DEBUG_INFORMATION_FORMAT = dwarf; 381 | ENABLE_STRICT_OBJC_MSGSEND = YES; 382 | ENABLE_TESTABILITY = YES; 383 | GCC_C_LANGUAGE_STANDARD = gnu11; 384 | GCC_DYNAMIC_NO_PIC = NO; 385 | GCC_NO_COMMON_BLOCKS = YES; 386 | GCC_OPTIMIZATION_LEVEL = 0; 387 | GCC_PREPROCESSOR_DEFINITIONS = ( 388 | "DEBUG=1", 389 | "$(inherited)", 390 | ); 391 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 392 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 393 | GCC_WARN_UNDECLARED_SELECTOR = YES; 394 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 395 | GCC_WARN_UNUSED_FUNCTION = YES; 396 | GCC_WARN_UNUSED_VARIABLE = YES; 397 | IPHONEOS_DEPLOYMENT_TARGET = 14.2; 398 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 399 | MTL_FAST_MATH = YES; 400 | ONLY_ACTIVE_ARCH = YES; 401 | SDKROOT = iphoneos; 402 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 403 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 404 | }; 405 | name = Debug; 406 | }; 407 | 7744CF9B258A1E7200AB2136 /* Release */ = { 408 | isa = XCBuildConfiguration; 409 | buildSettings = { 410 | ALWAYS_SEARCH_USER_PATHS = NO; 411 | CLANG_ANALYZER_NONNULL = YES; 412 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 413 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 414 | CLANG_CXX_LIBRARY = "libc++"; 415 | CLANG_ENABLE_MODULES = YES; 416 | CLANG_ENABLE_OBJC_ARC = YES; 417 | CLANG_ENABLE_OBJC_WEAK = YES; 418 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 419 | CLANG_WARN_BOOL_CONVERSION = YES; 420 | CLANG_WARN_COMMA = YES; 421 | CLANG_WARN_CONSTANT_CONVERSION = YES; 422 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 423 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 424 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 425 | CLANG_WARN_EMPTY_BODY = YES; 426 | CLANG_WARN_ENUM_CONVERSION = YES; 427 | CLANG_WARN_INFINITE_RECURSION = YES; 428 | CLANG_WARN_INT_CONVERSION = YES; 429 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 430 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 431 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 432 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 433 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 434 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 435 | CLANG_WARN_STRICT_PROTOTYPES = YES; 436 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 437 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 438 | CLANG_WARN_UNREACHABLE_CODE = YES; 439 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 440 | COPY_PHASE_STRIP = NO; 441 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 442 | ENABLE_NS_ASSERTIONS = NO; 443 | ENABLE_STRICT_OBJC_MSGSEND = YES; 444 | GCC_C_LANGUAGE_STANDARD = gnu11; 445 | GCC_NO_COMMON_BLOCKS = YES; 446 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 447 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 448 | GCC_WARN_UNDECLARED_SELECTOR = YES; 449 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 450 | GCC_WARN_UNUSED_FUNCTION = YES; 451 | GCC_WARN_UNUSED_VARIABLE = YES; 452 | IPHONEOS_DEPLOYMENT_TARGET = 14.2; 453 | MTL_ENABLE_DEBUG_INFO = NO; 454 | MTL_FAST_MATH = YES; 455 | SDKROOT = iphoneos; 456 | SWIFT_COMPILATION_MODE = wholemodule; 457 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 458 | VALIDATE_PRODUCT = YES; 459 | }; 460 | name = Release; 461 | }; 462 | 7744CF9D258A1E7200AB2136 /* Debug */ = { 463 | isa = XCBuildConfiguration; 464 | buildSettings = { 465 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 466 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 467 | CODE_SIGN_STYLE = Automatic; 468 | DEVELOPMENT_TEAM = K6T6NB7VRW; 469 | INFOPLIST_FILE = FloatingClock/Info.plist; 470 | LD_RUNPATH_SEARCH_PATHS = ( 471 | "$(inherited)", 472 | "@executable_path/Frameworks", 473 | ); 474 | PRODUCT_BUNDLE_IDENTIFIER = com.hzjuzhi.FloatingClock; 475 | PRODUCT_NAME = "$(TARGET_NAME)"; 476 | SWIFT_VERSION = 5.0; 477 | TARGETED_DEVICE_FAMILY = "1,2"; 478 | }; 479 | name = Debug; 480 | }; 481 | 7744CF9E258A1E7200AB2136 /* Release */ = { 482 | isa = XCBuildConfiguration; 483 | buildSettings = { 484 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 485 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 486 | CODE_SIGN_STYLE = Automatic; 487 | DEVELOPMENT_TEAM = K6T6NB7VRW; 488 | INFOPLIST_FILE = FloatingClock/Info.plist; 489 | LD_RUNPATH_SEARCH_PATHS = ( 490 | "$(inherited)", 491 | "@executable_path/Frameworks", 492 | ); 493 | PRODUCT_BUNDLE_IDENTIFIER = com.hzjuzhi.FloatingClock; 494 | PRODUCT_NAME = "$(TARGET_NAME)"; 495 | SWIFT_VERSION = 5.0; 496 | TARGETED_DEVICE_FAMILY = "1,2"; 497 | }; 498 | name = Release; 499 | }; 500 | 7744CFA0258A1E7200AB2136 /* Debug */ = { 501 | isa = XCBuildConfiguration; 502 | buildSettings = { 503 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 504 | BUNDLE_LOADER = "$(TEST_HOST)"; 505 | CODE_SIGN_STYLE = Automatic; 506 | INFOPLIST_FILE = FloatingClockTests/Info.plist; 507 | IPHONEOS_DEPLOYMENT_TARGET = 14.2; 508 | LD_RUNPATH_SEARCH_PATHS = ( 509 | "$(inherited)", 510 | "@executable_path/Frameworks", 511 | "@loader_path/Frameworks", 512 | ); 513 | PRODUCT_BUNDLE_IDENTIFIER = com.hzjuzhi.FloatingClockTests; 514 | PRODUCT_NAME = "$(TARGET_NAME)"; 515 | SWIFT_VERSION = 5.0; 516 | TARGETED_DEVICE_FAMILY = "1,2"; 517 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FloatingClock.app/FloatingClock"; 518 | }; 519 | name = Debug; 520 | }; 521 | 7744CFA1258A1E7200AB2136 /* Release */ = { 522 | isa = XCBuildConfiguration; 523 | buildSettings = { 524 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 525 | BUNDLE_LOADER = "$(TEST_HOST)"; 526 | CODE_SIGN_STYLE = Automatic; 527 | INFOPLIST_FILE = FloatingClockTests/Info.plist; 528 | IPHONEOS_DEPLOYMENT_TARGET = 14.2; 529 | LD_RUNPATH_SEARCH_PATHS = ( 530 | "$(inherited)", 531 | "@executable_path/Frameworks", 532 | "@loader_path/Frameworks", 533 | ); 534 | PRODUCT_BUNDLE_IDENTIFIER = com.hzjuzhi.FloatingClockTests; 535 | PRODUCT_NAME = "$(TARGET_NAME)"; 536 | SWIFT_VERSION = 5.0; 537 | TARGETED_DEVICE_FAMILY = "1,2"; 538 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FloatingClock.app/FloatingClock"; 539 | }; 540 | name = Release; 541 | }; 542 | 7744CFA3258A1E7200AB2136 /* Debug */ = { 543 | isa = XCBuildConfiguration; 544 | buildSettings = { 545 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 546 | CODE_SIGN_STYLE = Automatic; 547 | INFOPLIST_FILE = FloatingClockUITests/Info.plist; 548 | LD_RUNPATH_SEARCH_PATHS = ( 549 | "$(inherited)", 550 | "@executable_path/Frameworks", 551 | "@loader_path/Frameworks", 552 | ); 553 | PRODUCT_BUNDLE_IDENTIFIER = com.hzjuzhi.FloatingClockUITests; 554 | PRODUCT_NAME = "$(TARGET_NAME)"; 555 | SWIFT_VERSION = 5.0; 556 | TARGETED_DEVICE_FAMILY = "1,2"; 557 | TEST_TARGET_NAME = FloatingClock; 558 | }; 559 | name = Debug; 560 | }; 561 | 7744CFA4258A1E7200AB2136 /* Release */ = { 562 | isa = XCBuildConfiguration; 563 | buildSettings = { 564 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 565 | CODE_SIGN_STYLE = Automatic; 566 | INFOPLIST_FILE = FloatingClockUITests/Info.plist; 567 | LD_RUNPATH_SEARCH_PATHS = ( 568 | "$(inherited)", 569 | "@executable_path/Frameworks", 570 | "@loader_path/Frameworks", 571 | ); 572 | PRODUCT_BUNDLE_IDENTIFIER = com.hzjuzhi.FloatingClockUITests; 573 | PRODUCT_NAME = "$(TARGET_NAME)"; 574 | SWIFT_VERSION = 5.0; 575 | TARGETED_DEVICE_FAMILY = "1,2"; 576 | TEST_TARGET_NAME = FloatingClock; 577 | }; 578 | name = Release; 579 | }; 580 | /* End XCBuildConfiguration section */ 581 | 582 | /* Begin XCConfigurationList section */ 583 | 7744CF6D258A1E7000AB2136 /* Build configuration list for PBXProject "FloatingClock" */ = { 584 | isa = XCConfigurationList; 585 | buildConfigurations = ( 586 | 7744CF9A258A1E7200AB2136 /* Debug */, 587 | 7744CF9B258A1E7200AB2136 /* Release */, 588 | ); 589 | defaultConfigurationIsVisible = 0; 590 | defaultConfigurationName = Release; 591 | }; 592 | 7744CF9C258A1E7200AB2136 /* Build configuration list for PBXNativeTarget "FloatingClock" */ = { 593 | isa = XCConfigurationList; 594 | buildConfigurations = ( 595 | 7744CF9D258A1E7200AB2136 /* Debug */, 596 | 7744CF9E258A1E7200AB2136 /* Release */, 597 | ); 598 | defaultConfigurationIsVisible = 0; 599 | defaultConfigurationName = Release; 600 | }; 601 | 7744CF9F258A1E7200AB2136 /* Build configuration list for PBXNativeTarget "FloatingClockTests" */ = { 602 | isa = XCConfigurationList; 603 | buildConfigurations = ( 604 | 7744CFA0258A1E7200AB2136 /* Debug */, 605 | 7744CFA1258A1E7200AB2136 /* Release */, 606 | ); 607 | defaultConfigurationIsVisible = 0; 608 | defaultConfigurationName = Release; 609 | }; 610 | 7744CFA2258A1E7200AB2136 /* Build configuration list for PBXNativeTarget "FloatingClockUITests" */ = { 611 | isa = XCConfigurationList; 612 | buildConfigurations = ( 613 | 7744CFA3258A1E7200AB2136 /* Debug */, 614 | 7744CFA4258A1E7200AB2136 /* Release */, 615 | ); 616 | defaultConfigurationIsVisible = 0; 617 | defaultConfigurationName = Release; 618 | }; 619 | /* End XCConfigurationList section */ 620 | }; 621 | rootObject = 7744CF6A258A1E7000AB2136 /* Project object */; 622 | } 623 | -------------------------------------------------------------------------------- /FloatingClock.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /FloatingClock.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /FloatingClock.xcodeproj/project.xcworkspace/xcuserdata/wl.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gdoudeng/Floating-Clock/8b5a1bf219ef3162075ef09740514d5c8cadb9ea/FloatingClock.xcodeproj/project.xcworkspace/xcuserdata/wl.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /FloatingClock.xcodeproj/xcuserdata/wl.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /FloatingClock.xcodeproj/xcuserdata/wl.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | FloatingClock.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | SnapKitPlayground (Playground) 1.xcscheme 13 | 14 | isShown 15 | 16 | orderHint 17 | 2 18 | 19 | SnapKitPlayground (Playground) 2.xcscheme 20 | 21 | isShown 22 | 23 | orderHint 24 | 3 25 | 26 | SnapKitPlayground (Playground).xcscheme 27 | 28 | isShown 29 | 30 | orderHint 31 | 1 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /FloatingClock/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // FloatingClock 4 | // 5 | // Created by wl on 2020/12/16. 6 | // 7 | 8 | import UIKit 9 | import AVFoundation 10 | 11 | @main 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | 15 | 16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 17 | setupAudioSession() 18 | return true 19 | } 20 | 21 | // MARK: UISceneSession Lifecycle 22 | 23 | func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { 24 | // Called when a new scene session is being created. 25 | // Use this method to select a configuration to create the new scene with. 26 | return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) 27 | } 28 | 29 | func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { 30 | // Called when the user discards a scene session. 31 | // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. 32 | // Use this method to release any resources that were specific to the discarded scenes, as they will not return. 33 | } 34 | 35 | } 36 | 37 | extension AppDelegate { 38 | func setupAudioSession() { 39 | let audioSession = AVAudioSession.sharedInstance() 40 | do { 41 | try audioSession.setCategory(.playback) 42 | } catch { 43 | print("Setting category to AVAudioSessionCategoryPlayback failed.") 44 | } 45 | } 46 | } 47 | 48 | -------------------------------------------------------------------------------- /FloatingClock/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 | -------------------------------------------------------------------------------- /FloatingClock/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 | -------------------------------------------------------------------------------- /FloatingClock/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /FloatingClock/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /FloatingClock/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /FloatingClock/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 | UISceneConfigurations 28 | 29 | UIWindowSceneSessionRoleApplication 30 | 31 | 32 | UISceneConfigurationName 33 | Default Configuration 34 | UISceneDelegateClassName 35 | $(PRODUCT_MODULE_NAME).SceneDelegate 36 | UISceneStoryboardFile 37 | Main 38 | 39 | 40 | 41 | 42 | UIApplicationSupportsIndirectInputEvents 43 | 44 | UIBackgroundModes 45 | 46 | audio 47 | 48 | UILaunchStoryboardName 49 | LaunchScreen 50 | UIMainStoryboardFile 51 | Main 52 | UIRequiredDeviceCapabilities 53 | 54 | armv7 55 | 56 | UISupportedInterfaceOrientations 57 | 58 | UIInterfaceOrientationPortrait 59 | UIInterfaceOrientationLandscapeLeft 60 | UIInterfaceOrientationLandscapeRight 61 | 62 | UISupportedInterfaceOrientations~ipad 63 | 64 | UIInterfaceOrientationPortrait 65 | UIInterfaceOrientationPortraitUpsideDown 66 | UIInterfaceOrientationLandscapeLeft 67 | UIInterfaceOrientationLandscapeRight 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /FloatingClock/SceneDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SceneDelegate.swift 3 | // FloatingClock 4 | // 5 | // Created by wl on 2020/12/16. 6 | // 7 | 8 | import UIKit 9 | 10 | class SceneDelegate: UIResponder, UIWindowSceneDelegate { 11 | 12 | var window: UIWindow? 13 | 14 | 15 | func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { 16 | // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. 17 | // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. 18 | // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). 19 | guard let _ = (scene as? UIWindowScene) else { return } 20 | } 21 | 22 | func sceneDidDisconnect(_ scene: UIScene) { 23 | // Called as the scene is being released by the system. 24 | // This occurs shortly after the scene enters the background, or when its session is discarded. 25 | // Release any resources associated with this scene that can be re-created the next time the scene connects. 26 | // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). 27 | } 28 | 29 | func sceneDidBecomeActive(_ scene: UIScene) { 30 | // Called when the scene has moved from an inactive state to an active state. 31 | // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. 32 | } 33 | 34 | func sceneWillResignActive(_ scene: UIScene) { 35 | // Called when the scene will move from an active state to an inactive state. 36 | // This may occur due to temporary interruptions (ex. an incoming phone call). 37 | } 38 | 39 | func sceneWillEnterForeground(_ scene: UIScene) { 40 | // Called as the scene transitions from the background to the foreground. 41 | // Use this method to undo the changes made on entering the background. 42 | } 43 | 44 | func sceneDidEnterBackground(_ scene: UIScene) { 45 | // Called as the scene transitions from the foreground to the background. 46 | // Use this method to save data, release shared resources, and store enough scene-specific state information 47 | // to restore the scene back to its current state. 48 | } 49 | 50 | 51 | } 52 | 53 | -------------------------------------------------------------------------------- /FloatingClock/VideoEditor/TimeVideoComposition.swift: -------------------------------------------------------------------------------- 1 | // 2 | // VideoCompositing.swift 3 | // FloatingClock 4 | // 5 | // Created by wl on 2020/12/16. 6 | // 7 | 8 | import Foundation 9 | import AVFoundation 10 | import CoreImage 11 | import UIKit 12 | 13 | class TimeVideoComposition: NSObject, AVVideoCompositing { 14 | 15 | //https://developer.apple.com/documentation/avfoundation/avvideocompositing/1388610-sourcepixelbufferattributes?language=objc 16 | var sourcePixelBufferAttributes: [String : Any]? = [kCVPixelBufferPixelFormatTypeKey as String: Int(kCVPixelFormatType_32BGRA)] 17 | var requiredPixelBufferAttributesForRenderContext: [String : Any] = [kCVPixelBufferPixelFormatTypeKey as String: Int(kCVPixelFormatType_32BGRA)] 18 | 19 | /// Set if all pending requests have been cancelled. 20 | var shouldCancelAllRequests = false 21 | /// Dispatch Queue used to issue custom compositor rendering work requests. 22 | private var renderingQueue = DispatchQueue(label: "com.hzjuzhi.Floating.renderingqueue") 23 | /// Dispatch Queue used to synchronize notifications that the composition will switch to a different render context. 24 | private var renderContextQueue = DispatchQueue(label: "com.hzjuzhi.Floating.rendercontextqueue") 25 | /// The current render context within which the custom compositor will render new output pixels buffers. 26 | private var renderContext: AVVideoCompositionRenderContext? 27 | /// Maintain the state of render context changes. 28 | private var internalRenderContextDidChange = false 29 | /// Actual state of render context changes. 30 | private var renderContextDidChange: Bool { 31 | get { 32 | return renderContextQueue.sync { internalRenderContextDidChange } 33 | } 34 | set (newRenderContextDidChange) { 35 | renderContextQueue.sync { internalRenderContextDidChange = newRenderContextDidChange } 36 | } 37 | } 38 | 39 | 40 | 41 | // MARK: AVVideoCompositing protocol functions 42 | func renderContextChanged(_ newRenderContext: AVVideoCompositionRenderContext) { 43 | renderContextQueue.sync { renderContext = newRenderContext } 44 | renderContextDidChange = true 45 | } 46 | 47 | enum PixelBufferRequestError: Error { 48 | case newRenderedPixelBufferForRequestFailure 49 | } 50 | 51 | func startRequest(_ asyncVideoCompositionRequest: AVAsynchronousVideoCompositionRequest) { 52 | autoreleasepool { 53 | renderingQueue.async { 54 | // Check if all pending requests have been cancelled. 55 | if self.shouldCancelAllRequests { 56 | asyncVideoCompositionRequest.finishCancelledRequest() 57 | } else { 58 | guard let resultPixels = 59 | self.newRenderedPixelBufferForRequest(asyncVideoCompositionRequest) else { 60 | asyncVideoCompositionRequest.finish(with: PixelBufferRequestError.newRenderedPixelBufferForRequestFailure) 61 | return 62 | } 63 | 64 | // The resulting pixelbuffer from Metal renderer is passed along to the request. 65 | asyncVideoCompositionRequest.finish(withComposedVideoFrame: resultPixels) 66 | } 67 | } 68 | } 69 | } 70 | 71 | func newRenderedPixelBufferForRequest(_ request: AVAsynchronousVideoCompositionRequest) -> CVPixelBuffer? { 72 | guard renderContext?.newPixelBuffer() != nil else { 73 | return nil 74 | } 75 | 76 | guard let renderContext = renderContext else { 77 | return nil 78 | } 79 | 80 | guard let instruction = request.videoCompositionInstruction as? TimeVideoCompositionInstruction else { 81 | return nil 82 | } 83 | 84 | return instruction.getPixelBuffer(renderContext) 85 | } 86 | } 87 | 88 | -------------------------------------------------------------------------------- /FloatingClock/VideoEditor/TimeVideoCompositionInstruction.swift: -------------------------------------------------------------------------------- 1 | // 2 | // VideoCompositionInstruction.swift 3 | // FloatingClock 4 | // 5 | // Created by wl on 2020/12/17. 6 | // 7 | 8 | import UIKit 9 | import AVFoundation 10 | 11 | class TimeVideoCompositionInstruction:NSObject, AVVideoCompositionInstructionProtocol { 12 | 13 | // Protocol Property 14 | var timeRange: CMTimeRange 15 | var enablePostProcessing = false 16 | var containsTweening = true 17 | var requiredSourceTrackIDs: [NSValue]? 18 | var passthroughTrackID = kCMPersistentTrackID_Invalid 19 | var layerInstructions:[AVVideoCompositionLayerInstruction]? 20 | 21 | // render string 22 | var timeString = "00:00:00" 23 | 24 | 25 | init(_ requiredSourceTrackIDs: [NSValue]?, timeRange: CMTimeRange) { 26 | self.requiredSourceTrackIDs = requiredSourceTrackIDs 27 | self.timeRange = timeRange 28 | } 29 | 30 | func getPixelBuffer(_ renderContext: AVVideoCompositionRenderContext) -> CVPixelBuffer? { 31 | let width = Int(renderContext.size.width) 32 | let height = Int(renderContext.size.height) 33 | 34 | let attrs = [kCVPixelBufferCGImageCompatibilityKey: kCFBooleanTrue as Any , 35 | kCVPixelBufferCGBitmapContextCompatibilityKey: kCFBooleanTrue as Any, 36 | kCVPixelBufferIOSurfacePropertiesKey: NSDictionary() 37 | ] as CFDictionary 38 | 39 | var pixelBuffer : CVPixelBuffer? 40 | let status = CVPixelBufferCreate(kCFAllocatorDefault, width, height, kCVPixelFormatType_32ARGB, attrs, &pixelBuffer) 41 | guard (status == kCVReturnSuccess) else { 42 | return nil 43 | } 44 | 45 | CVPixelBufferLockBaseAddress(pixelBuffer!, CVPixelBufferLockFlags(rawValue: 0)) 46 | let pixelData = CVPixelBufferGetBaseAddress(pixelBuffer!) 47 | 48 | let rgbColorSpace = CGColorSpaceCreateDeviceRGB() 49 | let cgContext = CGContext(data: pixelData, width: width, height: height, bitsPerComponent: 8, bytesPerRow: CVPixelBufferGetBytesPerRow(pixelBuffer!), space: rgbColorSpace, bitmapInfo: CGImageAlphaInfo.noneSkipFirst.rawValue) 50 | 51 | guard let context = cgContext else { 52 | return nil 53 | } 54 | 55 | context.setFillColor(UIColor(red: 1, green: 1, blue: 1, alpha: 1).cgColor) 56 | context.fill(CGRect(x: 0, y: 0, width: Int(renderContext.size.width), height: Int(renderContext.size.height))) 57 | 58 | context.saveGState() 59 | // Parameters 60 | let color = CGColor.init(red: 0, green: 0, blue: 0, alpha: 1) 61 | let fontSize: CGFloat = 80 62 | // You can use the Font Book app to find the name 63 | let fontName = "San Francisco" as CFString 64 | let font = CTFontCreateWithName(fontName, fontSize, nil) 65 | 66 | let attributes: [NSAttributedString.Key: Any] = [NSAttributedString.Key.font: font, 67 | NSAttributedString.Key.foregroundColor: color] 68 | // Text 69 | let string = timeString 70 | let attributedString = NSAttributedString(string: string, 71 | attributes: attributes) 72 | 73 | // Render 74 | 75 | let line = CTLineCreateWithAttributedString(attributedString) 76 | let stringRect = CTLineGetImageBounds(line, context) 77 | 78 | context.textPosition = CGPoint(x: 100, 79 | y: (CGFloat(height) - stringRect.height) / 2) 80 | 81 | CTLineDraw(line, context) 82 | 83 | context.restoreGState() 84 | 85 | 86 | CVPixelBufferUnlockBaseAddress(pixelBuffer!, CVPixelBufferLockFlags(rawValue: 0)) 87 | return pixelBuffer 88 | } 89 | } 90 | 91 | -------------------------------------------------------------------------------- /FloatingClock/VideoEditor/VideoCreator.swift: -------------------------------------------------------------------------------- 1 | // 2 | // VideoCreator.swift 3 | // FloatingClock 4 | // 5 | // Created by wl on 2020/12/18. 6 | // 7 | 8 | import Foundation 9 | import AVFoundation 10 | 11 | 12 | //https://stackoverflow.com/questions/3741323/how-do-i-export-uiimage-array-as-a-movie/3742212#3742212 13 | class VideoCreator { 14 | func create() { 15 | //1.Wire the writer: 16 | guard var url = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first else { 17 | return 18 | } 19 | url.appendPathComponent("temp.mov") 20 | 21 | guard let videoWrite = try? AVAssetWriter(url: url, fileType: .mov) else { 22 | return 23 | } 24 | 25 | let videoSettings: [String : Any] = [ 26 | AVVideoCodecKey: AVVideoCodecType.h264, 27 | AVVideoWidthKey: 640, 28 | AVVideoHeightKey: 360, 29 | ] 30 | let writerInput = AVAssetWriterInput(mediaType: .video, outputSettings: videoSettings) 31 | guard videoWrite.canAdd(writerInput) else { 32 | return 33 | } 34 | videoWrite.add(writerInput) 35 | print(url) 36 | 37 | // 2.start session 38 | videoWrite.startWriting() 39 | videoWrite.startSession(atSourceTime: .zero) 40 | 41 | //3. empty buffer 42 | writerInput.append(getCMSampleBuffer()) 43 | 44 | //4. finish session 45 | writerInput.markAsFinished() 46 | videoWrite.finishWriting { 47 | print(videoWrite.status) 48 | } 49 | 50 | 51 | } 52 | 53 | fileprivate func getCMSampleBuffer() -> CMSampleBuffer { 54 | var pixelBuffer : CVPixelBuffer? = nil 55 | CVPixelBufferCreate(kCFAllocatorDefault, 640, 360, kCVPixelFormatType_32BGRA, nil, &pixelBuffer) 56 | 57 | var info = CMSampleTimingInfo() 58 | info.presentationTimeStamp = CMTime.zero 59 | info.duration = CMTime(value: 60, timescale: 600) 60 | info.decodeTimeStamp = CMTime.invalid 61 | 62 | 63 | var formatDesc: CMFormatDescription? = nil 64 | CMVideoFormatDescriptionCreateForImageBuffer(allocator: kCFAllocatorDefault, imageBuffer: pixelBuffer!, formatDescriptionOut: &formatDesc) 65 | 66 | var sampleBuffer: CMSampleBuffer? = nil 67 | 68 | CMSampleBufferCreateReadyWithImageBuffer(allocator: kCFAllocatorDefault, 69 | imageBuffer: pixelBuffer!, 70 | formatDescription: formatDesc!, 71 | sampleTiming: &info, 72 | sampleBufferOut: &sampleBuffer); 73 | 74 | return sampleBuffer! 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /FloatingClock/VideoEditor/certificate.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gdoudeng/Floating-Clock/8b5a1bf219ef3162075ef09740514d5c8cadb9ea/FloatingClock/VideoEditor/certificate.p12 -------------------------------------------------------------------------------- /FloatingClock/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // FloatingClock 4 | // 5 | // Created by wl on 2020/12/16. 6 | // 7 | 8 | import UIKit 9 | import AVFoundation 10 | import AVKit 11 | 12 | 13 | class ViewController: UIViewController { 14 | 15 | var asset: AVAsset! 16 | var item: AVPlayerItem! 17 | var player: AVPlayer! 18 | var observation: NSKeyValueObservation! 19 | var pipController: AVPictureInPictureController! 20 | var videoComposition: AVMutableVideoComposition! 21 | var playerLayer: AVPlayerLayer! 22 | var timeString = "00:00:00" 23 | var timeInstruction: TimeVideoCompositionInstruction! 24 | 25 | let timeLabel = UILabel() 26 | 27 | lazy var formatter: DateFormatter = { 28 | let formatter = DateFormatter() 29 | formatter.dateFormat = "HH:mm:ss.S" 30 | return formatter 31 | }() 32 | 33 | @IBOutlet weak var pipButton: UIButton! 34 | 35 | override func viewDidLoad() { 36 | super.viewDidLoad() 37 | setupUI() 38 | setupVideo() 39 | } 40 | 41 | @IBAction func startPIP(_ sender: UIButton) { 42 | pipController?.startPictureInPicture() 43 | } 44 | 45 | func createDisplayLink() { 46 | let displaylink = CADisplayLink(target: self, 47 | selector: #selector(refresh)) 48 | displaylink.preferredFramesPerSecond = 10 49 | displaylink.add(to: .current, 50 | forMode: .default) 51 | } 52 | 53 | @objc func refresh(displaylink: CADisplayLink) { 54 | reloadTime() 55 | item?.videoComposition = videoComposition 56 | } 57 | 58 | func reloadTime() { 59 | let date = Date() 60 | self.timeString = formatter.string(from: date) 61 | self.timeLabel.text = self.timeString 62 | self.timeInstruction.timeString = timeString 63 | } 64 | } 65 | 66 | extension ViewController: AVPictureInPictureControllerDelegate { 67 | func pictureInPictureControllerWillStartPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) { 68 | print("pip will start") 69 | } 70 | 71 | func pictureInPictureControllerDidStartPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) { 72 | print("pip did start") 73 | } 74 | } 75 | 76 | extension ViewController { 77 | func setupVideo() { 78 | guard let url = Bundle.main.url(forResource: "temp", withExtension: "mov") else { 79 | return 80 | } 81 | asset = AVAsset(url: url) 82 | item = AVPlayerItem(asset: asset!) 83 | player = AVPlayer(playerItem: item) 84 | 85 | playerLayer.player = player 86 | pipController = AVPictureInPictureController(playerLayer: playerLayer) 87 | pipController?.delegate = self 88 | 89 | observation = player?.observe(\.status, options: .new, changeHandler: {[weak self] (player, _) in 90 | guard let self = self else { return } 91 | switch player.status { 92 | case .readyToPlay: 93 | print("readyToPlay") 94 | self.loadAssetProperty() 95 | case .failed: 96 | print("failed") 97 | case .unknown: 98 | print("unknown") 99 | @unknown default:break 100 | } 101 | }) 102 | } 103 | 104 | func loadAssetProperty() { 105 | self.asset.loadValuesAsynchronously(forKeys: ["duration", "tracks"]) { [weak self] in 106 | guard let self = self else { return } 107 | var error: NSError? 108 | let durationStatus = self.asset.statusOfValue(forKey: "duration", error: &error) 109 | let tracksStatus = self.asset.statusOfValue(forKey: "tracks", error: &error) 110 | switch (durationStatus, tracksStatus){ 111 | case (.loaded, .loaded): 112 | DispatchQueue.main.async { 113 | self.setupComposition() 114 | self.createDisplayLink() 115 | } 116 | default: 117 | print("load failed") 118 | } 119 | } 120 | } 121 | 122 | func setupComposition() { 123 | 124 | // For best performance, ensure that the duration and tracks properties of the asset are already loaded before invoking this method. 125 | videoComposition = AVMutableVideoComposition(propertiesOf: asset!) 126 | let instructions = videoComposition.instructions as! [AVVideoCompositionInstruction] 127 | var newInstructions: [AVVideoCompositionInstructionProtocol] = [] 128 | 129 | guard let instruction = instructions.first else { 130 | return 131 | } 132 | let layerInstructions = instruction.layerInstructions 133 | // TrackIDs 134 | var trackIDs: [CMPersistentTrackID] = [] 135 | for layerInstruction in layerInstructions { 136 | trackIDs.append(layerInstruction.trackID) 137 | } 138 | timeInstruction = TimeVideoCompositionInstruction(trackIDs as [NSValue], timeRange: instruction.timeRange) 139 | timeInstruction.layerInstructions = layerInstructions 140 | newInstructions.append(timeInstruction) 141 | videoComposition.instructions = newInstructions 142 | 143 | self.videoComposition?.customVideoCompositorClass = TimeVideoComposition.self 144 | item?.videoComposition = videoComposition 145 | } 146 | 147 | 148 | 149 | func setupUI() { 150 | playerLayer = AVPlayerLayer() 151 | playerLayer.frame = CGRect(x: 0, y: 0, width: 100, height: 100) 152 | playerLayer.position = view.center 153 | playerLayer.backgroundColor = UIColor.cyan.cgColor 154 | view.layer.addSublayer(playerLayer) 155 | 156 | timeLabel.backgroundColor = .white 157 | timeLabel.textColor = .black 158 | timeLabel.font = .systemFont(ofSize: 40) 159 | view.addSubview(timeLabel) 160 | 161 | timeLabel.translatesAutoresizingMaskIntoConstraints = false 162 | timeLabel.topAnchor.constraint(equalTo: view.topAnchor, constant: 80).isActive = true 163 | timeLabel.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true 164 | timeLabel.widthAnchor.constraint(equalToConstant: 200).isActive = true 165 | 166 | if !AVPictureInPictureController.isPictureInPictureSupported() { 167 | pipButton.setTitle("not support PIP, please use real device", for: .normal) 168 | pipButton.isEnabled = false 169 | } 170 | } 171 | } 172 | 173 | -------------------------------------------------------------------------------- /FloatingClock/temp.mov: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gdoudeng/Floating-Clock/8b5a1bf219ef3162075ef09740514d5c8cadb9ea/FloatingClock/temp.mov -------------------------------------------------------------------------------- /FloatingClockTests/FloatingClockTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FloatingClockTests.swift 3 | // FloatingClockTests 4 | // 5 | // Created by wl on 2020/12/16. 6 | // 7 | 8 | import XCTest 9 | @testable import FloatingClock 10 | 11 | class FloatingClockTests: XCTestCase { 12 | 13 | override func setUpWithError() throws { 14 | // Put setup code here. This method is called before the invocation of each test method in the class. 15 | } 16 | 17 | override func tearDownWithError() throws { 18 | // Put teardown code here. This method is called after the invocation of each test method in the class. 19 | } 20 | 21 | func testExample() throws { 22 | // This is an example of a functional test case. 23 | // Use XCTAssert and related functions to verify your tests produce the correct results. 24 | } 25 | 26 | func testPerformanceExample() throws { 27 | // This is an example of a performance test case. 28 | self.measure { 29 | // Put the code you want to measure the time of here. 30 | } 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /FloatingClockTests/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 | 22 | 23 | -------------------------------------------------------------------------------- /FloatingClockUITests/FloatingClockUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FloatingClockUITests.swift 3 | // FloatingClockUITests 4 | // 5 | // Created by wl on 2020/12/16. 6 | // 7 | 8 | import XCTest 9 | 10 | class FloatingClockUITests: XCTestCase { 11 | 12 | override func setUpWithError() throws { 13 | // Put setup code here. This method is called before the invocation of each test method in the class. 14 | 15 | // In UI tests it is usually best to stop immediately when a failure occurs. 16 | continueAfterFailure = false 17 | 18 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 19 | } 20 | 21 | override func tearDownWithError() throws { 22 | // Put teardown code here. This method is called after the invocation of each test method in the class. 23 | } 24 | 25 | func testExample() throws { 26 | // UI tests must launch the application that they test. 27 | let app = XCUIApplication() 28 | app.launch() 29 | 30 | // Use recording to get started writing UI tests. 31 | // Use XCTAssert and related functions to verify your tests produce the correct results. 32 | } 33 | 34 | func testLaunchPerformance() throws { 35 | if #available(macOS 10.15, iOS 13.0, tvOS 13.0, *) { 36 | // This measures how long it takes to launch your application. 37 | measure(metrics: [XCTApplicationLaunchMetric()]) { 38 | XCUIApplication().launch() 39 | } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /FloatingClockUITests/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 | 22 | 23 | -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | ### Floating-Clock App 2 | 3 | > Use `AVPictureInPictureController` It can hover over other apps. Time display will not be affected by users 4 | 5 | 6 | if you use iphone, `AVPictureInPictureController` require iOS14 7 | 8 | If you're going to run it in an simulator, the iPad's simulator supports picture-in-picture, but the iPhone doesn't 9 | 10 | ### 中文说明 11 | [知乎跳转连接](https://zhuanlan.zhihu.com/p/356483705) 12 | 13 | 14 | ### 1. PreView 15 | 16 | ![demo.gif](Resource/demo.gif) 17 | 18 | 19 | -------------------------------------------------------------------------------- /Resource/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gdoudeng/Floating-Clock/8b5a1bf219ef3162075ef09740514d5c8cadb9ea/Resource/demo.gif --------------------------------------------------------------------------------