From 6f5743353a2bdf7afa25234b3709c52b67b704ed Mon Sep 17 00:00:00 2001 From: LoSenTrad Date: Tue, 23 Mar 2021 23:36:27 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E4=BF=AE=E5=A4=8DpauseBlock=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20-=20other?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Example/LSTTimer.xcodeproj/project.pbxproj | 4 +- Example/LSTTimer/LSTTimer-Info.plist | 6 +++ LSTTimer.podspec | 4 +- LSTTimer/Classes/LSTTimer.m | 63 +++++++++++++++++++--- 4 files changed, 66 insertions(+), 11 deletions(-) diff --git a/Example/LSTTimer.xcodeproj/project.pbxproj b/Example/LSTTimer.xcodeproj/project.pbxproj index 34dff26..96e7163 100644 --- a/Example/LSTTimer.xcodeproj/project.pbxproj +++ b/Example/LSTTimer.xcodeproj/project.pbxproj @@ -567,7 +567,7 @@ INFOPLIST_FILE = "LSTTimer/LSTTimer-Info.plist"; MARKETING_VERSION = 0.1; MODULE_NAME = ExampleApp; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_BUNDLE_IDENTIFIER = com.LSTTimer.www; PRODUCT_NAME = LSTTimer; SWIFT_VERSION = 4.0; WRAPPER_EXTENSION = app; @@ -586,7 +586,7 @@ INFOPLIST_FILE = "LSTTimer/LSTTimer-Info.plist"; MARKETING_VERSION = 0.1; MODULE_NAME = ExampleApp; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_BUNDLE_IDENTIFIER = com.LSTTimer.www; PRODUCT_NAME = LSTTimer; SWIFT_VERSION = 4.0; WRAPPER_EXTENSION = app; diff --git a/Example/LSTTimer/LSTTimer-Info.plist b/Example/LSTTimer/LSTTimer-Info.plist index 2e68b21..140ebc6 100644 --- a/Example/LSTTimer/LSTTimer-Info.plist +++ b/Example/LSTTimer/LSTTimer-Info.plist @@ -24,6 +24,12 @@ $(CURRENT_PROJECT_VERSION) LSRequiresIPhoneOS + UIBackgroundModes + + audio + fetch + processing + UILaunchStoryboardName LaunchScreen UIMainStoryboardFile diff --git a/LSTTimer.podspec b/LSTTimer.podspec index bd4b4b8..4c42391 100644 --- a/LSTTimer.podspec +++ b/LSTTimer.podspec @@ -8,8 +8,8 @@ Pod::Spec.new do |s| s.name = 'LSTTimer' - s.version = '0.1.08251125' - s.summary = 'A short description of LSTTimer.' + s.version = '0.2.10' + s.summary = '一个计时器组件' # This description is used to generate tags and improve search results. # * Think: What does it do? Why did you write it? What is the focus? diff --git a/LSTTimer/Classes/LSTTimer.m b/LSTTimer/Classes/LSTTimer.m index 4f3bf5a..648ae00 100644 --- a/LSTTimer/Classes/LSTTimer.m +++ b/LSTTimer/Classes/LSTTimer.m @@ -143,7 +143,14 @@ + (void)addTimerForTime:(NSTimeInterval)time handle:(LSTTimerChangeBlock)handle + (void)addTimerForTime:(NSTimeInterval)time identifier:(NSString *)identifier handle:(LSTTimerChangeBlock)handle { - [self initTimerForForTime:time identifier:identifier ForIsDisk:NO unit:-1 handle:handle finish:nil pause:nil]; + + [self initTimerForForTime:time + identifier:identifier + ForIsDisk:NO + unit:-1 + handle:handle + finish:nil + pause:nil]; } /** 添加定时器并开启计时 */ + (void)addTimerForTime:(NSTimeInterval)time @@ -151,14 +158,28 @@ + (void)addTimerForTime:(NSTimeInterval)time handle:(LSTTimerChangeBlock)handle finish:(LSTTimerFinishBlock)finishBlock pause:(LSTTimerPauseBlock)pauseBlock { - [self initTimerForForTime:time identifier:identifier ForIsDisk:NO unit:-1 handle:handle finish:finishBlock pause:pauseBlock]; + + [self initTimerForForTime:time + identifier:identifier + ForIsDisk:NO + unit:-1 + handle:handle + finish:finishBlock + pause:pauseBlock]; } /** 添加定时器并开启计时 */ + (void)addDiskTimerForTime:(NSTimeInterval)time identifier:(NSString *)identifier handle:(LSTTimerChangeBlock)handle { - [self initTimerForForTime:time identifier:identifier ForIsDisk:YES unit:-1 handle:handle finish:nil pause:nil]; + + [self initTimerForForTime:time + identifier:identifier + ForIsDisk:YES + unit:-1 + handle:handle + finish:nil + pause:nil]; } /** 添加定时器并开启计时 */ @@ -167,7 +188,14 @@ + (void)addDiskTimerForTime:(NSTimeInterval)time handle:(LSTTimerChangeBlock)handle finish:(LSTTimerFinishBlock)finishBlock pause:(LSTTimerPauseBlock)pauseBlock { - [self initTimerForForTime:time identifier:identifier ForIsDisk:YES unit:-1 handle:handle finish:finishBlock pause:pauseBlock]; + + [self initTimerForForTime:time + identifier:identifier + ForIsDisk:YES + unit:-1 + handle:handle + finish:finishBlock + pause:pauseBlock]; } @@ -179,7 +207,14 @@ + (void)addMinuteTimerForTime:(NSTimeInterval)time handle:(LSTTimerChangeBlock)h + (void)addMinuteTimerForTime:(NSTimeInterval)time identifier:(NSString *)identifier handle:(LSTTimerChangeBlock)handle { - [self initTimerForForTime:time identifier:identifier ForIsDisk:NO unit:1000 handle:handle finish:nil pause:nil]; + + [self initTimerForForTime:time + identifier:identifier + ForIsDisk:NO + unit:1000 + handle:handle + finish:nil + pause:nil]; } /** 添加定时器并开启计时 */ @@ -188,7 +223,14 @@ + (void)addMinuteTimerForTime:(NSTimeInterval)time handle:(LSTTimerChangeBlock)handle finish:(LSTTimerFinishBlock)finishBlock pause:(LSTTimerPauseBlock)pauseBlock { - [self initTimerForForTime:time identifier:identifier ForIsDisk:NO unit:1000 handle:handle finish:finishBlock pause:pauseBlock]; + + [self initTimerForForTime:time + identifier:identifier + ForIsDisk:NO + unit:1000 + handle:handle + finish:finishBlock + pause:pauseBlock]; } /** 添加定时器并开启计时 */ @@ -197,7 +239,14 @@ + (void)addDiskMinuteTimerForTime:(NSTimeInterval)time handle:(LSTTimerChangeBlock)handle finish:(LSTTimerFinishBlock)finishBlock pause:(LSTTimerPauseBlock)pauseBlock { - [self initTimerForForTime:time identifier:identifier ForIsDisk:YES unit:1000 handle:handle finish:finishBlock pause:pauseBlock]; + + [self initTimerForForTime:time + identifier:identifier + ForIsDisk:YES + unit:1000 + handle:handle + finish:finishBlock + pause:pauseBlock]; } //总初始化入口