diff --git a/.gitignore b/.gitignore index 39f8cd5..5f0c580 100644 --- a/.gitignore +++ b/.gitignore @@ -18,4 +18,7 @@ xcuserdata/ /Pods/ -/www \ No newline at end of file +/www + +# Carthage +Carthage/ diff --git a/.swift-version b/.swift-version new file mode 100644 index 0000000..bf77d54 --- /dev/null +++ b/.swift-version @@ -0,0 +1 @@ +4.2 diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..0930560 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,25 @@ +language: objective-c +rvm: 2.4.2 +osx_image: xcode10 + +env: + global: + - LC_CTYPE=en_US.UTF-8 + - LANG=en_US.UTF-8 + - PROJECT=SwiftyTimer.xcodeproj + +before_install: + - gem install cocoapods + - gem install xcpretty + +script: + - set -o pipefail + - xcodebuild -version + - xcodebuild -showsdks + + - xcodebuild -project "$PROJECT" -scheme 'SwiftyTimer' -destination 'name=iPhone 6,OS=10.0' ONLY_ACTIVE_ARCH=NO CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO build | xcpretty + - xcodebuild -project "$PROJECT" -scheme 'SwiftyTimer tvOS' -sdk appletvsimulator12.0 -destination 'name=Apple TV' ONLY_ACTIVE_ARCH=NO CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO build | xcpretty + - xcodebuild -project "$PROJECT" -scheme 'SwiftyTimer watchOS' -sdk iphonesimulator -destination 'name=Apple Watch - 42mm' ONLY_ACTIVE_ARCH=NO CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO build | xcpretty + - xcodebuild -project "$PROJECT" -scheme 'SwiftyTimer OS X' ONLY_ACTIVE_ARCH=NO CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO build | xcpretty + + - xcodebuild -archivePath 'Tests' -project SwiftyTimerTests/SwiftyTimerTests.xcodeproj -scheme 'SwiftyTimerTests' archive && Tests.xcarchive/Products/Applications/SwiftyTimerTests.app/Contents/MacOS/SwiftyTimerTests diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..6448adb --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,50 @@ +### 2.1.0 (2018-10-14) + +This version supports Swift 4.2 without introducing changes to the library workflow. +Library source modifications include adopting new changes in the `RunLoopMode` enum introduced in Swift 4.2 +- Updated for Swift 4.2 and Xcode 10 #45 @asowers1 + +### 2.0.0 (2016-09-23) + +This is the Swift 3 update version. + +It contains no major changes in the library itself, however it does change some APIs because of Swift 3 requirements. + +- Updated for Swift 3 and Xcode 8 compatibility #28 @ldiqual + +### 1.4.1 (2016-08-03) + +- Add support for Xcode 8 (Swift 2.3) for Carthage users + +### 1.4.0 (2016-04-10) + +- Add a variant of `every` and `new(every:)` that takes a closure with `NSTimer` passed in +- Fix Carthage support for Mac (set deployment target to 10.9) + +### 1.3.1 (2016-03-02) + +- Added support for Swift Package Manager +- Refactoring (Removed NSTimerActor. Used CFRunLoopTimerCreateWithHandler instead.) #22 @Austinate +- Added Travis CI + +### 1.3.0 (2016-02-29) + +- Add Carthage support +- Add tvOS and watchOS support + +### 1.2.0 (2015-09-18) + +- Update to Swift 2 +- Add millisecond helper (`100.ms`) + +### 1.1.0 (2015-05-13) + +- Add `start(runLoop:, modes:)` +- Refactoring + +### 1.0.0 (2015-05-11) + +- Initial release +- `NSTimer.after(...)` and `NSTimer.every(...)` +- `NSTimer.new` +- Ruby on Rails-inspired time helpers like (5.seconds or 1.minute) diff --git a/LICENSE b/LICENSE index 9e0e45b..e97e934 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015 Radosław Pietruszewski +Copyright (c) 2015-2016 Radosław Pietruszewski Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..507af30 --- /dev/null +++ b/Package.swift @@ -0,0 +1,8 @@ +import PackageDescription + +let package = Package( + name: "SwiftyTimer", + dependencies: [], + exclude: ["Sources/Info.plist", "Sources/SwiftyTimer.h", "SwiftyTimerTests"] + +) \ No newline at end of file diff --git a/README.md b/README.md index ffadcde..cd25710 100644 --- a/README.md +++ b/README.md @@ -1,77 +1,116 @@ # SwiftyTimer -SwiftyTimer is a set of extensions to make the `NSTimer` API cleaner, nicer to use, and at home with Swift's syntax. +![Platforms](https://img.shields.io/badge/platforms-ios%20%7C%20osx%20%7C%20watchos%20%7C%20tvos-lightgrey.svg) +[![CI Status](https://api.travis-ci.org/radex/SwiftyTimer.svg?branch=master)](https://travis-ci.org/radex/SwiftyTimer) +[![CocoaPods](http://img.shields.io/cocoapods/v/SwiftyTimer.svg)](https://cocoapods.org/pods/SwiftyTimer) +[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](#carthage) +![Swift version](https://img.shields.io/badge/swift-4.2-orange.svg) + +#### Modern Swifty API for `NSTimer` +###### SwiftyTimer allows you to instantly schedule delays and repeating timers using convenient closure syntax. It's time to get rid of Objective-C cruft. Read [Swifty APIs: NSTimer](http://radex.io/swift/nstimer/) for more information about this project. ## Usage -You can easily schedule repeating and non-repeating timers (repeats and delays) using `NSTimer.every` and `NSTimer.after`: +You can easily schedule repeating and non-repeating timers (repeats and delays) using `Timer.every` and `Timer.after`: ```swift -NSTimer.every(0.7.seconds) { +Timer.every(0.7.seconds) { statusItem.blink() } -NSTimer.after(1.minute) { +Timer.after(1.minute) { println("Are you still here?") } ``` -SwiftyTimer uses closures instead of target/selector/userInfo. - -You can specify time intervals with intuitive [Ruby on Rails](http://rubyonrails.org)-like helpers: +You can specify time intervals with these intuitive helpers: ```swift +100.ms 1.second 2.5.seconds 5.seconds 10.minutes 1.hour +2.days ``` You can pass method references instead of closures: ```swift -NSTimer.every(30.seconds, align) +Timer.every(30.seconds, align) ``` +### Manual scheduling + If you want to make a timer object without scheduling, use `new(after:)` and `new(every:)`: ```swift -let timer = NSTimer.new(every: 1.second) { +let timer = Timer.new(every: 1.second) { println(self.status) } ``` -(This should be defined as an initializer, but [a bug in Swift](http://www.openradar.me/18720947) prevents this) +(This should be defined as an initializer, but [a bug in Foundation](http://www.openradar.me/18720947) prevents this) Call `start()` to schedule timers created using `new`. You can optionally pass the run loop and run loop modes: ```swift timer.start() -timer.start(modes: NSDefaultRunLoopMode, NSEventTrackingRunLoopMode) +timer.start(modes: .defaultRunLoopMode, .eventTrackingRunLoopMode) +``` + +### Invalidation + +If you want to invalidate a repeating timer on some condition, you can take a `Timer` argument in the closure you pass in: + +```swift +Timer.every(5.seconds) { (timer: Timer) in + // do something + + if finished { + timer.invalidate() + } +} ``` ## Installation -The simplest way to install this library is to copy `Src/SwiftyTimer.swift` to your project. There's no step two! +**Note:** If you're running Swift 2, use [SwiftyTimer v1.4.1](https://github.com/radex/SwiftyTimer/tree/1.4.1) #### CocoaPods -You can also install this library using CocoaPods. Just add this line to your Podfile: +If you're using CocoaPods, just add this line to your Podfile: ```ruby pod 'SwiftyTimer' ``` -Then import library module like so: +Install by running this command in your terminal: + +```sh +pod install +``` + +Then import the library in all files where you use it: ```swift import SwiftyTimer ``` -Note that this requires CocoaPods 0.36+, as well as iOS 8 or OS X 10.9+ +#### Carthage + +Just add to your Cartfile: + +```ruby +github "radex/SwiftyTimer" +``` + +#### Manually + +Simply copy `Sources/SwiftyTimer.swift` to your Xcode project. ## More like this @@ -80,6 +119,7 @@ If you like SwiftyTimer, check out [SwiftyUserDefaults](https://github.com/radex You might also be interested in my blog posts which explain the design process behind those libraries: - [Swifty APIs: NSTimer](http://radex.io/swift/nstimer/) - [Swifty APIs: NSUserDefaults](http://radex.io/swift/nsuserdefaults/) +- [Statically-typed NSUserDefaults](http://radex.io/swift/nsuserdefaults/static) - [Swifty methods](http://radex.io/swift/methods/) ### Contributing diff --git a/Sources/Info.plist b/Sources/Info.plist new file mode 100644 index 0000000..d3de8ee --- /dev/null +++ b/Sources/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/Sources/SwiftyTimer.h b/Sources/SwiftyTimer.h new file mode 100644 index 0000000..2c112cd --- /dev/null +++ b/Sources/SwiftyTimer.h @@ -0,0 +1,4 @@ +#import + +FOUNDATION_EXPORT double SwiftyTimerVersionNumber; +FOUNDATION_EXPORT const unsigned char SwiftyTimerVersionString[]; \ No newline at end of file diff --git a/Sources/SwiftyTimer.swift b/Sources/SwiftyTimer.swift new file mode 100644 index 0000000..bbc78f3 --- /dev/null +++ b/Sources/SwiftyTimer.swift @@ -0,0 +1,134 @@ +// +// SwiftyTimer +// +// Copyright (c) 2015-2016 Radosław Pietruszewski +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// + +import Foundation + +extension Timer { + +// MARK: Schedule timers + + /// Create and schedule a timer that will call `block` once after the specified time. + + @discardableResult + public class func after(_ interval: TimeInterval, _ block: @escaping () -> Void) -> Timer { + let timer = Timer.new(after: interval, block) + timer.start() + return timer + } + + /// Create and schedule a timer that will call `block` repeatedly in specified time intervals. + + @discardableResult + public class func every(_ interval: TimeInterval, _ block: @escaping () -> Void) -> Timer { + let timer = Timer.new(every: interval, block) + timer.start() + return timer + } + + /// Create and schedule a timer that will call `block` repeatedly in specified time intervals. + /// (This variant also passes the timer instance to the block) + + @nonobjc @discardableResult + public class func every(_ interval: TimeInterval, _ block: @escaping (Timer) -> Void) -> Timer { + let timer = Timer.new(every: interval, block) + timer.start() + return timer + } + +// MARK: Create timers without scheduling + + /// Create a timer that will call `block` once after the specified time. + /// + /// - Note: The timer won't fire until it's scheduled on the run loop. + /// Use `NSTimer.after` to create and schedule a timer in one step. + /// - Note: The `new` class function is a workaround for a crashing bug when using convenience initializers (rdar://18720947) + + public class func new(after interval: TimeInterval, _ block: @escaping () -> Void) -> Timer { + return CFRunLoopTimerCreateWithHandler(kCFAllocatorDefault, CFAbsoluteTimeGetCurrent() + interval, 0, 0, 0) { _ in + block() + } + } + + /// Create a timer that will call `block` repeatedly in specified time intervals. + /// + /// - Note: The timer won't fire until it's scheduled on the run loop. + /// Use `NSTimer.every` to create and schedule a timer in one step. + /// - Note: The `new` class function is a workaround for a crashing bug when using convenience initializers (rdar://18720947) + + public class func new(every interval: TimeInterval, _ block: @escaping () -> Void) -> Timer { + return CFRunLoopTimerCreateWithHandler(kCFAllocatorDefault, CFAbsoluteTimeGetCurrent() + interval, interval, 0, 0) { _ in + block() + } + } + + /// Create a timer that will call `block` repeatedly in specified time intervals. + /// (This variant also passes the timer instance to the block) + /// + /// - Note: The timer won't fire until it's scheduled on the run loop. + /// Use `NSTimer.every` to create and schedule a timer in one step. + /// - Note: The `new` class function is a workaround for a crashing bug when using convenience initializers (rdar://18720947) + + @nonobjc public class func new(every interval: TimeInterval, _ block: @escaping (Timer) -> Void) -> Timer { + var timer: Timer! + timer = CFRunLoopTimerCreateWithHandler(kCFAllocatorDefault, CFAbsoluteTimeGetCurrent() + interval, interval, 0, 0) { _ in + block(timer) + } + return timer + } + +// MARK: Manual scheduling + + /// Schedule this timer on the run loop + /// + /// By default, the timer is scheduled on the current run loop for the default mode. + /// Specify `runLoop` or `modes` to override these defaults. + + public func start(runLoop: RunLoop = .current, modes: RunLoop.Mode...) { + let modes = modes.isEmpty ? [.default] : modes + + for mode in modes { + runLoop.add(self, forMode: mode) + } + } +} + +// MARK: - Time extensions + +extension Double { + public var millisecond: TimeInterval { return self / 1000 } + public var milliseconds: TimeInterval { return self / 1000 } + public var ms: TimeInterval { return self / 1000 } + + public var second: TimeInterval { return self } + public var seconds: TimeInterval { return self } + + public var minute: TimeInterval { return self * 60 } + public var minutes: TimeInterval { return self * 60 } + + public var hour: TimeInterval { return self * 3600 } + public var hours: TimeInterval { return self * 3600 } + + public var day: TimeInterval { return self * 3600 * 24 } + public var days: TimeInterval { return self * 3600 * 24 } +} diff --git a/Src/SwiftyTimer.swift b/Src/SwiftyTimer.swift deleted file mode 100644 index 3b49dcf..0000000 --- a/Src/SwiftyTimer.swift +++ /dev/null @@ -1,99 +0,0 @@ -// -// SwiftyTimer -// -// Copyright (c) 2015 Radosław Pietruszewski -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// - -import Foundation - -private class NSTimerActor { - var block: () -> Void - - init(_ block: () -> Void) { - self.block = block - } - - @objc func fire() { - block() - } -} - -extension NSTimer { - // NOTE: `new` class functions are a workaround for a crashing bug when using convenience initializers (18720947) - - /// Create a timer that will call `block` once after the specified time. - /// - /// **Note:** the timer won't fire until it's scheduled on the run loop. - /// Use `NSTimer.after` to create and schedule a timer in one step. - - public class func new(after interval: NSTimeInterval, _ block: () -> Void) -> NSTimer { - let actor = NSTimerActor(block) - return self.init(timeInterval: interval, target: actor, selector: "fire", userInfo: nil, repeats: false) - } - - /// Create a timer that will call `block` repeatedly in specified time intervals. - /// - /// **Note:** the timer won't fire until it's scheduled on the run loop. - /// Use `NSTimer.every` to create and schedule a timer in one step. - - public class func new(every interval: NSTimeInterval, _ block: () -> Void) -> NSTimer { - let actor = NSTimerActor(block) - return self.init(timeInterval: interval, target: actor, selector: "fire", userInfo: nil, repeats: true) - } - - /// Create and schedule a timer that will call `block` once after the specified time. - - public class func after(interval: NSTimeInterval, _ block: () -> Void) -> NSTimer { - let timer = NSTimer.new(after: interval, block) - timer.start() - return timer - } - - /// Create and schedule a timer that will call `block` repeatedly in specified time intervals. - - public class func every(interval: NSTimeInterval, _ block: () -> Void) -> NSTimer { - let timer = NSTimer.new(every: interval, block) - timer.start() - return timer - } - - /// Schedule this timer on the run loop - /// - /// By default, the timer is scheduled on the current run loop for the default mode. - /// Specify `runLoop` or `modes` to override these defaults. - - public func start(runLoop: NSRunLoop = NSRunLoop.currentRunLoop(), modes: String...) { - let modes = modes.count != 0 ? modes : [NSDefaultRunLoopMode] - - for mode in modes { - runLoop.addTimer(self, forMode: mode) - } - } -} - -extension Double { - public var second: NSTimeInterval { return self } - public var seconds: NSTimeInterval { return self } - public var minute: NSTimeInterval { return self * 60 } - public var minutes: NSTimeInterval { return self * 60 } - public var hour: NSTimeInterval { return self * 3600 } - public var hours: NSTimeInterval { return self * 3600 } -} diff --git a/SwiftyTimer.podspec b/SwiftyTimer.podspec index e868b03..06db5d9 100644 --- a/SwiftyTimer.podspec +++ b/SwiftyTimer.podspec @@ -1,15 +1,17 @@ Pod::Spec.new do |s| s.name = 'SwiftyTimer' - s.version = '1.1.0' + s.version = '2.1.0' s.license = 'MIT' s.summary = 'Swifty API for NSTimer' s.homepage = 'https://github.com/radex/SwiftyTimer' s.authors = { 'Radek Pietruszewski' => 'this.is@radex.io' } s.source = { git: 'https://github.com/radex/SwiftyTimer.git', tag: s.version } - + s.swift_version = '4.2' s.requires_arc = true s.ios.deployment_target = '8.0' s.osx.deployment_target = '10.9' + s.tvos.deployment_target = '9.0' + s.watchos.deployment_target = '2.0' - s.source_files = 'Src/*.swift' -end \ No newline at end of file + s.source_files = 'Sources/*.swift' +end diff --git a/SwiftyTimer.xcodeproj/project.pbxproj b/SwiftyTimer.xcodeproj/project.pbxproj new file mode 100644 index 0000000..e1f7577 --- /dev/null +++ b/SwiftyTimer.xcodeproj/project.pbxproj @@ -0,0 +1,654 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 3E721AC71BF725A2008AF027 /* SwiftyTimer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E721AC61BF725A2008AF027 /* SwiftyTimer.swift */; }; + 6E7E40931C84B2C60030CEBB /* SwiftyTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E7E40921C84B2970030CEBB /* SwiftyTimer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 6E7E40941C84B2C70030CEBB /* SwiftyTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E7E40921C84B2970030CEBB /* SwiftyTimer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 6E7E40A21C84B3F40030CEBB /* SwiftyTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E7E40921C84B2970030CEBB /* SwiftyTimer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 6E7E40B01C84B43A0030CEBB /* SwiftyTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E7E40921C84B2970030CEBB /* SwiftyTimer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 6E7E40B11C84B4B40030CEBB /* SwiftyTimer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E721AC61BF725A2008AF027 /* SwiftyTimer.swift */; }; + 6E7E40B21C84B4B40030CEBB /* SwiftyTimer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E721AC61BF725A2008AF027 /* SwiftyTimer.swift */; }; + 6E7E40B31C84B4B40030CEBB /* SwiftyTimer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E721AC61BF725A2008AF027 /* SwiftyTimer.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 3E721ABB1BF7255D008AF027 /* SwiftyTimer.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwiftyTimer.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 3E721AC01BF7255D008AF027 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 3E721AC61BF725A2008AF027 /* SwiftyTimer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftyTimer.swift; sourceTree = ""; }; + 6E7E408A1C84B1A20030CEBB /* SwiftyTimer.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwiftyTimer.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 6E7E40921C84B2970030CEBB /* SwiftyTimer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SwiftyTimer.h; sourceTree = ""; }; + 6E7E409A1C84B3790030CEBB /* SwiftyTimer.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwiftyTimer.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 6E7E40A81C84B4240030CEBB /* SwiftyTimer.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwiftyTimer.framework; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 3E721AB71BF7255D008AF027 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6E7E40861C84B1A20030CEBB /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6E7E40961C84B3790030CEBB /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6E7E40A41C84B4240030CEBB /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 3E721AB11BF7255C008AF027 = { + isa = PBXGroup; + children = ( + 3E721ABD1BF7255D008AF027 /* SwiftyTimer */, + 3E721ABC1BF7255D008AF027 /* Products */, + ); + sourceTree = ""; + }; + 3E721ABC1BF7255D008AF027 /* Products */ = { + isa = PBXGroup; + children = ( + 3E721ABB1BF7255D008AF027 /* SwiftyTimer.framework */, + 6E7E408A1C84B1A20030CEBB /* SwiftyTimer.framework */, + 6E7E409A1C84B3790030CEBB /* SwiftyTimer.framework */, + 6E7E40A81C84B4240030CEBB /* SwiftyTimer.framework */, + ); + name = Products; + sourceTree = ""; + }; + 3E721ABD1BF7255D008AF027 /* SwiftyTimer */ = { + isa = PBXGroup; + children = ( + 3E721AC61BF725A2008AF027 /* SwiftyTimer.swift */, + 3E721AC01BF7255D008AF027 /* Info.plist */, + 6E7E40921C84B2970030CEBB /* SwiftyTimer.h */, + ); + name = SwiftyTimer; + path = Sources; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 3E721AB81BF7255D008AF027 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 6E7E40931C84B2C60030CEBB /* SwiftyTimer.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6E7E40871C84B1A20030CEBB /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 6E7E40941C84B2C70030CEBB /* SwiftyTimer.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6E7E40971C84B3790030CEBB /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 6E7E40A21C84B3F40030CEBB /* SwiftyTimer.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6E7E40A51C84B4240030CEBB /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 6E7E40B01C84B43A0030CEBB /* SwiftyTimer.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 3E721ABA1BF7255D008AF027 /* SwiftyTimer */ = { + isa = PBXNativeTarget; + buildConfigurationList = 3E721AC31BF7255D008AF027 /* Build configuration list for PBXNativeTarget "SwiftyTimer" */; + buildPhases = ( + 3E721AB61BF7255D008AF027 /* Sources */, + 3E721AB71BF7255D008AF027 /* Frameworks */, + 3E721AB81BF7255D008AF027 /* Headers */, + 3E721AB91BF7255D008AF027 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = SwiftyTimer; + productName = SwiftyTimer; + productReference = 3E721ABB1BF7255D008AF027 /* SwiftyTimer.framework */; + productType = "com.apple.product-type.framework"; + }; + 6E7E40891C84B1A20030CEBB /* SwiftyTimer OS X */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6E7E408F1C84B1A20030CEBB /* Build configuration list for PBXNativeTarget "SwiftyTimer OS X" */; + buildPhases = ( + 6E7E40851C84B1A20030CEBB /* Sources */, + 6E7E40861C84B1A20030CEBB /* Frameworks */, + 6E7E40871C84B1A20030CEBB /* Headers */, + 6E7E40881C84B1A20030CEBB /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "SwiftyTimer OS X"; + productName = SwiftyTimerMac; + productReference = 6E7E408A1C84B1A20030CEBB /* SwiftyTimer.framework */; + productType = "com.apple.product-type.framework"; + }; + 6E7E40991C84B3790030CEBB /* SwiftyTimer tvOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6E7E409F1C84B3790030CEBB /* Build configuration list for PBXNativeTarget "SwiftyTimer tvOS" */; + buildPhases = ( + 6E7E40951C84B3790030CEBB /* Sources */, + 6E7E40961C84B3790030CEBB /* Frameworks */, + 6E7E40971C84B3790030CEBB /* Headers */, + 6E7E40981C84B3790030CEBB /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "SwiftyTimer tvOS"; + productName = "SwiftyTimer tvOS"; + productReference = 6E7E409A1C84B3790030CEBB /* SwiftyTimer.framework */; + productType = "com.apple.product-type.framework"; + }; + 6E7E40A71C84B4240030CEBB /* SwiftyTimer watchOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6E7E40AD1C84B4240030CEBB /* Build configuration list for PBXNativeTarget "SwiftyTimer watchOS" */; + buildPhases = ( + 6E7E40A31C84B4240030CEBB /* Sources */, + 6E7E40A41C84B4240030CEBB /* Frameworks */, + 6E7E40A51C84B4240030CEBB /* Headers */, + 6E7E40A61C84B4240030CEBB /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "SwiftyTimer watchOS"; + productName = "SwiftyTimer watchOS"; + productReference = 6E7E40A81C84B4240030CEBB /* SwiftyTimer.framework */; + productType = "com.apple.product-type.framework"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 3E721AB21BF7255C008AF027 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1000; + ORGANIZATIONNAME = "Radosław Pietruszewski"; + TargetAttributes = { + 3E721ABA1BF7255D008AF027 = { + CreatedOnToolsVersion = 7.1; + LastSwiftMigration = 0800; + }; + 6E7E40891C84B1A20030CEBB = { + CreatedOnToolsVersion = 7.2; + }; + 6E7E40991C84B3790030CEBB = { + CreatedOnToolsVersion = 7.2; + }; + 6E7E40A71C84B4240030CEBB = { + CreatedOnToolsVersion = 7.2; + }; + }; + }; + buildConfigurationList = 3E721AB51BF7255C008AF027 /* Build configuration list for PBXProject "SwiftyTimer" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 3E721AB11BF7255C008AF027; + productRefGroup = 3E721ABC1BF7255D008AF027 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 3E721ABA1BF7255D008AF027 /* SwiftyTimer */, + 6E7E40891C84B1A20030CEBB /* SwiftyTimer OS X */, + 6E7E40991C84B3790030CEBB /* SwiftyTimer tvOS */, + 6E7E40A71C84B4240030CEBB /* SwiftyTimer watchOS */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 3E721AB91BF7255D008AF027 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6E7E40881C84B1A20030CEBB /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6E7E40981C84B3790030CEBB /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6E7E40A61C84B4240030CEBB /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 3E721AB61BF7255D008AF027 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 3E721AC71BF725A2008AF027 /* SwiftyTimer.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6E7E40851C84B1A20030CEBB /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6E7E40B11C84B4B40030CEBB /* SwiftyTimer.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6E7E40951C84B3790030CEBB /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6E7E40B21C84B4B40030CEBB /* SwiftyTimer.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6E7E40A31C84B4240030CEBB /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6E7E40B31C84B4B40030CEBB /* SwiftyTimer.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 3E721AC11BF7255D008AF027 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.9; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 3E721AC21BF7255D008AF027 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.9; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 3E721AC41BF7255D008AF027 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = Sources/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = io.radex.SwiftyTimer; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_VERSION = 4.2; + }; + name = Debug; + }; + 3E721AC51BF7255D008AF027 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = Sources/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = io.radex.SwiftyTimer; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_VERSION = 4.2; + }; + name = Release; + }; + 6E7E40901C84B1A20030CEBB /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CODE_SIGN_IDENTITY = ""; + COMBINE_HIDPI_IMAGES = YES; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_VERSION = A; + INFOPLIST_FILE = Sources/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.9; + PRODUCT_BUNDLE_IDENTIFIER = io.radex.SwiftyTimer; + PRODUCT_NAME = SwiftyTimer; + SDKROOT = macosx; + SKIP_INSTALL = YES; + SWIFT_VERSION = 4.2; + }; + name = Debug; + }; + 6E7E40911C84B1A20030CEBB /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CODE_SIGN_IDENTITY = ""; + COMBINE_HIDPI_IMAGES = YES; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_VERSION = A; + INFOPLIST_FILE = Sources/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.9; + PRODUCT_BUNDLE_IDENTIFIER = io.radex.SwiftyTimer; + PRODUCT_NAME = SwiftyTimer; + SDKROOT = macosx; + SKIP_INSTALL = YES; + SWIFT_VERSION = 4.2; + }; + name = Release; + }; + 6E7E40A01C84B3790030CEBB /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = Sources/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = io.radex.SwiftyTimer; + PRODUCT_NAME = SwiftyTimer; + SDKROOT = appletvos; + SKIP_INSTALL = YES; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = 3; + TVOS_DEPLOYMENT_TARGET = 9.0; + }; + name = Debug; + }; + 6E7E40A11C84B3790030CEBB /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = Sources/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = io.radex.SwiftyTimer; + PRODUCT_NAME = SwiftyTimer; + SDKROOT = appletvos; + SKIP_INSTALL = YES; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = 3; + TVOS_DEPLOYMENT_TARGET = 9.0; + }; + name = Release; + }; + 6E7E40AE1C84B4240030CEBB /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = Sources/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = io.radex.SwiftyTimer; + PRODUCT_NAME = SwiftyTimer; + SDKROOT = watchos; + SKIP_INSTALL = YES; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = 4; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Debug; + }; + 6E7E40AF1C84B4240030CEBB /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = Sources/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = io.radex.SwiftyTimer; + PRODUCT_NAME = SwiftyTimer; + SDKROOT = watchos; + SKIP_INSTALL = YES; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = 4; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 3E721AB51BF7255C008AF027 /* Build configuration list for PBXProject "SwiftyTimer" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3E721AC11BF7255D008AF027 /* Debug */, + 3E721AC21BF7255D008AF027 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 3E721AC31BF7255D008AF027 /* Build configuration list for PBXNativeTarget "SwiftyTimer" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3E721AC41BF7255D008AF027 /* Debug */, + 3E721AC51BF7255D008AF027 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6E7E408F1C84B1A20030CEBB /* Build configuration list for PBXNativeTarget "SwiftyTimer OS X" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6E7E40901C84B1A20030CEBB /* Debug */, + 6E7E40911C84B1A20030CEBB /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6E7E409F1C84B3790030CEBB /* Build configuration list for PBXNativeTarget "SwiftyTimer tvOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6E7E40A01C84B3790030CEBB /* Debug */, + 6E7E40A11C84B3790030CEBB /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6E7E40AD1C84B4240030CEBB /* Build configuration list for PBXNativeTarget "SwiftyTimer watchOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6E7E40AE1C84B4240030CEBB /* Debug */, + 6E7E40AF1C84B4240030CEBB /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 3E721AB21BF7255C008AF027 /* Project object */; +} diff --git a/SwiftyTimer.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/SwiftyTimer.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..663a8fd --- /dev/null +++ b/SwiftyTimer.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/SwiftyTimer.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/SwiftyTimer.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/SwiftyTimer.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/SwiftyTimer.xcodeproj/xcshareddata/xcschemes/SwiftyTimer OS X.xcscheme b/SwiftyTimer.xcodeproj/xcshareddata/xcschemes/SwiftyTimer OS X.xcscheme new file mode 100644 index 0000000..ada9aa8 --- /dev/null +++ b/SwiftyTimer.xcodeproj/xcshareddata/xcschemes/SwiftyTimer OS X.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SwiftyTimer.xcodeproj/xcshareddata/xcschemes/SwiftyTimer tvOS.xcscheme b/SwiftyTimer.xcodeproj/xcshareddata/xcschemes/SwiftyTimer tvOS.xcscheme new file mode 100644 index 0000000..ee96e38 --- /dev/null +++ b/SwiftyTimer.xcodeproj/xcshareddata/xcschemes/SwiftyTimer tvOS.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SwiftyTimer.xcodeproj/xcshareddata/xcschemes/SwiftyTimer watchOS.xcscheme b/SwiftyTimer.xcodeproj/xcshareddata/xcschemes/SwiftyTimer watchOS.xcscheme new file mode 100644 index 0000000..f37f5fc --- /dev/null +++ b/SwiftyTimer.xcodeproj/xcshareddata/xcschemes/SwiftyTimer watchOS.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SwiftyTimer.xcodeproj/xcshareddata/xcschemes/SwiftyTimer.xcscheme b/SwiftyTimer.xcodeproj/xcshareddata/xcschemes/SwiftyTimer.xcscheme new file mode 100644 index 0000000..6cf4dbc --- /dev/null +++ b/SwiftyTimer.xcodeproj/xcshareddata/xcschemes/SwiftyTimer.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Tests/SwiftyTimerTests.xcodeproj/project.pbxproj b/SwiftyTimerTests/SwiftyTimerTests.xcodeproj/project.pbxproj similarity index 86% rename from Tests/SwiftyTimerTests.xcodeproj/project.pbxproj rename to SwiftyTimerTests/SwiftyTimerTests.xcodeproj/project.pbxproj index 25045e0..854241d 100644 --- a/Tests/SwiftyTimerTests.xcodeproj/project.pbxproj +++ b/SwiftyTimerTests/SwiftyTimerTests.xcodeproj/project.pbxproj @@ -15,7 +15,7 @@ 6EE9C1531B00BB5B00D6B91C /* SwiftyTimerTests.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwiftyTimerTests.app; sourceTree = BUILT_PRODUCTS_DIR; }; 6EE9C1571B00BB5B00D6B91C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 6EE9C1581B00BB5B00D6B91C /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; - 6EE9C1731B00BBB700D6B91C /* SwiftyTimer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SwiftyTimer.swift; path = ../../Src/SwiftyTimer.swift; sourceTree = ""; }; + 6EE9C1731B00BBB700D6B91C /* SwiftyTimer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SwiftyTimer.swift; path = ../../Sources/SwiftyTimer.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -89,10 +89,12 @@ 6EE9C14B1B00BB5B00D6B91C /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0640; + LastSwiftUpdateCheck = 0700; + LastUpgradeCheck = 1000; TargetAttributes = { 6EE9C1521B00BB5B00D6B91C = { CreatedOnToolsVersion = 6.4; + LastSwiftMigration = 0800; }; }; }; @@ -145,19 +147,30 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "-"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -178,6 +191,7 @@ ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -189,13 +203,23 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "-"; @@ -214,6 +238,7 @@ MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; + SWIFT_VERSION = 4.2; }; name = Release; }; @@ -224,7 +249,9 @@ COMBINE_HIDPI_IMAGES = YES; INFOPLIST_FILE = SwiftyTimerTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "radex.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -235,7 +262,10 @@ COMBINE_HIDPI_IMAGES = YES; INFOPLIST_FILE = SwiftyTimerTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "radex.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 4.2; }; name = Release; }; diff --git a/Tests/SwiftyTimerTests.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/SwiftyTimerTests/SwiftyTimerTests.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from Tests/SwiftyTimerTests.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to SwiftyTimerTests/SwiftyTimerTests.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/SwiftyTimerTests/SwiftyTimerTests.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/SwiftyTimerTests/SwiftyTimerTests.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/SwiftyTimerTests/SwiftyTimerTests.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/SwiftyTimerTests/SwiftyTimerTests.xcodeproj/xcshareddata/xcschemes/SwiftyTimerTests.xcscheme b/SwiftyTimerTests/SwiftyTimerTests.xcodeproj/xcshareddata/xcschemes/SwiftyTimerTests.xcscheme new file mode 100644 index 0000000..e172c40 --- /dev/null +++ b/SwiftyTimerTests/SwiftyTimerTests.xcodeproj/xcshareddata/xcschemes/SwiftyTimerTests.xcscheme @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Tests/SwiftyTimerTests/Info.plist b/SwiftyTimerTests/SwiftyTimerTests/Info.plist similarity index 93% rename from Tests/SwiftyTimerTests/Info.plist rename to SwiftyTimerTests/SwiftyTimerTests/Info.plist index b76bfee..908cdd4 100644 --- a/Tests/SwiftyTimerTests/Info.plist +++ b/SwiftyTimerTests/SwiftyTimerTests/Info.plist @@ -9,7 +9,7 @@ CFBundleIconFile CFBundleIdentifier - radex.$(PRODUCT_NAME:rfc1034identifier) + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/SwiftyTimerTests/SwiftyTimerTests/main.swift b/SwiftyTimerTests/SwiftyTimerTests/main.swift new file mode 100644 index 0000000..2d2d445 --- /dev/null +++ b/SwiftyTimerTests/SwiftyTimerTests/main.swift @@ -0,0 +1,119 @@ +import Cocoa + +let app = NSApplication.shared + +class AppDelegate: NSObject, NSApplicationDelegate { + func applicationDidFinishLaunching(_ aNotification: Notification) { + test() + } + + func test() { + assert(1.second == 1.0) + assert(1.minute == 60.0) + assert(1.hour == 1.minute * 60) + assert(1.2.seconds == 1.2) + assert(1.5.minutes == 90.0) + assert(1.5.hours == 5400.0) + assert(1.3.milliseconds == 0.0013) + assert(0.5.day == 43_200 ) + assert(1.day == 86_400 ) + assert(2.days == 172_800) + test2() + } + + func test2() { + var fired = false + Timer.after(0.1.seconds) { + assert(!fired) + fired = true + self.test3() + } + } + + var timer1: Timer! + + func test3() { + var fired = false + timer1 = Timer.every(0.1.seconds) { + if fired { + self.test4() + self.timer1.invalidate() + } else { + fired = true + } + } + } + + let timer2 = Timer.new(after: 0.1.seconds) { fatalError() } + let timer3 = Timer.new(every: 0.1.seconds) { fatalError() } + + func test4() { + let timer = Timer.new(after: 0.1.seconds) { + self.test5() + } + RunLoop.current.add(timer, forMode: .default) + } + + var timer4: Timer! + + func test5() { + var fired = false + timer4 = Timer.new(every: 0.1.seconds) { + if fired { + self.timer4.invalidate() + self.test6() + } else { + fired = true + } + } + timer4.start() + } + + func test6() { + let timer = Timer.new(after: 0.1.seconds) { + self.test7() + } + + timer.start(runLoop: .current, modes: .default, .eventTracking) + } + + func test7() { + Timer.after(0.1.seconds, test8) + } + + func test8() { + var fires = 0 + let timer = Timer.new(every: 0.1.seconds) { (timer: Timer) in + guard fires <= 1 else { fatalError("should be invalidated") } + defer { fires += 1 } + + if fires == 1 { + timer.invalidate() + self.test9() + } + } + timer.start() + } + + func test9() { + var fires = 0 + Timer.every(0.1.seconds) { (timer: Timer) in + guard fires <= 1 else { fatalError("should be invalidated") } + defer { fires += 1 } + + if fires == 1 { + timer.invalidate() + self.done() + } + } + } + + func done() { + print("All tests passed") + app.terminate(self) + } +} + +let delegate = AppDelegate() +app.delegate = delegate +app.run() diff --git a/Tests/SwiftyTimerTests/main.swift b/Tests/SwiftyTimerTests/main.swift deleted file mode 100644 index 06970d4..0000000 --- a/Tests/SwiftyTimerTests/main.swift +++ /dev/null @@ -1,88 +0,0 @@ -import Cocoa - -let app = NSApplication.sharedApplication() - -class AppDelegate: NSObject, NSApplicationDelegate { - func applicationDidFinishLaunching(aNotification: NSNotification) { - test() - } - - func test() { - assert(1.second == 1.0) - assert(1.minute == 60.0) - assert(1.hour == 1.minute * 60) - assert(1.2.seconds == 1.2) - assert(1.5.minutes == 90.0) - assert(1.5.hours == 5400.0) - test2() - } - - func test2() { - var fired = false - NSTimer.after(0.1.seconds) { - assert(!fired) - fired = true - self.test3() - } - } - - var timer1: NSTimer! - - func test3() { - var fired = false - timer1 = NSTimer.every(0.1.seconds) { - if fired { - self.test4() - self.timer1.invalidate() - } else { - fired = true - } - } - } - - let timer2 = NSTimer.new(after: 0.1.seconds) { fatalError() } - let timer3 = NSTimer.new(every: 0.1.seconds) { fatalError() } - - func test4() { - let timer = NSTimer.new(after: 0.1.seconds) { - self.test5() - } - NSRunLoop.currentRunLoop().addTimer(timer, forMode: NSDefaultRunLoopMode) - } - - var timer4: NSTimer! - - func test5() { - var fired = false - timer4 = NSTimer.new(every: 0.1.seconds) { - if fired { - self.timer4.invalidate() - self.test6() - } else { - fired = true - } - } - timer4.start() - } - - func test6() { - let timer = NSTimer.new(after: 0.1.seconds) { - self.test7() - } - - timer.start(modes: NSDefaultRunLoopMode, NSEventTrackingRunLoopMode, runLoop: NSRunLoop.currentRunLoop()) - } - - func test7() { - NSTimer.after(0.1.seconds, done) - } - - func done() { - println("All tests passed") - app.terminate(self) - } -} - -let delegate = AppDelegate() -app.delegate = delegate -app.run() \ No newline at end of file