Skip to content

Commit

Permalink
- 修复pauseBlock问题
Browse files Browse the repository at this point in the history
- other
  • Loading branch information
LoSenTrad committed Mar 23, 2021
1 parent d0d3802 commit 6f57433
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Example/LSTTimer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions Example/LSTTimer/LSTTimer-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
<string>fetch</string>
<string>processing</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
Expand Down
4 changes: 2 additions & 2 deletions LSTTimer.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
63 changes: 56 additions & 7 deletions LSTTimer/Classes/LSTTimer.m
Original file line number Diff line number Diff line change
Expand Up @@ -143,22 +143,43 @@ + (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
identifier:(NSString *)identifier
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];
}

/** 添加定时器并开启计时 */
Expand All @@ -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];
}


Expand All @@ -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];
}

/** 添加定时器并开启计时 */
Expand All @@ -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];
}

/** 添加定时器并开启计时 */
Expand All @@ -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];
}

//总初始化入口
Expand Down

0 comments on commit 6f57433

Please sign in to comment.