Skip to content

Commit 00a7188

Browse files
committed
Version 0.1.5
1 parent 23aab43 commit 00a7188

File tree

5 files changed

+39
-26
lines changed

5 files changed

+39
-26
lines changed

Example/SCCatWaitingHUD.xcodeproj/project.pbxproj

+9
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,9 @@
247247
LastUpgradeCheck = 0510;
248248
ORGANIZATIONNAME = SergioChan;
249249
TargetAttributes = {
250+
6003F589195388D20070C39A = {
251+
DevelopmentTeam = Q8H99663FH;
252+
};
250253
6003F5AD195388D20070C39A = {
251254
TestTargetID = 6003F589195388D20070C39A;
252255
};
@@ -511,12 +514,15 @@
511514
baseConfigurationReference = A3EF8D5822D182EC1E13CE3C /* Pods-SCCatWaitingHUD_Example.debug.xcconfig */;
512515
buildSettings = {
513516
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
517+
CODE_SIGN_IDENTITY = "iPhone Developer";
518+
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
514519
GCC_PRECOMPILE_PREFIX_HEADER = YES;
515520
GCC_PREFIX_HEADER = "SCCatWaitingHUD/SCCatWaitingHUD-Prefix.pch";
516521
INFOPLIST_FILE = "SCCatWaitingHUD/SCCatWaitingHUD-Info.plist";
517522
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
518523
MODULE_NAME = ExampleApp;
519524
PRODUCT_NAME = "$(TARGET_NAME)";
525+
PROVISIONING_PROFILE = "";
520526
WRAPPER_EXTENSION = app;
521527
};
522528
name = Debug;
@@ -526,12 +532,15 @@
526532
baseConfigurationReference = 5CFE4AA53B22DE048FC74463 /* Pods-SCCatWaitingHUD_Example.release.xcconfig */;
527533
buildSettings = {
528534
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
535+
CODE_SIGN_IDENTITY = "iPhone Developer";
536+
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
529537
GCC_PRECOMPILE_PREFIX_HEADER = YES;
530538
GCC_PREFIX_HEADER = "SCCatWaitingHUD/SCCatWaitingHUD-Prefix.pch";
531539
INFOPLIST_FILE = "SCCatWaitingHUD/SCCatWaitingHUD-Info.plist";
532540
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
533541
MODULE_NAME = ExampleApp;
534542
PRODUCT_NAME = "$(TARGET_NAME)";
543+
PROVISIONING_PROFILE = "";
535544
WRAPPER_EXTENSION = app;
536545
};
537546
name = Release;

Example/SCCatWaitingHUD/SCViewController.m

+1-4
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,10 @@ - (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
2626
{
2727
if(![SCCatWaitingHUD sharedInstance].isAnimating)
2828
{
29-
[[SCCatWaitingHUD sharedInstance] animate];
30-
self.hintLabel.text = @"Tap to stop";
31-
}
29+
[[SCCatWaitingHUD sharedInstance] animateWithInteractionEnabled:YES]; }
3230
else
3331
{
3432
[[SCCatWaitingHUD sharedInstance] stop];
35-
self.hintLabel.text = @"Tap to animate";
3633
}
3734

3835
}

Pod/Classes/SCCatWaitingHUD.h

+1-6
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@
3333
*/
3434
@property (nonatomic) BOOL isAnimating;
3535

36-
/**
37-
* Time duration for HUD display and disappear.
38-
*/
39-
@property (nonatomic) CGFloat easeInDuration;
40-
4136
/**
4237
* Time duration for each loop.
4338
*/
@@ -46,7 +41,7 @@
4641
@property (nonatomic) UIInterfaceOrientation previousOrientation;
4742

4843
/**
49-
* Title of your HUD. Display in contentLabel.
44+
* Title of your HUD. Display in contentLabel. Default is 'Loading...'
5045
*/
5146
@property (nonatomic, strong) NSString *title;
5247

Pod/Classes/SCCatWaitingHUD.m

+27-15
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ @interface SCCatWaitingHUD()
1818

1919
@property (nonatomic, strong) UIView *leftEyeCover;
2020
@property (nonatomic, strong) UIView *rightEyeCover;
21+
22+
/**
23+
* Time duration for HUD display and disappear.
24+
*/
25+
@property (nonatomic) CGFloat easeInDuration;
26+
2127
@end
2228

2329
@implementation SCCatWaitingHUD
@@ -37,8 +43,8 @@ - (id)initWithFrame:(CGRect)frame
3743
self = [super initWithFrame:frame];
3844
if(self)
3945
{
40-
self.easeInDuration = 0.3f;
41-
self.animationDuration = 2.0f;
46+
self.animationDuration = 1.5f;
47+
self.easeInDuration = self.animationDuration * 0.25f;
4248

4349
[[NSNotificationCenter defaultCenter] addObserver:self
4450
selector:@selector(statusBarOrientationChange:)
@@ -90,7 +96,7 @@ - (void)initSubViews
9096
_leftEye.layer.masksToBounds = YES;
9197
_leftEye.layer.cornerRadius = 2.5f;
9298
_leftEye.backgroundColor = [UIColor blackColor];
93-
_leftEye.layer.anchorPoint = CGPointMake(1.7f, 1.3f);
99+
_leftEye.layer.anchorPoint = CGPointMake(1.5f, 1.5f);
94100
_leftEye.layer.position = CGPointMake(self.faceView.left + 13.5f,self.faceView.top + width/3.0f + 7.5f);
95101
[_indicatorView addSubview:_leftEye];
96102

@@ -104,7 +110,7 @@ - (void)initSubViews
104110
_rightEye.layer.masksToBounds = YES;
105111
_rightEye.layer.cornerRadius = 2.5f;
106112
_rightEye.backgroundColor = [UIColor blackColor];
107-
_rightEye.layer.anchorPoint = CGPointMake(1.7f, 1.3f);
113+
_rightEye.layer.anchorPoint = CGPointMake(1.5f, 1.5f);
108114
_rightEye.layer.position = CGPointMake(self.faceView.right - 13.5f, self.faceView.top + width/3.0f + 7.5f);
109115
[_indicatorView addSubview:_rightEye];
110116

@@ -230,6 +236,8 @@ - (void)animateWithInteractionEnabled:(BOOL)enabled
230236
{
231237
return;
232238
}
239+
240+
_isAnimating = YES;
233241
[_backgroundWindow makeKeyAndVisible];
234242
timer = [NSTimer scheduledTimerWithTimeInterval:self.animationDuration * 2.0f target:self selector:@selector(timerUpdate:) userInfo:nil repeats:YES];
235243
[[NSRunLoop currentRunLoop] addTimer:timer forMode:NSRunLoopCommonModes];
@@ -239,15 +247,19 @@ - (void)animateWithInteractionEnabled:(BOOL)enabled
239247
_backgroundWindow.alpha = 1.0f;
240248
_indicatorView.alpha = 1.0f;
241249
} completion:^(BOOL finished) {
242-
_isAnimating = YES;
243-
244-
[_mouseView.layer addAnimation:[self rotationAnimation] forKey:@"rotate"];
245-
[_leftEye.layer addAnimation:[self rotationAnimation] forKey:@"rotate"];
246-
[_rightEye.layer addAnimation:[self rotationAnimation] forKey:@"rotate"];
247-
248-
[_leftEyeCover.layer addAnimation:[self scaleAnimation] forKey:@"scale"];
249-
[_rightEyeCover.layer addAnimation:[self scaleAnimation] forKey:@"scale"];
250250
}];
251+
252+
[_leftEyeCover.layer addAnimation:[self scaleAnimation] forKey:@"scale"];
253+
[_rightEyeCover.layer addAnimation:[self scaleAnimation] forKey:@"scale"];
254+
255+
[self performSelector:@selector(test) withObject:nil afterDelay:self.animationDuration * 0.25f];
256+
}
257+
258+
- (void)test
259+
{
260+
[_mouseView.layer addAnimation:[self rotationAnimation] forKey:@"rotate"];
261+
[_leftEye.layer addAnimation:[self rotationAnimation] forKey:@"rotate"];
262+
[_rightEye.layer addAnimation:[self rotationAnimation] forKey:@"rotate"];
251263
}
252264

253265
- (void)animate
@@ -338,15 +350,15 @@ - (CAAnimationGroup *)scaleAnimation
338350
scaleAnimation = [CABasicAnimation animationWithKeyPath:@"transform"];
339351
scaleAnimation.fromValue = [NSValue valueWithCATransform3D:CATransform3DIdentity];
340352
scaleAnimation.toValue = [NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0, 3.0, 1.0)];
341-
scaleAnimation.duration = self.animationDuration * 0.75f;
353+
scaleAnimation.duration = self.animationDuration;
342354
scaleAnimation.cumulative = YES;
343355
scaleAnimation.repeatCount = 1;
344356
scaleAnimation.removedOnCompletion= NO;
345357
scaleAnimation.fillMode=kCAFillModeForwards;
346358
scaleAnimation.autoreverses = NO;
347359
scaleAnimation.timingFunction = [CAMediaTimingFunction functionWithControlPoints:0.2:0.0 :0.8 :1.0];
348360
scaleAnimation.speed = 1.0f;
349-
scaleAnimation.beginTime = self.animationDuration * 0.25f;
361+
scaleAnimation.beginTime = 0.0f;
350362

351363

352364
CAAnimationGroup *group = [CAAnimationGroup animation];
@@ -355,7 +367,7 @@ - (CAAnimationGroup *)scaleAnimation
355367
group.removedOnCompletion= NO;
356368
group.fillMode=kCAFillModeForwards;
357369
group.autoreverses = YES;
358-
group.timingFunction = [CAMediaTimingFunction functionWithControlPoints:0.2:0.0 :0.8 :1.0];
370+
group.timingFunction = [CAMediaTimingFunction functionWithControlPoints:0.2:0.0:0.8 :1.0];
359371

360372
group.animations = [NSArray arrayWithObjects:scaleAnimation, nil];
361373
return group;

SCCatWaitingHUD.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Pod::Spec.new do |s|
1010
s.name = "SCCatWaitingHUD"
11-
s.version = "0.1.4"
11+
s.version = "0.1.5"
1212
s.summary = "Cute and simple waiting HUD indicator on iOS"
1313

1414
# This description is used to generate tags and improve search results.

0 commit comments

Comments
 (0)