Skip to content

Commit 4849957

Browse files
committed
Update 1.0.0
1 parent ef2002c commit 4849957

18 files changed

Lines changed: 2631 additions & 54 deletions

Demo/Podfile

Lines changed: 0 additions & 7 deletions
This file was deleted.

Demo/WSProgressHUD.xcodeproj/project.pbxproj

Lines changed: 46 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
FE1C9C371B645F0700BB2D67 /* FBShimmeringLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = FE1C9C2D1B645F0700BB2D67 /* FBShimmeringLayer.m */; };
11+
FE1C9C381B645F0700BB2D67 /* FBShimmeringView.m in Sources */ = {isa = PBXBuildFile; fileRef = FE1C9C2F1B645F0700BB2D67 /* FBShimmeringView.m */; };
12+
FE1C9C391B645F0700BB2D67 /* MMMaterialDesignSpinner.m in Sources */ = {isa = PBXBuildFile; fileRef = FE1C9C311B645F0700BB2D67 /* MMMaterialDesignSpinner.m */; };
13+
FE1C9C3A1B645F0700BB2D67 /* WSIndefiniteAnimationView.m in Sources */ = {isa = PBXBuildFile; fileRef = FE1C9C331B645F0700BB2D67 /* WSIndefiniteAnimationView.m */; };
14+
FE1C9C3B1B645F0700BB2D67 /* WSProgressBundle.bundle in Resources */ = {isa = PBXBuildFile; fileRef = FE1C9C341B645F0700BB2D67 /* WSProgressBundle.bundle */; };
15+
FE1C9C3C1B645F0700BB2D67 /* WSProgressHUD.m in Sources */ = {isa = PBXBuildFile; fileRef = FE1C9C361B645F0700BB2D67 /* WSProgressHUD.m */; };
1016
FED429031B63E262002A5294 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = FED428F21B63E262002A5294 /* AppDelegate.m */; };
1117
FED429061B63E262002A5294 /* image1.jpg in Resources */ = {isa = PBXBuildFile; fileRef = FED428F71B63E262002A5294 /* image1.jpg */; };
1218
FED429071B63E262002A5294 /* image2.png in Resources */ = {isa = PBXBuildFile; fileRef = FED428F81B63E262002A5294 /* image2.png */; };
@@ -20,12 +26,6 @@
2026
FED429261B63E2A0002A5294 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = FED428F31B63E262002A5294 /* LaunchScreen.xib */; };
2127
FED429271B63E2A0002A5294 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FED428F51B63E262002A5294 /* Main.storyboard */; };
2228
FED429281B63E2A0002A5294 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = FEDB74B91B593589003DDB79 /* Info.plist */; };
23-
FED4293F1B63E39B002A5294 /* WSProgressHUD.m in Sources */ = {isa = PBXBuildFile; fileRef = FED429391B63E39B002A5294 /* WSProgressHUD.m */; };
24-
FED4294B1B63EBC7002A5294 /* FBShimmeringLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = FED429431B63EBC7002A5294 /* FBShimmeringLayer.m */; };
25-
FED4294C1B63EBC7002A5294 /* FBShimmeringView.m in Sources */ = {isa = PBXBuildFile; fileRef = FED429451B63EBC7002A5294 /* FBShimmeringView.m */; };
26-
FED4294D1B63EBC7002A5294 /* MMMaterialDesignSpinner.m in Sources */ = {isa = PBXBuildFile; fileRef = FED429471B63EBC7002A5294 /* MMMaterialDesignSpinner.m */; };
27-
FED4294E1B63EBC7002A5294 /* WSIndefiniteAnimationView.m in Sources */ = {isa = PBXBuildFile; fileRef = FED429491B63EBC7002A5294 /* WSIndefiniteAnimationView.m */; };
28-
FED4294F1B63EBC7002A5294 /* WSProgressBundle.bundle in Resources */ = {isa = PBXBuildFile; fileRef = FED4294A1B63EBC7002A5294 /* WSProgressBundle.bundle */; };
2929
FEDB74BB1B593589003DDB79 /* WSProgressHUDTests.m in Sources */ = {isa = PBXBuildFile; fileRef = FEDB74BA1B593589003DDB79 /* WSProgressHUDTests.m */; };
3030
/* End PBXBuildFile section */
3131

@@ -40,6 +40,19 @@
4040
/* End PBXContainerItemProxy section */
4141

4242
/* Begin PBXFileReference section */
43+
FE1C9C2A1B645F0700BB2D67 /* FBShimmering-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "FBShimmering-Prefix.pch"; sourceTree = "<group>"; };
44+
FE1C9C2B1B645F0700BB2D67 /* FBShimmering.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBShimmering.h; sourceTree = "<group>"; };
45+
FE1C9C2C1B645F0700BB2D67 /* FBShimmeringLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBShimmeringLayer.h; sourceTree = "<group>"; };
46+
FE1C9C2D1B645F0700BB2D67 /* FBShimmeringLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBShimmeringLayer.m; sourceTree = "<group>"; };
47+
FE1C9C2E1B645F0700BB2D67 /* FBShimmeringView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBShimmeringView.h; sourceTree = "<group>"; };
48+
FE1C9C2F1B645F0700BB2D67 /* FBShimmeringView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBShimmeringView.m; sourceTree = "<group>"; };
49+
FE1C9C301B645F0700BB2D67 /* MMMaterialDesignSpinner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMMaterialDesignSpinner.h; sourceTree = "<group>"; };
50+
FE1C9C311B645F0700BB2D67 /* MMMaterialDesignSpinner.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMMaterialDesignSpinner.m; sourceTree = "<group>"; };
51+
FE1C9C321B645F0700BB2D67 /* WSIndefiniteAnimationView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WSIndefiniteAnimationView.h; sourceTree = "<group>"; };
52+
FE1C9C331B645F0700BB2D67 /* WSIndefiniteAnimationView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WSIndefiniteAnimationView.m; sourceTree = "<group>"; };
53+
FE1C9C341B645F0700BB2D67 /* WSProgressBundle.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = WSProgressBundle.bundle; sourceTree = "<group>"; };
54+
FE1C9C351B645F0700BB2D67 /* WSProgressHUD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WSProgressHUD.h; sourceTree = "<group>"; };
55+
FE1C9C361B645F0700BB2D67 /* WSProgressHUD.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WSProgressHUD.m; sourceTree = "<group>"; };
4356
FED428F11B63E262002A5294 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
4457
FED428F21B63E262002A5294 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
4558
FED428F41B63E262002A5294 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
@@ -56,19 +69,6 @@
5669
FED429001B63E262002A5294 /* TabViewController2.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TabViewController2.m; sourceTree = "<group>"; };
5770
FED429011B63E262002A5294 /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
5871
FED429021B63E262002A5294 /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
59-
FED429381B63E39B002A5294 /* WSProgressHUD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WSProgressHUD.h; sourceTree = "<group>"; };
60-
FED429391B63E39B002A5294 /* WSProgressHUD.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WSProgressHUD.m; sourceTree = "<group>"; };
61-
FED429401B63EBC7002A5294 /* FBShimmering-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "FBShimmering-Prefix.pch"; sourceTree = "<group>"; };
62-
FED429411B63EBC7002A5294 /* FBShimmering.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBShimmering.h; sourceTree = "<group>"; };
63-
FED429421B63EBC7002A5294 /* FBShimmeringLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBShimmeringLayer.h; sourceTree = "<group>"; };
64-
FED429431B63EBC7002A5294 /* FBShimmeringLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBShimmeringLayer.m; sourceTree = "<group>"; };
65-
FED429441B63EBC7002A5294 /* FBShimmeringView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBShimmeringView.h; sourceTree = "<group>"; };
66-
FED429451B63EBC7002A5294 /* FBShimmeringView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBShimmeringView.m; sourceTree = "<group>"; };
67-
FED429461B63EBC7002A5294 /* MMMaterialDesignSpinner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMMaterialDesignSpinner.h; sourceTree = "<group>"; };
68-
FED429471B63EBC7002A5294 /* MMMaterialDesignSpinner.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMMaterialDesignSpinner.m; sourceTree = "<group>"; };
69-
FED429481B63EBC7002A5294 /* WSIndefiniteAnimationView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WSIndefiniteAnimationView.h; sourceTree = "<group>"; };
70-
FED429491B63EBC7002A5294 /* WSIndefiniteAnimationView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WSIndefiniteAnimationView.m; sourceTree = "<group>"; };
71-
FED4294A1B63EBC7002A5294 /* WSProgressBundle.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = WSProgressBundle.bundle; sourceTree = "<group>"; };
7272
FEDB749B1B593589003DDB79 /* WSProgressHUD.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WSProgressHUD.app; sourceTree = BUILT_PRODUCTS_DIR; };
7373
FEDB74B41B593589003DDB79 /* WSProgressHUDTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = WSProgressHUDTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
7474
FEDB74B91B593589003DDB79 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
@@ -93,6 +93,26 @@
9393
/* End PBXFrameworksBuildPhase section */
9494

9595
/* Begin PBXGroup section */
96+
FE1C9C291B645F0700BB2D67 /* WSProgressHUD */ = {
97+
isa = PBXGroup;
98+
children = (
99+
FE1C9C2A1B645F0700BB2D67 /* FBShimmering-Prefix.pch */,
100+
FE1C9C2B1B645F0700BB2D67 /* FBShimmering.h */,
101+
FE1C9C2C1B645F0700BB2D67 /* FBShimmeringLayer.h */,
102+
FE1C9C2D1B645F0700BB2D67 /* FBShimmeringLayer.m */,
103+
FE1C9C2E1B645F0700BB2D67 /* FBShimmeringView.h */,
104+
FE1C9C2F1B645F0700BB2D67 /* FBShimmeringView.m */,
105+
FE1C9C301B645F0700BB2D67 /* MMMaterialDesignSpinner.h */,
106+
FE1C9C311B645F0700BB2D67 /* MMMaterialDesignSpinner.m */,
107+
FE1C9C321B645F0700BB2D67 /* WSIndefiniteAnimationView.h */,
108+
FE1C9C331B645F0700BB2D67 /* WSIndefiniteAnimationView.m */,
109+
FE1C9C341B645F0700BB2D67 /* WSProgressBundle.bundle */,
110+
FE1C9C351B645F0700BB2D67 /* WSProgressHUD.h */,
111+
FE1C9C361B645F0700BB2D67 /* WSProgressHUD.m */,
112+
);
113+
path = WSProgressHUD;
114+
sourceTree = "<group>";
115+
};
96116
FED428F01B63E262002A5294 /* WSProgressHUDDemo */ = {
97117
isa = PBXGroup;
98118
children = (
@@ -116,31 +136,10 @@
116136
path = WSProgressHUDDemo;
117137
sourceTree = "<group>";
118138
};
119-
FED429291B63E39B002A5294 /* WSProgressHUD */ = {
120-
isa = PBXGroup;
121-
children = (
122-
FED429381B63E39B002A5294 /* WSProgressHUD.h */,
123-
FED429391B63E39B002A5294 /* WSProgressHUD.m */,
124-
FED429401B63EBC7002A5294 /* FBShimmering-Prefix.pch */,
125-
FED429411B63EBC7002A5294 /* FBShimmering.h */,
126-
FED429421B63EBC7002A5294 /* FBShimmeringLayer.h */,
127-
FED429431B63EBC7002A5294 /* FBShimmeringLayer.m */,
128-
FED429441B63EBC7002A5294 /* FBShimmeringView.h */,
129-
FED429451B63EBC7002A5294 /* FBShimmeringView.m */,
130-
FED429461B63EBC7002A5294 /* MMMaterialDesignSpinner.h */,
131-
FED429471B63EBC7002A5294 /* MMMaterialDesignSpinner.m */,
132-
FED429481B63EBC7002A5294 /* WSIndefiniteAnimationView.h */,
133-
FED429491B63EBC7002A5294 /* WSIndefiniteAnimationView.m */,
134-
FED4294A1B63EBC7002A5294 /* WSProgressBundle.bundle */,
135-
);
136-
name = WSProgressHUD;
137-
path = ../WSProgressHUD;
138-
sourceTree = "<group>";
139-
};
140139
FEDB74921B593589003DDB79 = {
141140
isa = PBXGroup;
142141
children = (
143-
FED429291B63E39B002A5294 /* WSProgressHUD */,
142+
FE1C9C291B645F0700BB2D67 /* WSProgressHUD */,
144143
FED428F01B63E262002A5294 /* WSProgressHUDDemo */,
145144
FEDB74B71B593589003DDB79 /* WSProgressHUDTests */,
146145
FEDB749C1B593589003DDB79 /* Products */,
@@ -253,7 +252,7 @@
253252
isa = PBXResourcesBuildPhase;
254253
buildActionMask = 2147483647;
255254
files = (
256-
FED4294F1B63EBC7002A5294 /* WSProgressBundle.bundle in Resources */,
255+
FE1C9C3B1B645F0700BB2D67 /* WSProgressBundle.bundle in Resources */,
257256
FED429261B63E2A0002A5294 /* LaunchScreen.xib in Resources */,
258257
FED429271B63E2A0002A5294 /* Main.storyboard in Resources */,
259258
FED429281B63E2A0002A5294 /* Info.plist in Resources */,
@@ -279,15 +278,15 @@
279278
isa = PBXSourcesBuildPhase;
280279
buildActionMask = 2147483647;
281280
files = (
282-
FED4294E1B63EBC7002A5294 /* WSIndefiniteAnimationView.m in Sources */,
281+
FE1C9C371B645F0700BB2D67 /* FBShimmeringLayer.m in Sources */,
283282
FED429031B63E262002A5294 /* AppDelegate.m in Sources */,
284-
FED4294D1B63EBC7002A5294 /* MMMaterialDesignSpinner.m in Sources */,
285-
FED4293F1B63E39B002A5294 /* WSProgressHUD.m in Sources */,
283+
FE1C9C3C1B645F0700BB2D67 /* WSProgressHUD.m in Sources */,
286284
FED4290E1B63E262002A5294 /* ViewController.m in Sources */,
287-
FED4294C1B63EBC7002A5294 /* FBShimmeringView.m in Sources */,
285+
FE1C9C381B645F0700BB2D67 /* FBShimmeringView.m in Sources */,
288286
FED4290D1B63E262002A5294 /* TabViewController2.m in Sources */,
289-
FED4294B1B63EBC7002A5294 /* FBShimmeringLayer.m in Sources */,
290287
FED4290B1B63E262002A5294 /* main.m in Sources */,
288+
FE1C9C391B645F0700BB2D67 /* MMMaterialDesignSpinner.m in Sources */,
289+
FE1C9C3A1B645F0700BB2D67 /* WSIndefiniteAnimationView.m in Sources */,
291290
FED4290C1B63E262002A5294 /* TabViewController1.m in Sources */,
292291
);
293292
runOnlyForDeploymentPostprocessing = 0;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//
2+
// Prefix header
3+
//
4+
// The contents of this file are implicitly included at the beginning of every source file.
5+
//
6+
7+
#ifdef __OBJC__
8+
#import <Foundation/Foundation.h>
9+
#endif

Demo/WSProgressHUD/FBShimmering.h

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/**
2+
Copyright (c) 2014-present, Facebook, Inc.
3+
All rights reserved.
4+
5+
This source code is licensed under the BSD-style license found in the
6+
LICENSE file in the root directory of this source tree. An additional grant
7+
of patent rights can be found in the PATENTS file in the same directory.
8+
*/
9+
10+
#import <CoreGraphics/CoreGraphics.h>
11+
#import <Foundation/Foundation.h>
12+
13+
typedef NS_ENUM(NSInteger, FBShimmerDirection) {
14+
FBShimmerDirectionRight, // Shimmer animation goes from left to right
15+
FBShimmerDirectionLeft, // Shimmer animation goes from right to left
16+
FBShimmerDirectionUp, // Shimmer animation goes from below to above
17+
FBShimmerDirectionDown, // Shimmer animation goes from above to below
18+
};
19+
20+
static const float FBShimmerDefaultBeginTime = CGFLOAT_MAX;
21+
22+
@protocol FBShimmering <NSObject>
23+
24+
//! @abstract Set this to YES to start shimming and NO to stop. Defaults to NO.
25+
@property (assign, nonatomic, readwrite, getter = isShimmering) BOOL shimmering;
26+
27+
//! @abstract The time interval between shimmerings in seconds. Defaults to 0.4.
28+
@property (assign, nonatomic, readwrite) CFTimeInterval shimmeringPauseDuration;
29+
30+
//! @abstract The opacity of the content while it is shimmering. Defaults to 0.5.
31+
@property (assign, nonatomic, readwrite) CGFloat shimmeringAnimationOpacity;
32+
33+
//! @abstract The opacity of the content before it is shimmering. Defaults to 1.0.
34+
@property (assign, nonatomic, readwrite) CGFloat shimmeringOpacity;
35+
36+
//! @abstract The speed of shimmering, in points per second. Defaults to 230.
37+
@property (assign, nonatomic, readwrite) CGFloat shimmeringSpeed;
38+
39+
//! @abstract The highlight length of shimmering. Range of [0,1], defaults to 1.0.
40+
@property (assign, nonatomic, readwrite) CGFloat shimmeringHighlightLength;
41+
42+
//! @abstract @deprecated Same as "shimmeringHighlightLength", just for downward compatibility
43+
@property (assign, nonatomic, readwrite, getter = shimmeringHighlightLength, setter = setShimmeringHighlightLength:) CGFloat shimmeringHighlightWidth;
44+
45+
//! @abstract The direction of shimmering animation. Defaults to FBShimmerDirectionRight.
46+
@property (assign, nonatomic, readwrite) FBShimmerDirection shimmeringDirection;
47+
48+
//! @abstract The duration of the fade used when shimmer begins. Defaults to 0.1.
49+
@property (assign, nonatomic, readwrite) CFTimeInterval shimmeringBeginFadeDuration;
50+
51+
//! @abstract The duration of the fade used when shimmer ends. Defaults to 0.3.
52+
@property (assign, nonatomic, readwrite) CFTimeInterval shimmeringEndFadeDuration;
53+
54+
/**
55+
@abstract The absolute CoreAnimation media time when the shimmer will fade in.
56+
@discussion Only valid after setting {@ref shimmering} to NO.
57+
*/
58+
@property (assign, nonatomic, readonly) CFTimeInterval shimmeringFadeTime;
59+
60+
/**
61+
@abstract The absolute CoreAnimation media time when the shimmer will begin.
62+
@discussion Only valid after setting {@ref shimmering} to YES.
63+
*/
64+
@property (assign, nonatomic) CFTimeInterval shimmeringBeginTime;
65+
66+
@end
67+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
Copyright (c) 2014-present, Facebook, Inc.
3+
All rights reserved.
4+
5+
This source code is licensed under the BSD-style license found in the
6+
LICENSE file in the root directory of this source tree. An additional grant
7+
of patent rights can be found in the PATENTS file in the same directory.
8+
*/
9+
10+
#import <QuartzCore/CALayer.h>
11+
12+
#import "FBShimmering.h"
13+
14+
/**
15+
@abstract Lightweight, generic shimmering layer.
16+
*/
17+
@interface FBShimmeringLayer : CALayer <FBShimmering>
18+
19+
//! @abstract The content layer to be shimmered.
20+
@property (strong, nonatomic) CALayer *contentLayer;
21+
22+
@end

0 commit comments

Comments
 (0)