From 8aec469704357dc5c7733a07b651d913a00944f3 Mon Sep 17 00:00:00 2001 From: sadeghgoo Date: Thu, 28 Apr 2022 17:21:41 +0430 Subject: [PATCH 01/37] Initial Commit --- .gitignore | 7 +++++ .../xcshareddata/IDEWorkspaceChecks.plist | 8 ++++++ Package.swift | 28 +++++++++++++++++++ README.md | 3 ++ Sources/MagicTimer/MagicTimer.swift | 6 ++++ Tests/MagicTimerTests/MagicTimerTests.swift | 11 ++++++++ 6 files changed, 63 insertions(+) create mode 100644 .gitignore create mode 100644 .swiftpm/xcode/package.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 Package.swift create mode 100644 README.md create mode 100644 Sources/MagicTimer/MagicTimer.swift create mode 100644 Tests/MagicTimerTests/MagicTimerTests.swift diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bb460e7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +.DS_Store +/.build +/Packages +/*.xcodeproj +xcuserdata/ +DerivedData/ +.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata diff --git a/.swiftpm/xcode/package.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/.swiftpm/xcode/package.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/.swiftpm/xcode/package.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..0c40bf8 --- /dev/null +++ b/Package.swift @@ -0,0 +1,28 @@ +// swift-tools-version:5.5 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "MagicTimer", + products: [ + // Products define the executables and libraries a package produces, and make them visible to other packages. + .library( + name: "MagicTimer", + targets: ["MagicTimer"]), + ], + dependencies: [ + // Dependencies declare other packages that this package depends on. + // .package(url: /* package url */, from: "1.0.0"), + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages this package depends on. + .target( + name: "MagicTimer", + dependencies: []), + .testTarget( + name: "MagicTimerTests", + dependencies: ["MagicTimer"]), + ] +) diff --git a/README.md b/README.md new file mode 100644 index 0000000..4f6dfed --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# MagicTimer + +A description of this package. diff --git a/Sources/MagicTimer/MagicTimer.swift b/Sources/MagicTimer/MagicTimer.swift new file mode 100644 index 0000000..41caa69 --- /dev/null +++ b/Sources/MagicTimer/MagicTimer.swift @@ -0,0 +1,6 @@ +public struct MagicTimer { + public private(set) var text = "Hello, World!" + + public init() { + } +} diff --git a/Tests/MagicTimerTests/MagicTimerTests.swift b/Tests/MagicTimerTests/MagicTimerTests.swift new file mode 100644 index 0000000..f44883c --- /dev/null +++ b/Tests/MagicTimerTests/MagicTimerTests.swift @@ -0,0 +1,11 @@ +import XCTest +@testable import MagicTimer + +final class MagicTimerTests: XCTestCase { + func testExample() throws { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct + // results. + XCTAssertEqual(MagicTimer().text, "Hello, World!") + } +} From 0c1cb590d644441e3ade85061ea01ef276c1679b Mon Sep 17 00:00:00 2001 From: sadeghgoo Date: Thu, 28 Apr 2022 17:38:12 +0430 Subject: [PATCH 02/37] Initial commit --- Sources/MagicTimer/MagicTimer.swift | 202 +++++++++++++++++++++++++++- 1 file changed, 200 insertions(+), 2 deletions(-) diff --git a/Sources/MagicTimer/MagicTimer.swift b/Sources/MagicTimer/MagicTimer.swift index 41caa69..aed5a23 100644 --- a/Sources/MagicTimer/MagicTimer.swift +++ b/Sources/MagicTimer/MagicTimer.swift @@ -1,6 +1,204 @@ -public struct MagicTimer { - public private(set) var text = "Hello, World!" +import Foundation +import UIKit + +@available(*, unavailable, renamed: "MGTimerMode") +/// The timer counting mode. +public enum MGCountMode { + case stopWatch + case countDown(fromSeconds: TimeInterval) +} + + +public enum MGTimerMode { + case stopWatch + case countDown(fromSeconds: TimeInterval) +} + + +/** + A broker between contianer and view. + + Every time calculation or any commands are managing in MagicTimer that contains counter, executive and background time calculator. + */ + +public class MagicTimer { + + public typealias StateHandler = ((MagicTimerState) -> Void) + public typealias ElapsedTimeHandler = ((TimeInterval) -> Void) + + private var counter: MGCounterBehavior + private var executive: MGExecutiveBehavior + private var backgroundCalculator: MGBackgroundCalculableBehavior + + private(set) var lastState: MagicTimerState = .none + + @available(*, unavailable, renamed: "lastStateDidChangeHandler") + /// Timer state callback + public var didStateChange: ((MagicTimerState) -> Void)? + + /// Timer state callback + public var lastStateDidChangeHandler: StateHandler? + + @available(*, unavailable, renamed: "elapsedTimeDidChangeHandler") + /// A elpsed time that can observe + public var observeElapsedTime: ((TimeInterval) -> Void)? + + /// A elpsed time that can observe + public var elapsedTimeDidChangeHandler: ElapsedTimeHandler? + + private(set) var elapsedTime: TimeInterval = 0 + + /// Set value to counter defultValue. + public var defultValue: TimeInterval = 0 { + willSet { + guard newValue >= 0 else { + fatalError("The defultValue should be greater or equal to zero.") + } + counter.setDefaultValue(newValue) + } + } + /// Set value to counter effectiveValue. + public var effectiveValue: TimeInterval = 1 { + willSet { + guard newValue >= 0 else { + fatalError("The effectiveValue should be greater or equal to zero.") + } + counter.setEffectiveValue(newValue) + } + } + /// Set time interval to executive timeInerval. + public var timeInterval: TimeInterval = 1 { + willSet { + // TODO: make extension for math operators. + guard newValue >= 0 else { + fatalError("The timeInterval should be greater or equal to zero.") + } + executive.timeInerval = newValue + } + } + /// Set value to backgroundCalculator isActiveBackgroundMode property. + public var isActiveInBackground: Bool = false { + willSet { + backgroundCalculator.isActiveBackgroundMode = newValue + } + } + /// Timer count mode. + public var countMode: MGTimerMode = .stopWatch + + @available(*, unavailable, renamed: "lastState") + /// The current state of the timer. + public var currentState: MagicTimerState { + return lastState + } + public init() { + counter = MGCounter() + executive = MGTimerExecutive() + backgroundCalculator = MGBackgroundCalculator() + + backgroundCalculator.backgroundTimeCalculateHandler = { elapsedTime in + self.calclulateBackgroundTime(elapsedTime: elapsedTime) + } + + log(message: "initialized") + } + // Calculate time in background + private func calclulateBackgroundTime(elapsedTime: TimeInterval) { + switch countMode { + case .stopWatch: + // Set totalCountedValue to all elpased time plus time in background. + counter.setTotalCountedValue(elapsedTime) + case let .countDown(fromSeconds: countDownSeconds): + + let subtraction = countDownSeconds - elapsedTime + // Checking elapsed time in background wasn't negeative. + if subtraction.isPositive { + // Set totalCountedValue to total time minus elapsed time in background. + counter.setTotalCountedValue(subtraction) + } else { + counter.setTotalCountedValue(1) + } + } + } + + private func countUp() { + + executive.scheduleTimerHandler = { + self.counter.add() + self.elapsedTimeDidChangeHandler?(self.counter.totalCountedValue) + } + } + + private func countDown(fromSeconds: TimeInterval) { + // Checking if defaultValue plus fromSeconds not going to invalid format(negative seconds). + guard (defultValue + fromSeconds).truncatingRemainder(dividingBy: effectiveValue ) == 0 else { + fatalError("The time does not leading to valid format. Use valid effetiveValue") + } + + counter.setTotalCountedValue(fromSeconds) + + // Every timeInterval observe value is called. + executive.scheduleTimerHandler = { + // Check if totalCountedValue is valid or not. + guard self.counter.totalCountedValue > 0 else { + self.executive.suspand() + self.lastStateDidChangeHandler?(.stopped) + + return + } + // Subtract effectiveValue from totalCountedValue. + self.counter.subtract() + // Tell the delegate totalCountedValue(elapsed time). + self.elapsedTimeDidChangeHandler?(self.counter.totalCountedValue) + } + } + + /// Observe counting mode and start counting. + public func start() { + + executive.start { + // Set current date to timer firing date(for calculate background elapsed time). When set the time is not fired. + self.backgroundCalculator.setTimeFiredDate(Date()) + } + + switch countMode { + case let .countDown(fromSeconds: seconds): + countDown(fromSeconds: seconds) + case .stopWatch: + countUp() + } + lastState = .fired + lastStateDidChangeHandler?(.fired) + + log(message: "timer started") + } + /// Stop timer counting. + public func stop() { + executive.suspand() + lastState = .stopped + lastStateDidChangeHandler?(.stopped) + + log(message: "timer stopped") + } + /// Reset timer to zero + public func reset() { + executive.suspand() + counter.resetTotalCounted() + lastState = .restarted + lastStateDidChangeHandler?(.restarted) + + log(message: "timer restarted") + + } + /// Reset timer to default value + public func resetToDefault() { + executive.suspand() + counter.resetToDefaultValue() + lastState = .restarted + lastStateDidChangeHandler?(.restarted) + log(message: "timer restarted to default") + } } + From 608771ca2b27bece9905c54462a2cfccd86c072e Mon Sep 17 00:00:00 2001 From: sadeghgoo Date: Tue, 3 May 2022 21:16:18 +0430 Subject: [PATCH 03/37] Remove log methods, Update manifest. --- Package.swift | 15 +++++++++------ Sources/MagicTimer/MagicTimer.swift | 11 +---------- Tests/MagicTimerTests/MagicTimerTests.swift | 1 - 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/Package.swift b/Package.swift index 0c40bf8..a1f3af9 100644 --- a/Package.swift +++ b/Package.swift @@ -5,22 +5,25 @@ import PackageDescription let package = Package( name: "MagicTimer", + platforms: [.iOS("11.0")], products: [ - // Products define the executables and libraries a package produces, and make them visible to other packages. .library( name: "MagicTimer", targets: ["MagicTimer"]), ], dependencies: [ - // Dependencies declare other packages that this package depends on. - // .package(url: /* package url */, from: "1.0.0"), + .package( + name: "MagicTimerCore", + url: "https://github.com/MagicTimerFW/MagicTimerCore", branch: "main") ], targets: [ - // Targets are the basic building blocks of a package. A target can define a module or a test suite. - // Targets can depend on other targets in this package, and on products in packages this package depends on. .target( name: "MagicTimer", - dependencies: []), + dependencies: [ + .product( + name: "MagicTimerCore", + package: "MagicTimerCore") + ]), .testTarget( name: "MagicTimerTests", dependencies: ["MagicTimer"]), diff --git a/Sources/MagicTimer/MagicTimer.swift b/Sources/MagicTimer/MagicTimer.swift index aed5a23..d5d0527 100644 --- a/Sources/MagicTimer/MagicTimer.swift +++ b/Sources/MagicTimer/MagicTimer.swift @@ -1,6 +1,5 @@ import Foundation -import UIKit - +import MagicTimerCore @available(*, unavailable, renamed: "MGTimerMode") /// The timer counting mode. @@ -101,7 +100,6 @@ public class MagicTimer { self.calclulateBackgroundTime(elapsedTime: elapsedTime) } - log(message: "initialized") } // Calculate time in background private func calclulateBackgroundTime(elapsedTime: TimeInterval) { @@ -171,15 +169,12 @@ public class MagicTimer { lastState = .fired lastStateDidChangeHandler?(.fired) - log(message: "timer started") } /// Stop timer counting. public func stop() { executive.suspand() lastState = .stopped lastStateDidChangeHandler?(.stopped) - - log(message: "timer stopped") } /// Reset timer to zero public func reset() { @@ -187,8 +182,6 @@ public class MagicTimer { counter.resetTotalCounted() lastState = .restarted lastStateDidChangeHandler?(.restarted) - - log(message: "timer restarted") } /// Reset timer to default value @@ -197,8 +190,6 @@ public class MagicTimer { counter.resetToDefaultValue() lastState = .restarted lastStateDidChangeHandler?(.restarted) - log(message: "timer restarted to default") - } } diff --git a/Tests/MagicTimerTests/MagicTimerTests.swift b/Tests/MagicTimerTests/MagicTimerTests.swift index f44883c..cd2e672 100644 --- a/Tests/MagicTimerTests/MagicTimerTests.swift +++ b/Tests/MagicTimerTests/MagicTimerTests.swift @@ -6,6 +6,5 @@ final class MagicTimerTests: XCTestCase { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct // results. - XCTAssertEqual(MagicTimer().text, "Hello, World!") } } From 22c412439b65b49ab553459892b6e486e00d596f Mon Sep 17 00:00:00 2001 From: sadeghgoo Date: Tue, 3 May 2022 21:35:36 +0430 Subject: [PATCH 04/37] Access level of lastState property changed to public. --- Sources/MagicTimer/MagicTimer.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/MagicTimer/MagicTimer.swift b/Sources/MagicTimer/MagicTimer.swift index d5d0527..62646aa 100644 --- a/Sources/MagicTimer/MagicTimer.swift +++ b/Sources/MagicTimer/MagicTimer.swift @@ -30,7 +30,7 @@ public class MagicTimer { private var executive: MGExecutiveBehavior private var backgroundCalculator: MGBackgroundCalculableBehavior - private(set) var lastState: MagicTimerState = .none + open private(set) var lastState: MagicTimerState = .none @available(*, unavailable, renamed: "lastStateDidChangeHandler") /// Timer state callback From fe896946fbcc3d53d7f96d42787901e6d2ab5af9 Mon Sep 17 00:00:00 2001 From: sadeghgoo Date: Wed, 4 May 2022 13:34:34 +0430 Subject: [PATCH 05/37] Access level of lastState changed to public. --- Sources/MagicTimer/MagicTimer.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/MagicTimer/MagicTimer.swift b/Sources/MagicTimer/MagicTimer.swift index 62646aa..34eb0b0 100644 --- a/Sources/MagicTimer/MagicTimer.swift +++ b/Sources/MagicTimer/MagicTimer.swift @@ -30,7 +30,7 @@ public class MagicTimer { private var executive: MGExecutiveBehavior private var backgroundCalculator: MGBackgroundCalculableBehavior - open private(set) var lastState: MagicTimerState = .none + public private(set) var lastState: MagicTimerState = .none @available(*, unavailable, renamed: "lastStateDidChangeHandler") /// Timer state callback From f5194943aada18de4167a80c3a7ef54cae433ee9 Mon Sep 17 00:00:00 2001 From: sadeghgoo Date: Fri, 20 Jan 2023 16:59:43 +0330 Subject: [PATCH 06/37] Dependency injection has been added to MagicTimer class. --- Package.resolved | 25 +++++++++++++++++++++++++ Sources/MagicTimer/MagicTimer.swift | 23 +++++++++++------------ 2 files changed, 36 insertions(+), 12 deletions(-) create mode 100644 Package.resolved diff --git a/Package.resolved b/Package.resolved new file mode 100644 index 0000000..8b5095a --- /dev/null +++ b/Package.resolved @@ -0,0 +1,25 @@ +{ + "object": { + "pins": [ + { + "package": "MagicTimerCommon", + "repositoryURL": "https://github.com/MagicTimerFW/MagicTimerCommon.git", + "state": { + "branch": "main", + "revision": "f2ee82927667250a0d7206c472696e4642bec4da", + "version": null + } + }, + { + "package": "MagicTimerCore", + "repositoryURL": "https://github.com/MagicTimerFW/MagicTimerCore", + "state": { + "branch": "main", + "revision": "a65c5ef7fcc56c75044e84d3b7bbfc6b1f7d9f30", + "version": null + } + } + ] + }, + "version": 1 +} diff --git a/Sources/MagicTimer/MagicTimer.swift b/Sources/MagicTimer/MagicTimer.swift index 34eb0b0..49e1189 100644 --- a/Sources/MagicTimer/MagicTimer.swift +++ b/Sources/MagicTimer/MagicTimer.swift @@ -91,17 +91,18 @@ public class MagicTimer { return lastState } - public init() { - counter = MGCounter() - executive = MGTimerExecutive() - backgroundCalculator = MGBackgroundCalculator() - - backgroundCalculator.backgroundTimeCalculateHandler = { elapsedTime in + public init(counter: MGCounterBehavior = MGCounter(), + executive: MGExecutiveBehavior = MGTimerExecutive(), + backgroundCalculator: MGBackgroundCalculableBehavior = MGBackgroundCalculator()) { + self.counter = counter + self.executive = executive + self.backgroundCalculator = backgroundCalculator + self.backgroundCalculator.backgroundTimeCalculateHandler = { elapsedTime in self.calclulateBackgroundTime(elapsedTime: elapsedTime) } - } - // Calculate time in background + + // Calculate time in background. private func calclulateBackgroundTime(elapsedTime: TimeInterval) { switch countMode { case .stopWatch: @@ -121,7 +122,6 @@ public class MagicTimer { } private func countUp() { - executive.scheduleTimerHandler = { self.counter.add() self.elapsedTimeDidChangeHandler?(self.counter.totalCountedValue) @@ -154,7 +154,6 @@ public class MagicTimer { /// Observe counting mode and start counting. public func start() { - executive.start { // Set current date to timer firing date(for calculate background elapsed time). When set the time is not fired. self.backgroundCalculator.setTimeFiredDate(Date()) @@ -176,7 +175,7 @@ public class MagicTimer { lastState = .stopped lastStateDidChangeHandler?(.stopped) } - /// Reset timer to zero + /// Reset timer to zero. public func reset() { executive.suspand() counter.resetTotalCounted() @@ -184,7 +183,7 @@ public class MagicTimer { lastStateDidChangeHandler?(.restarted) } - /// Reset timer to default value + /// Reset timer to default value. public func resetToDefault() { executive.suspand() counter.resetToDefaultValue() From 20dda0cbff2c402c45648862999ae0fb3f6cf7cf Mon Sep 17 00:00:00 2001 From: sadeghgoo Date: Fri, 21 Apr 2023 13:13:50 +0330 Subject: [PATCH 07/37] MathOperators has been implemented and replace with old API. --- Package.resolved | 11 +- Sources/MagicTimer/MagicTimer.swift | 155 +++++++++++++++------------- 2 files changed, 96 insertions(+), 70 deletions(-) diff --git a/Package.resolved b/Package.resolved index 8b5095a..5f4836c 100644 --- a/Package.resolved +++ b/Package.resolved @@ -15,7 +15,16 @@ "repositoryURL": "https://github.com/MagicTimerFW/MagicTimerCore", "state": { "branch": "main", - "revision": "a65c5ef7fcc56c75044e84d3b7bbfc6b1f7d9f30", + "revision": "7f7e6fb987a2ced2dec1240c42987663ed8c1587", + "version": null + } + }, + { + "package": "MathOperators", + "repositoryURL": "https://github.com/sadeghgoo/MathOperators.git", + "state": { + "branch": "main", + "revision": "1bedb10d9a5914040606ca1b26d9c44a21fb19a6", "version": null } } diff --git a/Sources/MagicTimer/MagicTimer.swift b/Sources/MagicTimer/MagicTimer.swift index 49e1189..2239be9 100644 --- a/Sources/MagicTimer/MagicTimer.swift +++ b/Sources/MagicTimer/MagicTimer.swift @@ -1,5 +1,6 @@ import Foundation import MagicTimerCore +import MathOperators @available(*, unavailable, renamed: "MGTimerMode") /// The timer counting mode. @@ -8,82 +9,85 @@ public enum MGCountMode { case countDown(fromSeconds: TimeInterval) } - public enum MGTimerMode { case stopWatch case countDown(fromSeconds: TimeInterval) } - -/** - A broker between contianer and view. - - Every time calculation or any commands are managing in MagicTimer that contains counter, executive and background time calculator. - */ - +/// The MagicTimer implements a timer with different modes (stop watch, and count down) that supports background mode calculations. public class MagicTimer { + // MARK: - Typealias public typealias StateHandler = ((MagicTimerState) -> Void) public typealias ElapsedTimeHandler = ((TimeInterval) -> Void) - private var counter: MGCounterBehavior - private var executive: MGExecutiveBehavior - private var backgroundCalculator: MGBackgroundCalculableBehavior - - public private(set) var lastState: MagicTimerState = .none + // MARK: - Public properties - @available(*, unavailable, renamed: "lastStateDidChangeHandler") - /// Timer state callback - public var didStateChange: ((MagicTimerState) -> Void)? + // MARK: - Handlers - /// Timer state callback + /// Last state of the timer handler. It calls when state of timer changes. public var lastStateDidChangeHandler: StateHandler? - @available(*, unavailable, renamed: "elapsedTimeDidChangeHandler") - /// A elpsed time that can observe - public var observeElapsedTime: ((TimeInterval) -> Void)? - - /// A elpsed time that can observe + /// Elapsed time handler. It calls on each timeInterval. public var elapsedTimeDidChangeHandler: ElapsedTimeHandler? - private(set) var elapsedTime: TimeInterval = 0 + // MARK: - Get only + + public private(set) var lastState: MagicTimerState = .none + + public private(set) var elapsedTime: TimeInterval = 0 + + /// Timer count mode. + public var countMode: MGTimerMode = .stopWatch /// Set value to counter defultValue. public var defultValue: TimeInterval = 0 { willSet { - guard newValue >= 0 else { + guard newValue.isBiggerThanOrEqual(.zero) else { fatalError("The defultValue should be greater or equal to zero.") } counter.setDefaultValue(newValue) } } + /// Set value to counter effectiveValue. public var effectiveValue: TimeInterval = 1 { willSet { - guard newValue >= 0 else { + guard newValue.isBiggerThanOrEqual(.zero) else { fatalError("The effectiveValue should be greater or equal to zero.") } counter.setEffectiveValue(newValue) } } + /// Set time interval to executive timeInerval. public var timeInterval: TimeInterval = 1 { willSet { - // TODO: make extension for math operators. - guard newValue >= 0 else { + guard newValue.isBiggerThanOrEqual(.zero) else { fatalError("The timeInterval should be greater or equal to zero.") } executive.timeInerval = newValue } } + /// Set value to backgroundCalculator isActiveBackgroundMode property. public var isActiveInBackground: Bool = false { willSet { backgroundCalculator.isActiveBackgroundMode = newValue } } - /// Timer count mode. - public var countMode: MGTimerMode = .stopWatch + + // MARK: - Private + + private var counter: MGCounterBehavior + private var executive: MGExecutiveBehavior + private var backgroundCalculator: MGBackgroundCalculableBehavior + + // MARK: - Unavailable + + @available(*, unavailable, renamed: "elapsedTimeDidChangeHandler") + /// A elpsed time that can observe + public var observeElapsedTime: ((TimeInterval) -> Void)? @available(*, unavailable, renamed: "lastState") /// The current state of the timer. @@ -91,6 +95,12 @@ public class MagicTimer { return lastState } + @available(*, unavailable, renamed: "lastStateDidChangeHandler") + /// Timer state callback + public var didStateChange: ((MagicTimerState) -> Void)? + + // MARK: - Constructor + public init(counter: MGCounterBehavior = MGCounter(), executive: MGExecutiveBehavior = MGTimerExecutive(), backgroundCalculator: MGBackgroundCalculableBehavior = MGBackgroundCalculator()) { @@ -102,6 +112,52 @@ public class MagicTimer { } } + // MARK: - Public methods + + /// Observe counting mode and start counting. + public func start() { + executive.start { + // Set current date to timer firing date(for calculate background elapsed time). When set the time is not fired. + self.backgroundCalculator.setTimeFiredDate(Date()) + } + + switch countMode { + case let .countDown(fromSeconds: seconds): + countDown(fromSeconds: seconds) + case .stopWatch: + countUp() + } + lastState = .fired + lastStateDidChangeHandler?(.fired) + + } + + /// Stop timer counting. + public func stop() { + executive.suspand() + lastState = .stopped + lastStateDidChangeHandler?(.stopped) + } + + /// Reset timer to zero. + public func reset() { + executive.suspand() + counter.resetTotalCounted() + lastState = .restarted + lastStateDidChangeHandler?(.restarted) + + } + + /// Reset timer to default value. + public func resetToDefault() { + executive.suspand() + counter.resetToDefaultValue() + lastState = .restarted + lastStateDidChangeHandler?(.restarted) + } + + // MARK: - Private methods + // Calculate time in background. private func calclulateBackgroundTime(elapsedTime: TimeInterval) { switch countMode { @@ -130,7 +186,7 @@ public class MagicTimer { private func countDown(fromSeconds: TimeInterval) { // Checking if defaultValue plus fromSeconds not going to invalid format(negative seconds). - guard (defultValue + fromSeconds).truncatingRemainder(dividingBy: effectiveValue ) == 0 else { + guard (defultValue + fromSeconds).truncatingRemainder(dividingBy: effectiveValue ).isEqual(to: .zero) else { fatalError("The time does not leading to valid format. Use valid effetiveValue") } @@ -151,44 +207,5 @@ public class MagicTimer { self.elapsedTimeDidChangeHandler?(self.counter.totalCountedValue) } } - - /// Observe counting mode and start counting. - public func start() { - executive.start { - // Set current date to timer firing date(for calculate background elapsed time). When set the time is not fired. - self.backgroundCalculator.setTimeFiredDate(Date()) - } - - switch countMode { - case let .countDown(fromSeconds: seconds): - countDown(fromSeconds: seconds) - case .stopWatch: - countUp() - } - lastState = .fired - lastStateDidChangeHandler?(.fired) - - } - /// Stop timer counting. - public func stop() { - executive.suspand() - lastState = .stopped - lastStateDidChangeHandler?(.stopped) - } - /// Reset timer to zero. - public func reset() { - executive.suspand() - counter.resetTotalCounted() - lastState = .restarted - lastStateDidChangeHandler?(.restarted) - - } - /// Reset timer to default value. - public func resetToDefault() { - executive.suspand() - counter.resetToDefaultValue() - lastState = .restarted - lastStateDidChangeHandler?(.restarted) - } } From 459bdccc9e6182daa18dc2dc96aa99248093c427 Mon Sep 17 00:00:00 2001 From: sadeghgoo Date: Fri, 21 Apr 2023 13:50:43 +0330 Subject: [PATCH 08/37] Dependencies have been updated. --- Package.resolved | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Package.resolved b/Package.resolved index 5f4836c..8b35295 100644 --- a/Package.resolved +++ b/Package.resolved @@ -6,7 +6,7 @@ "repositoryURL": "https://github.com/MagicTimerFW/MagicTimerCommon.git", "state": { "branch": "main", - "revision": "f2ee82927667250a0d7206c472696e4642bec4da", + "revision": "8e362710b2cca6ea283bce2721b93500ec780171", "version": null } }, From 1779859a3170a391138cadd7fb1b5e566f12dc67 Mon Sep 17 00:00:00 2001 From: sadeghgoo Date: Fri, 28 Apr 2023 13:53:59 +0330 Subject: [PATCH 09/37] observeScheduleTimer method has been added, Handle called in didSet of properties. --- Sources/MagicTimer/MagicTimer.swift | 95 ++++++++++++++--------------- 1 file changed, 47 insertions(+), 48 deletions(-) diff --git a/Sources/MagicTimer/MagicTimer.swift b/Sources/MagicTimer/MagicTimer.swift index 2239be9..ef7648d 100644 --- a/Sources/MagicTimer/MagicTimer.swift +++ b/Sources/MagicTimer/MagicTimer.swift @@ -31,11 +31,19 @@ public class MagicTimer { /// Elapsed time handler. It calls on each timeInterval. public var elapsedTimeDidChangeHandler: ElapsedTimeHandler? - // MARK: - Get only + // MARK: - Get only properties - public private(set) var lastState: MagicTimerState = .none + public private(set) var lastState: MagicTimerState = .none { + didSet { + lastStateDidChangeHandler?(lastState) + } + } - public private(set) var elapsedTime: TimeInterval = 0 + public private(set) var elapsedTime: TimeInterval = 0 { + didSet { + elapsedTimeDidChangeHandler?(elapsedTime) + } + } /// Timer count mode. public var countMode: MGTimerMode = .stopWatch @@ -119,41 +127,29 @@ public class MagicTimer { executive.start { // Set current date to timer firing date(for calculate background elapsed time). When set the time is not fired. self.backgroundCalculator.setTimeFiredDate(Date()) - } - - switch countMode { - case let .countDown(fromSeconds: seconds): - countDown(fromSeconds: seconds) - case .stopWatch: - countUp() - } - lastState = .fired - lastStateDidChangeHandler?(.fired) - + self.lastState = .fired + self.observeScheduleTimer() + } } - /// Stop timer counting. + /// Stop the timer. public func stop() { executive.suspand() lastState = .stopped - lastStateDidChangeHandler?(.stopped) } - /// Reset timer to zero. + /// Reset the timer. It will set the elapsed time to zero. public func reset() { executive.suspand() counter.resetTotalCounted() lastState = .restarted - lastStateDidChangeHandler?(.restarted) - } - /// Reset timer to default value. + /// Reset the timer to the default value. public func resetToDefault() { executive.suspand() counter.resetToDefaultValue() lastState = .restarted - lastStateDidChangeHandler?(.restarted) } // MARK: - Private methods @@ -176,35 +172,38 @@ public class MagicTimer { } } } - - private func countUp() { - executive.scheduleTimerHandler = { - self.counter.add() - self.elapsedTimeDidChangeHandler?(self.counter.totalCountedValue) - } - } - - private func countDown(fromSeconds: TimeInterval) { - // Checking if defaultValue plus fromSeconds not going to invalid format(negative seconds). - guard (defultValue + fromSeconds).truncatingRemainder(dividingBy: effectiveValue ).isEqual(to: .zero) else { - fatalError("The time does not leading to valid format. Use valid effetiveValue") - } - - counter.setTotalCountedValue(fromSeconds) - // Every timeInterval observe value is called. - executive.scheduleTimerHandler = { - // Check if totalCountedValue is valid or not. - guard self.counter.totalCountedValue > 0 else { - self.executive.suspand() - self.lastStateDidChangeHandler?(.stopped) - - return + private func observeScheduleTimer() { + executive.scheduleTimerHandler = { [weak self] in + guard let self else { return } + + switch self.countMode { + case .stopWatch: + self.counter.add() + self.elapsedTime = self.counter.totalCountedValue + case .countDown(let fromSeconds): + // Checking if defaultValue plus fromSeconds not going to invalid format(negative seconds). + guard (self.defultValue + fromSeconds).truncatingRemainder(dividingBy: self.effectiveValue).isEqual(to: .zero) else { + fatalError("The time does not leading to valid format. Use valid effetiveValue") + } + + self.counter.setTotalCountedValue(fromSeconds) + + // Every timeInterval observe value is called. + self.executive.scheduleTimerHandler = { [weak self] in + // Check if totalCountedValue is valid or not. + guard let self else { return } + guard self.counter.totalCountedValue.isBiggerThan(.zero) else { + self.executive.suspand() + self.lastState = .stopped + return + } + // Subtract effectiveValue from totalCountedValue. + self.counter.subtract() + // Tell the delegate totalCountedValue(elapsed time). + self.elapsedTime = self.counter.totalCountedValue + } } - // Subtract effectiveValue from totalCountedValue. - self.counter.subtract() - // Tell the delegate totalCountedValue(elapsed time). - self.elapsedTimeDidChangeHandler?(self.counter.totalCountedValue) } } } From 2405d4fff66ab5579c4ca6318b390aac716f494a Mon Sep 17 00:00:00 2001 From: sadeghgoo Date: Sat, 29 Apr 2023 13:07:21 +0330 Subject: [PATCH 10/37] MagicTimerState has been moved to MagicTimer repo. --- Sources/MagicTimer/MagicTimerState.swift | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 Sources/MagicTimer/MagicTimerState.swift diff --git a/Sources/MagicTimer/MagicTimerState.swift b/Sources/MagicTimer/MagicTimerState.swift new file mode 100644 index 0000000..13351ac --- /dev/null +++ b/Sources/MagicTimer/MagicTimerState.swift @@ -0,0 +1,6 @@ +public enum MagicTimerState { + case fired + case stopped + case restarted + case none +} From 3825425d2839240843542915538b1dbf0b8f1f38 Mon Sep 17 00:00:00 2001 From: sadeghgoo Date: Sat, 29 Apr 2023 13:20:25 +0330 Subject: [PATCH 11/37] Update the fatal error message. --- Sources/MagicTimer/MagicTimer.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/MagicTimer/MagicTimer.swift b/Sources/MagicTimer/MagicTimer.swift index ef7648d..31db2cc 100644 --- a/Sources/MagicTimer/MagicTimer.swift +++ b/Sources/MagicTimer/MagicTimer.swift @@ -184,7 +184,7 @@ public class MagicTimer { case .countDown(let fromSeconds): // Checking if defaultValue plus fromSeconds not going to invalid format(negative seconds). guard (self.defultValue + fromSeconds).truncatingRemainder(dividingBy: self.effectiveValue).isEqual(to: .zero) else { - fatalError("The time does not leading to valid format. Use valid effetiveValue") + fatalError("The time does not lead to a valid format. Use valid effetiveValue") } self.counter.setTotalCountedValue(fromSeconds) From 7050f6bb1a2d1cc9c3a93989d5efd6c5bfc2d8e3 Mon Sep 17 00:00:00 2001 From: sadeghgoo Date: Sat, 24 Jun 2023 14:56:14 +0330 Subject: [PATCH 12/37] MagicTimerCore old codes have been updated. --- Package.resolved | 4 +-- Sources/MagicTimer/MagicTimer.swift | 55 +++++++++++------------------ 2 files changed, 23 insertions(+), 36 deletions(-) diff --git a/Package.resolved b/Package.resolved index 8b35295..4a3dcbd 100644 --- a/Package.resolved +++ b/Package.resolved @@ -6,7 +6,7 @@ "repositoryURL": "https://github.com/MagicTimerFW/MagicTimerCommon.git", "state": { "branch": "main", - "revision": "8e362710b2cca6ea283bce2721b93500ec780171", + "revision": "fb03ac56dba62017a5fefea3552b0e8c045b1f37", "version": null } }, @@ -15,7 +15,7 @@ "repositoryURL": "https://github.com/MagicTimerFW/MagicTimerCore", "state": { "branch": "main", - "revision": "7f7e6fb987a2ced2dec1240c42987663ed8c1587", + "revision": "781975cb4332a13caa2bf28942595c303e1acfd7", "version": null } }, diff --git a/Sources/MagicTimer/MagicTimer.swift b/Sources/MagicTimer/MagicTimer.swift index 31db2cc..c66c694 100644 --- a/Sources/MagicTimer/MagicTimer.swift +++ b/Sources/MagicTimer/MagicTimer.swift @@ -22,9 +22,7 @@ public class MagicTimer { public typealias ElapsedTimeHandler = ((TimeInterval) -> Void) // MARK: - Public properties - // MARK: - Handlers - /// Last state of the timer handler. It calls when state of timer changes. public var lastStateDidChangeHandler: StateHandler? @@ -32,53 +30,55 @@ public class MagicTimer { public var elapsedTimeDidChangeHandler: ElapsedTimeHandler? // MARK: - Get only properties - + + /// Last state of the timer. Checkout ```MagicTimerState```. public private(set) var lastState: MagicTimerState = .none { didSet { lastStateDidChangeHandler?(lastState) } } - + + /// Elapsed time from where the timer started. Default is 0. public private(set) var elapsedTime: TimeInterval = 0 { didSet { elapsedTimeDidChangeHandler?(elapsedTime) } } - /// Timer count mode. + /// Timer count mode. Default is `.stopWatch`. Checkout ```MGTimerMode``` public var countMode: MGTimerMode = .stopWatch - /// Set value to counter defultValue. + /// Timer default value. Default is 0. public var defultValue: TimeInterval = 0 { willSet { guard newValue.isBiggerThanOrEqual(.zero) else { fatalError("The defultValue should be greater or equal to zero.") } - counter.setDefaultValue(newValue) + counter.defultValue = newValue } } - /// Set value to counter effectiveValue. + /// Timer effective value. Default is 1. public var effectiveValue: TimeInterval = 1 { willSet { guard newValue.isBiggerThanOrEqual(.zero) else { fatalError("The effectiveValue should be greater or equal to zero.") } - counter.setEffectiveValue(newValue) + counter.effectiveValue = newValue } } - /// Set time interval to executive timeInerval. + /// Timer time interval, Default is 1. public var timeInterval: TimeInterval = 1 { willSet { guard newValue.isBiggerThanOrEqual(.zero) else { fatalError("The timeInterval should be greater or equal to zero.") } - executive.timeInerval = newValue + executive.timeInterval = newValue } } - /// Set value to backgroundCalculator isActiveBackgroundMode property. + /// Set value to backgroundCalculator isActiveBackgroundMode property. public var isActiveInBackground: Bool = false { willSet { backgroundCalculator.isActiveBackgroundMode = newValue @@ -86,13 +86,11 @@ public class MagicTimer { } // MARK: - Private - private var counter: MGCounterBehavior private var executive: MGExecutiveBehavior private var backgroundCalculator: MGBackgroundCalculableBehavior // MARK: - Unavailable - @available(*, unavailable, renamed: "elapsedTimeDidChangeHandler") /// A elpsed time that can observe public var observeElapsedTime: ((TimeInterval) -> Void)? @@ -107,8 +105,7 @@ public class MagicTimer { /// Timer state callback public var didStateChange: ((MagicTimerState) -> Void)? - // MARK: - Constructor - + // MARK: - Constructors public init(counter: MGCounterBehavior = MGCounter(), executive: MGExecutiveBehavior = MGTimerExecutive(), backgroundCalculator: MGBackgroundCalculableBehavior = MGBackgroundCalculator()) { @@ -121,18 +118,16 @@ public class MagicTimer { } // MARK: - Public methods - - /// Observe counting mode and start counting. + /// Start counting the timer. public func start() { executive.start { - // Set current date to timer firing date(for calculate background elapsed time). When set the time is not fired. - self.backgroundCalculator.setTimeFiredDate(Date()) + self.backgroundCalculator.timerFiredDate = Date() self.lastState = .fired self.observeScheduleTimer() } } - /// Stop the timer. + /// Stop counting the timer. public func stop() { executive.suspand() lastState = .stopped @@ -153,22 +148,18 @@ public class MagicTimer { } // MARK: - Private methods - - // Calculate time in background. + // It calculates the elapsed time user was in background. private func calclulateBackgroundTime(elapsedTime: TimeInterval) { switch countMode { case .stopWatch: - // Set totalCountedValue to all elpased time plus time in background. - counter.setTotalCountedValue(elapsedTime) + counter.totalCountedValue = elapsedTime case let .countDown(fromSeconds: countDownSeconds): let subtraction = countDownSeconds - elapsedTime - // Checking elapsed time in background wasn't negeative. if subtraction.isPositive { - // Set totalCountedValue to total time minus elapsed time in background. - counter.setTotalCountedValue(subtraction) + counter.totalCountedValue = subtraction } else { - counter.setTotalCountedValue(1) + counter.totalCountedValue = 1 } } } @@ -187,20 +178,16 @@ public class MagicTimer { fatalError("The time does not lead to a valid format. Use valid effetiveValue") } - self.counter.setTotalCountedValue(fromSeconds) + self.counter.totalCountedValue = fromSeconds - // Every timeInterval observe value is called. self.executive.scheduleTimerHandler = { [weak self] in - // Check if totalCountedValue is valid or not. guard let self else { return } guard self.counter.totalCountedValue.isBiggerThan(.zero) else { self.executive.suspand() self.lastState = .stopped return } - // Subtract effectiveValue from totalCountedValue. self.counter.subtract() - // Tell the delegate totalCountedValue(elapsed time). self.elapsedTime = self.counter.totalCountedValue } } From f2129a84357c124767e2956b1422778a6ca7a0e2 Mon Sep 17 00:00:00 2001 From: Sadeq Bitarafan <43542836+sadeghgoo@users.noreply.github.com> Date: Fri, 30 Jun 2023 13:55:51 +0330 Subject: [PATCH 13/37] MagicTimer.md has been added. --- docs/MagicTimer.md | 98 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 docs/MagicTimer.md diff --git a/docs/MagicTimer.md b/docs/MagicTimer.md new file mode 100644 index 0000000..920de45 --- /dev/null +++ b/docs/MagicTimer.md @@ -0,0 +1,98 @@ +# MagicTimer + +The `MagicTimer` class is a timer implementation written in Swift. It provides various functionalities to start, stop, reset, background time calculation and observe the elapsed time. The class uses a set of handler closures to notify the changes in the timer's state and elapsed time. + +## Typealiases + +```swift +public typealias StateHandler = ((MagicTimerState) -> Void) +public typealias ElapsedTimeHandler = ((TimeInterval) -> Void) +``` + +- `StateHandler`: A closure type that takes a `MagicTimerState` parameter, representing the timer's state, and returns `Void`. This closure is called when the state of the timer changes. +- `ElapsedTimeHandler`: A closure type that takes a `TimeInterval` parameter, representing the elapsed time, and returns `Void`. This closure is called on each time interval to update the elapsed time. + +## Public Properties + +- `lastStateDidChangeHandler`: A closure that is called when the state of the timer changes. +- `elapsedTimeDidChangeHandler`: A closure that is called on each time interval to update the elapsed time. + +```swift +public var lastStateDidChangeHandler: StateHandler? +public var elapsedTimeDidChangeHandler: ElapsedTimeHandler? +``` + +- `lastState`: A read-only property representing the last state of the timer. Checkout `MagicTimerState`. + +```swift +public private(set) var lastState: MagicTimerState = .none { + didSet { + lastStateDidChangeHandler?(lastState) + } +} +``` + +- `elapsedTime`: A read-only property representing the elapsed time from when the timer started. Default is 0. + +```swift +public private(set) var elapsedTime: TimeInterval = 0 { + didSet { + elapsedTimeDidChangeHandler?(elapsedTime) + } +} +``` + +- `countMode`: Timer count mode. Default is `.stopWatch`. Checkout `MGTimerMode`. + +```swift +public var countMode: MGTimerMode = .stopWatch +``` + +- `defultValue`: Timer default value. Default is 0. + +```swift +public var defultValue: TimeInterval = 0 { + willSet { + guard newValue.isBiggerThanOrEqual(.zero) else { + fatalError("The defultValue should be greater or equal to zero.") + } + counter.defultValue = newValue + } +} +``` + +- `effectiveValue`: A number which is added or minused on each `timeInterval`. Default is 1. + +```swift +public var effectiveValue: TimeInterval = 1 { + willSet { + guard newValue.isBiggerThanOrEqual(.zero) else { + fatalError("The effectiveValue should be greater or equal to zero.") + } + counter.effectiveValue = newValue + } +} +``` + +- `timeInterval`: Timer time interval, Default is 1. + +```swift +public var timeInterval: TimeInterval = 1 { + willSet { + guard newValue.isBiggerThanOrEqual(.zero) else { + fatalError("The timeInterval should be greater or equal to zero.") + } + executive.timeInterval = newValue + } +} +``` + +- `isActiveInBackground`: By changing this type, the timer decides whether to calculate the time in the background. Default is true. + +```swift +public var isActiveInBackground: Bool = true { + willSet { + backgroundCalculator.isActiveBackgroundMode = newValue + } +} +``` From b824f9e93049d1e31d9bd712b42ec777d8e35271 Mon Sep 17 00:00:00 2001 From: sadeghgoo Date: Sat, 1 Jul 2023 13:22:00 +0330 Subject: [PATCH 14/37] Documentations have been updated. --- Package.resolved | 2 +- Sources/MagicTimer/MagicTimer.swift | 86 ++++++++++++------------ Sources/MagicTimer/MagicTimerState.swift | 12 ++++ 3 files changed, 56 insertions(+), 44 deletions(-) diff --git a/Package.resolved b/Package.resolved index 4a3dcbd..2b5879e 100644 --- a/Package.resolved +++ b/Package.resolved @@ -15,7 +15,7 @@ "repositoryURL": "https://github.com/MagicTimerFW/MagicTimerCore", "state": { "branch": "main", - "revision": "781975cb4332a13caa2bf28942595c303e1acfd7", + "revision": "a35ccad1b686bb28251fd6fd64ed178d3d8b6f3d", "version": null } }, diff --git a/Sources/MagicTimer/MagicTimer.swift b/Sources/MagicTimer/MagicTimer.swift index c66c694..7f83542 100644 --- a/Sources/MagicTimer/MagicTimer.swift +++ b/Sources/MagicTimer/MagicTimer.swift @@ -2,19 +2,19 @@ import Foundation import MagicTimerCore import MathOperators -@available(*, unavailable, renamed: "MGTimerMode") +@available(*, unavailable, renamed: "MagicTimerMode") /// The timer counting mode. public enum MGCountMode { case stopWatch case countDown(fromSeconds: TimeInterval) } -public enum MGTimerMode { +public enum MagicTimerMode { case stopWatch case countDown(fromSeconds: TimeInterval) } -/// The MagicTimer implements a timer with different modes (stop watch, and count down) that supports background mode calculations. +/// The MagicTimer class is a timer implementation. It provides various functionalities to start, stop, reset, background time calculation and more. public class MagicTimer { // MARK: - Typealias @@ -45,50 +45,50 @@ public class MagicTimer { } } - /// Timer count mode. Default is `.stopWatch`. Checkout ```MGTimerMode``` - public var countMode: MGTimerMode = .stopWatch + /// Timer count mode. Default is `.stopWatch`. Checkout ```MagicTimerMode```. + public var countMode: MagicTimerMode = .stopWatch /// Timer default value. Default is 0. public var defultValue: TimeInterval = 0 { - willSet { - guard newValue.isBiggerThanOrEqual(.zero) else { + didSet { + guard defultValue.isBiggerThanOrEqual(.zero) else { fatalError("The defultValue should be greater or equal to zero.") } - counter.defultValue = newValue + counter.defultValue = defultValue } } - /// Timer effective value. Default is 1. + /// A number which is added or minused on each ``timeInterval``. Default is 1. public var effectiveValue: TimeInterval = 1 { - willSet { - guard newValue.isBiggerThanOrEqual(.zero) else { + didSet { + guard effectiveValue.isBiggerThanOrEqual(.zero) else { fatalError("The effectiveValue should be greater or equal to zero.") } - counter.effectiveValue = newValue + counter.effectiveValue = effectiveValue } } - /// Timer time interval, Default is 1. + /// Timer time interval. Default is 1. public var timeInterval: TimeInterval = 1 { - willSet { - guard newValue.isBiggerThanOrEqual(.zero) else { + didSet { + guard timeInterval.isBiggerThanOrEqual(.zero) else { fatalError("The timeInterval should be greater or equal to zero.") } - executive.timeInterval = newValue + executive.timeInterval = timeInterval } } - /// Set value to backgroundCalculator isActiveBackgroundMode property. - public var isActiveInBackground: Bool = false { - willSet { - backgroundCalculator.isActiveBackgroundMode = newValue + /// By changing this type timer decides to whether calcualte the time in background. Default is true. + public var isActiveInBackground: Bool = true { + didSet { + backgroundCalculator.isActiveBackgroundMode = isActiveInBackground } } // MARK: - Private - private var counter: MGCounterBehavior - private var executive: MGExecutiveBehavior - private var backgroundCalculator: MGBackgroundCalculableBehavior + private var counter: MagicTimerCounterInterface + private var executive: MagicTimerExecutiveInterface + private var backgroundCalculator: MagicTimerBackgroundCalculatorInterface // MARK: - Unavailable @available(*, unavailable, renamed: "elapsedTimeDidChangeHandler") @@ -106,9 +106,9 @@ public class MagicTimer { public var didStateChange: ((MagicTimerState) -> Void)? // MARK: - Constructors - public init(counter: MGCounterBehavior = MGCounter(), - executive: MGExecutiveBehavior = MGTimerExecutive(), - backgroundCalculator: MGBackgroundCalculableBehavior = MGBackgroundCalculator()) { + public init(counter: MagicTimerCounterInterface = MagicTimerCounter(), + executive: MagicTimerExecutiveInterface = MagicTimerExecutive(), + backgroundCalculator: MagicTimerBackgroundCalculatorInterface = MagicTimerBackgroundCalculator()) { self.counter = counter self.executive = executive self.backgroundCalculator = backgroundCalculator @@ -129,22 +129,25 @@ public class MagicTimer { /// Stop counting the timer. public func stop() { - executive.suspand() - lastState = .stopped + executive.suspand { + self.lastState = .stopped + } } /// Reset the timer. It will set the elapsed time to zero. public func reset() { - executive.suspand() - counter.resetTotalCounted() - lastState = .restarted + executive.suspand { + self.counter.resetTotalCounted() + self.lastState = .restarted + } } - /// Reset the timer to the default value. + /// Reset the timer to the ``defaultvalue``. public func resetToDefault() { - executive.suspand() - counter.resetToDefaultValue() - lastState = .restarted + executive.suspand { + self.counter.resetToDefaultValue() + self.lastState = .restarted + } } // MARK: - Private methods @@ -179,17 +182,14 @@ public class MagicTimer { } self.counter.totalCountedValue = fromSeconds - - self.executive.scheduleTimerHandler = { [weak self] in - guard let self else { return } - guard self.counter.totalCountedValue.isBiggerThan(.zero) else { - self.executive.suspand() + guard counter.totalCountedValue.isBiggerThan(.zero) else { + executive.suspand { self.lastState = .stopped - return } - self.counter.subtract() - self.elapsedTime = self.counter.totalCountedValue + return } + counter.subtract() + elapsedTime = self.counter.totalCountedValue } } } diff --git a/Sources/MagicTimer/MagicTimerState.swift b/Sources/MagicTimer/MagicTimerState.swift index 13351ac..dc12677 100644 --- a/Sources/MagicTimer/MagicTimerState.swift +++ b/Sources/MagicTimer/MagicTimerState.swift @@ -1,3 +1,15 @@ +@available(*, deprecated, message: "MGStateManager is no longer available. Use MagicTimerState insted ") +public class MGStateManager { + static let shared: MGStateManager = .init() + public enum TimerState { + case fired + case stopped + case restarted + case none + } + public var currentTimerState: TimerState = .none +} + public enum MagicTimerState { case fired case stopped From 91d23e6fa9aeefe6466697cda10fcd03300f83bf Mon Sep 17 00:00:00 2001 From: sadeghgoo Date: Sat, 1 Jul 2023 13:24:00 +0330 Subject: [PATCH 15/37] ```start()``` method has been replaced with ```fire()```. --- Sources/MagicTimer/MagicTimer.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/MagicTimer/MagicTimer.swift b/Sources/MagicTimer/MagicTimer.swift index 7f83542..e2db708 100644 --- a/Sources/MagicTimer/MagicTimer.swift +++ b/Sources/MagicTimer/MagicTimer.swift @@ -120,7 +120,7 @@ public class MagicTimer { // MARK: - Public methods /// Start counting the timer. public func start() { - executive.start { + executive.fire { self.backgroundCalculator.timerFiredDate = Date() self.lastState = .fired self.observeScheduleTimer() From 1cd5ee211cbea8845461ce480a3c8e82f3e6f518 Mon Sep 17 00:00:00 2001 From: Sadeq Bitarafan <43542836+sadeghgoo@users.noreply.github.com> Date: Sat, 1 Jul 2023 15:53:00 +0330 Subject: [PATCH 16/37] Update MagicTimer.md --- docs/MagicTimer.md | 127 +++++++++++++++++++-------------------------- 1 file changed, 52 insertions(+), 75 deletions(-) diff --git a/docs/MagicTimer.md b/docs/MagicTimer.md index 920de45..444e55f 100644 --- a/docs/MagicTimer.md +++ b/docs/MagicTimer.md @@ -1,98 +1,75 @@ -# MagicTimer +# MagicTimer Class -The `MagicTimer` class is a timer implementation written in Swift. It provides various functionalities to start, stop, reset, background time calculation and observe the elapsed time. The class uses a set of handler closures to notify the changes in the timer's state and elapsed time. +The `MagicTimer` class is a timer implementation that provides various functionalities to start, stop, reset, and calculate elapsed time. It supports different timer modes, background time calculation, and event handlers. -## Typealiases +## Properties -```swift -public typealias StateHandler = ((MagicTimerState) -> Void) -public typealias ElapsedTimeHandler = ((TimeInterval) -> Void) -``` +### Handlers -- `StateHandler`: A closure type that takes a `MagicTimerState` parameter, representing the timer's state, and returns `Void`. This closure is called when the state of the timer changes. -- `ElapsedTimeHandler`: A closure type that takes a `TimeInterval` parameter, representing the elapsed time, and returns `Void`. This closure is called on each time interval to update the elapsed time. +- `lastStateDidChangeHandler`: A handler called when the timer state changes. It provides the last state of the timer. +- `elapsedTimeDidChangeHandler`: A handler called on each time interval. It provides the elapsed time. -## Public Properties +### Get-only Properties -- `lastStateDidChangeHandler`: A closure that is called when the state of the timer changes. -- `elapsedTimeDidChangeHandler`: A closure that is called on each time interval to update the elapsed time. +- `lastState`: The last state of the timer. It can be one of the following states: `.none`, `.fired`, `.stopped`, or `.restarted`. +- `elapsedTime`: The elapsed time from when the timer started. -```swift -public var lastStateDidChangeHandler: StateHandler? -public var elapsedTimeDidChangeHandler: ElapsedTimeHandler? -``` +### Timer Configuration Properties -- `lastState`: A read-only property representing the last state of the timer. Checkout `MagicTimerState`. +- `countMode`: The timer count mode. It can be either `.stopWatch` or `.countDown(fromSeconds: TimeInterval)`. +- `defultValue`: The timer default value. This value is used when resetting the timer. +- `effectiveValue`: The value added or subtracted on each time interval. +- `timeInterval`: The time interval between each timer tick. +- `isActiveInBackground`: Determines whether the timer calculates time in the background. -```swift -public private(set) var lastState: MagicTimerState = .none { - didSet { - lastStateDidChangeHandler?(lastState) - } -} -``` +## Constructors -- `elapsedTime`: A read-only property representing the elapsed time from when the timer started. Default is 0. +- `init(counter: MagicTimerCounterInterface = MagicTimerCounter(), executive: MagicTimerExecutiveInterface = MagicTimerExecutive(), backgroundCalculator: MagicTimerBackgroundCalculatorInterface = MagicTimerBackgroundCalculator())`: Initializes a new instance of the `MagicTimer` class with the specified counter, executive, and background calculator. -```swift -public private(set) var elapsedTime: TimeInterval = 0 { - didSet { - elapsedTimeDidChangeHandler?(elapsedTime) - } -} -``` +## Methods -- `countMode`: Timer count mode. Default is `.stopWatch`. Checkout `MGTimerMode`. +- `start()`: Starts the timer. +- `stop()`: Stops the timer. +- `reset()`: Resets the timer, setting the elapsed time to zero. +- `resetToDefault()`: Resets the timer to the default value. -```swift -public var countMode: MGTimerMode = .stopWatch -``` -- `defultValue`: Timer default value. Default is 0. -```swift -public var defultValue: TimeInterval = 0 { - willSet { - guard newValue.isBiggerThanOrEqual(.zero) else { - fatalError("The defultValue should be greater or equal to zero.") - } - counter.defultValue = newValue - } -} -``` +> Note: The `MagicTimer` class uses the `MagicTimerCounterInterface`, `MagicTimerExecutiveInterface`, and `MagicTimerBackgroundCalculatorInterface` protocols for counter, executive, and background calculator implementations, respectively. + +Checkout the documentations: +[MagicTimerCounterInterface](https://github.com/MagicTimerFW/MagicTimerCore/blob/main/docs/MagicTimerCounter.md]MagicTimerCounterInterface), [MagicTimerExecutiveInterface](https://github.com/MagicTimerFW/MagicTimerCore/blob/main/docs/MagicTimerExecutive.md), [MagicTimerBackgroundCalculatorInterface](https://github.com/MagicTimerFW/MagicTimerCore/blob/main/docs/MagicTimerBackgroundCalculator.md +), -- `effectiveValue`: A number which is added or minused on each `timeInterval`. Default is 1. +## Usage ```swift -public var effectiveValue: TimeInterval = 1 { - willSet { - guard newValue.isBiggerThanOrEqual(.zero) else { - fatalError("The effectiveValue should be greater or equal to zero.") - } - counter.effectiveValue = newValue - } -} -``` +// Create an instance of MagicTimer +let timer = MagicTimer() -- `timeInterval`: Timer time interval, Default is 1. +// Configure event handlers +timer.lastStateDidChangeHandler = { state in + // Handle timer state changes +} -```swift -public var timeInterval: TimeInterval = 1 { - willSet { - guard newValue.isBiggerThanOrEqual(.zero) else { - fatalError("The timeInterval should be greater or equal to zero.") - } - executive.timeInterval = newValue - } +timer.elapsedTimeDidChangeHandler = { elapsedTime in + // Handle elapsed time changes } -``` -- `isActiveInBackground`: By changing this type, the timer decides whether to calculate the time in the background. Default is true. +// Start the timer +timer.start() -```swift -public var isActiveInBackground: Bool = true { - willSet { - backgroundCalculator.isActiveBackgroundMode = newValue - } -} -``` +// ... + +// Stop the timer +timer.stop() + +// ... + +// Reset the timer +timer.reset() + +// ... + +// Reset the timer to the default value +timer.resetToDefault() From 5892bbdbcf88758d45b320daf35d89b36ad0a809 Mon Sep 17 00:00:00 2001 From: Sadeq Bitarafan <43542836+sadeghgoo@users.noreply.github.com> Date: Sat, 1 Jul 2023 16:13:45 +0330 Subject: [PATCH 17/37] Update README.md --- README.md | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 92 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4f6dfed..d164752 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,94 @@ # MagicTimer +![MagicTimer logo](https://user-images.githubusercontent.com/43542836/83555945-53b50780-a524-11ea-850e-d10b0839f63b.png) -A description of this package. +Welcome to the MagicTimer framework, your ultimate solution for handling timers in your iOS applications. This framework provides a powerful and flexible timer implementation with various features to meet your timer needs. + +## Features + +- **Easy-to-use**: MagicTimer offers a simple and intuitive API that allows you to effortlessly manage timers in your iOS apps. +- **Timer Modes**: Choose between two timer modes: Stopwatch and Countdown. Use the Stopwatch mode to measure elapsed time, or Countdown mode to count down from a specified time. +- **Event Handlers**: Take advantage of event handlers to respond to timer state changes and elapsed time updates. +- **Background Time Calculation**: Enable background time calculation to accurately track elapsed time even when the app is in the background. +- **Highly Configurable**: Customize timer properties such as time interval, default value, and effective value to fine-tune your timer behavior. + +## Why Use MagicTimer? + +- **Saves Development Time**: With MagicTimer, you can quickly integrate timer functionality into your app without spending excessive time on implementation. +- **Flexible Timer Modes**: Whether you need to measure elapsed time or create countdowns, MagicTimer has got you covered. +- **Smooth Background Time Calculation**: Ensure accurate time tracking, even when your app goes into the background. +- **Simplified Event Handling**: Leverage event handlers to handle timer state changes and elapsed time updates effortlessly. +- **Fully Customizable**: Adjust timer properties to match your app's specific requirements. + +## Getting Started + +To start using the MagicTimer framework in your iOS project, follow these simple steps: + +1. Install MagicTimer via Swift Package Manager or by manually adding the framework files to your project. +2. Import the MagicTimer module into your source code files. +3. Create an instance of `MagicTimer` and configure its properties as needed. +4. Set up event handlers to respond to timer state changes and elapsed time updates. +5. Start the timer using the `start()` method. +6. Enjoy the power and convenience of MagicTimer in your app! + +### Code Example + +```swift +import MagicTimer + +// Create an instance of MagicTimer +let timer = MagicTimer() + +// Configure the timer properties +timer.countMode = .stopWatch +timer.defultValue = 0 +timer.effectiveValue = 1 +timer.timeInterval = 1 +timer.isActiveInBackground = true + +// Set up event handlers +timer.lastStateDidChangeHandler = { state in + print("Timer state changed: \(state)") +} + +timer.elapsedTimeDidChangeHandler = { elapsedTime in + print("Elapsed time updated: \(elapsedTime)") +} + +// Start the timer +timer.start() +``` + +> **Note:** For detailed usage instructions and API documentation, please refer to the [MagicTimer Documentation](./docs/MagicTimer.md) file. + +## Requirements + +- iOS 11.0+ +- Swift 5.0+ + +## Installation + +### Swift Package Manager + +You can use Swift Package Manager to integrate MagicTimer into your Xcode project. Simply add the package dependency to your `Package.swift` file: + +```swift +dependencies: [ + .package(url: "https://github.com/your-username/MagicTimer.git", from: "1.0.0") +] +``` +### Manual Installation + +If you prefer manual installation, you can download the MagicTimer framework from the [GitHub repository](https://github.com/your-username/MagicTimer). After downloading, add the necessary files to your Xcode project. + +## Warning +⚠️ ```MagicTimerView``` is no longer available. Create your own UIView and connect ```MagicTimer``` to it. + +## Contribute + +We welcome contributions from the community to enhance the MagicTimer framework. If you encounter any issues or have ideas for improvements, please submit a pull request or open an issue on the [GitHub repository](https://github.com/your-username/MagicTimer). + +## License + +MagicTimer is released under the [MIT License](https://opensource.org/licenses/MIT). See the [LICENSE](./LICENSE) file for more details. + +This Markdown file provides an overview of the MagicTimer framework, highlights its features and benefits, guides developers on getting started, provides installation instructions, and encourages contributions. It also includes information on requirements, licensing, and ways to connect From 9a4250c1487ad8e575aa90511571fe709e077d90 Mon Sep 17 00:00:00 2001 From: Sadeq Bitarafan <43542836+sadeghgoo@users.noreply.github.com> Date: Sat, 1 Jul 2023 16:16:28 +0330 Subject: [PATCH 18/37] Create LICENSE --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..31d9a01 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 MagicTimer + +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. From 16fb831583aa3d30ddc803a46e9b5cdd3a81baaf Mon Sep 17 00:00:00 2001 From: sadeghgoo Date: Sat, 1 Jul 2023 16:20:05 +0330 Subject: [PATCH 19/37] Code documentation has been updated. --- Sources/MagicTimer/MagicTimer.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/MagicTimer/MagicTimer.swift b/Sources/MagicTimer/MagicTimer.swift index e2db708..c98584e 100644 --- a/Sources/MagicTimer/MagicTimer.swift +++ b/Sources/MagicTimer/MagicTimer.swift @@ -85,7 +85,7 @@ public class MagicTimer { } } - // MARK: - Private + // MARK: - Private properties private var counter: MagicTimerCounterInterface private var executive: MagicTimerExecutiveInterface private var backgroundCalculator: MagicTimerBackgroundCalculatorInterface From c078c51eeecdd15312c4e3598cfa286d34d90e9b Mon Sep 17 00:00:00 2001 From: sadeghgoo Date: Sat, 1 Jul 2023 17:27:22 +0330 Subject: [PATCH 20/37] MagicTimer podspec has been added. --- MagicTimer.podspec | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 MagicTimer.podspec diff --git a/MagicTimer.podspec b/MagicTimer.podspec new file mode 100644 index 0000000..de7f71d --- /dev/null +++ b/MagicTimer.podspec @@ -0,0 +1,16 @@ +Pod::Spec.new do |s| + s.name = 'MagicTimerTimer' + s.version = '2.0.0' + s.summary = 'MagicTimer framework, your ultimate solution for handling timers in your iOS applications. This framework provides a powerful and flexible timer implementation with various features to meet your timer needs.' + + s.homepage = 'https://github.com/MagicTimerFW/MagicTimer' + s.license = { :type => 'MIT', :file => 'LICENSE' } + s.author = { 'sadeghgoo' => 'sadeghitunes2@gmail.com' } + s.source = { :git => 'https://github.com/MagicTimerFW/MagicTimer', :tag => s.version.to_s } + + s.ios.deployment_target = '11.0' + s.swift_versions = ['5.0'] + s.source_files = 'Sources/**/*' + s.frameworks = 'Foundation' + s.dependency 'MagicTimerCore' +end \ No newline at end of file From ba2b9d860617601a27dd78c9e43ab0a3a8a55800 Mon Sep 17 00:00:00 2001 From: sadeghgoo Date: Sun, 2 Jul 2023 21:22:11 +0330 Subject: [PATCH 21/37] Podspec name has been updated. --- MagicTimer.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MagicTimer.podspec b/MagicTimer.podspec index de7f71d..f6abf30 100644 --- a/MagicTimer.podspec +++ b/MagicTimer.podspec @@ -1,5 +1,5 @@ Pod::Spec.new do |s| - s.name = 'MagicTimerTimer' + s.name = 'MagicTimer' s.version = '2.0.0' s.summary = 'MagicTimer framework, your ultimate solution for handling timers in your iOS applications. This framework provides a powerful and flexible timer implementation with various features to meet your timer needs.' From 9ff923bdea4b4dcfbca2002ff8b71ed7971f04d3 Mon Sep 17 00:00:00 2001 From: sadeghgoo Date: Sun, 2 Jul 2023 21:23:30 +0330 Subject: [PATCH 22/37] Podspec version has been updated. --- MagicTimer.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MagicTimer.podspec b/MagicTimer.podspec index f6abf30..21df599 100644 --- a/MagicTimer.podspec +++ b/MagicTimer.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'MagicTimer' - s.version = '2.0.0' + s.version = '2.0.1' s.summary = 'MagicTimer framework, your ultimate solution for handling timers in your iOS applications. This framework provides a powerful and flexible timer implementation with various features to meet your timer needs.' s.homepage = 'https://github.com/MagicTimerFW/MagicTimer' From 41bd1461f4160e1aeb6129ec5bf91961c8ce11ac Mon Sep 17 00:00:00 2001 From: sadeghgoo Date: Sun, 2 Jul 2023 22:59:17 +0330 Subject: [PATCH 23/37] Useless files have been removed. --- CONTRIBUTING.md | 84 -- Example/MagicTimer.xcodeproj/project.pbxproj | 581 ------------- .../contents.xcworkspacedata | 7 - .../xcschemes/MagicTimer-Example.xcscheme | 117 --- .../contents.xcworkspacedata | 10 - .../xcshareddata/IDEWorkspaceChecks.plist | 8 - Example/MagicTimer/AppDelegate.swift | 46 -- .../MagicTimer/Base.lproj/LaunchScreen.xib | 46 -- Example/MagicTimer/Base.lproj/Main.storyboard | 105 --- .../AppIcon.appiconset/Contents.json | 53 -- Example/MagicTimer/Info.plist | 39 - Example/MagicTimer/ViewController.swift | 49 -- Example/Podfile | 11 - Example/Podfile.lock | 16 - .../Local Podspecs/MagicTimer.podspec.json | 22 - Example/Pods/Manifest.lock | 16 - Example/Pods/Pods.xcodeproj/project.pbxproj | 767 ------------------ .../contents.xcworkspacedata | 7 - .../xcshareddata/IDEWorkspaceChecks.plist | 8 - .../MagicTimer/MagicTimer-Info.plist | 26 - .../MagicTimer/MagicTimer-dummy.m | 5 - .../MagicTimer/MagicTimer-prefix.pch | 12 - .../MagicTimer/MagicTimer-umbrella.h | 16 - .../MagicTimer/MagicTimer.debug.xcconfig | 10 - .../MagicTimer/MagicTimer.modulemap | 6 - .../MagicTimer/MagicTimer.release.xcconfig | 10 - .../Pods-MagicTimer_Example-Info.plist | 26 - ...gicTimer_Example-acknowledgements.markdown | 26 - ...-MagicTimer_Example-acknowledgements.plist | 58 -- .../Pods-MagicTimer_Example-dummy.m | 5 - .../Pods-MagicTimer_Example-frameworks.sh | 207 ----- .../Pods-MagicTimer_Example-umbrella.h | 16 - .../Pods-MagicTimer_Example.debug.xcconfig | 12 - .../Pods-MagicTimer_Example.modulemap | 6 - .../Pods-MagicTimer_Example.release.xcconfig | 12 - .../Pods-MagicTimer_Tests-Info.plist | 26 - ...MagicTimer_Tests-acknowledgements.markdown | 3 - ...ds-MagicTimer_Tests-acknowledgements.plist | 29 - .../Pods-MagicTimer_Tests-dummy.m | 5 - .../Pods-MagicTimer_Tests-umbrella.h | 16 - .../Pods-MagicTimer_Tests.debug.xcconfig | 9 - .../Pods-MagicTimer_Tests.modulemap | 6 - .../Pods-MagicTimer_Tests.release.xcconfig | 9 - Example/Tests/Info.plist | 24 - Example/Tests/Tests.swift | 27 - README.md | 94 --- Sources/MagicTimer/Int+Extension.swift | 28 - .../MagicTimer/MGBackgroundCalculator.swift | 75 -- Sources/MagicTimer/MGCounter.swift | 66 -- Sources/MagicTimer/MGLogable.swift | 14 - Sources/MagicTimer/MGObservable.swift | 12 - .../MagicTimer/MGStandardTimerFormatter.swift | 46 -- Sources/MagicTimer/MGStateManager.swift | 19 - Sources/MagicTimer/MGTimerExecutive.swift | 62 -- Sources/MagicTimer/MagicTimerView.swift | 306 ------- .../MagicTimer/MagicTimerViewDelegate.swift | 15 - .../MagicTimer/TimeInterval+Extesnion.swift | 14 - Sources/MagicTimer/UIFont+Extension.swift | 23 - _Pods.xcodeproj | 1 - 59 files changed, 3374 deletions(-) delete mode 100644 CONTRIBUTING.md delete mode 100644 Example/MagicTimer.xcodeproj/project.pbxproj delete mode 100644 Example/MagicTimer.xcodeproj/project.xcworkspace/contents.xcworkspacedata delete mode 100644 Example/MagicTimer.xcodeproj/xcshareddata/xcschemes/MagicTimer-Example.xcscheme delete mode 100644 Example/MagicTimer.xcworkspace/contents.xcworkspacedata delete mode 100644 Example/MagicTimer.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist delete mode 100644 Example/MagicTimer/AppDelegate.swift delete mode 100644 Example/MagicTimer/Base.lproj/LaunchScreen.xib delete mode 100644 Example/MagicTimer/Base.lproj/Main.storyboard delete mode 100644 Example/MagicTimer/Images.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 Example/MagicTimer/Info.plist delete mode 100644 Example/MagicTimer/ViewController.swift delete mode 100644 Example/Podfile delete mode 100644 Example/Podfile.lock delete mode 100644 Example/Pods/Local Podspecs/MagicTimer.podspec.json delete mode 100644 Example/Pods/Manifest.lock delete mode 100644 Example/Pods/Pods.xcodeproj/project.pbxproj delete mode 100644 Example/Pods/Pods.xcodeproj/project.xcworkspace/contents.xcworkspacedata delete mode 100644 Example/Pods/Pods.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist delete mode 100644 Example/Pods/Target Support Files/MagicTimer/MagicTimer-Info.plist delete mode 100644 Example/Pods/Target Support Files/MagicTimer/MagicTimer-dummy.m delete mode 100644 Example/Pods/Target Support Files/MagicTimer/MagicTimer-prefix.pch delete mode 100644 Example/Pods/Target Support Files/MagicTimer/MagicTimer-umbrella.h delete mode 100644 Example/Pods/Target Support Files/MagicTimer/MagicTimer.debug.xcconfig delete mode 100644 Example/Pods/Target Support Files/MagicTimer/MagicTimer.modulemap delete mode 100644 Example/Pods/Target Support Files/MagicTimer/MagicTimer.release.xcconfig delete mode 100644 Example/Pods/Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example-Info.plist delete mode 100644 Example/Pods/Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example-acknowledgements.markdown delete mode 100644 Example/Pods/Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example-acknowledgements.plist delete mode 100644 Example/Pods/Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example-dummy.m delete mode 100755 Example/Pods/Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example-frameworks.sh delete mode 100644 Example/Pods/Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example-umbrella.h delete mode 100644 Example/Pods/Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example.debug.xcconfig delete mode 100644 Example/Pods/Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example.modulemap delete mode 100644 Example/Pods/Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example.release.xcconfig delete mode 100644 Example/Pods/Target Support Files/Pods-MagicTimer_Tests/Pods-MagicTimer_Tests-Info.plist delete mode 100644 Example/Pods/Target Support Files/Pods-MagicTimer_Tests/Pods-MagicTimer_Tests-acknowledgements.markdown delete mode 100644 Example/Pods/Target Support Files/Pods-MagicTimer_Tests/Pods-MagicTimer_Tests-acknowledgements.plist delete mode 100644 Example/Pods/Target Support Files/Pods-MagicTimer_Tests/Pods-MagicTimer_Tests-dummy.m delete mode 100644 Example/Pods/Target Support Files/Pods-MagicTimer_Tests/Pods-MagicTimer_Tests-umbrella.h delete mode 100644 Example/Pods/Target Support Files/Pods-MagicTimer_Tests/Pods-MagicTimer_Tests.debug.xcconfig delete mode 100644 Example/Pods/Target Support Files/Pods-MagicTimer_Tests/Pods-MagicTimer_Tests.modulemap delete mode 100644 Example/Pods/Target Support Files/Pods-MagicTimer_Tests/Pods-MagicTimer_Tests.release.xcconfig delete mode 100644 Example/Tests/Info.plist delete mode 100644 Example/Tests/Tests.swift delete mode 100644 README.md delete mode 100644 Sources/MagicTimer/Int+Extension.swift delete mode 100644 Sources/MagicTimer/MGBackgroundCalculator.swift delete mode 100644 Sources/MagicTimer/MGCounter.swift delete mode 100644 Sources/MagicTimer/MGLogable.swift delete mode 100644 Sources/MagicTimer/MGObservable.swift delete mode 100644 Sources/MagicTimer/MGStandardTimerFormatter.swift delete mode 100644 Sources/MagicTimer/MGStateManager.swift delete mode 100644 Sources/MagicTimer/MGTimerExecutive.swift delete mode 100644 Sources/MagicTimer/MagicTimerView.swift delete mode 100644 Sources/MagicTimer/MagicTimerViewDelegate.swift delete mode 100644 Sources/MagicTimer/TimeInterval+Extesnion.swift delete mode 100644 Sources/MagicTimer/UIFont+Extension.swift delete mode 120000 _Pods.xcodeproj diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index aef3416..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,84 +0,0 @@ -# Contributing - -When contributing to this repository, please first discuss the change you wish to make via issue, -email, or any other method with the owners of this repository before making a change. - -Please note we have a code of conduct, please follow it in all your interactions with the project. - -## Pull Request Process - -1. Ensure any install or build dependencies are removed before the end of the layer when doing a - build. -2. Update the README.md with details of changes to the interface, this includes new environment - variables, exposed ports, useful file locations and container parameters. -3. Increase the version numbers in any examples files and the README.md to the new version that this - Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/). -4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you - do not have permission to do that, you may request the second reviewer to merge it for you. - -## Code of Conduct - -### Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of experience, -nationality, personal appearance, race, religion, or sexual identity and -orientation. - -### Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or -advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -### Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -### Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -### Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at [sadeghitunes2@gmail.com]. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. diff --git a/Example/MagicTimer.xcodeproj/project.pbxproj b/Example/MagicTimer.xcodeproj/project.pbxproj deleted file mode 100644 index 8878cc9..0000000 --- a/Example/MagicTimer.xcodeproj/project.pbxproj +++ /dev/null @@ -1,581 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 53F8428C84C9D95496E8784F /* Pods_MagicTimer_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 33D67ECCAD0A480854D2FD57 /* Pods_MagicTimer_Example.framework */; }; - 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; }; - 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD71AFB9204008FA782 /* ViewController.swift */; }; - 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; }; - 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDC1AFB9204008FA782 /* Images.xcassets */; }; - 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; }; - 607FACEC1AFB9204008FA782 /* Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACEB1AFB9204008FA782 /* Tests.swift */; }; - E2B7592662B41ADD8B021854 /* Pods_MagicTimer_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B0CF771593F2B2D73BF88BE /* Pods_MagicTimer_Tests.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 607FACC81AFB9204008FA782 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 607FACCF1AFB9204008FA782; - remoteInfo = MagicTimer; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 23978C4181824350DAA6823A /* MagicTimer.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = MagicTimer.podspec; path = ../MagicTimer.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; - 31E59D20EC760FFE3141ECFE /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; - 33D67ECCAD0A480854D2FD57 /* Pods_MagicTimer_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_MagicTimer_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 3B0CF771593F2B2D73BF88BE /* Pods_MagicTimer_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_MagicTimer_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 607FACD01AFB9204008FA782 /* MagicTimer_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MagicTimer_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 607FACD51AFB9204008FA782 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 607FACD71AFB9204008FA782 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - 607FACDA1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 607FACDC1AFB9204008FA782 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; - 607FACDF1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; - 607FACE51AFB9204008FA782 /* MagicTimer_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MagicTimer_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 607FACEA1AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 607FACEB1AFB9204008FA782 /* Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tests.swift; sourceTree = ""; }; - 8E19C45641F99A8D8684F77C /* Pods-MagicTimer_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MagicTimer_Tests.release.xcconfig"; path = "Target Support Files/Pods-MagicTimer_Tests/Pods-MagicTimer_Tests.release.xcconfig"; sourceTree = ""; }; - 99C5E08054BD9603712939AD /* Pods-MagicTimer_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MagicTimer_Example.debug.xcconfig"; path = "Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example.debug.xcconfig"; sourceTree = ""; }; - 9FFE6AC26DED3B4800594CA6 /* Pods-MagicTimer_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MagicTimer_Example.release.xcconfig"; path = "Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example.release.xcconfig"; sourceTree = ""; }; - E7784C2A6F847A398D035A4D /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; - FBC41B9710E5FBD2469B879D /* Pods-MagicTimer_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MagicTimer_Tests.debug.xcconfig"; path = "Target Support Files/Pods-MagicTimer_Tests/Pods-MagicTimer_Tests.debug.xcconfig"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 607FACCD1AFB9204008FA782 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 53F8428C84C9D95496E8784F /* Pods_MagicTimer_Example.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 607FACE21AFB9204008FA782 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - E2B7592662B41ADD8B021854 /* Pods_MagicTimer_Tests.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 607FACC71AFB9204008FA782 = { - isa = PBXGroup; - children = ( - 607FACF51AFB993E008FA782 /* Podspec Metadata */, - 607FACD21AFB9204008FA782 /* Example for MagicTimer */, - 607FACE81AFB9204008FA782 /* Tests */, - 607FACD11AFB9204008FA782 /* Products */, - C6675EFE639555A647D1691D /* Pods */, - 86E0FE631B50DE4AB11FA908 /* Frameworks */, - ); - sourceTree = ""; - }; - 607FACD11AFB9204008FA782 /* Products */ = { - isa = PBXGroup; - children = ( - 607FACD01AFB9204008FA782 /* MagicTimer_Example.app */, - 607FACE51AFB9204008FA782 /* MagicTimer_Tests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - 607FACD21AFB9204008FA782 /* Example for MagicTimer */ = { - isa = PBXGroup; - children = ( - 607FACD51AFB9204008FA782 /* AppDelegate.swift */, - 607FACD71AFB9204008FA782 /* ViewController.swift */, - 607FACD91AFB9204008FA782 /* Main.storyboard */, - 607FACDC1AFB9204008FA782 /* Images.xcassets */, - 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */, - 607FACD31AFB9204008FA782 /* Supporting Files */, - ); - name = "Example for MagicTimer"; - path = MagicTimer; - sourceTree = ""; - }; - 607FACD31AFB9204008FA782 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 607FACD41AFB9204008FA782 /* Info.plist */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - 607FACE81AFB9204008FA782 /* Tests */ = { - isa = PBXGroup; - children = ( - 607FACEB1AFB9204008FA782 /* Tests.swift */, - 607FACE91AFB9204008FA782 /* Supporting Files */, - ); - path = Tests; - sourceTree = ""; - }; - 607FACE91AFB9204008FA782 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 607FACEA1AFB9204008FA782 /* Info.plist */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - 607FACF51AFB993E008FA782 /* Podspec Metadata */ = { - isa = PBXGroup; - children = ( - 23978C4181824350DAA6823A /* MagicTimer.podspec */, - 31E59D20EC760FFE3141ECFE /* README.md */, - E7784C2A6F847A398D035A4D /* LICENSE */, - ); - name = "Podspec Metadata"; - sourceTree = ""; - }; - 86E0FE631B50DE4AB11FA908 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 33D67ECCAD0A480854D2FD57 /* Pods_MagicTimer_Example.framework */, - 3B0CF771593F2B2D73BF88BE /* Pods_MagicTimer_Tests.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - C6675EFE639555A647D1691D /* Pods */ = { - isa = PBXGroup; - children = ( - 99C5E08054BD9603712939AD /* Pods-MagicTimer_Example.debug.xcconfig */, - 9FFE6AC26DED3B4800594CA6 /* Pods-MagicTimer_Example.release.xcconfig */, - FBC41B9710E5FBD2469B879D /* Pods-MagicTimer_Tests.debug.xcconfig */, - 8E19C45641F99A8D8684F77C /* Pods-MagicTimer_Tests.release.xcconfig */, - ); - path = Pods; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 607FACCF1AFB9204008FA782 /* MagicTimer_Example */ = { - isa = PBXNativeTarget; - buildConfigurationList = 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "MagicTimer_Example" */; - buildPhases = ( - 937F3E12B0C08ED2882F78A1 /* [CP] Check Pods Manifest.lock */, - 607FACCC1AFB9204008FA782 /* Sources */, - 607FACCD1AFB9204008FA782 /* Frameworks */, - 607FACCE1AFB9204008FA782 /* Resources */, - A29F54CF691FE2731FFB0BFC /* [CP] Embed Pods Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = MagicTimer_Example; - productName = MagicTimer; - productReference = 607FACD01AFB9204008FA782 /* MagicTimer_Example.app */; - productType = "com.apple.product-type.application"; - }; - 607FACE41AFB9204008FA782 /* MagicTimer_Tests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "MagicTimer_Tests" */; - buildPhases = ( - 85BDEE3A5137B3EB733B580C /* [CP] Check Pods Manifest.lock */, - 607FACE11AFB9204008FA782 /* Sources */, - 607FACE21AFB9204008FA782 /* Frameworks */, - 607FACE31AFB9204008FA782 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 607FACE71AFB9204008FA782 /* PBXTargetDependency */, - ); - name = MagicTimer_Tests; - productName = Tests; - productReference = 607FACE51AFB9204008FA782 /* MagicTimer_Tests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 607FACC81AFB9204008FA782 /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0830; - LastUpgradeCheck = 0830; - ORGANIZATIONNAME = CocoaPods; - TargetAttributes = { - 607FACCF1AFB9204008FA782 = { - CreatedOnToolsVersion = 6.3.1; - LastSwiftMigration = 0900; - }; - 607FACE41AFB9204008FA782 = { - CreatedOnToolsVersion = 6.3.1; - LastSwiftMigration = 0900; - TestTargetID = 607FACCF1AFB9204008FA782; - }; - }; - }; - buildConfigurationList = 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "MagicTimer" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - English, - en, - Base, - ); - mainGroup = 607FACC71AFB9204008FA782; - productRefGroup = 607FACD11AFB9204008FA782 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 607FACCF1AFB9204008FA782 /* MagicTimer_Example */, - 607FACE41AFB9204008FA782 /* MagicTimer_Tests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 607FACCE1AFB9204008FA782 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */, - 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */, - 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 607FACE31AFB9204008FA782 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 85BDEE3A5137B3EB733B580C /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-MagicTimer_Tests-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 937F3E12B0C08ED2882F78A1 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-MagicTimer_Example-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - A29F54CF691FE2731FFB0BFC /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/MagicTimer/MagicTimer.framework", - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MagicTimer.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 607FACCC1AFB9204008FA782 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */, - 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 607FACE11AFB9204008FA782 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 607FACEC1AFB9204008FA782 /* Tests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 607FACE71AFB9204008FA782 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 607FACCF1AFB9204008FA782 /* MagicTimer_Example */; - targetProxy = 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 607FACD91AFB9204008FA782 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 607FACDA1AFB9204008FA782 /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */ = { - isa = PBXVariantGroup; - children = ( - 607FACDF1AFB9204008FA782 /* Base */, - ); - name = LaunchScreen.xib; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 607FACED1AFB9204008FA782 /* 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_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_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; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - 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_SYMBOLS_PRIVATE_EXTERN = NO; - 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 = 9.3; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - }; - name = Debug; - }; - 607FACEE1AFB9204008FA782 /* 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_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_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; - 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 = 9.3; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 607FACF01AFB9204008FA782 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 99C5E08054BD9603712939AD /* Pods-MagicTimer_Example.debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = MagicTimer/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MODULE_NAME = ExampleApp; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; - }; - name = Debug; - }; - 607FACF11AFB9204008FA782 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9FFE6AC26DED3B4800594CA6 /* Pods-MagicTimer_Example.release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = MagicTimer/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MODULE_NAME = ExampleApp; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; - }; - name = Release; - }; - 607FACF31AFB9204008FA782 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = FBC41B9710E5FBD2469B879D /* Pods-MagicTimer_Tests.debug.xcconfig */; - buildSettings = { - FRAMEWORK_SEARCH_PATHS = ( - "$(PLATFORM_DIR)/Developer/Library/Frameworks", - "$(inherited)", - ); - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - INFOPLIST_FILE = Tests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MagicTimer_Example.app/MagicTimer_Example"; - }; - name = Debug; - }; - 607FACF41AFB9204008FA782 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 8E19C45641F99A8D8684F77C /* Pods-MagicTimer_Tests.release.xcconfig */; - buildSettings = { - FRAMEWORK_SEARCH_PATHS = ( - "$(PLATFORM_DIR)/Developer/Library/Frameworks", - "$(inherited)", - ); - INFOPLIST_FILE = Tests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MagicTimer_Example.app/MagicTimer_Example"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "MagicTimer" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 607FACED1AFB9204008FA782 /* Debug */, - 607FACEE1AFB9204008FA782 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "MagicTimer_Example" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 607FACF01AFB9204008FA782 /* Debug */, - 607FACF11AFB9204008FA782 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "MagicTimer_Tests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 607FACF31AFB9204008FA782 /* Debug */, - 607FACF41AFB9204008FA782 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 607FACC81AFB9204008FA782 /* Project object */; -} diff --git a/Example/MagicTimer.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Example/MagicTimer.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 283c581..0000000 --- a/Example/MagicTimer.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Example/MagicTimer.xcodeproj/xcshareddata/xcschemes/MagicTimer-Example.xcscheme b/Example/MagicTimer.xcodeproj/xcshareddata/xcschemes/MagicTimer-Example.xcscheme deleted file mode 100644 index 6da2137..0000000 --- a/Example/MagicTimer.xcodeproj/xcshareddata/xcschemes/MagicTimer-Example.xcscheme +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Example/MagicTimer.xcworkspace/contents.xcworkspacedata b/Example/MagicTimer.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 136c04f..0000000 --- a/Example/MagicTimer.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/Example/MagicTimer.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Example/MagicTimer.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d9810..0000000 --- a/Example/MagicTimer.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/Example/MagicTimer/AppDelegate.swift b/Example/MagicTimer/AppDelegate.swift deleted file mode 100644 index 0900e07..0000000 --- a/Example/MagicTimer/AppDelegate.swift +++ /dev/null @@ -1,46 +0,0 @@ -// -// AppDelegate.swift -// MagicTimer -// -// Created by sadeghgoo on 06/02/2020. -// Copyright (c) 2020 sadeghgoo. All rights reserved. -// - -import UIKit - -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { - - var window: UIWindow? - - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { - // Override point for customization after application launch. - return true - } - - func applicationWillResignActive(_ application: UIApplication) { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. - } - - func applicationDidEnterBackground(_ application: UIApplication) { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. - } - - func applicationWillEnterForeground(_ application: UIApplication) { - // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. - } - - func applicationDidBecomeActive(_ application: UIApplication) { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - } - - func applicationWillTerminate(_ application: UIApplication) { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. - } - - -} - diff --git a/Example/MagicTimer/Base.lproj/LaunchScreen.xib b/Example/MagicTimer/Base.lproj/LaunchScreen.xib deleted file mode 100644 index 98ccfac..0000000 --- a/Example/MagicTimer/Base.lproj/LaunchScreen.xib +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Example/MagicTimer/Base.lproj/Main.storyboard b/Example/MagicTimer/Base.lproj/Main.storyboard deleted file mode 100644 index 9092663..0000000 --- a/Example/MagicTimer/Base.lproj/Main.storyboard +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Example/MagicTimer/Images.xcassets/AppIcon.appiconset/Contents.json b/Example/MagicTimer/Images.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 7006c9e..0000000 --- a/Example/MagicTimer/Images.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - }, - { - "idiom" : "ios-marketing", - "size" : "1024x1024", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/Example/MagicTimer/Info.plist b/Example/MagicTimer/Info.plist deleted file mode 100644 index eb18faa..0000000 --- a/Example/MagicTimer/Info.plist +++ /dev/null @@ -1,39 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - - - diff --git a/Example/MagicTimer/ViewController.swift b/Example/MagicTimer/ViewController.swift deleted file mode 100644 index ca94e0a..0000000 --- a/Example/MagicTimer/ViewController.swift +++ /dev/null @@ -1,49 +0,0 @@ -// -// ViewController.swift -// MagicTimer -// -// Created by sadeghgoo on 06/02/2020. -// Copyright (c) 2020 sadeghgoo. All rights reserved. -// - -import UIKit -import MagicTimer - -class ViewController: UIViewController { - - @IBOutlet weak var timer: MagicTimerView! - - override func viewDidLoad() { - super.viewDidLoad() - - timer.isActiveInBackground = false - timer.font = UIFont.systemFont(ofSize: 45, weight: .bold) - timer.mode = .stopWatch - timer.delegate = self - } - - @IBAction func start(_ sender: Any) { - timer.startCounting() - } - - @IBAction func stop(_ sender: Any) { - timer.stopCounting() - } - - @IBAction func reset(_ sender: Any) { - timer.reset() - } - - @IBAction func resetDefault(_ sender: Any) { - timer.resetToDefault() - } - -} - -extension ViewController: MagicTimerViewDelegate { - - func timerElapsedTimeDidChange(timer: MagicTimerView, elapsedTime: TimeInterval) { - //print(elapsedTime) - } -} - diff --git a/Example/Podfile b/Example/Podfile deleted file mode 100644 index 427a439..0000000 --- a/Example/Podfile +++ /dev/null @@ -1,11 +0,0 @@ -use_frameworks! - -target 'MagicTimer_Example' do - pod 'MagicTimer', :path => '../' - - target 'MagicTimer_Tests' do - inherit! :search_paths - - - end -end diff --git a/Example/Podfile.lock b/Example/Podfile.lock deleted file mode 100644 index f131bee..0000000 --- a/Example/Podfile.lock +++ /dev/null @@ -1,16 +0,0 @@ -PODS: - - MagicTimer (0.1.0) - -DEPENDENCIES: - - MagicTimer (from `../`) - -EXTERNAL SOURCES: - MagicTimer: - :path: "../" - -SPEC CHECKSUMS: - MagicTimer: 01b740d69513fdfb51a02b0425ab336dbddf73ca - -PODFILE CHECKSUM: fb78e00aeb4307729370da9751caaf6781eec9ab - -COCOAPODS: 1.9.3 diff --git a/Example/Pods/Local Podspecs/MagicTimer.podspec.json b/Example/Pods/Local Podspecs/MagicTimer.podspec.json deleted file mode 100644 index 5da48af..0000000 --- a/Example/Pods/Local Podspecs/MagicTimer.podspec.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "MagicTimer", - "version": "0.1.0", - "summary": "A short description of MagicTimer.", - "description": "TODO: Add long description of the pod here.", - "homepage": "https://github.com/sadeghgoo/MagicTimer", - "license": { - "type": "MIT", - "file": "LICENSE" - }, - "authors": { - "sadeghgoo": "sadeghitunes2@gmail.com" - }, - "source": { - "git": "https://github.com/sadeghgoo/MagicTimer.git", - "tag": "0.1.0" - }, - "platforms": { - "ios": "8.0" - }, - "source_files": "MagicTimer/Classes/**/*" -} diff --git a/Example/Pods/Manifest.lock b/Example/Pods/Manifest.lock deleted file mode 100644 index f131bee..0000000 --- a/Example/Pods/Manifest.lock +++ /dev/null @@ -1,16 +0,0 @@ -PODS: - - MagicTimer (0.1.0) - -DEPENDENCIES: - - MagicTimer (from `../`) - -EXTERNAL SOURCES: - MagicTimer: - :path: "../" - -SPEC CHECKSUMS: - MagicTimer: 01b740d69513fdfb51a02b0425ab336dbddf73ca - -PODFILE CHECKSUM: fb78e00aeb4307729370da9751caaf6781eec9ab - -COCOAPODS: 1.9.3 diff --git a/Example/Pods/Pods.xcodeproj/project.pbxproj b/Example/Pods/Pods.xcodeproj/project.pbxproj deleted file mode 100644 index 9c5d2c7..0000000 --- a/Example/Pods/Pods.xcodeproj/project.pbxproj +++ /dev/null @@ -1,767 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 04B15C78D63ACB404FC55D2376345AE6 /* MagicTimer-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 5173E17109E1212EE4CD2CFDDB2FA2B0 /* MagicTimer-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 27E7932D3C599BB7C38283642B286891 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3212113385A8FBBDB272BD23C409FF61 /* Foundation.framework */; }; - 4B67F27A9FCBEF931193142F39BD7226 /* Pods-MagicTimer_Example-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = EEDBEBDA37A84A2B6168A755E7228EE4 /* Pods-MagicTimer_Example-dummy.m */; }; - 75EC5240F77BDE0402C2C17B6098CDDF /* Pods-MagicTimer_Example-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D47E0DBFB29609E26C6D0796560A242 /* Pods-MagicTimer_Example-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 8092F8AFBE1883868FA8B2C249BCE11D /* MagicTimer-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 3FED7E8C2AE7494BA93B9F4A31A56972 /* MagicTimer-dummy.m */; }; - 9AD3C56DA41D21D22AD01D74B6E3867F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3212113385A8FBBDB272BD23C409FF61 /* Foundation.framework */; }; - AC37FC401C812D8B2E73011032968C34 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3212113385A8FBBDB272BD23C409FF61 /* Foundation.framework */; }; - B4B559259D87D66EE42459168627A02D /* Pods-MagicTimer_Tests-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 32394DEA25D878A17E7CA3D060B27079 /* Pods-MagicTimer_Tests-dummy.m */; }; - C6CB4EAC998BF1E9C2BEC3393D046A03 /* Pods-MagicTimer_Tests-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 7631C71E2330FB3AE79C2349C8609172 /* Pods-MagicTimer_Tests-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 0BCFDABF4F14FB9CEC83E10D9F528A8A /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 9A2AFD30069CA32CD2E72E7D9D0E0097; - remoteInfo = MagicTimer; - }; - E1704D138E3A3E8EF6C67C35BC53796A /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 2A49B3D7B2AF019B36E7142850B28953; - remoteInfo = "Pods-MagicTimer_Example"; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 0FB114E27F8414106022220B5B533895 /* MagicTimer.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MagicTimer.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 1178F12C9EB0D0F26F05AE7F6FEEBD6A /* Pods_MagicTimer_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_MagicTimer_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 2012AF5EB427DD9AFD348BCBF73A3296 /* Pods-MagicTimer_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-MagicTimer_Example.debug.xcconfig"; sourceTree = ""; }; - 3212113385A8FBBDB272BD23C409FF61 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; - 32394DEA25D878A17E7CA3D060B27079 /* Pods-MagicTimer_Tests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-MagicTimer_Tests-dummy.m"; sourceTree = ""; }; - 3A74D44C48465A257732A2EC6026D6DD /* Pods-MagicTimer_Example-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-MagicTimer_Example-Info.plist"; sourceTree = ""; }; - 3D47E0DBFB29609E26C6D0796560A242 /* Pods-MagicTimer_Example-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-MagicTimer_Example-umbrella.h"; sourceTree = ""; }; - 3FDAD8A99461F0430FCC54B57A034D66 /* Pods_MagicTimer_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_MagicTimer_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 3FED7E8C2AE7494BA93B9F4A31A56972 /* MagicTimer-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "MagicTimer-dummy.m"; sourceTree = ""; }; - 5173E17109E1212EE4CD2CFDDB2FA2B0 /* MagicTimer-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "MagicTimer-umbrella.h"; sourceTree = ""; }; - 5348EC6F9BEBB04D91F7A131A1764A7A /* Pods-MagicTimer_Example-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-MagicTimer_Example-acknowledgements.plist"; sourceTree = ""; }; - 58C6E77B935B00A75CEACEB684DCFD97 /* MagicTimer.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; path = MagicTimer.podspec; sourceTree = ""; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; - 68EDE36A3DAA66E4A151287FC148A962 /* Pods-MagicTimer_Example-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-MagicTimer_Example-acknowledgements.markdown"; sourceTree = ""; }; - 740D96F0EC33398D55AC080246B4D515 /* Pods-MagicTimer_Tests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-MagicTimer_Tests.modulemap"; sourceTree = ""; }; - 7631C71E2330FB3AE79C2349C8609172 /* Pods-MagicTimer_Tests-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-MagicTimer_Tests-umbrella.h"; sourceTree = ""; }; - 95CDD39AFBE1A02209400D46FF16D2A4 /* MagicTimer.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = MagicTimer.modulemap; sourceTree = ""; }; - 9D940727FF8FB9C785EB98E56350EF41 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; - 9FB6919AD8E575F402E9EA7C333F0D6A /* MagicTimer.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = MagicTimer.debug.xcconfig; sourceTree = ""; }; - A05E876970CA0E2884B03039EB73AACA /* Pods-MagicTimer_Tests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-MagicTimer_Tests-acknowledgements.plist"; sourceTree = ""; }; - A437101ECAD49D2CD6A14D71107571ED /* Pods-MagicTimer_Tests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-MagicTimer_Tests-acknowledgements.markdown"; sourceTree = ""; }; - A64FB3EF377C057561C3886371FB0A87 /* Pods-MagicTimer_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-MagicTimer_Example.release.xcconfig"; sourceTree = ""; }; - AEB6C2E09A6B2862EC1089883BB5249E /* Pods-MagicTimer_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-MagicTimer_Tests.release.xcconfig"; sourceTree = ""; }; - B918B4E62D32ECE67D865B8F6E410D09 /* Pods-MagicTimer_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-MagicTimer_Tests.debug.xcconfig"; sourceTree = ""; }; - B946FF443DA421D09D68B9E7C8ECEE0F /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; - CCF281E83B5B89FC9F2FEBA023016EBC /* MagicTimer.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = MagicTimer.release.xcconfig; sourceTree = ""; }; - D58C3B1F8F5DBC84B83ABE478F84A524 /* Pods-MagicTimer_Example-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-MagicTimer_Example-frameworks.sh"; sourceTree = ""; }; - D69D0C51A5E6C19747DCA6A85E92305F /* MagicTimer-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "MagicTimer-Info.plist"; sourceTree = ""; }; - E4CED06CD89D2103BBD6CB83094A5F9D /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = LICENSE; sourceTree = ""; }; - E5351118ABCC78FC3B6F58E425FA8E40 /* MagicTimer-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "MagicTimer-prefix.pch"; sourceTree = ""; }; - EC8D2B7251D75C5151D41BCF67C78C08 /* Pods-MagicTimer_Example.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-MagicTimer_Example.modulemap"; sourceTree = ""; }; - EEDBEBDA37A84A2B6168A755E7228EE4 /* Pods-MagicTimer_Example-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-MagicTimer_Example-dummy.m"; sourceTree = ""; }; - F659B267E605782001704DED437A1472 /* Pods-MagicTimer_Tests-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-MagicTimer_Tests-Info.plist"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 7011EBA4D7AE2196B295EE61FDEE3F01 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - AC37FC401C812D8B2E73011032968C34 /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D12FA703DDF0CACDBD9E702DA2988227 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 27E7932D3C599BB7C38283642B286891 /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - E3F716B57742E886C1A887E463B90DEA /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 9AD3C56DA41D21D22AD01D74B6E3867F /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 096D07427F200D0456EE3E0919F832B1 /* Pods-MagicTimer_Tests */ = { - isa = PBXGroup; - children = ( - 740D96F0EC33398D55AC080246B4D515 /* Pods-MagicTimer_Tests.modulemap */, - A437101ECAD49D2CD6A14D71107571ED /* Pods-MagicTimer_Tests-acknowledgements.markdown */, - A05E876970CA0E2884B03039EB73AACA /* Pods-MagicTimer_Tests-acknowledgements.plist */, - 32394DEA25D878A17E7CA3D060B27079 /* Pods-MagicTimer_Tests-dummy.m */, - F659B267E605782001704DED437A1472 /* Pods-MagicTimer_Tests-Info.plist */, - 7631C71E2330FB3AE79C2349C8609172 /* Pods-MagicTimer_Tests-umbrella.h */, - B918B4E62D32ECE67D865B8F6E410D09 /* Pods-MagicTimer_Tests.debug.xcconfig */, - AEB6C2E09A6B2862EC1089883BB5249E /* Pods-MagicTimer_Tests.release.xcconfig */, - ); - name = "Pods-MagicTimer_Tests"; - path = "Target Support Files/Pods-MagicTimer_Tests"; - sourceTree = ""; - }; - 1EEC4C2784A131325E877925F6FB050C /* Pods-MagicTimer_Example */ = { - isa = PBXGroup; - children = ( - EC8D2B7251D75C5151D41BCF67C78C08 /* Pods-MagicTimer_Example.modulemap */, - 68EDE36A3DAA66E4A151287FC148A962 /* Pods-MagicTimer_Example-acknowledgements.markdown */, - 5348EC6F9BEBB04D91F7A131A1764A7A /* Pods-MagicTimer_Example-acknowledgements.plist */, - EEDBEBDA37A84A2B6168A755E7228EE4 /* Pods-MagicTimer_Example-dummy.m */, - D58C3B1F8F5DBC84B83ABE478F84A524 /* Pods-MagicTimer_Example-frameworks.sh */, - 3A74D44C48465A257732A2EC6026D6DD /* Pods-MagicTimer_Example-Info.plist */, - 3D47E0DBFB29609E26C6D0796560A242 /* Pods-MagicTimer_Example-umbrella.h */, - 2012AF5EB427DD9AFD348BCBF73A3296 /* Pods-MagicTimer_Example.debug.xcconfig */, - A64FB3EF377C057561C3886371FB0A87 /* Pods-MagicTimer_Example.release.xcconfig */, - ); - name = "Pods-MagicTimer_Example"; - path = "Target Support Files/Pods-MagicTimer_Example"; - sourceTree = ""; - }; - 4F058576C2870CA1012BCF598C8B4AE1 /* MagicTimer */ = { - isa = PBXGroup; - children = ( - B78755F16CC26F0D1AB3FEEC1F99B960 /* Pod */, - E1D574155B3F3EA7DAE6A588A82D2F0A /* Support Files */, - ); - name = MagicTimer; - path = ../..; - sourceTree = ""; - }; - 4F241B0F9781CFD3F0B33E3B8D77B789 /* Development Pods */ = { - isa = PBXGroup; - children = ( - 4F058576C2870CA1012BCF598C8B4AE1 /* MagicTimer */, - ); - name = "Development Pods"; - sourceTree = ""; - }; - 843F9492DFEB16FAA6D4645C6FB1F103 /* Targets Support Files */ = { - isa = PBXGroup; - children = ( - 1EEC4C2784A131325E877925F6FB050C /* Pods-MagicTimer_Example */, - 096D07427F200D0456EE3E0919F832B1 /* Pods-MagicTimer_Tests */, - ); - name = "Targets Support Files"; - sourceTree = ""; - }; - 9DC7490BCE6CDF0704DF1922300B2361 /* Products */ = { - isa = PBXGroup; - children = ( - 0FB114E27F8414106022220B5B533895 /* MagicTimer.framework */, - 1178F12C9EB0D0F26F05AE7F6FEEBD6A /* Pods_MagicTimer_Example.framework */, - 3FDAD8A99461F0430FCC54B57A034D66 /* Pods_MagicTimer_Tests.framework */, - ); - name = Products; - sourceTree = ""; - }; - B78755F16CC26F0D1AB3FEEC1F99B960 /* Pod */ = { - isa = PBXGroup; - children = ( - E4CED06CD89D2103BBD6CB83094A5F9D /* LICENSE */, - 58C6E77B935B00A75CEACEB684DCFD97 /* MagicTimer.podspec */, - B946FF443DA421D09D68B9E7C8ECEE0F /* README.md */, - ); - name = Pod; - sourceTree = ""; - }; - C0834CEBB1379A84116EF29F93051C60 /* iOS */ = { - isa = PBXGroup; - children = ( - 3212113385A8FBBDB272BD23C409FF61 /* Foundation.framework */, - ); - name = iOS; - sourceTree = ""; - }; - CF1408CF629C7361332E53B88F7BD30C = { - isa = PBXGroup; - children = ( - 9D940727FF8FB9C785EB98E56350EF41 /* Podfile */, - 4F241B0F9781CFD3F0B33E3B8D77B789 /* Development Pods */, - D210D550F4EA176C3123ED886F8F87F5 /* Frameworks */, - 9DC7490BCE6CDF0704DF1922300B2361 /* Products */, - 843F9492DFEB16FAA6D4645C6FB1F103 /* Targets Support Files */, - ); - sourceTree = ""; - }; - D210D550F4EA176C3123ED886F8F87F5 /* Frameworks */ = { - isa = PBXGroup; - children = ( - C0834CEBB1379A84116EF29F93051C60 /* iOS */, - ); - name = Frameworks; - sourceTree = ""; - }; - E1D574155B3F3EA7DAE6A588A82D2F0A /* Support Files */ = { - isa = PBXGroup; - children = ( - 95CDD39AFBE1A02209400D46FF16D2A4 /* MagicTimer.modulemap */, - 3FED7E8C2AE7494BA93B9F4A31A56972 /* MagicTimer-dummy.m */, - D69D0C51A5E6C19747DCA6A85E92305F /* MagicTimer-Info.plist */, - E5351118ABCC78FC3B6F58E425FA8E40 /* MagicTimer-prefix.pch */, - 5173E17109E1212EE4CD2CFDDB2FA2B0 /* MagicTimer-umbrella.h */, - 9FB6919AD8E575F402E9EA7C333F0D6A /* MagicTimer.debug.xcconfig */, - CCF281E83B5B89FC9F2FEBA023016EBC /* MagicTimer.release.xcconfig */, - ); - name = "Support Files"; - path = "Example/Pods/Target Support Files/MagicTimer"; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - 137D89FB5A5EA86DBD4D49C30F9A5CC5 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 75EC5240F77BDE0402C2C17B6098CDDF /* Pods-MagicTimer_Example-umbrella.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 16444ABFF386AAA6394D75689A9BDB70 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 04B15C78D63ACB404FC55D2376345AE6 /* MagicTimer-umbrella.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 24B83A9E1FED4031BF35C7952C364B44 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - C6CB4EAC998BF1E9C2BEC3393D046A03 /* Pods-MagicTimer_Tests-umbrella.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - 2A49B3D7B2AF019B36E7142850B28953 /* Pods-MagicTimer_Example */ = { - isa = PBXNativeTarget; - buildConfigurationList = 8375E093AB7DB001C1525E77EDF72D62 /* Build configuration list for PBXNativeTarget "Pods-MagicTimer_Example" */; - buildPhases = ( - 137D89FB5A5EA86DBD4D49C30F9A5CC5 /* Headers */, - 7D792655DC91FC3527D99B1D21683281 /* Sources */, - 7011EBA4D7AE2196B295EE61FDEE3F01 /* Frameworks */, - 2A06D555C8BCB4F85DC8BAEA1EBA4E3D /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - F3D1139ADEDFDF6EF729AE7C03472BE1 /* PBXTargetDependency */, - ); - name = "Pods-MagicTimer_Example"; - productName = "Pods-MagicTimer_Example"; - productReference = 1178F12C9EB0D0F26F05AE7F6FEEBD6A /* Pods_MagicTimer_Example.framework */; - productType = "com.apple.product-type.framework"; - }; - 44824552C608141C5112976D327202BA /* Pods-MagicTimer_Tests */ = { - isa = PBXNativeTarget; - buildConfigurationList = AA9054DA66AB9C907BC2ABA68F180BA8 /* Build configuration list for PBXNativeTarget "Pods-MagicTimer_Tests" */; - buildPhases = ( - 24B83A9E1FED4031BF35C7952C364B44 /* Headers */, - 275BFB17E7DE5CB3EBAA3ED670ABFF16 /* Sources */, - D12FA703DDF0CACDBD9E702DA2988227 /* Frameworks */, - 404EAB9EB3CC6904C597DB910D181832 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - AF2A85222A6199C005EF7D02027D0570 /* PBXTargetDependency */, - ); - name = "Pods-MagicTimer_Tests"; - productName = "Pods-MagicTimer_Tests"; - productReference = 3FDAD8A99461F0430FCC54B57A034D66 /* Pods_MagicTimer_Tests.framework */; - productType = "com.apple.product-type.framework"; - }; - 9A2AFD30069CA32CD2E72E7D9D0E0097 /* MagicTimer */ = { - isa = PBXNativeTarget; - buildConfigurationList = 65D482A6F8D5284899C41340C6C0DCD8 /* Build configuration list for PBXNativeTarget "MagicTimer" */; - buildPhases = ( - 16444ABFF386AAA6394D75689A9BDB70 /* Headers */, - 3B84206A14B6941477D2094AB4557D59 /* Sources */, - E3F716B57742E886C1A887E463B90DEA /* Frameworks */, - 9A8A513F8CC66688468DD6B9A2EFEF1A /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = MagicTimer; - productName = MagicTimer; - productReference = 0FB114E27F8414106022220B5B533895 /* MagicTimer.framework */; - productType = "com.apple.product-type.framework"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - BFDFE7DC352907FC980B868725387E98 /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 1100; - LastUpgradeCheck = 1100; - }; - buildConfigurationList = 4821239608C13582E20E6DA73FD5F1F9 /* Build configuration list for PBXProject "Pods" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = CF1408CF629C7361332E53B88F7BD30C; - productRefGroup = 9DC7490BCE6CDF0704DF1922300B2361 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 9A2AFD30069CA32CD2E72E7D9D0E0097 /* MagicTimer */, - 2A49B3D7B2AF019B36E7142850B28953 /* Pods-MagicTimer_Example */, - 44824552C608141C5112976D327202BA /* Pods-MagicTimer_Tests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 2A06D555C8BCB4F85DC8BAEA1EBA4E3D /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 404EAB9EB3CC6904C597DB910D181832 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 9A8A513F8CC66688468DD6B9A2EFEF1A /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 275BFB17E7DE5CB3EBAA3ED670ABFF16 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - B4B559259D87D66EE42459168627A02D /* Pods-MagicTimer_Tests-dummy.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 3B84206A14B6941477D2094AB4557D59 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 8092F8AFBE1883868FA8B2C249BCE11D /* MagicTimer-dummy.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 7D792655DC91FC3527D99B1D21683281 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4B67F27A9FCBEF931193142F39BD7226 /* Pods-MagicTimer_Example-dummy.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - AF2A85222A6199C005EF7D02027D0570 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "Pods-MagicTimer_Example"; - target = 2A49B3D7B2AF019B36E7142850B28953 /* Pods-MagicTimer_Example */; - targetProxy = E1704D138E3A3E8EF6C67C35BC53796A /* PBXContainerItemProxy */; - }; - F3D1139ADEDFDF6EF729AE7C03472BE1 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = MagicTimer; - target = 9A2AFD30069CA32CD2E72E7D9D0E0097 /* MagicTimer */; - targetProxy = 0BCFDABF4F14FB9CEC83E10D9F528A8A /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin XCBuildConfiguration section */ - 0E57863B5548155DF581C49071DAFBB0 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = B918B4E62D32ECE67D865B8F6E410D09 /* Pods-MagicTimer_Tests.debug.xcconfig */; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = "Target Support Files/Pods-MagicTimer_Tests/Pods-MagicTimer_Tests-Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-MagicTimer_Tests/Pods-MagicTimer_Tests.modulemap"; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - 331B6C48088CD521EC7298394BDDB9F9 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = CCF281E83B5B89FC9F2FEBA023016EBC /* MagicTimer.release.xcconfig */; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - GCC_PREFIX_HEADER = "Target Support Files/MagicTimer/MagicTimer-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/MagicTimer/MagicTimer-Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/MagicTimer/MagicTimer.modulemap"; - PRODUCT_MODULE_NAME = MagicTimer; - PRODUCT_NAME = MagicTimer; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - AB10246F4C57AE942C2EF9A660E04AF0 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 2012AF5EB427DD9AFD348BCBF73A3296 /* Pods-MagicTimer_Example.debug.xcconfig */; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = "Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example-Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example.modulemap"; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - B0087CB4594321EF41619F3181FE120E /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = 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_DOCUMENTATION_COMMENTS = YES; - 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_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREPROCESSOR_DEFINITIONS = ( - "POD_CONFIGURATION_RELEASE=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 = 9.3; - MTL_ENABLE_DEBUG_INFO = NO; - MTL_FAST_MATH = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - STRIP_INSTALLED_PRODUCT = NO; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 5.0; - SYMROOT = "${SRCROOT}/../build"; - }; - name = Release; - }; - B8BCBD0110C2658BB5DAADB9B7D97B92 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = 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_DOCUMENTATION_COMMENTS = YES; - 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_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "POD_CONFIGURATION_DEBUG=1", - "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 = 9.3; - MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; - MTL_FAST_MATH = YES; - ONLY_ACTIVE_ARCH = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - STRIP_INSTALLED_PRODUCT = NO; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - SYMROOT = "${SRCROOT}/../build"; - }; - name = Debug; - }; - F0D97D8C0D8E86098CD92AEE2028B743 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = AEB6C2E09A6B2862EC1089883BB5249E /* Pods-MagicTimer_Tests.release.xcconfig */; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = "Target Support Files/Pods-MagicTimer_Tests/Pods-MagicTimer_Tests-Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-MagicTimer_Tests/Pods-MagicTimer_Tests.modulemap"; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - FBDE97569664FF3EB4CE27BAC0B8832E /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = A64FB3EF377C057561C3886371FB0A87 /* Pods-MagicTimer_Example.release.xcconfig */; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = "Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example-Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example.modulemap"; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - FF61EC42685EFD21F67353E9EE78FBD7 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9FB6919AD8E575F402E9EA7C333F0D6A /* MagicTimer.debug.xcconfig */; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - GCC_PREFIX_HEADER = "Target Support Files/MagicTimer/MagicTimer-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/MagicTimer/MagicTimer-Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/MagicTimer/MagicTimer.modulemap"; - PRODUCT_MODULE_NAME = MagicTimer; - PRODUCT_NAME = MagicTimer; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 4821239608C13582E20E6DA73FD5F1F9 /* Build configuration list for PBXProject "Pods" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - B8BCBD0110C2658BB5DAADB9B7D97B92 /* Debug */, - B0087CB4594321EF41619F3181FE120E /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 65D482A6F8D5284899C41340C6C0DCD8 /* Build configuration list for PBXNativeTarget "MagicTimer" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - FF61EC42685EFD21F67353E9EE78FBD7 /* Debug */, - 331B6C48088CD521EC7298394BDDB9F9 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 8375E093AB7DB001C1525E77EDF72D62 /* Build configuration list for PBXNativeTarget "Pods-MagicTimer_Example" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - AB10246F4C57AE942C2EF9A660E04AF0 /* Debug */, - FBDE97569664FF3EB4CE27BAC0B8832E /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - AA9054DA66AB9C907BC2ABA68F180BA8 /* Build configuration list for PBXNativeTarget "Pods-MagicTimer_Tests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 0E57863B5548155DF581C49071DAFBB0 /* Debug */, - F0D97D8C0D8E86098CD92AEE2028B743 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = BFDFE7DC352907FC980B868725387E98 /* Project object */; -} diff --git a/Example/Pods/Pods.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Example/Pods/Pods.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a..0000000 --- a/Example/Pods/Pods.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Example/Pods/Pods.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Example/Pods/Pods.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d9810..0000000 --- a/Example/Pods/Pods.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/Example/Pods/Target Support Files/MagicTimer/MagicTimer-Info.plist b/Example/Pods/Target Support Files/MagicTimer/MagicTimer-Info.plist deleted file mode 100644 index 161a9d3..0000000 --- a/Example/Pods/Target Support Files/MagicTimer/MagicTimer-Info.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - ${PRODUCT_BUNDLE_IDENTIFIER} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - FMWK - CFBundleShortVersionString - 0.1.0 - CFBundleSignature - ???? - CFBundleVersion - ${CURRENT_PROJECT_VERSION} - NSPrincipalClass - - - diff --git a/Example/Pods/Target Support Files/MagicTimer/MagicTimer-dummy.m b/Example/Pods/Target Support Files/MagicTimer/MagicTimer-dummy.m deleted file mode 100644 index 4a558ad..0000000 --- a/Example/Pods/Target Support Files/MagicTimer/MagicTimer-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_MagicTimer : NSObject -@end -@implementation PodsDummy_MagicTimer -@end diff --git a/Example/Pods/Target Support Files/MagicTimer/MagicTimer-prefix.pch b/Example/Pods/Target Support Files/MagicTimer/MagicTimer-prefix.pch deleted file mode 100644 index beb2a24..0000000 --- a/Example/Pods/Target Support Files/MagicTimer/MagicTimer-prefix.pch +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - diff --git a/Example/Pods/Target Support Files/MagicTimer/MagicTimer-umbrella.h b/Example/Pods/Target Support Files/MagicTimer/MagicTimer-umbrella.h deleted file mode 100644 index a7b594a..0000000 --- a/Example/Pods/Target Support Files/MagicTimer/MagicTimer-umbrella.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - - -FOUNDATION_EXPORT double MagicTimerVersionNumber; -FOUNDATION_EXPORT const unsigned char MagicTimerVersionString[]; - diff --git a/Example/Pods/Target Support Files/MagicTimer/MagicTimer.debug.xcconfig b/Example/Pods/Target Support Files/MagicTimer/MagicTimer.debug.xcconfig deleted file mode 100644 index fd44567..0000000 --- a/Example/Pods/Target Support Files/MagicTimer/MagicTimer.debug.xcconfig +++ /dev/null @@ -1,10 +0,0 @@ -CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/MagicTimer -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -PODS_BUILD_DIR = ${BUILD_DIR} -PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES -USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES diff --git a/Example/Pods/Target Support Files/MagicTimer/MagicTimer.modulemap b/Example/Pods/Target Support Files/MagicTimer/MagicTimer.modulemap deleted file mode 100644 index c9e5af0..0000000 --- a/Example/Pods/Target Support Files/MagicTimer/MagicTimer.modulemap +++ /dev/null @@ -1,6 +0,0 @@ -framework module MagicTimer { - umbrella header "MagicTimer-umbrella.h" - - export * - module * { export * } -} diff --git a/Example/Pods/Target Support Files/MagicTimer/MagicTimer.release.xcconfig b/Example/Pods/Target Support Files/MagicTimer/MagicTimer.release.xcconfig deleted file mode 100644 index fd44567..0000000 --- a/Example/Pods/Target Support Files/MagicTimer/MagicTimer.release.xcconfig +++ /dev/null @@ -1,10 +0,0 @@ -CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/MagicTimer -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -PODS_BUILD_DIR = ${BUILD_DIR} -PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES -USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES diff --git a/Example/Pods/Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example-Info.plist b/Example/Pods/Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example-Info.plist deleted file mode 100644 index 2243fe6..0000000 --- a/Example/Pods/Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example-Info.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - ${PRODUCT_BUNDLE_IDENTIFIER} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0.0 - CFBundleSignature - ???? - CFBundleVersion - ${CURRENT_PROJECT_VERSION} - NSPrincipalClass - - - diff --git a/Example/Pods/Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example-acknowledgements.markdown b/Example/Pods/Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example-acknowledgements.markdown deleted file mode 100644 index c91acb1..0000000 --- a/Example/Pods/Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example-acknowledgements.markdown +++ /dev/null @@ -1,26 +0,0 @@ -# Acknowledgements -This application makes use of the following third party libraries: - -## MagicTimer - -Copyright (c) 2020 sadeghgoo - -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. - -Generated by CocoaPods - https://cocoapods.org diff --git a/Example/Pods/Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example-acknowledgements.plist b/Example/Pods/Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example-acknowledgements.plist deleted file mode 100644 index 0f907f2..0000000 --- a/Example/Pods/Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example-acknowledgements.plist +++ /dev/null @@ -1,58 +0,0 @@ - - - - - PreferenceSpecifiers - - - FooterText - This application makes use of the following third party libraries: - Title - Acknowledgements - Type - PSGroupSpecifier - - - FooterText - Copyright (c) 2020 sadeghgoo <sadeghitunes2@gmail.com> - -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. - - License - MIT - Title - MagicTimer - Type - PSGroupSpecifier - - - FooterText - Generated by CocoaPods - https://cocoapods.org - Title - - Type - PSGroupSpecifier - - - StringsTable - Acknowledgements - Title - Acknowledgements - - diff --git a/Example/Pods/Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example-dummy.m b/Example/Pods/Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example-dummy.m deleted file mode 100644 index 6b01534..0000000 --- a/Example/Pods/Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_Pods_MagicTimer_Example : NSObject -@end -@implementation PodsDummy_Pods_MagicTimer_Example -@end diff --git a/Example/Pods/Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example-frameworks.sh b/Example/Pods/Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example-frameworks.sh deleted file mode 100755 index eb5edb2..0000000 --- a/Example/Pods/Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example-frameworks.sh +++ /dev/null @@ -1,207 +0,0 @@ -#!/bin/sh -set -e -set -u -set -o pipefail - -function on_error { - echo "$(realpath -mq "${0}"):$1: error: Unexpected failure" -} -trap 'on_error $LINENO' ERR - -if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then - # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy - # frameworks to, so exit 0 (signalling the script phase was successful). - exit 0 -fi - -echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" -mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - -COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" -SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" - -# Used as a return value for each invocation of `strip_invalid_archs` function. -STRIP_BINARY_RETVAL=0 - -# This protects against multiple targets copying the same framework dependency at the same time. The solution -# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html -RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") - -# Copies and strips a vendored framework -install_framework() -{ - if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then - local source="${BUILT_PRODUCTS_DIR}/$1" - elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then - local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" - elif [ -r "$1" ]; then - local source="$1" - fi - - local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - - if [ -L "${source}" ]; then - echo "Symlinked..." - source="$(readlink "${source}")" - fi - - # Use filter instead of exclude so missing patterns don't throw errors. - echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" - rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" - - local basename - basename="$(basename -s .framework "$1")" - binary="${destination}/${basename}.framework/${basename}" - - if ! [ -r "$binary" ]; then - binary="${destination}/${basename}" - elif [ -L "${binary}" ]; then - echo "Destination binary is symlinked..." - dirname="$(dirname "${binary}")" - binary="${dirname}/$(readlink "${binary}")" - fi - - # Strip invalid architectures so "fat" simulator / device frameworks work on device - if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then - strip_invalid_archs "$binary" - fi - - # Resign the code if required by the build settings to avoid unstable apps - code_sign_if_enabled "${destination}/$(basename "$1")" - - # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. - if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then - local swift_runtime_libs - swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u) - for lib in $swift_runtime_libs; do - echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" - rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" - code_sign_if_enabled "${destination}/${lib}" - done - fi -} - -# Copies and strips a vendored dSYM -install_dsym() { - local source="$1" - warn_missing_arch=${2:-true} - if [ -r "$source" ]; then - # Copy the dSYM into the targets temp dir. - echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" - rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" - - local basename - basename="$(basename -s .dSYM "$source")" - binary_name="$(ls "$source/Contents/Resources/DWARF")" - binary="${DERIVED_FILES_DIR}/${basename}.dSYM/Contents/Resources/DWARF/${binary_name}" - - # Strip invalid architectures so "fat" simulator / device frameworks work on device - if [[ "$(file "$binary")" == *"Mach-O "*"dSYM companion"* ]]; then - strip_invalid_archs "$binary" "$warn_missing_arch" - fi - - if [[ $STRIP_BINARY_RETVAL == 1 ]]; then - # Move the stripped file into its final destination. - echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" - rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.dSYM" "${DWARF_DSYM_FOLDER_PATH}" - else - # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. - touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.dSYM" - fi - fi -} - -# Copies the bcsymbolmap files of a vendored framework -install_bcsymbolmap() { - local bcsymbolmap_path="$1" - local destination="${BUILT_PRODUCTS_DIR}" - echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}"" - rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}" -} - -# Signs a framework with the provided identity -code_sign_if_enabled() { - if [ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then - # Use the current code_sign_identity - echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" - local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" - - if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then - code_sign_cmd="$code_sign_cmd &" - fi - echo "$code_sign_cmd" - eval "$code_sign_cmd" - fi -} - -# Strip invalid architectures -strip_invalid_archs() { - binary="$1" - warn_missing_arch=${2:-true} - # Get architectures for current target binary - binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" - # Intersect them with the architectures we are building for - intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" - # If there are no archs supported by this binary then warn the user - if [[ -z "$intersected_archs" ]]; then - if [[ "$warn_missing_arch" == "true" ]]; then - echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." - fi - STRIP_BINARY_RETVAL=0 - return - fi - stripped="" - for arch in $binary_archs; do - if ! [[ "${ARCHS}" == *"$arch"* ]]; then - # Strip non-valid architectures in-place - lipo -remove "$arch" -output "$binary" "$binary" - stripped="$stripped $arch" - fi - done - if [[ "$stripped" ]]; then - echo "Stripped $binary of architectures:$stripped" - fi - STRIP_BINARY_RETVAL=1 -} - -install_artifact() { - artifact="$1" - base="$(basename "$artifact")" - case $base in - *.framework) - install_framework "$artifact" - ;; - *.dSYM) - # Suppress arch warnings since XCFrameworks will include many dSYM files - install_dsym "$artifact" "false" - ;; - *.bcsymbolmap) - install_bcsymbolmap "$artifact" - ;; - *) - echo "error: Unrecognized artifact "$artifact"" - ;; - esac -} - -copy_artifacts() { - file_list="$1" - while read artifact; do - install_artifact "$artifact" - done <$file_list -} - -ARTIFACT_LIST_FILE="${BUILT_PRODUCTS_DIR}/cocoapods-artifacts-${CONFIGURATION}.txt" -if [ -r "${ARTIFACT_LIST_FILE}" ]; then - copy_artifacts "${ARTIFACT_LIST_FILE}" -fi - -if [[ "$CONFIGURATION" == "Debug" ]]; then - install_framework "${BUILT_PRODUCTS_DIR}/MagicTimer/MagicTimer.framework" -fi -if [[ "$CONFIGURATION" == "Release" ]]; then - install_framework "${BUILT_PRODUCTS_DIR}/MagicTimer/MagicTimer.framework" -fi -if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then - wait -fi diff --git a/Example/Pods/Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example-umbrella.h b/Example/Pods/Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example-umbrella.h deleted file mode 100644 index 96225cc..0000000 --- a/Example/Pods/Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example-umbrella.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - - -FOUNDATION_EXPORT double Pods_MagicTimer_ExampleVersionNumber; -FOUNDATION_EXPORT const unsigned char Pods_MagicTimer_ExampleVersionString[]; - diff --git a/Example/Pods/Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example.debug.xcconfig b/Example/Pods/Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example.debug.xcconfig deleted file mode 100644 index be2f707..0000000 --- a/Example/Pods/Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example.debug.xcconfig +++ /dev/null @@ -1,12 +0,0 @@ -ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES -FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MagicTimer" -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MagicTimer/MagicTimer.framework/Headers" -LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' -OTHER_LDFLAGS = $(inherited) -framework "MagicTimer" -OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -PODS_BUILD_DIR = ${BUILD_DIR} -PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_PODFILE_DIR_PATH = ${SRCROOT}/. -PODS_ROOT = ${SRCROOT}/Pods -USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES diff --git a/Example/Pods/Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example.modulemap b/Example/Pods/Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example.modulemap deleted file mode 100644 index 152270b..0000000 --- a/Example/Pods/Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example.modulemap +++ /dev/null @@ -1,6 +0,0 @@ -framework module Pods_MagicTimer_Example { - umbrella header "Pods-MagicTimer_Example-umbrella.h" - - export * - module * { export * } -} diff --git a/Example/Pods/Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example.release.xcconfig b/Example/Pods/Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example.release.xcconfig deleted file mode 100644 index be2f707..0000000 --- a/Example/Pods/Target Support Files/Pods-MagicTimer_Example/Pods-MagicTimer_Example.release.xcconfig +++ /dev/null @@ -1,12 +0,0 @@ -ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES -FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MagicTimer" -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MagicTimer/MagicTimer.framework/Headers" -LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' -OTHER_LDFLAGS = $(inherited) -framework "MagicTimer" -OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -PODS_BUILD_DIR = ${BUILD_DIR} -PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_PODFILE_DIR_PATH = ${SRCROOT}/. -PODS_ROOT = ${SRCROOT}/Pods -USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES diff --git a/Example/Pods/Target Support Files/Pods-MagicTimer_Tests/Pods-MagicTimer_Tests-Info.plist b/Example/Pods/Target Support Files/Pods-MagicTimer_Tests/Pods-MagicTimer_Tests-Info.plist deleted file mode 100644 index 2243fe6..0000000 --- a/Example/Pods/Target Support Files/Pods-MagicTimer_Tests/Pods-MagicTimer_Tests-Info.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - ${PRODUCT_BUNDLE_IDENTIFIER} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0.0 - CFBundleSignature - ???? - CFBundleVersion - ${CURRENT_PROJECT_VERSION} - NSPrincipalClass - - - diff --git a/Example/Pods/Target Support Files/Pods-MagicTimer_Tests/Pods-MagicTimer_Tests-acknowledgements.markdown b/Example/Pods/Target Support Files/Pods-MagicTimer_Tests/Pods-MagicTimer_Tests-acknowledgements.markdown deleted file mode 100644 index 102af75..0000000 --- a/Example/Pods/Target Support Files/Pods-MagicTimer_Tests/Pods-MagicTimer_Tests-acknowledgements.markdown +++ /dev/null @@ -1,3 +0,0 @@ -# Acknowledgements -This application makes use of the following third party libraries: -Generated by CocoaPods - https://cocoapods.org diff --git a/Example/Pods/Target Support Files/Pods-MagicTimer_Tests/Pods-MagicTimer_Tests-acknowledgements.plist b/Example/Pods/Target Support Files/Pods-MagicTimer_Tests/Pods-MagicTimer_Tests-acknowledgements.plist deleted file mode 100644 index 7acbad1..0000000 --- a/Example/Pods/Target Support Files/Pods-MagicTimer_Tests/Pods-MagicTimer_Tests-acknowledgements.plist +++ /dev/null @@ -1,29 +0,0 @@ - - - - - PreferenceSpecifiers - - - FooterText - This application makes use of the following third party libraries: - Title - Acknowledgements - Type - PSGroupSpecifier - - - FooterText - Generated by CocoaPods - https://cocoapods.org - Title - - Type - PSGroupSpecifier - - - StringsTable - Acknowledgements - Title - Acknowledgements - - diff --git a/Example/Pods/Target Support Files/Pods-MagicTimer_Tests/Pods-MagicTimer_Tests-dummy.m b/Example/Pods/Target Support Files/Pods-MagicTimer_Tests/Pods-MagicTimer_Tests-dummy.m deleted file mode 100644 index 372fbb7..0000000 --- a/Example/Pods/Target Support Files/Pods-MagicTimer_Tests/Pods-MagicTimer_Tests-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_Pods_MagicTimer_Tests : NSObject -@end -@implementation PodsDummy_Pods_MagicTimer_Tests -@end diff --git a/Example/Pods/Target Support Files/Pods-MagicTimer_Tests/Pods-MagicTimer_Tests-umbrella.h b/Example/Pods/Target Support Files/Pods-MagicTimer_Tests/Pods-MagicTimer_Tests-umbrella.h deleted file mode 100644 index dc07996..0000000 --- a/Example/Pods/Target Support Files/Pods-MagicTimer_Tests/Pods-MagicTimer_Tests-umbrella.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - - -FOUNDATION_EXPORT double Pods_MagicTimer_TestsVersionNumber; -FOUNDATION_EXPORT const unsigned char Pods_MagicTimer_TestsVersionString[]; - diff --git a/Example/Pods/Target Support Files/Pods-MagicTimer_Tests/Pods-MagicTimer_Tests.debug.xcconfig b/Example/Pods/Target Support Files/Pods-MagicTimer_Tests/Pods-MagicTimer_Tests.debug.xcconfig deleted file mode 100644 index 159fca3..0000000 --- a/Example/Pods/Target Support Files/Pods-MagicTimer_Tests/Pods-MagicTimer_Tests.debug.xcconfig +++ /dev/null @@ -1,9 +0,0 @@ -FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MagicTimer" -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MagicTimer/MagicTimer.framework/Headers" -OTHER_LDFLAGS = $(inherited) -framework "MagicTimer" -PODS_BUILD_DIR = ${BUILD_DIR} -PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_PODFILE_DIR_PATH = ${SRCROOT}/. -PODS_ROOT = ${SRCROOT}/Pods -USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES diff --git a/Example/Pods/Target Support Files/Pods-MagicTimer_Tests/Pods-MagicTimer_Tests.modulemap b/Example/Pods/Target Support Files/Pods-MagicTimer_Tests/Pods-MagicTimer_Tests.modulemap deleted file mode 100644 index 88935c8..0000000 --- a/Example/Pods/Target Support Files/Pods-MagicTimer_Tests/Pods-MagicTimer_Tests.modulemap +++ /dev/null @@ -1,6 +0,0 @@ -framework module Pods_MagicTimer_Tests { - umbrella header "Pods-MagicTimer_Tests-umbrella.h" - - export * - module * { export * } -} diff --git a/Example/Pods/Target Support Files/Pods-MagicTimer_Tests/Pods-MagicTimer_Tests.release.xcconfig b/Example/Pods/Target Support Files/Pods-MagicTimer_Tests/Pods-MagicTimer_Tests.release.xcconfig deleted file mode 100644 index 159fca3..0000000 --- a/Example/Pods/Target Support Files/Pods-MagicTimer_Tests/Pods-MagicTimer_Tests.release.xcconfig +++ /dev/null @@ -1,9 +0,0 @@ -FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MagicTimer" -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MagicTimer/MagicTimer.framework/Headers" -OTHER_LDFLAGS = $(inherited) -framework "MagicTimer" -PODS_BUILD_DIR = ${BUILD_DIR} -PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_PODFILE_DIR_PATH = ${SRCROOT}/. -PODS_ROOT = ${SRCROOT}/Pods -USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES diff --git a/Example/Tests/Info.plist b/Example/Tests/Info.plist deleted file mode 100644 index ba72822..0000000 --- a/Example/Tests/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - - diff --git a/Example/Tests/Tests.swift b/Example/Tests/Tests.swift deleted file mode 100644 index 730831a..0000000 --- a/Example/Tests/Tests.swift +++ /dev/null @@ -1,27 +0,0 @@ -import XCTest - -class Tests: XCTestCase { - - override func setUp() { - super.setUp() - // Put setup code here. This method is called before the invocation of each test method in the class. - } - - override func tearDown() { - // Put teardown code here. This method is called after the invocation of each test method in the class. - super.tearDown() - } - - func testExample() { - // This is an example of a functional test case. - XCTAssert(true, "Pass") - } - - func testPerformanceExample() { - // This is an example of a performance test case. - self.measure() { - // Put the code you want to measure the time of here. - } - } - -} diff --git a/README.md b/README.md deleted file mode 100644 index d164752..0000000 --- a/README.md +++ /dev/null @@ -1,94 +0,0 @@ -# MagicTimer -![MagicTimer logo](https://user-images.githubusercontent.com/43542836/83555945-53b50780-a524-11ea-850e-d10b0839f63b.png) - -Welcome to the MagicTimer framework, your ultimate solution for handling timers in your iOS applications. This framework provides a powerful and flexible timer implementation with various features to meet your timer needs. - -## Features - -- **Easy-to-use**: MagicTimer offers a simple and intuitive API that allows you to effortlessly manage timers in your iOS apps. -- **Timer Modes**: Choose between two timer modes: Stopwatch and Countdown. Use the Stopwatch mode to measure elapsed time, or Countdown mode to count down from a specified time. -- **Event Handlers**: Take advantage of event handlers to respond to timer state changes and elapsed time updates. -- **Background Time Calculation**: Enable background time calculation to accurately track elapsed time even when the app is in the background. -- **Highly Configurable**: Customize timer properties such as time interval, default value, and effective value to fine-tune your timer behavior. - -## Why Use MagicTimer? - -- **Saves Development Time**: With MagicTimer, you can quickly integrate timer functionality into your app without spending excessive time on implementation. -- **Flexible Timer Modes**: Whether you need to measure elapsed time or create countdowns, MagicTimer has got you covered. -- **Smooth Background Time Calculation**: Ensure accurate time tracking, even when your app goes into the background. -- **Simplified Event Handling**: Leverage event handlers to handle timer state changes and elapsed time updates effortlessly. -- **Fully Customizable**: Adjust timer properties to match your app's specific requirements. - -## Getting Started - -To start using the MagicTimer framework in your iOS project, follow these simple steps: - -1. Install MagicTimer via Swift Package Manager or by manually adding the framework files to your project. -2. Import the MagicTimer module into your source code files. -3. Create an instance of `MagicTimer` and configure its properties as needed. -4. Set up event handlers to respond to timer state changes and elapsed time updates. -5. Start the timer using the `start()` method. -6. Enjoy the power and convenience of MagicTimer in your app! - -### Code Example - -```swift -import MagicTimer - -// Create an instance of MagicTimer -let timer = MagicTimer() - -// Configure the timer properties -timer.countMode = .stopWatch -timer.defultValue = 0 -timer.effectiveValue = 1 -timer.timeInterval = 1 -timer.isActiveInBackground = true - -// Set up event handlers -timer.lastStateDidChangeHandler = { state in - print("Timer state changed: \(state)") -} - -timer.elapsedTimeDidChangeHandler = { elapsedTime in - print("Elapsed time updated: \(elapsedTime)") -} - -// Start the timer -timer.start() -``` - -> **Note:** For detailed usage instructions and API documentation, please refer to the [MagicTimer Documentation](./docs/MagicTimer.md) file. - -## Requirements - -- iOS 11.0+ -- Swift 5.0+ - -## Installation - -### Swift Package Manager - -You can use Swift Package Manager to integrate MagicTimer into your Xcode project. Simply add the package dependency to your `Package.swift` file: - -```swift -dependencies: [ - .package(url: "https://github.com/your-username/MagicTimer.git", from: "1.0.0") -] -``` -### Manual Installation - -If you prefer manual installation, you can download the MagicTimer framework from the [GitHub repository](https://github.com/your-username/MagicTimer). After downloading, add the necessary files to your Xcode project. - -## Warning -⚠️ ```MagicTimerView``` is no longer available. Create your own UIView and connect ```MagicTimer``` to it. - -## Contribute - -We welcome contributions from the community to enhance the MagicTimer framework. If you encounter any issues or have ideas for improvements, please submit a pull request or open an issue on the [GitHub repository](https://github.com/your-username/MagicTimer). - -## License - -MagicTimer is released under the [MIT License](https://opensource.org/licenses/MIT). See the [LICENSE](./LICENSE) file for more details. - -This Markdown file provides an overview of the MagicTimer framework, highlights its features and benefits, guides developers on getting started, provides installation instructions, and encourages contributions. It also includes information on requirements, licensing, and ways to connect diff --git a/Sources/MagicTimer/Int+Extension.swift b/Sources/MagicTimer/Int+Extension.swift deleted file mode 100644 index 0d31a54..0000000 --- a/Sources/MagicTimer/Int+Extension.swift +++ /dev/null @@ -1,28 +0,0 @@ - -import Foundation - -extension Int { - /// Cast Int to TimeInterval - func convertToTimeInterval() -> TimeInterval { - return TimeInterval(self) - } - /// Cast Int to String - func convertToString() -> String { - return String(self) - } - -} - -extension Double { - /// Check the number is positive(bigger than zero) - var isPositive: Bool { - get { - return self>0 - } - } - /// Cast Double to TimeInterval - func convertToTimeInterval() -> TimeInterval { - - return TimeInterval(self) - } -} diff --git a/Sources/MagicTimer/MGBackgroundCalculator.swift b/Sources/MagicTimer/MGBackgroundCalculator.swift deleted file mode 100644 index 233945b..0000000 --- a/Sources/MagicTimer/MGBackgroundCalculator.swift +++ /dev/null @@ -1,75 +0,0 @@ - -import Foundation -import UIKit - -/// A type that every calculable object must conform -protocol MGBackgroundCalculableBehavior: MGObservebaleTimeInterval { - /// The timer firing date - var timerFiredDate: Date? { get } - /// A Boolean value that determines whether the is background mode active - var isActiveBackgroundMode: Bool { get set } - /// Calculate time diffrence between two date - func calculateDateDiffrence() -> TimeInterval? - /// Set timer firing date - func setTimeFiredDate(_ value: Date) - /// Current state of timer - var state: MagicTimerState { get set } -} - -class MGBackgroundCalculator: MGBackgroundCalculableBehavior, MGLogable { - - public var timerFiredDate: Date? - public var isActiveBackgroundMode: Bool = false - public var observe: ((TimeInterval) -> Void)? - var isFirstForegroundNotification: Bool = true - public var state: MagicTimerState = .none - - init() { - - NotificationCenter.default.addObserver(self, selector: #selector(willEnterForegroundNotification), name: UIApplication.willEnterForegroundNotification, object: nil) - - log(message: "initialized") - } - - @objc private func willEnterForegroundNotification() { - /// Check if background mode is activated - guard isActiveBackgroundMode else { return } - - if state == .fired { - /// Calculate time diffrence between two date - if let timeInterval = calculateDateDiffrence() { - observe!(timeInterval) - - } - log(message: "background time calculation completed") - } - - - - - } - - /// Set nil value to timerFiredDate - func invalidateFiredDate() { - timerFiredDate = nil - } - /// Calculate time diffrence between two date - public func calculateDateDiffrence() -> TimeInterval? { - guard timerFiredDate != nil else { return nil } - let validTimeSubtraction = abs(timerFiredDate! - Date()) - return validTimeSubtraction.convertToTimeInterval() - - } - /// Set timer firing date - public func setTimeFiredDate(_ value: Date) { - self.timerFiredDate = value - } -} - -extension Date { - - static func - (lhs: Date, rhs: Date) -> TimeInterval { - return lhs.timeIntervalSinceReferenceDate - rhs.timeIntervalSinceReferenceDate - } - -} diff --git a/Sources/MagicTimer/MGCounter.swift b/Sources/MagicTimer/MGCounter.swift deleted file mode 100644 index 44978fc..0000000 --- a/Sources/MagicTimer/MGCounter.swift +++ /dev/null @@ -1,66 +0,0 @@ - -import Foundation - -/// A type that represent counter behavior -protocol MGCounterBehavior { - /// The total counted vlaue - var totalCountedValue: TimeInterval { get } - /// The value that affect to totalCountedValue - var effectiveValue: TimeInterval { get } - /// The initial value of counter - var defultValue: TimeInterval { get } - /// Add effectiveValue to totalCountedValue - func add() - /// Subtract effectiveValue from totalCountedValue - func subtract() - /// Reset totalCountedValue to zero - func resetTotalCounted() - /// Set Value to totalCountedValue - func setTotalCountedValue(_ value: TimeInterval) - /// Set value to effectiveValue - func setEffectiveValue(_ value: TimeInterval) - /// Set value to defultValue - func setDefaultValue(_ value: TimeInterval) - /// Reset totalCountedValue to defultValue - func resetToDefaultValue() -} - -class MGCounter: MGCounterBehavior, MGLogable { - - var totalCountedValue: TimeInterval = 0 - var effectiveValue: TimeInterval = 1.0 - var defultValue: TimeInterval = 0.0 { - willSet { - totalCountedValue += newValue - } - } - - func add() { - totalCountedValue += effectiveValue - } - - func subtract() { - totalCountedValue -= effectiveValue - } - - func resetTotalCounted() { - totalCountedValue = 0 - } - - func setTotalCountedValue(_ value: TimeInterval) { - self.totalCountedValue = value - } - - func setEffectiveValue(_ value: TimeInterval) { - self.effectiveValue = value - } - - func setDefaultValue(_ value: TimeInterval) { - self.defultValue = value - } - - func resetToDefaultValue() { - totalCountedValue = defultValue - } -} - diff --git a/Sources/MagicTimer/MGLogable.swift b/Sources/MagicTimer/MGLogable.swift deleted file mode 100644 index 144e2db..0000000 --- a/Sources/MagicTimer/MGLogable.swift +++ /dev/null @@ -1,14 +0,0 @@ - - -import Foundation - -/// A type that make easy logging -protocol MGLogable { - func log(message: String) -} - -extension MGLogable { - func log(message: String) { - NSLog("\(Self.self): \(message)") - } -} diff --git a/Sources/MagicTimer/MGObservable.swift b/Sources/MagicTimer/MGObservable.swift deleted file mode 100644 index ffe11bd..0000000 --- a/Sources/MagicTimer/MGObservable.swift +++ /dev/null @@ -1,12 +0,0 @@ - -import Foundation - -/// A type that can observe a closure. -protocol MGObservableBehavior { - var observeValue: (() -> Void)? { get set } -} -/// A type that can observe time interval in closure. -protocol MGObservebaleTimeInterval { - var observe: ((TimeInterval) -> Void)? { get set } - -} diff --git a/Sources/MagicTimer/MGStandardTimerFormatter.swift b/Sources/MagicTimer/MGStandardTimerFormatter.swift deleted file mode 100644 index 8e6213c..0000000 --- a/Sources/MagicTimer/MGStandardTimerFormatter.swift +++ /dev/null @@ -1,46 +0,0 @@ - -import Foundation - -/// A type that any date formatter should conform -public protocol MGTimeFormatter { - /// Convert time interval to String format - /// - Parameter ti: elapsed time - func converToValidFormat(ti: TimeInterval) -> String? -} - -/// A type that contains time unit -enum MGTimeUnit: Int { - /// A hour in seconds. - case hour = 3600 - /// A minute in seconds. - case minute = 60 - /// A milliSeconds in seconds. - case milliSeconds = 1000 -} - -class MGStandardTimerFormatter: DateComponentsFormatter, MGTimeFormatter { - - override init() { - super.init() - unitsStyle = .positional - zeroFormattingBehavior = .pad - } - - required init?(coder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - - func converToValidFormat(ti: TimeInterval) -> String? { - switch ti { - case let x where Int(x) >= MGTimeUnit.hour.rawValue: - allowedUnits = [.hour, .minute, .second] - case let x where Int(x) <= MGTimeUnit.hour.rawValue: - allowedUnits = [.minute, .second] - default: - break - } - return super.string(from: ti) - } -} - diff --git a/Sources/MagicTimer/MGStateManager.swift b/Sources/MagicTimer/MGStateManager.swift deleted file mode 100644 index 19a5ae8..0000000 --- a/Sources/MagicTimer/MGStateManager.swift +++ /dev/null @@ -1,19 +0,0 @@ - -import Foundation - -///// A type that save state. -@available(*, deprecated, message: "MGStateManager is no longer available. Use MagicTimerState insted ") -public class MGStateManager { - /// Shared instance for managing state. - static let shared: MGStateManager = .init() - /// Kind of possible timer state - public enum TimerState { - case fired - case stopped - case restarted - case none - } - /// The current state of timer. Default is none - public var currentTimerState: TimerState = .none - -} diff --git a/Sources/MagicTimer/MGTimerExecutive.swift b/Sources/MagicTimer/MGTimerExecutive.swift deleted file mode 100644 index 83aef9e..0000000 --- a/Sources/MagicTimer/MGTimerExecutive.swift +++ /dev/null @@ -1,62 +0,0 @@ - - -import Foundation - -protocol MGExecutiveTimerBehavior { - /// A core timer of module. - var scheduleTimer: Timer? { get } - /// The timer time interval. - var timeInerval: TimeInterval { get } - /// Create sheduleTImer and observe element in each timeInerval. - func start(compeltion: (() -> Void)?) - /// Invalidate the core timer. - func suspand() - /// Set value to timeInerval. - /// - Parameter value: time - func setTimeInterval(_ value: TimeInterval) - /// Current state of timer - var state: MagicTimerState { get set } -} -/// A Observebale type that have timer managing behavior -protocol MGObservableTimerBehavior: MGExecutiveTimerBehavior, MGObservableBehavior { - -} -/** - A type that manage core timer. For example starting or suspanding. - */ -class MGTimerExecutive: MGObservableTimerBehavior, MGLogable { - - - var observeValue: (() -> Void)? - var scheduleTimer: Timer? - var timeInerval: TimeInterval = 1.0 - var state: MagicTimerState = .none - - func start(compeltion: (() -> Void)?) { - // Check if timer is not fired - guard state != .fired else { return } - // Create instane of timer and assign to scheduleTimer - scheduleTimer = Timer.scheduledTimer(withTimeInterval: timeInerval, repeats: true, block: { [weak self] _ in - // Observe value every defined time interval - self?.observeValue!() - - }) - state = .fired - // Add timer to custom Runloop - RunLoop.main.add(scheduleTimer!, forMode: .common) - - guard compeltion != nil else { return } - compeltion!() - } - - func suspand() { - // Invalidate core timer - scheduleTimer?.invalidate() - state = .stopped - } - - func setTimeInterval(_ value: TimeInterval) { - self.timeInerval = value - } - -} diff --git a/Sources/MagicTimer/MagicTimerView.swift b/Sources/MagicTimer/MagicTimerView.swift deleted file mode 100644 index a2a80b0..0000000 --- a/Sources/MagicTimer/MagicTimerView.swift +++ /dev/null @@ -1,306 +0,0 @@ -import Foundation -import UIKit - -/** - An object that displays a countdown or count-up timer. - - Use a timer object to configure the amount of time and the appearance of the timer text. - When you start the timer, Magic timer updates the displayed text automatically on the user’s - device without further interactions from your extension. - */ - -@IBDesignable -open class MagicTimerView: UIView { - - /// Timer broker that bridge between timer logic and view. - private var broker: MagicTimer = .init() - /// Formatter that format time interval to string. - public var formatter: MGTimeFormatter = MGStandardTimerFormatter() - /// Elappsed time of timer. - private(set) var elapsedTime: TimeInterval? - - public weak var delegate: MagicTimerViewDelegate? - - /// The current state of the timer. - public var currentState: MagicTimerState { - return broker.currentState - } - /// Timer state callback - public var didStateChange: ((MagicTimerState) -> Void)? - - /// The color of the timer label. - @IBInspectable public var textColor: UIColor! { - willSet { - timerLabel.textColor = newValue - } - } - - /// Font size of timer label. just available in interface builder. Default value is 18. - @available(*, unavailable, message: "Just available in interface builder") - @IBInspectable var fontSize: CGFloat = 18 { - willSet { - timerLabel.font = timerLabel.font.withSize(newValue) - } - } - - /// The radius to use when drawing rounded corners for the timer view background. Default is 0.0. - @IBInspectable public var cornerRadius: CGFloat = 0.0 { - willSet { - layer.cornerRadius = newValue - } - } - /// The color of the border. Default is clear. - @IBInspectable public var borderColor: UIColor = .clear { - willSet { - layer.borderColor = newValue.cgColor - } - } - /// The width of the border. Default is 0.0. - @IBInspectable public var borderWidth: CGFloat = 0.0 { - willSet { - layer.borderWidth = newValue - } - } - - /// The Start color of the gradient. The default is nil. - @IBInspectable public var gradeintStartColor: UIColor? { - didSet { - updateGradient() - } - } - /// The end color of the gradient. The default is nil. - @IBInspectable public var gradeintEndColor: UIColor? { - didSet { - updateGradient() - } - } - /// The angle of the gradient. The default is 270 degrees. - @IBInspectable public var gradeintAngle: CGFloat = 270 { - didSet { - updateGradient() - } - } - /// Background image of the timer. Default is nil. - public var backgroundImage: UIImage? { - willSet { - let isHidden = newValue != nil ? false: true - backgrounImageView.isHidden = isHidden - backgrounImageView.image = newValue - } - } - /// A value that affects to counting. Default is 1. - @IBInspectable public var effectiveValue: Int = 1 { - willSet { - let validTimeInterval = newValue.convertToTimeInterval() - broker.effectiveValue = validTimeInterval - } - } - /// An interval that affects to observing time. Default is 1. - @IBInspectable public var timeInterval: Int = 1 { - willSet { - let validTImeInterval = newValue.convertToTimeInterval() - broker.timeInterval = validTImeInterval - } - } - /// The default value of the timer. The initial value is 0. - @IBInspectable public var defaultValue: Int = 0 { - willSet { - broker.defultValue = newValue.convertToTimeInterval() - let validTimeInterval = newValue.convertToTimeInterval() - timerLabel.text = formatter.converToValidFormat(ti: validTimeInterval) - } - } - - /// A Boolean value that determines whether the calculation of timer active in background. - @IBInspectable public var isActiveInBackground: Bool = false { - willSet { - broker.isActiveInBackground = newValue - } - } - /// The font used to display the timer label text. - public var font: UIFont? { - willSet { - timerLabel.font = newValue?.monospacedDigitFont - } - } - /// The mode of the timer. default is stop watch. - public var mode: MGCountMode = .stopWatch { - willSet { - broker.countMode = newValue - } - } - - private lazy var timerLabel: UILabel = { - let label = UILabel() - label.textColor = .systemBlue - label.textAlignment = .center - label.font = UIFont.systemFont(ofSize: 18).monospacedDigitFont - label.translatesAutoresizingMaskIntoConstraints = false - return label - }() - - private lazy var backgrounImageView: UIImageView = { - let imageView = UIImageView() - imageView.isHidden = true - imageView.contentMode = .scaleAspectFill - imageView.translatesAutoresizingMaskIntoConstraints = false - return imageView - }() - - public override init(frame: CGRect) { - super.init(frame: frame) - - initialSubView() - setConstraint() - observeTime() - setInitialValue() - } - - public required init?(coder: NSCoder) { - super.init(coder: coder) - - initialSubView() - setConstraint() - observeTime() - setInitialValue() - - } - /// Set inital value to interface object. Called when interface is initialized. - private func setInitialValue() { - timerLabel.text = formatter.converToValidFormat(ti: 0) - - } - /// Called when interface is initialized. Override this method for conforming delegate. - func observeTime() { - broker.observeElapsedTime = { timeInterval in - self.elapsedTime = timeInterval - DispatchQueue.main.async { - self.timerLabel.text = self.formatter.converToValidFormat(ti: timeInterval) - self.delegate?.timerElapsedTimeDidChange(timer: self, elapsedTime: timeInterval) - } - } - } - - public override class var layerClass: AnyClass { - return CAGradientLayer.self - } - - public override func layoutSubviews() { - (layer as! CAGradientLayer).colors = [gradeintStartColor?.cgColor ?? UIColor.clear.cgColor, gradeintEndColor?.cgColor ?? UIColor.clear.cgColor] - (layer as! CAGradientLayer).cornerRadius = cornerRadius - } - - private func updateGradient() { - let grLayer = layer as? CAGradientLayer - if let gradient = grLayer { - let startColor = self.gradeintStartColor ?? UIColor.clear - let endColor = self.gradeintEndColor ?? UIColor.clear - gradient.colors = [startColor.cgColor, endColor.cgColor] - let (start, end) = gradientPointsForAngle(self.gradeintAngle) - gradient.startPoint = start - gradient.endPoint = end - } - } - - private func gradientPointsForAngle(_ angle: CGFloat) -> (CGPoint, CGPoint) { - // get vector start and end points - let end = pointForAngle(angle) - //let start = pointForAngle(angle+180.0) - let start = oppositePoint(end) - // convert to gradient space - let p0 = transformToGradientSpace(start) - let p1 = transformToGradientSpace(end) - return (p0, p1) - } - - // get a point corresponding to the angle - private func pointForAngle(_ angle: CGFloat) -> CGPoint { - // convert degrees to radians - let radians = angle * .pi / 180.0 - var x = cos(radians) - var y = sin(radians) - // (x,y) is in terms unit circle. Extrapolate to unit square to get full vector length - if (abs(x) > abs(y)) { - // extrapolate x to unit length - x = x > 0 ? 1 : -1 - y = x * tan(radians) - } else { - // extrapolate y to unit length - y = y > 0 ? 1 : -1 - x = y / tan(radians) - } - return CGPoint(x: x, y: y) - } - - // transform point in unit space to gradient space - private func transformToGradientSpace(_ point: CGPoint) -> CGPoint { - // input point is in signed unit space: (-1,-1) to (1,1) - // convert to gradient space: (0,0) to (1,1), with flipped Y axis - return CGPoint(x: (point.x + 1) * 0.5, y: 1.0 - (point.y + 1) * 0.5) - } - - // return the opposite point in the signed unit square - private func oppositePoint(_ point: CGPoint) -> CGPoint { - return CGPoint(x: -point.x, y: -point.y) - } - - /// Begins updates to the timer’s display. - public func startCounting() { - broker.start() - didStateChange?(.fired) - } - - /// Stops updates to the timer’s display. - public func stopCounting() { - broker.stop() - didStateChange?(.stopped) - - } - - /// Reset timer to zero. - public func reset() { - timerLabel.text = formatter.converToValidFormat(ti: 0) - broker.reset() - didStateChange?(.restarted) - } - /// Reset timer to the default value. - public func resetToDefault() { - timerLabel.text = formatter.converToValidFormat(ti: broker.defultValue) - broker.resetToDefault() - didStateChange?(.restarted) - } - -} - -extension MagicTimerView: StandardConstraintableView { - - /// Set constraint of any element in object. Called in init after initialSubView method. - func setConstraint() { - - let timerLabelConstraint: [NSLayoutConstraint] = [ - timerLabel.topAnchor.constraint(equalTo: topAnchor), - timerLabel.leadingAnchor.constraint(equalTo: leadingAnchor), - timerLabel.bottomAnchor.constraint(equalTo: bottomAnchor), - timerLabel.trailingAnchor.constraint(equalTo: trailingAnchor) - ] - let imageViewConstrinat: [NSLayoutConstraint] = [ - backgrounImageView.topAnchor.constraint(equalTo: topAnchor), - backgrounImageView.leadingAnchor.constraint(equalTo: leadingAnchor), - backgrounImageView.trailingAnchor.constraint(equalTo: trailingAnchor), - backgrounImageView.bottomAnchor.constraint(equalTo: bottomAnchor) - ] - - NSLayoutConstraint.activate(imageViewConstrinat) - NSLayoutConstraint.activate(timerLabelConstraint) - } - - /// Add subview of any element in object. Called in init before setConstraint method. - func initialSubView() { - addSubview(backgrounImageView) - addSubview(timerLabel) - } - -} - - - diff --git a/Sources/MagicTimer/MagicTimerViewDelegate.swift b/Sources/MagicTimer/MagicTimerViewDelegate.swift deleted file mode 100644 index 987beb4..0000000 --- a/Sources/MagicTimer/MagicTimerViewDelegate.swift +++ /dev/null @@ -1,15 +0,0 @@ - - -import Foundation - -/// Methods for get information from MagicInterfaceTimer. -public protocol MagicTimerViewDelegate: AnyObject { - func timerElapsedTimeDidChange(timer: MagicTimerView, elapsedTime: TimeInterval) -} - -public extension MagicTimerViewDelegate { - - func timerElapsedTimeDidChange(timer: MagicTimerView, elapsedTime: TimeInterval) { - - } -} diff --git a/Sources/MagicTimer/TimeInterval+Extesnion.swift b/Sources/MagicTimer/TimeInterval+Extesnion.swift deleted file mode 100644 index 24e6868..0000000 --- a/Sources/MagicTimer/TimeInterval+Extesnion.swift +++ /dev/null @@ -1,14 +0,0 @@ - - -import Foundation - -extension TimeInterval { - /// Cast TimeInterval to Int. - func convertToInteger() -> Int { - return Int(self) - } - /// Cast TimeInterval to String. - func convertToString() -> String { - return String(self) - } -} diff --git a/Sources/MagicTimer/UIFont+Extension.swift b/Sources/MagicTimer/UIFont+Extension.swift deleted file mode 100644 index a7414b8..0000000 --- a/Sources/MagicTimer/UIFont+Extension.swift +++ /dev/null @@ -1,23 +0,0 @@ - -import Foundation -import UIKit - -extension UIFont { - - var monospacedDigitFont: UIFont { - let oldFontDescriptor = fontDescriptor - let newFontDescriptor = oldFontDescriptor.monospacedDigitFontDescriptor - return UIFont(descriptor: newFontDescriptor, size: 0) - } - -} - -private extension UIFontDescriptor { - - var monospacedDigitFontDescriptor: UIFontDescriptor { - let fontDescriptorFeatureSettings = [[UIFontDescriptor.FeatureKey.featureIdentifier: kNumberSpacingType, UIFontDescriptor.FeatureKey.typeIdentifier: kMonospacedNumbersSelector]] - let fontDescriptorAttributes = [UIFontDescriptor.AttributeName.featureSettings: fontDescriptorFeatureSettings] - let fontDescriptor = self.addingAttributes(fontDescriptorAttributes) - return fontDescriptor - } -} diff --git a/_Pods.xcodeproj b/_Pods.xcodeproj deleted file mode 120000 index 3c5a8e7..0000000 --- a/_Pods.xcodeproj +++ /dev/null @@ -1 +0,0 @@ -Example/Pods/Pods.xcodeproj \ No newline at end of file From 9a9b7b70d5e85ac160aad33817567f0aef6de523 Mon Sep 17 00:00:00 2001 From: Sadeq Bitarafan <43542836+sadeghgoo@users.noreply.github.com> Date: Sun, 2 Jul 2023 23:03:40 +0330 Subject: [PATCH 24/37] Create README.md --- README.md | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..d164752 --- /dev/null +++ b/README.md @@ -0,0 +1,94 @@ +# MagicTimer +![MagicTimer logo](https://user-images.githubusercontent.com/43542836/83555945-53b50780-a524-11ea-850e-d10b0839f63b.png) + +Welcome to the MagicTimer framework, your ultimate solution for handling timers in your iOS applications. This framework provides a powerful and flexible timer implementation with various features to meet your timer needs. + +## Features + +- **Easy-to-use**: MagicTimer offers a simple and intuitive API that allows you to effortlessly manage timers in your iOS apps. +- **Timer Modes**: Choose between two timer modes: Stopwatch and Countdown. Use the Stopwatch mode to measure elapsed time, or Countdown mode to count down from a specified time. +- **Event Handlers**: Take advantage of event handlers to respond to timer state changes and elapsed time updates. +- **Background Time Calculation**: Enable background time calculation to accurately track elapsed time even when the app is in the background. +- **Highly Configurable**: Customize timer properties such as time interval, default value, and effective value to fine-tune your timer behavior. + +## Why Use MagicTimer? + +- **Saves Development Time**: With MagicTimer, you can quickly integrate timer functionality into your app without spending excessive time on implementation. +- **Flexible Timer Modes**: Whether you need to measure elapsed time or create countdowns, MagicTimer has got you covered. +- **Smooth Background Time Calculation**: Ensure accurate time tracking, even when your app goes into the background. +- **Simplified Event Handling**: Leverage event handlers to handle timer state changes and elapsed time updates effortlessly. +- **Fully Customizable**: Adjust timer properties to match your app's specific requirements. + +## Getting Started + +To start using the MagicTimer framework in your iOS project, follow these simple steps: + +1. Install MagicTimer via Swift Package Manager or by manually adding the framework files to your project. +2. Import the MagicTimer module into your source code files. +3. Create an instance of `MagicTimer` and configure its properties as needed. +4. Set up event handlers to respond to timer state changes and elapsed time updates. +5. Start the timer using the `start()` method. +6. Enjoy the power and convenience of MagicTimer in your app! + +### Code Example + +```swift +import MagicTimer + +// Create an instance of MagicTimer +let timer = MagicTimer() + +// Configure the timer properties +timer.countMode = .stopWatch +timer.defultValue = 0 +timer.effectiveValue = 1 +timer.timeInterval = 1 +timer.isActiveInBackground = true + +// Set up event handlers +timer.lastStateDidChangeHandler = { state in + print("Timer state changed: \(state)") +} + +timer.elapsedTimeDidChangeHandler = { elapsedTime in + print("Elapsed time updated: \(elapsedTime)") +} + +// Start the timer +timer.start() +``` + +> **Note:** For detailed usage instructions and API documentation, please refer to the [MagicTimer Documentation](./docs/MagicTimer.md) file. + +## Requirements + +- iOS 11.0+ +- Swift 5.0+ + +## Installation + +### Swift Package Manager + +You can use Swift Package Manager to integrate MagicTimer into your Xcode project. Simply add the package dependency to your `Package.swift` file: + +```swift +dependencies: [ + .package(url: "https://github.com/your-username/MagicTimer.git", from: "1.0.0") +] +``` +### Manual Installation + +If you prefer manual installation, you can download the MagicTimer framework from the [GitHub repository](https://github.com/your-username/MagicTimer). After downloading, add the necessary files to your Xcode project. + +## Warning +⚠️ ```MagicTimerView``` is no longer available. Create your own UIView and connect ```MagicTimer``` to it. + +## Contribute + +We welcome contributions from the community to enhance the MagicTimer framework. If you encounter any issues or have ideas for improvements, please submit a pull request or open an issue on the [GitHub repository](https://github.com/your-username/MagicTimer). + +## License + +MagicTimer is released under the [MIT License](https://opensource.org/licenses/MIT). See the [LICENSE](./LICENSE) file for more details. + +This Markdown file provides an overview of the MagicTimer framework, highlights its features and benefits, guides developers on getting started, provides installation instructions, and encourages contributions. It also includes information on requirements, licensing, and ways to connect From 67eb531b58b1f95cfb5fc4dde1b17c1c6789e99a Mon Sep 17 00:00:00 2001 From: sadeghgoo Date: Sun, 2 Jul 2023 23:04:50 +0330 Subject: [PATCH 25/37] travis file has been removed. --- .travis.yml | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0771a44..0000000 --- a/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -# references: -# * https://www.objc.io/issues/6-build-tools/travis-ci/ -# * https://github.com/supermarin/xcpretty#usage - -osx_image: xcode7.3 -language: objective-c -# cache: cocoapods -# podfile: Example/Podfile -# before_install: -# - gem install cocoapods # Since Travis is not always on latest version -# - pod install --project-directory=Example -script: -- set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/MagicTimer.xcworkspace -scheme MagicTimer-Example -sdk iphonesimulator9.3 ONLY_ACTIVE_ARCH=NO | xcpretty -- pod lib lint From bfb035846c912087445289c0e2a2e6228c966c61 Mon Sep 17 00:00:00 2001 From: Sadeq Bitarafan <43542836+sadeghgoo@users.noreply.github.com> Date: Tue, 4 Jul 2023 12:15:11 +0330 Subject: [PATCH 26/37] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d164752..0ed8b92 100644 --- a/README.md +++ b/README.md @@ -73,19 +73,19 @@ You can use Swift Package Manager to integrate MagicTimer into your Xcode projec ```swift dependencies: [ - .package(url: "https://github.com/your-username/MagicTimer.git", from: "1.0.0") + .package(url: "https://github.com/MagicTimerFW/MagicTimer", from: "2.0.1") ] ``` ### Manual Installation -If you prefer manual installation, you can download the MagicTimer framework from the [GitHub repository](https://github.com/your-username/MagicTimer). After downloading, add the necessary files to your Xcode project. +If you prefer manual installation, you can download the MagicTimer framework from the [GitHub repository](https://github.com/MagicTimerFW/MagicTimer). After downloading, add the necessary files to your Xcode project. ## Warning ⚠️ ```MagicTimerView``` is no longer available. Create your own UIView and connect ```MagicTimer``` to it. ## Contribute -We welcome contributions from the community to enhance the MagicTimer framework. If you encounter any issues or have ideas for improvements, please submit a pull request or open an issue on the [GitHub repository](https://github.com/your-username/MagicTimer). +We welcome contributions from the community to enhance the MagicTimer framework. If you encounter any issues or have ideas for improvements, please submit a pull request or open an issue on the [GitHub repository](https://github.com/MagicTimerFW/MagicTimer). ## License From cdc7c923a4568c6fe9feabae90372773e71b26db Mon Sep 17 00:00:00 2001 From: sadeghgoo Date: Thu, 13 Jul 2023 10:09:26 +0330 Subject: [PATCH 27/37] MagicTimerCore version has been specified. --- Package.resolved | 34 ---------------------------------- Package.swift | 6 ++---- 2 files changed, 2 insertions(+), 38 deletions(-) delete mode 100644 Package.resolved diff --git a/Package.resolved b/Package.resolved deleted file mode 100644 index 2b5879e..0000000 --- a/Package.resolved +++ /dev/null @@ -1,34 +0,0 @@ -{ - "object": { - "pins": [ - { - "package": "MagicTimerCommon", - "repositoryURL": "https://github.com/MagicTimerFW/MagicTimerCommon.git", - "state": { - "branch": "main", - "revision": "fb03ac56dba62017a5fefea3552b0e8c045b1f37", - "version": null - } - }, - { - "package": "MagicTimerCore", - "repositoryURL": "https://github.com/MagicTimerFW/MagicTimerCore", - "state": { - "branch": "main", - "revision": "a35ccad1b686bb28251fd6fd64ed178d3d8b6f3d", - "version": null - } - }, - { - "package": "MathOperators", - "repositoryURL": "https://github.com/sadeghgoo/MathOperators.git", - "state": { - "branch": "main", - "revision": "1bedb10d9a5914040606ca1b26d9c44a21fb19a6", - "version": null - } - } - ] - }, - "version": 1 -} diff --git a/Package.swift b/Package.swift index a1f3af9..fdc717e 100644 --- a/Package.swift +++ b/Package.swift @@ -12,9 +12,7 @@ let package = Package( targets: ["MagicTimer"]), ], dependencies: [ - .package( - name: "MagicTimerCore", - url: "https://github.com/MagicTimerFW/MagicTimerCore", branch: "main") + .package(url: "https://github.com/MagicTimerFW/MagicTimerCore", from: "1.0.0") ], targets: [ .target( @@ -22,7 +20,7 @@ let package = Package( dependencies: [ .product( name: "MagicTimerCore", - package: "MagicTimerCore") + package: "MagicTimerCore"), ]), .testTarget( name: "MagicTimerTests", From 922c4a210a059210548f82d6c8b3bf0a6fa47521 Mon Sep 17 00:00:00 2001 From: sadeghgoo Date: Thu, 13 Jul 2023 10:30:43 +0330 Subject: [PATCH 28/37] Version has been downgraded to 2.0.0 --- MagicTimer.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MagicTimer.podspec b/MagicTimer.podspec index 21df599..f6abf30 100644 --- a/MagicTimer.podspec +++ b/MagicTimer.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'MagicTimer' - s.version = '2.0.1' + s.version = '2.0.0' s.summary = 'MagicTimer framework, your ultimate solution for handling timers in your iOS applications. This framework provides a powerful and flexible timer implementation with various features to meet your timer needs.' s.homepage = 'https://github.com/MagicTimerFW/MagicTimer' From 1373e14ddb1ed1844dbb83d285ad8ea36ecdd43e Mon Sep 17 00:00:00 2001 From: sadeghgoo Date: Thu, 13 Jul 2023 11:07:16 +0330 Subject: [PATCH 29/37] Podspec version has been updated. --- MagicTimer.podspec | 4 ++-- Package.resolved | 34 ++++++++++++++++++++++++++++++++++ Package.swift | 2 +- 3 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 Package.resolved diff --git a/MagicTimer.podspec b/MagicTimer.podspec index f6abf30..43033ca 100644 --- a/MagicTimer.podspec +++ b/MagicTimer.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'MagicTimer' - s.version = '2.0.0' + s.version = '2.0.1' s.summary = 'MagicTimer framework, your ultimate solution for handling timers in your iOS applications. This framework provides a powerful and flexible timer implementation with various features to meet your timer needs.' s.homepage = 'https://github.com/MagicTimerFW/MagicTimer' @@ -13,4 +13,4 @@ Pod::Spec.new do |s| s.source_files = 'Sources/**/*' s.frameworks = 'Foundation' s.dependency 'MagicTimerCore' -end \ No newline at end of file +end diff --git a/Package.resolved b/Package.resolved new file mode 100644 index 0000000..ec5144a --- /dev/null +++ b/Package.resolved @@ -0,0 +1,34 @@ +{ + "object": { + "pins": [ + { + "package": "MagicTimerCommon", + "repositoryURL": "https://github.com/MagicTimerFW/MagicTimerCommon.git", + "state": { + "branch": "main", + "revision": "26d4544ff36655b4666de138041a1187605e8971", + "version": null + } + }, + { + "package": "MagicTimerCore", + "repositoryURL": "https://github.com/MagicTimerFW/MagicTimerCore", + "state": { + "branch": "1.0.0", + "revision": "b73e495db4bfb19c49aadf948748f84ce678ad07", + "version": null + } + }, + { + "package": "MathOperators", + "repositoryURL": "https://github.com/sadeghgoo/MathOperators.git", + "state": { + "branch": "main", + "revision": "1bedb10d9a5914040606ca1b26d9c44a21fb19a6", + "version": null + } + } + ] + }, + "version": 1 +} diff --git a/Package.swift b/Package.swift index fdc717e..cedc40e 100644 --- a/Package.swift +++ b/Package.swift @@ -12,7 +12,7 @@ let package = Package( targets: ["MagicTimer"]), ], dependencies: [ - .package(url: "https://github.com/MagicTimerFW/MagicTimerCore", from: "1.0.0") + .package(url: "https://github.com/MagicTimerFW/MagicTimerCore", revision: "1.0.0") ], targets: [ .target( From 695b80ebca434da9cbcb017e1135d73e57d844b2 Mon Sep 17 00:00:00 2001 From: sadeghgoo Date: Sun, 2 Jul 2023 22:59:17 +0330 Subject: [PATCH 30/37] Useless files have been removed. Create README.md travis file has been removed. Update README.md MagicTimerCore version has been specified. Version has been downgraded to 2.0.0 Podspec version has been updated. Package has been updated. --- Package.resolved | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Package.resolved b/Package.resolved index ec5144a..bfb39e7 100644 --- a/Package.resolved +++ b/Package.resolved @@ -5,7 +5,7 @@ "package": "MagicTimerCommon", "repositoryURL": "https://github.com/MagicTimerFW/MagicTimerCommon.git", "state": { - "branch": "main", + "branch": "1.0.0", "revision": "26d4544ff36655b4666de138041a1187605e8971", "version": null } @@ -15,7 +15,7 @@ "repositoryURL": "https://github.com/MagicTimerFW/MagicTimerCore", "state": { "branch": "1.0.0", - "revision": "b73e495db4bfb19c49aadf948748f84ce678ad07", + "revision": "ad356988b5cfd45930586c7d8916f9e579ebd91e", "version": null } }, From 1c95448bbc2acd7525234e06fdce307f5fa5604b Mon Sep 17 00:00:00 2001 From: sadeghgoo Date: Sun, 2 Jul 2023 22:59:17 +0330 Subject: [PATCH 31/37] Useless files have been removed. Create README.md travis file has been removed. Update README.md MagicTimerCore version has been specified. Version has been downgraded to 2.0.0 Podspec version has been updated. Package has been updated. Version has been updated. --- MagicTimer.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MagicTimer.podspec b/MagicTimer.podspec index 43033ca..87b14f3 100644 --- a/MagicTimer.podspec +++ b/MagicTimer.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'MagicTimer' - s.version = '2.0.1' + s.version = '2.0.0' s.summary = 'MagicTimer framework, your ultimate solution for handling timers in your iOS applications. This framework provides a powerful and flexible timer implementation with various features to meet your timer needs.' s.homepage = 'https://github.com/MagicTimerFW/MagicTimer' From cadc66ee8ec32a1c989591a6e31f6c35655d63cc Mon Sep 17 00:00:00 2001 From: Mohammad Reza Ansary Date: Mon, 25 Sep 2023 21:36:30 +0330 Subject: [PATCH 32/37] fix: Unavailable mark in xcode 15 --- Sources/MagicTimer/MagicTimer.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/MagicTimer/MagicTimer.swift b/Sources/MagicTimer/MagicTimer.swift index c98584e..7bfdce6 100644 --- a/Sources/MagicTimer/MagicTimer.swift +++ b/Sources/MagicTimer/MagicTimer.swift @@ -91,18 +91,18 @@ public class MagicTimer { private var backgroundCalculator: MagicTimerBackgroundCalculatorInterface // MARK: - Unavailable - @available(*, unavailable, renamed: "elapsedTimeDidChangeHandler") - /// A elpsed time that can observe + /// A elapsed time that can observe + /// - Warning: renamed: "elapsedTimeDidChangeHandler" public var observeElapsedTime: ((TimeInterval) -> Void)? - @available(*, unavailable, renamed: "lastState") /// The current state of the timer. + /// - Warning: renamed: "lastState" public var currentState: MagicTimerState { return lastState } - @available(*, unavailable, renamed: "lastStateDidChangeHandler") /// Timer state callback + /// - Warning: renamed: "lastStateDidChangeHandler" public var didStateChange: ((MagicTimerState) -> Void)? // MARK: - Constructors From f095047b3222a5e0fcaaa2354caebd8166dfcbbe Mon Sep 17 00:00:00 2001 From: sadeghgoo Date: Fri, 3 Nov 2023 12:15:39 +0330 Subject: [PATCH 33/37] revision "1.0.0." has been changed to branch "Main" for `MagicTimerCore`. --- Package.resolved | 6 +++--- Package.swift | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Package.resolved b/Package.resolved index bfb39e7..bd602fe 100644 --- a/Package.resolved +++ b/Package.resolved @@ -5,7 +5,7 @@ "package": "MagicTimerCommon", "repositoryURL": "https://github.com/MagicTimerFW/MagicTimerCommon.git", "state": { - "branch": "1.0.0", + "branch": "main", "revision": "26d4544ff36655b4666de138041a1187605e8971", "version": null } @@ -14,8 +14,8 @@ "package": "MagicTimerCore", "repositoryURL": "https://github.com/MagicTimerFW/MagicTimerCore", "state": { - "branch": "1.0.0", - "revision": "ad356988b5cfd45930586c7d8916f9e579ebd91e", + "branch": "main", + "revision": "2af8ffaac0bec73a32a984c77f331f961a854753", "version": null } }, diff --git a/Package.swift b/Package.swift index cedc40e..4e52655 100644 --- a/Package.swift +++ b/Package.swift @@ -12,7 +12,7 @@ let package = Package( targets: ["MagicTimer"]), ], dependencies: [ - .package(url: "https://github.com/MagicTimerFW/MagicTimerCore", revision: "1.0.0") + .package(url: "https://github.com/MagicTimerFW/MagicTimerCore", branch: "main") ], targets: [ .target( From 7fab39b32da860591084f7c779a62a54c82416d5 Mon Sep 17 00:00:00 2001 From: sadeghgoo Date: Thu, 23 Nov 2023 19:09:47 +0330 Subject: [PATCH 34/37] Useless modularization has been removed from code. --- Package.resolved | 18 ------- Package.swift | 8 ++- Sources/MagicTimer/Date+Extension.swift | 7 +++ Sources/MagicTimer/Double+Extension.swift | 12 +++++ Sources/MagicTimer/Int+Extension.swift | 26 ++++++++++ Sources/MagicTimer/MagicTimer.swift | 1 - .../MagicTimerBackgroundCalculator.swift | 46 ++++++++++++++++ Sources/MagicTimer/MagicTimerCounter.swift | 52 +++++++++++++++++++ Sources/MagicTimer/MagicTimerExecutive.swift | 44 ++++++++++++++++ 9 files changed, 190 insertions(+), 24 deletions(-) create mode 100644 Sources/MagicTimer/Date+Extension.swift create mode 100644 Sources/MagicTimer/Double+Extension.swift create mode 100644 Sources/MagicTimer/Int+Extension.swift create mode 100644 Sources/MagicTimer/MagicTimerBackgroundCalculator.swift create mode 100644 Sources/MagicTimer/MagicTimerCounter.swift create mode 100644 Sources/MagicTimer/MagicTimerExecutive.swift diff --git a/Package.resolved b/Package.resolved index 2b5879e..734ca8b 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,24 +1,6 @@ { "object": { "pins": [ - { - "package": "MagicTimerCommon", - "repositoryURL": "https://github.com/MagicTimerFW/MagicTimerCommon.git", - "state": { - "branch": "main", - "revision": "fb03ac56dba62017a5fefea3552b0e8c045b1f37", - "version": null - } - }, - { - "package": "MagicTimerCore", - "repositoryURL": "https://github.com/MagicTimerFW/MagicTimerCore", - "state": { - "branch": "main", - "revision": "a35ccad1b686bb28251fd6fd64ed178d3d8b6f3d", - "version": null - } - }, { "package": "MathOperators", "repositoryURL": "https://github.com/sadeghgoo/MathOperators.git", diff --git a/Package.swift b/Package.swift index a1f3af9..8997acf 100644 --- a/Package.swift +++ b/Package.swift @@ -12,17 +12,15 @@ let package = Package( targets: ["MagicTimer"]), ], dependencies: [ - .package( - name: "MagicTimerCore", - url: "https://github.com/MagicTimerFW/MagicTimerCore", branch: "main") + .package(url: "https://github.com/sadeghgoo/MathOperators.git", branch: "main") ], targets: [ .target( name: "MagicTimer", dependencies: [ .product( - name: "MagicTimerCore", - package: "MagicTimerCore") + name: "MathOperators", + package: "MathOperators"), ]), .testTarget( name: "MagicTimerTests", diff --git a/Sources/MagicTimer/Date+Extension.swift b/Sources/MagicTimer/Date+Extension.swift new file mode 100644 index 0000000..e9e7e78 --- /dev/null +++ b/Sources/MagicTimer/Date+Extension.swift @@ -0,0 +1,7 @@ +import Foundation + +public extension Date { + static func - (lhs: Date, rhs: Date) -> TimeInterval { + return lhs.timeIntervalSinceReferenceDate.minus(rhs.timeIntervalSinceReferenceDate) + } +} diff --git a/Sources/MagicTimer/Double+Extension.swift b/Sources/MagicTimer/Double+Extension.swift new file mode 100644 index 0000000..3d60806 --- /dev/null +++ b/Sources/MagicTimer/Double+Extension.swift @@ -0,0 +1,12 @@ +import Foundation + +public extension TimeInterval { + /// Cast TimeInterval to Int. + func convertToInteger() -> Int { + return Int(self) + } + /// Cast TimeInterval to String. + func convertToString() -> String { + return String(self) + } +} diff --git a/Sources/MagicTimer/Int+Extension.swift b/Sources/MagicTimer/Int+Extension.swift new file mode 100644 index 0000000..0545130 --- /dev/null +++ b/Sources/MagicTimer/Int+Extension.swift @@ -0,0 +1,26 @@ +import Foundation + +public extension Int { + /// Cast Int to TimeInterval + func convertToTimeInterval() -> TimeInterval { + return TimeInterval(self) + } + /// Cast Int to String + func convertToString() -> String { + return String(self) + } + +} + +public extension Double { + /// Check the number is positive(bigger than zero) + var isPositive: Bool { + get { + return self > 0 + } + } + /// Cast Double to TimeInterval + func convertToTimeInterval() -> TimeInterval { + return TimeInterval(self) + } +} diff --git a/Sources/MagicTimer/MagicTimer.swift b/Sources/MagicTimer/MagicTimer.swift index c98584e..04d47f2 100644 --- a/Sources/MagicTimer/MagicTimer.swift +++ b/Sources/MagicTimer/MagicTimer.swift @@ -1,5 +1,4 @@ import Foundation -import MagicTimerCore import MathOperators @available(*, unavailable, renamed: "MagicTimerMode") diff --git a/Sources/MagicTimer/MagicTimerBackgroundCalculator.swift b/Sources/MagicTimer/MagicTimerBackgroundCalculator.swift new file mode 100644 index 0000000..147a356 --- /dev/null +++ b/Sources/MagicTimer/MagicTimerBackgroundCalculator.swift @@ -0,0 +1,46 @@ +import UIKit +import MathOperators + +public protocol MagicTimerBackgroundCalculatorInterface { + /// The timer fired date. + var timerFiredDate: Date? { get set } + /// By changing this type timer decides to whether calcualte the time in background. + var isActiveBackgroundMode: Bool { get set } + + var backgroundTimeCalculateHandler: ((TimeInterval) -> Void)? { get set } +} + +public final class MagicTimerBackgroundCalculator: MagicTimerBackgroundCalculatorInterface { + + public var timerFiredDate: Date? + public var isActiveBackgroundMode: Bool = true + public var backgroundTimeCalculateHandler: ((TimeInterval) -> Void)? + + public init() { + NotificationCenter.default.addObserver(self, selector: #selector(willEnterForegroundNotification), name: UIApplication.willEnterForegroundNotification, object: nil) + } + + deinit { + NotificationCenter.default.removeObserver(self) + } + + private func invalidateFiredDate() { + timerFiredDate = nil + } + + private func calculateDateDiffrence() -> TimeInterval? { + guard let timerFiredDate else { return nil } + let validTimeSubtraction = abs(timerFiredDate - Date()) + return validTimeSubtraction.convertToTimeInterval() + } + + @objc + private func willEnterForegroundNotification() { + guard isActiveBackgroundMode else { return } + + if let timeInterval = calculateDateDiffrence() { + backgroundTimeCalculateHandler?(timeInterval) + } + } +} + diff --git a/Sources/MagicTimer/MagicTimerCounter.swift b/Sources/MagicTimer/MagicTimerCounter.swift new file mode 100644 index 0000000..e9ba846 --- /dev/null +++ b/Sources/MagicTimer/MagicTimerCounter.swift @@ -0,0 +1,52 @@ +import Foundation +import MathOperators + +public protocol MagicTimerCounterInterface { + /// The total counted value. + var totalCountedValue: TimeInterval { get set } + /// A number which is added or minused on each ``timeInterval``. + var effectiveValue: TimeInterval { get set } + /// The initial value of counter. + var defultValue: TimeInterval { get set } + /// Add effectiveValue to totalCountedValue. + func add() + /// Subtract effectiveValue from totalCountedValue. + func subtract() + /// Reset totalCountedValue to zero. + func resetTotalCounted() + /// Reset totalCountedValue to defultValue. + func resetToDefaultValue() +} + +public final class MagicTimerCounter: MagicTimerCounterInterface { + + // MARK: - Public properties + public var totalCountedValue: TimeInterval = 0 + public var effectiveValue: TimeInterval = 1.0 + public var defultValue: TimeInterval = 0.0 { + didSet { + totalCountedValue = totalCountedValue.plus(defultValue) + } + } + + // MARK: - Constructors + public init() { } + + // MARK: - Public methods + public func add() { + totalCountedValue = totalCountedValue.plus(effectiveValue) + } + + public func subtract() { + totalCountedValue = totalCountedValue.minus(effectiveValue) + } + + public func resetTotalCounted() { + totalCountedValue = 0 + } + + public func resetToDefaultValue() { + totalCountedValue = defultValue + } +} + diff --git a/Sources/MagicTimer/MagicTimerExecutive.swift b/Sources/MagicTimer/MagicTimerExecutive.swift new file mode 100644 index 0000000..6758d7f --- /dev/null +++ b/Sources/MagicTimer/MagicTimerExecutive.swift @@ -0,0 +1,44 @@ +import Foundation + +public protocol MagicTimerExecutiveInterface { + /// Timer time interval. + var timeInterval: TimeInterval { get set } + /// Fire the timer. + func fire(compeltionHandler: (() -> Void)?) + /// Suspand the timer. + func suspand(completionHandler: (() -> Void)?) + /// A call back which is called on every time interval. + var scheduleTimerHandler: (() -> Void)? { get set } +} + +public final class MagicTimerExecutive: MagicTimerExecutiveInterface { + + // MARK: - Public properties + public var scheduleTimerHandler: (() -> Void)? + public var timeInterval: TimeInterval = 1.0 + + // MARK: - Private + private var scheduleTimer: Timer? + private var isTimerAlreadyStarted: Bool = false + + // MARK: - Constructors + public init() { + scheduleTimer = Timer.scheduledTimer(withTimeInterval: timeInterval, repeats: true, block: { [weak self] _ in + self?.scheduleTimerHandler?() + }) + } + + // MARK: - Public methods + public func fire(compeltionHandler: (() -> Void)?) { + isTimerAlreadyStarted = true + scheduleTimer?.fire() + RunLoop.main.add(scheduleTimer!, forMode: .common) + compeltionHandler?() + } + + public func suspand(completionHandler: (() -> Void)?) { + scheduleTimer?.invalidate() + isTimerAlreadyStarted = false + completionHandler?() + } +} From 4f8ec7d7b83e826a3fe0326983ea8ee0551fd994 Mon Sep 17 00:00:00 2001 From: sadeghgoo Date: Thu, 23 Nov 2023 19:15:48 +0330 Subject: [PATCH 35/37] Podspec has been updated. --- MagicTimer.podspec | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/MagicTimer.podspec b/MagicTimer.podspec index 87b14f3..d967fd0 100644 --- a/MagicTimer.podspec +++ b/MagicTimer.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'MagicTimer' - s.version = '2.0.0' + s.version = '1.0.5' s.summary = 'MagicTimer framework, your ultimate solution for handling timers in your iOS applications. This framework provides a powerful and flexible timer implementation with various features to meet your timer needs.' s.homepage = 'https://github.com/MagicTimerFW/MagicTimer' @@ -12,5 +12,4 @@ Pod::Spec.new do |s| s.swift_versions = ['5.0'] s.source_files = 'Sources/**/*' s.frameworks = 'Foundation' - s.dependency 'MagicTimerCore' end From 23db92ff528b1e7ec5f50a82f223992b482766db Mon Sep 17 00:00:00 2001 From: sadeghgoo Date: Sat, 2 Dec 2023 23:39:18 +0330 Subject: [PATCH 36/37] Podspec problem has been fixed. --- MagicTimer.podspec | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/MagicTimer.podspec b/MagicTimer.podspec index d967fd0..9226c76 100644 --- a/MagicTimer.podspec +++ b/MagicTimer.podspec @@ -1,15 +1,16 @@ Pod::Spec.new do |s| s.name = 'MagicTimer' - s.version = '1.0.5' + s.version = '1.0.6' s.summary = 'MagicTimer framework, your ultimate solution for handling timers in your iOS applications. This framework provides a powerful and flexible timer implementation with various features to meet your timer needs.' s.homepage = 'https://github.com/MagicTimerFW/MagicTimer' s.license = { :type => 'MIT', :file => 'LICENSE' } s.author = { 'sadeghgoo' => 'sadeghitunes2@gmail.com' } - s.source = { :git => 'https://github.com/MagicTimerFW/MagicTimer', :tag => s.version.to_s } + s.source = { :git => 'https://github.com/MagicTimerFW/MagicTimer.git', :tag => s.version.to_s } s.ios.deployment_target = '11.0' s.swift_versions = ['5.0'] s.source_files = 'Sources/**/*' s.frameworks = 'Foundation' + s.dependency 'MathOperators' end From f53b3bc3fcaf99376d9f2f9820bbd6cd1af68306 Mon Sep 17 00:00:00 2001 From: Sadeq Bitarafan <43542836+sadeghgoo@users.noreply.github.com> Date: Fri, 15 Mar 2024 14:05:13 +0330 Subject: [PATCH 37/37] Issue/#29 fixed. (#30) * #29 issue fixed. * pod spec updated. --------- Co-authored-by: Sadeq Bitarafan --- MagicTimer.podspec | 2 +- Sources/MagicTimer/MagicTimer.swift | 31 +++++++++++-------- .../MagicTimerBackgroundCalculator.swift | 12 +++++-- 3 files changed, 29 insertions(+), 16 deletions(-) diff --git a/MagicTimer.podspec b/MagicTimer.podspec index 9226c76..84a6458 100644 --- a/MagicTimer.podspec +++ b/MagicTimer.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'MagicTimer' - s.version = '1.0.6' + s.version = '1.0.7' s.summary = 'MagicTimer framework, your ultimate solution for handling timers in your iOS applications. This framework provides a powerful and flexible timer implementation with various features to meet your timer needs.' s.homepage = 'https://github.com/MagicTimerFW/MagicTimer' diff --git a/Sources/MagicTimer/MagicTimer.swift b/Sources/MagicTimer/MagicTimer.swift index 305aba3..98a0526 100644 --- a/Sources/MagicTimer/MagicTimer.swift +++ b/Sources/MagicTimer/MagicTimer.swift @@ -45,7 +45,20 @@ public class MagicTimer { } /// Timer count mode. Default is `.stopWatch`. Checkout ```MagicTimerMode```. - public var countMode: MagicTimerMode = .stopWatch + public var countMode: MagicTimerMode = .stopWatch { + didSet { + switch countMode { + case .stopWatch: + break + case .countDown(let fromSeconds): + // Checking if defaultValue plus fromSeconds not going to invalid format(negative seconds). + guard (defultValue + fromSeconds).truncatingRemainder(dividingBy: effectiveValue).isEqual(to: .zero) else { + fatalError("The time does not lead to a valid format. Use valid effetiveValue") + } + counter.totalCountedValue = fromSeconds + } + } + } /// Timer default value. Default is 0. public var defultValue: TimeInterval = 0 { @@ -169,18 +182,10 @@ public class MagicTimer { private func observeScheduleTimer() { executive.scheduleTimerHandler = { [weak self] in guard let self else { return } - - switch self.countMode { + switch countMode { case .stopWatch: - self.counter.add() - self.elapsedTime = self.counter.totalCountedValue - case .countDown(let fromSeconds): - // Checking if defaultValue plus fromSeconds not going to invalid format(negative seconds). - guard (self.defultValue + fromSeconds).truncatingRemainder(dividingBy: self.effectiveValue).isEqual(to: .zero) else { - fatalError("The time does not lead to a valid format. Use valid effetiveValue") - } - - self.counter.totalCountedValue = fromSeconds + counter.add() + case .countDown(_): guard counter.totalCountedValue.isBiggerThan(.zero) else { executive.suspand { self.lastState = .stopped @@ -188,8 +193,8 @@ public class MagicTimer { return } counter.subtract() - elapsedTime = self.counter.totalCountedValue } + elapsedTime = counter.totalCountedValue } } } diff --git a/Sources/MagicTimer/MagicTimerBackgroundCalculator.swift b/Sources/MagicTimer/MagicTimerBackgroundCalculator.swift index 147a356..512c432 100644 --- a/Sources/MagicTimer/MagicTimerBackgroundCalculator.swift +++ b/Sources/MagicTimer/MagicTimerBackgroundCalculator.swift @@ -16,8 +16,11 @@ public final class MagicTimerBackgroundCalculator: MagicTimerBackgroundCalculato public var isActiveBackgroundMode: Bool = true public var backgroundTimeCalculateHandler: ((TimeInterval) -> Void)? + private var shouldCalculate: Bool = false + public init() { NotificationCenter.default.addObserver(self, selector: #selector(willEnterForegroundNotification), name: UIApplication.willEnterForegroundNotification, object: nil) + NotificationCenter.default.addObserver(self, selector: #selector(willEnterBackgroundNotification), name: UIApplication.didEnterBackgroundNotification, object: nil) } deinit { @@ -30,17 +33,22 @@ public final class MagicTimerBackgroundCalculator: MagicTimerBackgroundCalculato private func calculateDateDiffrence() -> TimeInterval? { guard let timerFiredDate else { return nil } - let validTimeSubtraction = abs(timerFiredDate - Date()) + let validTimeSubtraction = floor(abs(timerFiredDate - Date())) return validTimeSubtraction.convertToTimeInterval() } @objc private func willEnterForegroundNotification() { - guard isActiveBackgroundMode else { return } + guard isActiveBackgroundMode, shouldCalculate else { return } if let timeInterval = calculateDateDiffrence() { backgroundTimeCalculateHandler?(timeInterval) } } + + @objc + private func willEnterBackgroundNotification() { + shouldCalculate = true + } }