Compare commits
76 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a7eba17652 | |||
| a557a5cdff | |||
| ddde760011 | |||
| e05bc50c51 | |||
| 2e469fa630 | |||
| 404fb9c14c | |||
| bfeedb79a8 | |||
| 3589bd7ca0 | |||
| 1130a2da95 | |||
| ad579d96bb | |||
| 5fc7ee0228 | |||
| b493db97ab | |||
| 0711a8778a | |||
| 57615b05c1 | |||
| c4bb281016 | |||
| 614c03adaa | |||
| aee5bfa869 | |||
| 15f7acf21a | |||
| bc2c19c59d | |||
| 32ded5bf7b | |||
| 95fd9feee1 | |||
| ceb9c80f77 | |||
| 7dc7f8eb54 | |||
| 70506f3d09 | |||
| 1baad61fd2 | |||
| 0d3a7c0db9 | |||
| f4aa7a9ab5 | |||
| fd2abb9c37 | |||
| 08445aa4de | |||
| f4158b87d2 | |||
| 050c099198 | |||
| d061caea51 | |||
| e21c2e05bf | |||
| 8605de99e9 | |||
| 782f268e1c | |||
| 8065d0a559 | |||
| b71e31443a | |||
| 127942fbb3 | |||
| eb3719c5ef | |||
| f48e93ed26 | |||
| c1a8e992c8 | |||
| 4ae7f17da8 | |||
| 4188decad2 | |||
| 86872744cd | |||
| 97ef47c730 | |||
| eafbee08b8 | |||
| 18c66221b4 | |||
| df9efc20c1 | |||
| 6a7c402ebb | |||
| 2b2fc43f52 | |||
| aab60584d0 | |||
| 55abc20f5d | |||
| 247b72637d | |||
| e87f4d70c0 | |||
| 15f7298182 | |||
| 45b56528a8 | |||
| 16f267cbe0 | |||
| cf2df623db | |||
| cbfcf82a41 | |||
| cd7b8fec76 | |||
| 364178a024 | |||
| 80174f920a | |||
| 0959467783 | |||
| e247c0d532 | |||
| d8d07721ce | |||
| 666dcd756b | |||
| ef6b16a51a | |||
| 31982c028d | |||
| a03d37eb79 | |||
| be4190a349 | |||
| 7155457c6e | |||
| 376d3c2022 | |||
| 5065281f4c | |||
| b0c5c797b5 | |||
| 43eafbeb64 | |||
| fcd94ed171 |
+3
-1
@@ -12,4 +12,6 @@
|
||||
*.xccheckout
|
||||
*.xcuserdatad
|
||||
|
||||
Pods
|
||||
build/
|
||||
|
||||
Pods
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
# Code of Conduct
|
||||
Facebook has adopted a Code of Conduct that we expect project participants to adhere to. Please [read the full text](https://code.fb.com/codeofconduct) so that you can understand what actions will and will not be tolerated.
|
||||
+1
-1
@@ -14,7 +14,7 @@ possible. If you run into problems, please open an issue. We also actively welco
|
||||
In order to accept your pull request, we need you to submit a CLA. You only need
|
||||
to do this once to work on any of Facebook's open source projects.
|
||||
|
||||
Complete your CLA here: <https://developers.facebook.com/opensource/cla>
|
||||
Complete your CLA here: <https://code.facebook.com/cla>
|
||||
|
||||
## Issues
|
||||
We use GitHub issues to track public bugs. Please ensure your description is
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
077ACA6E1CBD6B7200B3A708 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 077ACA6D1CBD6B7200B3A708 /* UIKit.framework */; };
|
||||
EC45CACE18ADC7CE0063DD11 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EC45CACD18ADC7CE0063DD11 /* Foundation.framework */; };
|
||||
EC45CAD018ADC7CE0063DD11 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EC45CACF18ADC7CE0063DD11 /* CoreGraphics.framework */; };
|
||||
EC45CAD218ADC7CE0063DD11 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EC45CAD118ADC7CE0063DD11 /* UIKit.framework */; };
|
||||
EC45CAD818ADC7CE0063DD11 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = EC45CAD618ADC7CE0063DD11 /* InfoPlist.strings */; };
|
||||
EC45CADA18ADC7CE0063DD11 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = EC45CAD918ADC7CE0063DD11 /* main.m */; };
|
||||
EC45CADE18ADC7CE0063DD11 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = EC45CADD18ADC7CE0063DD11 /* AppDelegate.m */; };
|
||||
@@ -21,10 +21,10 @@
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
077ACA6D1CBD6B7200B3A708 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
|
||||
EC45CACA18ADC7CE0063DD11 /* Logo-iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Logo-iOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
EC45CACD18ADC7CE0063DD11 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
||||
EC45CACF18ADC7CE0063DD11 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
|
||||
EC45CAD118ADC7CE0063DD11 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; };
|
||||
EC45CAD518ADC7CE0063DD11 /* Logo-iOS-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Logo-iOS-Info.plist"; sourceTree = "<group>"; };
|
||||
EC45CAD718ADC7CE0063DD11 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
EC45CAD918ADC7CE0063DD11 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||
@@ -36,12 +36,7 @@
|
||||
EC45CAE518ADC7CE0063DD11 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
|
||||
EC45CAE618ADC7CE0063DD11 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
|
||||
EC45CAE818ADC7CE0063DD11 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
|
||||
EC45CAEF18ADC7CE0063DD11 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
|
||||
EC45CB0318ADC7E80063DD11 /* libFBShimmering.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libFBShimmering.a; path = "../../../Library/Developer/Xcode/DerivedData/FBShimmering-amnevtoymcgzwwazjmzbwvbeduoi/Build/Products/Debug-iphoneos/libFBShimmering.a"; sourceTree = "<group>"; };
|
||||
EC45CB0A18ADC8570063DD11 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
|
||||
EC45CB0D18ADC8570063DD11 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
|
||||
EC45CB0E18ADC8570063DD11 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; };
|
||||
EC45CB0F18ADC8570063DD11 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@@ -49,9 +44,9 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
077ACA6E1CBD6B7200B3A708 /* UIKit.framework in Frameworks */,
|
||||
EC45CB0418ADC7E80063DD11 /* libFBShimmering.a in Frameworks */,
|
||||
EC45CAD018ADC7CE0063DD11 /* CoreGraphics.framework in Frameworks */,
|
||||
EC45CAD218ADC7CE0063DD11 /* UIKit.framework in Frameworks */,
|
||||
EC45CACE18ADC7CE0063DD11 /* Foundation.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -66,7 +61,9 @@
|
||||
EC45CACC18ADC7CE0063DD11 /* Frameworks */,
|
||||
EC45CACB18ADC7CE0063DD11 /* Products */,
|
||||
);
|
||||
indentWidth = 2;
|
||||
sourceTree = "<group>";
|
||||
tabWidth = 2;
|
||||
};
|
||||
EC45CACB18ADC7CE0063DD11 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
@@ -82,10 +79,7 @@
|
||||
EC45CB0318ADC7E80063DD11 /* libFBShimmering.a */,
|
||||
EC45CACD18ADC7CE0063DD11 /* Foundation.framework */,
|
||||
EC45CACF18ADC7CE0063DD11 /* CoreGraphics.framework */,
|
||||
EC45CAD118ADC7CE0063DD11 /* UIKit.framework */,
|
||||
EC45CAEF18ADC7CE0063DD11 /* XCTest.framework */,
|
||||
EC45CB0A18ADC8570063DD11 /* Cocoa.framework */,
|
||||
EC45CB0C18ADC8570063DD11 /* Other Frameworks */,
|
||||
077ACA6D1CBD6B7200B3A708 /* UIKit.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
@@ -116,16 +110,6 @@
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
EC45CB0C18ADC8570063DD11 /* Other Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
EC45CB0D18ADC8570063DD11 /* AppKit.framework */,
|
||||
EC45CB0E18ADC8570063DD11 /* CoreData.framework */,
|
||||
EC45CB0F18ADC8570063DD11 /* Foundation.framework */,
|
||||
);
|
||||
name = "Other Frameworks";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
ECC5761518ADEDFC00C2BFB8 /* Logo */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -160,7 +144,7 @@
|
||||
EC45CAC018ADC7920063DD11 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0500;
|
||||
LastUpgradeCheck = 0510;
|
||||
};
|
||||
buildConfigurationList = EC45CAC318ADC7920063DD11 /* Build configuration list for PBXProject "Examples" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
@@ -238,12 +222,17 @@
|
||||
EC45CAC418ADC7920063DD11 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
EC45CAC518ADC7920063DD11 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
|
||||
SDKROOT = iphoneos;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
@@ -251,7 +240,6 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
@@ -289,7 +277,7 @@
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
INFOPLIST_FILE = "Logo-iOS/Logo-iOS-Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(USER_LIBRARY_DIR)/Developer/Xcode/DerivedData/FBShimmering-amnevtoymcgzwwazjmzbwvbeduoi/Build/Products/Debug-iphoneos",
|
||||
@@ -306,7 +294,6 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
@@ -338,7 +325,7 @@
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
INFOPLIST_FILE = "Logo-iOS/Logo-iOS-Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(USER_LIBRARY_DIR)/Developer/Xcode/DerivedData/FBShimmering-amnevtoymcgzwwazjmzbwvbeduoi/Build/Products/Debug-iphoneos",
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1110"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "EC45CAC918ADC7CE0063DD11"
|
||||
BuildableName = "Logo-iOS.app"
|
||||
BlueprintName = "Logo-iOS"
|
||||
ReferencedContainer = "container:Examples.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "EC45CAC918ADC7CE0063DD11"
|
||||
BuildableName = "Logo-iOS.app"
|
||||
BlueprintName = "Logo-iOS"
|
||||
ReferencedContainer = "container:Examples.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "EC45CAC918ADC7CE0063DD11"
|
||||
BuildableName = "Logo-iOS.app"
|
||||
BlueprintName = "Logo-iOS"
|
||||
ReferencedContainer = "container:Examples.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
@@ -0,0 +1,9 @@
|
||||
This file provided by Facebook is for non-commercial testing and evaluation
|
||||
purposes only. Facebook reserves all rights not expressly granted.
|
||||
|
||||
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
|
||||
FACEBOOK 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.
|
||||
@@ -19,7 +19,6 @@
|
||||
{
|
||||
UIImageView *_wallpaperView;
|
||||
FBShimmeringView *_shimmeringView;
|
||||
UIView *_contentView;
|
||||
UILabel *_logoLabel;
|
||||
|
||||
UILabel *_valueLabel;
|
||||
@@ -52,13 +51,10 @@
|
||||
_valueLabel.textAlignment = NSTextAlignmentCenter;
|
||||
_valueLabel.numberOfLines = 0;
|
||||
_valueLabel.alpha = 0.0;
|
||||
_valueLabel.backgroundColor = [UIColor clearColor];
|
||||
[self.view addSubview:_valueLabel];
|
||||
|
||||
CGRect shimmeringFrame = self.view.bounds;
|
||||
shimmeringFrame.origin.y = shimmeringFrame.size.height * 0.68;
|
||||
shimmeringFrame.size.height = shimmeringFrame.size.height * 0.32;
|
||||
|
||||
_shimmeringView = [[FBShimmeringView alloc] initWithFrame:shimmeringFrame];
|
||||
_shimmeringView = [[FBShimmeringView alloc] init];
|
||||
_shimmeringView.shimmering = YES;
|
||||
_shimmeringView.shimmeringBeginFadeDuration = 0.3;
|
||||
_shimmeringView.shimmeringOpacity = 0.3;
|
||||
@@ -69,6 +65,7 @@
|
||||
_logoLabel.font = [UIFont fontWithName:@"HelveticaNeue-UltraLight" size:60.0];
|
||||
_logoLabel.textColor = [UIColor whiteColor];
|
||||
_logoLabel.textAlignment = NSTextAlignmentCenter;
|
||||
_logoLabel.backgroundColor = [UIColor clearColor];
|
||||
_shimmeringView.contentView = _logoLabel;
|
||||
|
||||
UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(_tapped:)];
|
||||
@@ -78,6 +75,16 @@
|
||||
[self.view addGestureRecognizer:panRecognizer];
|
||||
}
|
||||
|
||||
- (void)viewWillLayoutSubviews
|
||||
{
|
||||
[super viewWillLayoutSubviews];
|
||||
|
||||
CGRect shimmeringFrame = self.view.bounds;
|
||||
shimmeringFrame.origin.y = shimmeringFrame.size.height * 0.68;
|
||||
shimmeringFrame.size.height = shimmeringFrame.size.height * 0.32;
|
||||
_shimmeringView.frame = shimmeringFrame;
|
||||
}
|
||||
|
||||
- (void)_tapped:(UITapGestureRecognizer *)tapRecognizer
|
||||
{
|
||||
_shimmeringView.shimmering = !_shimmeringView.shimmering;
|
||||
@@ -89,7 +96,11 @@
|
||||
CGPoint velocity = [panRecognizer velocityInView:self.view];
|
||||
|
||||
if (panRecognizer.state == UIGestureRecognizerStateBegan) {
|
||||
#if CGFLOAT_IS_DOUBLE
|
||||
_panVertical = (fabs(velocity.y) > fabs(velocity.x));
|
||||
#else
|
||||
_panVertical = (fabsf(velocity.y) > fabsf(velocity.x));
|
||||
#endif
|
||||
|
||||
if (_panVertical) {
|
||||
_panStartValue = _shimmeringView.shimmeringSpeed;
|
||||
|
||||
@@ -6,40 +6,23 @@
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXAggregateTarget section */
|
||||
ECEA612C18A4A7360064AFF4 /* Framework */ = {
|
||||
isa = PBXAggregateTarget;
|
||||
buildConfigurationList = ECEA612D18A4A7360064AFF4 /* Build configuration list for PBXAggregateTarget "Framework" */;
|
||||
buildPhases = (
|
||||
ECEA613218A4A76E0064AFF4 /* ShellScript */,
|
||||
);
|
||||
dependencies = (
|
||||
ECEA613118A4A73D0064AFF4 /* PBXTargetDependency */,
|
||||
);
|
||||
name = Framework;
|
||||
productName = Framework;
|
||||
};
|
||||
/* End PBXAggregateTarget section */
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
077ACA6A1CBD6B4300B3A708 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 077ACA691CBD6B4300B3A708 /* UIKit.framework */; };
|
||||
077ACA6C1CBD6B5800B3A708 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 077ACA6B1CBD6B5800B3A708 /* CoreGraphics.framework */; };
|
||||
1899D26B18BD1CFB0035A1B0 /* FBShimmeringView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1899D26718BD1CFB0035A1B0 /* FBShimmeringView.m */; };
|
||||
1899D26C18BD1CFB0035A1B0 /* FBShimmeringLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 1899D26918BD1CFB0035A1B0 /* FBShimmeringLayer.m */; };
|
||||
1899D27418BD201B0035A1B0 /* FBShimmering.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1899D26D18BD1D070035A1B0 /* FBShimmering.h */; };
|
||||
1899D27518BD201B0035A1B0 /* FBShimmeringView.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1899D26818BD1CFB0035A1B0 /* FBShimmeringView.h */; };
|
||||
1899D27618BD201B0035A1B0 /* FBShimmeringLayer.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1899D26A18BD1CFB0035A1B0 /* FBShimmeringLayer.h */; };
|
||||
A1C8E0BF1E13C0C9002D6069 /* Shimmer.h in Headers */ = {isa = PBXBuildFile; fileRef = A1C8E0BD1E13C0C9002D6069 /* Shimmer.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
A1C8E0C31E13C0D3002D6069 /* FBShimmering.h in Headers */ = {isa = PBXBuildFile; fileRef = 1899D26D18BD1D070035A1B0 /* FBShimmering.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
A1C8E0C41E13C0D3002D6069 /* FBShimmeringView.h in Headers */ = {isa = PBXBuildFile; fileRef = 1899D26818BD1CFB0035A1B0 /* FBShimmeringView.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
A1C8E0C51E13C0D3002D6069 /* FBShimmeringLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1899D26A18BD1CFB0035A1B0 /* FBShimmeringLayer.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
A1C8E0C61E13C0D8002D6069 /* FBShimmeringView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1899D26718BD1CFB0035A1B0 /* FBShimmeringView.m */; };
|
||||
A1C8E0C71E13C0D8002D6069 /* FBShimmeringLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 1899D26918BD1CFB0035A1B0 /* FBShimmeringLayer.m */; };
|
||||
ECEA610218A49C620064AFF4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ECEA610118A49C620064AFF4 /* Foundation.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
ECEA613018A4A73D0064AFF4 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = ECEA60F618A49C620064AFF4 /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = ECEA60FD18A49C620064AFF4;
|
||||
remoteInfo = FBShimmering;
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
ECEA60FC18A49C620064AFF4 /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
@@ -56,12 +39,16 @@
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
077ACA691CBD6B4300B3A708 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
|
||||
077ACA6B1CBD6B5800B3A708 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
|
||||
1899D26718BD1CFB0035A1B0 /* FBShimmeringView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBShimmeringView.m; sourceTree = "<group>"; };
|
||||
1899D26818BD1CFB0035A1B0 /* FBShimmeringView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBShimmeringView.h; sourceTree = "<group>"; };
|
||||
1899D26918BD1CFB0035A1B0 /* FBShimmeringLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBShimmeringLayer.m; sourceTree = "<group>"; };
|
||||
1899D26A18BD1CFB0035A1B0 /* FBShimmeringLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBShimmeringLayer.h; sourceTree = "<group>"; };
|
||||
1899D26D18BD1D070035A1B0 /* FBShimmering.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBShimmering.h; sourceTree = "<group>"; };
|
||||
5CEF702BB5574A90B448BF09 /* libPods-FBShimmeringTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-FBShimmeringTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
A1C8E0BB1E13C0C9002D6069 /* Shimmer.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Shimmer.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
A1C8E0BD1E13C0C9002D6069 /* Shimmer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Shimmer.h; sourceTree = "<group>"; };
|
||||
A1C8E0BE1E13C0C9002D6069 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
EC8BB5B318A5A1EE00EB2793 /* LICENSE */ = {isa = PBXFileReference; lastKnownFileType = text; path = LICENSE; sourceTree = "<group>"; };
|
||||
EC8BB5B418A5A1F500EB2793 /* PATENTS */ = {isa = PBXFileReference; lastKnownFileType = text; path = PATENTS; sourceTree = "<group>"; };
|
||||
EC8BB5B518A5A30700EB2793 /* CONTRIBUTING.md */ = {isa = PBXFileReference; lastKnownFileType = text; path = CONTRIBUTING.md; sourceTree = "<group>"; };
|
||||
@@ -69,15 +56,22 @@
|
||||
ECEA60FE18A49C620064AFF4 /* libFBShimmering.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libFBShimmering.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
ECEA610118A49C620064AFF4 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
||||
ECEA610518A49C620064AFF4 /* FBShimmering-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "FBShimmering-Prefix.pch"; sourceTree = "<group>"; };
|
||||
ECEA610F18A49C620064AFF4 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
|
||||
ECEA611218A49C620064AFF4 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
A1C8E0B71E13C0C9002D6069 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
ECEA60FB18A49C620064AFF4 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
077ACA6C1CBD6B5800B3A708 /* CoreGraphics.framework in Frameworks */,
|
||||
077ACA6A1CBD6B4300B3A708 /* UIKit.framework in Frameworks */,
|
||||
ECEA610218A49C620064AFF4 /* Foundation.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -85,6 +79,15 @@
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
A1C8E0BC1E13C0C9002D6069 /* Framework */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A1C8E0BD1E13C0C9002D6069 /* Shimmer.h */,
|
||||
A1C8E0BE1E13C0C9002D6069 /* Info.plist */,
|
||||
);
|
||||
path = Framework;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
ECEA60F518A49C620064AFF4 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -93,15 +96,19 @@
|
||||
EC8BB5B318A5A1EE00EB2793 /* LICENSE */,
|
||||
EC8BB5B418A5A1F500EB2793 /* PATENTS */,
|
||||
ECEA610318A49C620064AFF4 /* FBShimmering */,
|
||||
A1C8E0BC1E13C0C9002D6069 /* Framework */,
|
||||
ECEA610018A49C620064AFF4 /* Frameworks */,
|
||||
ECEA60FF18A49C620064AFF4 /* Products */,
|
||||
);
|
||||
indentWidth = 2;
|
||||
sourceTree = "<group>";
|
||||
tabWidth = 2;
|
||||
};
|
||||
ECEA60FF18A49C620064AFF4 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
ECEA60FE18A49C620064AFF4 /* libFBShimmering.a */,
|
||||
A1C8E0BB1E13C0C9002D6069 /* Shimmer.framework */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@@ -109,10 +116,9 @@
|
||||
ECEA610018A49C620064AFF4 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
077ACA6B1CBD6B5800B3A708 /* CoreGraphics.framework */,
|
||||
077ACA691CBD6B4300B3A708 /* UIKit.framework */,
|
||||
ECEA610118A49C620064AFF4 /* Foundation.framework */,
|
||||
ECEA610F18A49C620064AFF4 /* XCTest.framework */,
|
||||
ECEA611218A49C620064AFF4 /* UIKit.framework */,
|
||||
5CEF702BB5574A90B448BF09 /* libPods-FBShimmeringTests.a */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
@@ -140,7 +146,39 @@
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXHeadersBuildPhase section */
|
||||
A1C8E0B81E13C0C9002D6069 /* Headers */ = {
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
A1C8E0BF1E13C0C9002D6069 /* Shimmer.h in Headers */,
|
||||
A1C8E0C31E13C0D3002D6069 /* FBShimmering.h in Headers */,
|
||||
A1C8E0C41E13C0D3002D6069 /* FBShimmeringView.h in Headers */,
|
||||
A1C8E0C51E13C0D3002D6069 /* FBShimmeringLayer.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXHeadersBuildPhase section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
A1C8E0BA1E13C0C9002D6069 /* Shimmer */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = A1C8E0C01E13C0C9002D6069 /* Build configuration list for PBXNativeTarget "Shimmer" */;
|
||||
buildPhases = (
|
||||
A1C8E0B61E13C0C9002D6069 /* Sources */,
|
||||
A1C8E0B71E13C0C9002D6069 /* Frameworks */,
|
||||
A1C8E0B81E13C0C9002D6069 /* Headers */,
|
||||
A1C8E0B91E13C0C9002D6069 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = Shimmer;
|
||||
productName = Shimmer;
|
||||
productReference = A1C8E0BB1E13C0C9002D6069 /* Shimmer.framework */;
|
||||
productType = "com.apple.product-type.framework";
|
||||
};
|
||||
ECEA60FD18A49C620064AFF4 /* FBShimmering */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = ECEA612118A49C620064AFF4 /* Build configuration list for PBXNativeTarget "FBShimmering" */;
|
||||
@@ -165,8 +203,9 @@
|
||||
ECEA60F618A49C620064AFF4 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0500;
|
||||
ORGANIZATIONNAME = "Kimon Tsinteris";
|
||||
CLASSPREFIX = FB;
|
||||
LastUpgradeCheck = 0510;
|
||||
ORGANIZATIONNAME = Facebook;
|
||||
};
|
||||
buildConfigurationList = ECEA60F918A49C620064AFF4 /* Build configuration list for PBXProject "FBShimmering" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
@@ -181,11 +220,21 @@
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
ECEA60FD18A49C620064AFF4 /* FBShimmering */,
|
||||
ECEA612C18A4A7360064AFF4 /* Framework */,
|
||||
A1C8E0BA1E13C0C9002D6069 /* Shimmer */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
A1C8E0B91E13C0C9002D6069 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
ECEA612718A49DDD0064AFF4 /* ShellScript */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
@@ -200,22 +249,18 @@
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "set -e\n\nmkdir -p \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework/Versions/A/Headers\"\n\n# Link the \"Current\" version to \"A\"\n/bin/ln -sfh A \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework/Versions/Current\"\n/bin/ln -sfh Versions/Current/Headers \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework/Headers\"\n/bin/ln -sfh \"Versions/Current/${PRODUCT_NAME}\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework/${PRODUCT_NAME}\"\n\n# The -a ensures that the headers maintain the source modification date so that we don't constantly\n# cause propagating rebuilds of files that import these headers.\n/bin/cp -a \"${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}/\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework/Versions/A/Headers\"";
|
||||
};
|
||||
ECEA613218A4A76E0064AFF4 /* ShellScript */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "set -e\nset +u\n# Avoid recursively calling this script.\nif [[ $SF_MASTER_SCRIPT_RUNNING ]]\nthen\nexit 0\nfi\nset -u\nexport SF_MASTER_SCRIPT_RUNNING=1\n\nSF_TARGET_NAME=${PROJECT_NAME}\nSF_EXECUTABLE_PATH=\"lib${SF_TARGET_NAME}.a\"\nSF_WRAPPER_NAME=\"${SF_TARGET_NAME}.framework\"\n\n# The following conditionals come from\n# https://github.com/kstenerud/iOS-Universal-Framework\n\nif [[ \"$SDK_NAME\" =~ ([A-Za-z]+) ]]\nthen\nSF_SDK_PLATFORM=${BASH_REMATCH[1]}\nelse\necho \"Could not find platform name from SDK_NAME: $SDK_NAME\"\nexit 1\nfi\n\nif [[ \"$SDK_NAME\" =~ ([0-9]+.*$) ]]\nthen\nSF_SDK_VERSION=${BASH_REMATCH[1]}\nelse\necho \"Could not find sdk version from SDK_NAME: $SDK_NAME\"\nexit 1\nfi\n\nif [[ \"$SF_SDK_PLATFORM\" = \"iphoneos\" ]]\nthen\nSF_OTHER_PLATFORM=iphonesimulator\nelse\nSF_OTHER_PLATFORM=iphoneos\nfi\n\nif [[ \"$BUILT_PRODUCTS_DIR\" =~ (.*)$SF_SDK_PLATFORM$ ]]\nthen\nSF_OTHER_BUILT_PRODUCTS_DIR=\"${BASH_REMATCH[1]}${SF_OTHER_PLATFORM}\"\nelse\necho \"Could not find platform name from build products directory: $BUILT_PRODUCTS_DIR\"\nexit 1\nfi\n\n# Build the other platform.\nxcodebuild -project \"${PROJECT_FILE_PATH}\" -target \"${TARGET_NAME}\" -configuration \"${CONFIGURATION}\" -sdk ${SF_OTHER_PLATFORM}${SF_SDK_VERSION} BUILD_DIR=\"${BUILD_DIR}\" OBJROOT=\"${OBJROOT}\" BUILD_ROOT=\"${BUILD_ROOT}\" SYMROOT=\"${SYMROOT}\" $ACTION\n\n# Smash the two static libraries into one fat binary and store it in the .framework\nlipo -create \"${BUILT_PRODUCTS_DIR}/${SF_EXECUTABLE_PATH}\" \"${SF_OTHER_BUILT_PRODUCTS_DIR}/${SF_EXECUTABLE_PATH}\" -output \"${BUILT_PRODUCTS_DIR}/${SF_WRAPPER_NAME}/Versions/${FRAMEWORK_VERSION}/${SF_TARGET_NAME}\"\n\n# Copy the binary to the other architecture folder to have a complete framework in both.\ncp -a \"${BUILT_PRODUCTS_DIR}/${SF_WRAPPER_NAME}/Versions/${FRAMEWORK_VERSION}/${SF_TARGET_NAME}\" \"${SF_OTHER_BUILT_PRODUCTS_DIR}/${SF_WRAPPER_NAME}/Versions/${FRAMEWORK_VERSION}/${SF_TARGET_NAME}\"\n";
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
A1C8E0B61E13C0C9002D6069 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
A1C8E0C71E13C0D8002D6069 /* FBShimmeringLayer.m in Sources */,
|
||||
A1C8E0C61E13C0D8002D6069 /* FBShimmeringView.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
ECEA60FA18A49C620064AFF4 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -227,20 +272,76 @@
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
ECEA613118A4A73D0064AFF4 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = ECEA60FD18A49C620064AFF4 /* FBShimmering */;
|
||||
targetProxy = ECEA613018A4A73D0064AFF4 /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
A1C8E0C11E13C0C9002D6069 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
INFOPLIST_FILE = Framework/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.facebook.Shimmer;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
A1C8E0C21E13C0C9002D6069 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
INFOPLIST_FILE = Framework/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.facebook.Shimmer;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
ECEA611F18A49C620064AFF4 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
@@ -268,7 +369,7 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
};
|
||||
@@ -278,7 +379,6 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
@@ -300,7 +400,7 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
|
||||
SDKROOT = iphoneos;
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
@@ -338,23 +438,18 @@
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
ECEA612E18A4A7360064AFF4 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
ECEA612F18A4A7360064AFF4 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
A1C8E0C01E13C0C9002D6069 /* Build configuration list for PBXNativeTarget "Shimmer" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
A1C8E0C11E13C0C9002D6069 /* Debug */,
|
||||
A1C8E0C21E13C0C9002D6069 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
ECEA60F918A49C620064AFF4 /* Build configuration list for PBXProject "FBShimmering" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
@@ -373,15 +468,6 @@
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
ECEA612D18A4A7360064AFF4 /* Build configuration list for PBXAggregateTarget "Framework" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
ECEA612E18A4A7360064AFF4 /* Debug */,
|
||||
ECEA612F18A4A7360064AFF4 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = ECEA60F618A49C620064AFF4 /* Project object */;
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1110"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "ECEA60FD18A49C620064AFF4"
|
||||
BuildableName = "libFBShimmering.a"
|
||||
BlueprintName = "FBShimmering"
|
||||
ReferencedContainer = "container:FBShimmering.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "ECEA60FD18A49C620064AFF4"
|
||||
BuildableName = "libFBShimmering.a"
|
||||
BlueprintName = "FBShimmering"
|
||||
ReferencedContainer = "container:FBShimmering.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
@@ -0,0 +1,76 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0820"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "A1C8E0BA1E13C0C9002D6069"
|
||||
BuildableName = "Shimmer.framework"
|
||||
BlueprintName = "Shimmer"
|
||||
ReferencedContainer = "container:FBShimmering.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "A1C8E0BA1E13C0C9002D6069"
|
||||
BuildableName = "Shimmer.framework"
|
||||
BlueprintName = "Shimmer"
|
||||
ReferencedContainer = "container:FBShimmering.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "A1C8E0BA1E13C0C9002D6069"
|
||||
BuildableName = "Shimmer.framework"
|
||||
BlueprintName = "Shimmer"
|
||||
ReferencedContainer = "container:FBShimmering.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -7,22 +7,48 @@
|
||||
of patent rights can be found in the PATENTS file in the same directory.
|
||||
*/
|
||||
|
||||
#import <CoreGraphics/CoreGraphics.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
typedef NS_ENUM(NSInteger, FBShimmerDirection) {
|
||||
//! Shimmer animation goes from left to right
|
||||
FBShimmerDirectionRight,
|
||||
//! Shimmer animation goes from right to left
|
||||
FBShimmerDirectionLeft,
|
||||
//! Shimmer animation goes from below to above
|
||||
FBShimmerDirectionUp,
|
||||
//! Shimmer animation goes from above to below
|
||||
FBShimmerDirectionDown,
|
||||
};
|
||||
|
||||
static const float FBShimmerDefaultBeginTime = CGFLOAT_MAX;
|
||||
|
||||
@protocol FBShimmering <NSObject>
|
||||
|
||||
//! @abstract Set this to YES to start shimming and NO to stop. Defaults to NO.
|
||||
@property (nonatomic, assign, readwrite, getter = isShimmering) BOOL shimmering;
|
||||
@property (assign, nonatomic, readwrite, getter = isShimmering) BOOL shimmering;
|
||||
|
||||
//! @abstract The time interval between shimmerings in seconds. Defaults to 0.4.
|
||||
@property (assign, nonatomic, readwrite) CFTimeInterval shimmeringPauseDuration;
|
||||
|
||||
//! @abstract The opacity of the content while it is shimmering. Defaults to 0.5.
|
||||
@property (assign, nonatomic, readwrite) CGFloat shimmeringAnimationOpacity;
|
||||
|
||||
//! @abstract The opacity of the content before it is shimmering. Defaults to 1.0.
|
||||
@property (assign, nonatomic, readwrite) CGFloat shimmeringOpacity;
|
||||
|
||||
//! @abstract The speed of shimmering, in points per second. Defaults to 230.
|
||||
@property (assign, nonatomic, readwrite) CGFloat shimmeringSpeed;
|
||||
|
||||
//! @abstract The highlight length of shimmering. Range of [0,1], defaults to 1.0.
|
||||
@property (assign, nonatomic, readwrite) CGFloat shimmeringHighlightLength;
|
||||
|
||||
//! @abstract Same as "shimmeringHighlightLength", just for downward compatibility. @deprecated
|
||||
@property (assign, nonatomic, readwrite, getter = shimmeringHighlightLength, setter = setShimmeringHighlightLength:) CGFloat shimmeringHighlightWidth DEPRECATED_MSG_ATTRIBUTE("Use shimmeringHighlightLength");
|
||||
|
||||
//! @abstract The direction of shimmering animation. Defaults to FBShimmerDirectionRight.
|
||||
@property (assign, nonatomic, readwrite) FBShimmerDirection shimmeringDirection;
|
||||
|
||||
//! @abstract The duration of the fade used when shimmer begins. Defaults to 0.1.
|
||||
@property (assign, nonatomic, readwrite) CFTimeInterval shimmeringBeginFadeDuration;
|
||||
|
||||
@@ -35,5 +61,11 @@
|
||||
*/
|
||||
@property (assign, nonatomic, readonly) CFTimeInterval shimmeringFadeTime;
|
||||
|
||||
/**
|
||||
@abstract The absolute CoreAnimation media time when the shimmer will begin.
|
||||
@discussion Only valid after setting {@ref shimmering} to YES.
|
||||
*/
|
||||
@property (assign, nonatomic) CFTimeInterval shimmeringBeginTime;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -16,8 +16,12 @@
|
||||
#import <UIKit/UIGeometry.h>
|
||||
#import <UIKit/UIColor.h>
|
||||
|
||||
#if !__has_feature(objc_arc)
|
||||
#error This file must be compiled with ARC. Convert your project to ARC or specify the -fobjc-arc flag.
|
||||
#endif
|
||||
|
||||
#if TARGET_IPHONE_SIMULATOR
|
||||
UIKIT_EXTERN CGFloat UIAnimationDragCoefficient(void); // UIKit private drag coeffient, use judiciously
|
||||
UIKIT_EXTERN float UIAnimationDragCoefficient(void); // UIKit private drag coeffient, use judiciously
|
||||
#endif
|
||||
|
||||
static CGFloat FBShimmeringLayerDragCoefficient(void)
|
||||
@@ -43,47 +47,39 @@ static NSString *const kFBShimmerSlideAnimationKey = @"slide";
|
||||
static NSString *const kFBFadeAnimationKey = @"fade";
|
||||
static NSString *const kFBEndFadeAnimationKey = @"fade-end";
|
||||
|
||||
static CABasicAnimation *fade_animation(id delegate, CALayer *layer, CGFloat opacity, CFTimeInterval duration)
|
||||
static CABasicAnimation *fade_animation(CALayer *layer, CGFloat opacity, CFTimeInterval duration)
|
||||
{
|
||||
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"opacity"];
|
||||
animation.delegate = delegate;
|
||||
animation.fromValue = @([layer.presentationLayer opacity]);
|
||||
animation.fromValue = @([(layer.presentationLayer ?: layer) opacity]);
|
||||
animation.toValue = @(opacity);
|
||||
animation.fillMode = kCAFillModeBoth;
|
||||
animation.removedOnCompletion = NO;
|
||||
animation.duration = duration;
|
||||
FBShimmeringLayerAnimationApplyDragCoefficient(animation);
|
||||
return animation;
|
||||
}
|
||||
|
||||
static CABasicAnimation *shimmer_begin_fade_animation(id delegate, CALayer *layer, CGFloat opacity, CGFloat duration)
|
||||
{
|
||||
return fade_animation(delegate, layer, opacity, duration);
|
||||
}
|
||||
|
||||
static CABasicAnimation *shimmer_end_fade_animation(id delegate, CALayer *layer, CGFloat opacity, CGFloat duration)
|
||||
{
|
||||
CABasicAnimation *animation = fade_animation(delegate, layer, opacity, duration);
|
||||
[animation setValue:@YES forKey:kFBEndFadeAnimationKey];
|
||||
return animation;
|
||||
}
|
||||
|
||||
static CABasicAnimation *shimmer_slide_animation(id delegate, CFTimeInterval duration)
|
||||
static CABasicAnimation *shimmer_slide_animation(CFTimeInterval duration, FBShimmerDirection direction)
|
||||
{
|
||||
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"position"];
|
||||
animation.delegate = delegate;
|
||||
animation.toValue = [NSValue valueWithCGPoint:CGPointZero];
|
||||
animation.duration = duration;
|
||||
animation.repeatCount = HUGE_VALF;
|
||||
FBShimmeringLayerAnimationApplyDragCoefficient(animation);
|
||||
if (direction == FBShimmerDirectionLeft ||
|
||||
direction == FBShimmerDirectionUp) {
|
||||
animation.speed = -fabsf(animation.speed);
|
||||
}
|
||||
return animation;
|
||||
}
|
||||
|
||||
// take a shimmer slide animation and turns into repeating
|
||||
static CAAnimation *shimmer_slide_repeat(CAAnimation *a, CFTimeInterval duration)
|
||||
static CAAnimation *shimmer_slide_repeat(CAAnimation *a, CFTimeInterval duration, FBShimmerDirection direction)
|
||||
{
|
||||
CAAnimation *anim = [a copy];
|
||||
anim.repeatCount = HUGE_VALF;
|
||||
anim.duration = duration;
|
||||
anim.speed = (direction == FBShimmerDirectionRight || direction == FBShimmerDirectionDown) ? fabsf(anim.speed) : -fabsf(anim.speed);
|
||||
return anim;
|
||||
}
|
||||
|
||||
@@ -123,6 +119,11 @@ static CAAnimation *shimmer_slide_finish(CAAnimation *a)
|
||||
@end
|
||||
|
||||
@interface FBShimmeringLayer ()
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 100000
|
||||
// iOS 10 SDK has CALayerDelegate and CAAnimationDelegate as proper protocols.
|
||||
<CALayerDelegate, CAAnimationDelegate>
|
||||
#endif
|
||||
|
||||
@property (strong, nonatomic) FBShimmeringMaskLayer *maskLayer;
|
||||
@end
|
||||
|
||||
@@ -136,11 +137,16 @@ static CAAnimation *shimmer_slide_finish(CAAnimation *a)
|
||||
|
||||
@synthesize shimmering = _shimmering;
|
||||
@synthesize shimmeringPauseDuration = _shimmeringPauseDuration;
|
||||
@synthesize shimmeringAnimationOpacity = _shimmeringAnimationOpacity;
|
||||
@synthesize shimmeringOpacity = _shimmeringOpacity;
|
||||
@synthesize shimmeringSpeed = _shimmeringSpeed;
|
||||
@synthesize shimmeringHighlightLength = _shimmeringHighlightLength;
|
||||
@synthesize shimmeringDirection = _shimmeringDirection;
|
||||
@synthesize shimmeringFadeTime = _shimmeringFadeTime;
|
||||
@synthesize shimmeringBeginFadeDuration = _shimmeringBeginFadeDuration;
|
||||
@synthesize shimmeringEndFadeDuration = _shimmeringEndFadeDuration;
|
||||
@synthesize shimmeringBeginTime = _shimmeringBeginTime;
|
||||
@dynamic shimmeringHighlightWidth;
|
||||
|
||||
- (instancetype)init
|
||||
{
|
||||
@@ -149,9 +155,13 @@ static CAAnimation *shimmer_slide_finish(CAAnimation *a)
|
||||
// default configuration
|
||||
_shimmeringPauseDuration = 0.4;
|
||||
_shimmeringSpeed = 230.0;
|
||||
_shimmeringOpacity = 0.5;
|
||||
_shimmeringHighlightLength = 1.0;
|
||||
_shimmeringAnimationOpacity = 0.5;
|
||||
_shimmeringOpacity = 1.0;
|
||||
_shimmeringDirection = FBShimmerDirectionRight;
|
||||
_shimmeringBeginFadeDuration = 0.1;
|
||||
_shimmeringEndFadeDuration = 0.3;
|
||||
_shimmeringBeginTime = FBShimmerDefaultBeginTime;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@@ -179,7 +189,7 @@ static CAAnimation *shimmer_slide_finish(CAAnimation *a)
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setShimmeringSpeed:(float)speed
|
||||
- (void)setShimmeringSpeed:(CGFloat)speed
|
||||
{
|
||||
if (speed != _shimmeringSpeed) {
|
||||
_shimmeringSpeed = speed;
|
||||
@@ -187,6 +197,22 @@ static CAAnimation *shimmer_slide_finish(CAAnimation *a)
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setShimmeringHighlightLength:(CGFloat)length
|
||||
{
|
||||
if (length != _shimmeringHighlightLength) {
|
||||
_shimmeringHighlightLength = length;
|
||||
[self _updateShimmering];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setShimmeringDirection:(FBShimmerDirection)direction
|
||||
{
|
||||
if (direction != _shimmeringDirection) {
|
||||
_shimmeringDirection = direction;
|
||||
[self _updateShimmering];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setShimmeringPauseDuration:(CFTimeInterval)duration
|
||||
{
|
||||
if (duration != _shimmeringPauseDuration) {
|
||||
@@ -195,6 +221,14 @@ static CAAnimation *shimmer_slide_finish(CAAnimation *a)
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setShimmeringAnimationOpacity:(CGFloat)shimmeringAnimationOpacity
|
||||
{
|
||||
if (shimmeringAnimationOpacity != _shimmeringAnimationOpacity) {
|
||||
_shimmeringAnimationOpacity = shimmeringAnimationOpacity;
|
||||
[self _updateMaskColors];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setShimmeringOpacity:(CGFloat)shimmeringOpacity
|
||||
{
|
||||
if (shimmeringOpacity != _shimmeringOpacity) {
|
||||
@@ -203,17 +237,37 @@ static CAAnimation *shimmer_slide_finish(CAAnimation *a)
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setShimmeringBeginTime:(CFTimeInterval)beginTime
|
||||
{
|
||||
if (beginTime != _shimmeringBeginTime) {
|
||||
_shimmeringBeginTime = beginTime;
|
||||
[self _updateShimmering];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)layoutSublayers
|
||||
{
|
||||
[super layoutSublayers];
|
||||
CGRect r = self.bounds;
|
||||
_contentLayer.anchorPoint = CGPointMake(0.5, 0.5);
|
||||
_contentLayer.bounds = r;
|
||||
_contentLayer.position = CGPointMake(CGRectGetMidX(r), CGRectGetMidY(r));
|
||||
|
||||
if (nil != _maskLayer) {
|
||||
[self _updateMaskLayout];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setBounds:(CGRect)bounds
|
||||
{
|
||||
CGRect oldBounds = self.bounds;
|
||||
[super setBounds:bounds];
|
||||
|
||||
if (!CGRectEqualToRect(oldBounds, bounds)) {
|
||||
[self _updateShimmering];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Internal
|
||||
|
||||
- (void)_clearMask
|
||||
@@ -251,7 +305,7 @@ static CAAnimation *shimmer_slide_finish(CAAnimation *a)
|
||||
// We create a gradient to be used as a mask.
|
||||
// In a mask, the colors do not matter, it's the alpha that decides the degree of masking.
|
||||
UIColor *maskedColor = [UIColor colorWithWhite:1.0 alpha:_shimmeringOpacity];
|
||||
UIColor *unmaskedColor = [UIColor whiteColor];
|
||||
UIColor *unmaskedColor = [UIColor colorWithWhite:1.0 alpha:_shimmeringAnimationOpacity];
|
||||
|
||||
// Create a gradient from masked to unmasked to masked.
|
||||
_maskLayer.colors = @[(__bridge id)maskedColor.CGColor, (__bridge id)unmaskedColor.CGColor, (__bridge id)maskedColor.CGColor];
|
||||
@@ -260,26 +314,47 @@ static CAAnimation *shimmer_slide_finish(CAAnimation *a)
|
||||
- (void)_updateMaskLayout
|
||||
{
|
||||
// Everything outside the mask layer is hidden, so we need to create a mask long enough for the shimmered layer to be always covered by the mask.
|
||||
CGFloat width = CGRectGetWidth(_contentLayer.bounds);
|
||||
if (0 == width) {
|
||||
CGFloat length = 0.0f;
|
||||
if (_shimmeringDirection == FBShimmerDirectionDown ||
|
||||
_shimmeringDirection == FBShimmerDirectionUp) {
|
||||
length = CGRectGetHeight(_contentLayer.bounds);
|
||||
} else {
|
||||
length = CGRectGetWidth(_contentLayer.bounds);
|
||||
}
|
||||
if (0 == length) {
|
||||
return;
|
||||
}
|
||||
|
||||
// extra distance for the gradient to travel during the pause.
|
||||
CGFloat extraDistance = width + _shimmeringSpeed * _shimmeringPauseDuration;
|
||||
CGFloat extraDistance = length + _shimmeringSpeed * _shimmeringPauseDuration;
|
||||
|
||||
// compute how far the shimmering goes
|
||||
CGFloat fullShimmerLength = width * 3.0f + extraDistance;
|
||||
CGFloat travelDistance = width * 2.0f + extraDistance;
|
||||
|
||||
// setup the gradient for shimmering
|
||||
_maskLayer.startPoint = CGPointMake((width + extraDistance) / fullShimmerLength, 0.0);
|
||||
_maskLayer.endPoint = CGPointMake(travelDistance / fullShimmerLength, 0.0);
|
||||
CGFloat fullShimmerLength = length * 3.0f + extraDistance;
|
||||
CGFloat travelDistance = length * 2.0f + extraDistance;
|
||||
|
||||
// position the gradient for the desired width
|
||||
CGFloat highlightOutsideLength = (1.0 - _shimmeringHighlightLength) / 2.0;
|
||||
_maskLayer.locations = @[@(highlightOutsideLength),
|
||||
@(0.5),
|
||||
@(1.0 - highlightOutsideLength)];
|
||||
|
||||
CGFloat startPoint = (length + extraDistance) / fullShimmerLength;
|
||||
CGFloat endPoint = travelDistance / fullShimmerLength;
|
||||
|
||||
// position for the start of the animation
|
||||
_maskLayer.anchorPoint = CGPointZero;
|
||||
_maskLayer.position = CGPointMake(-travelDistance, 0.0);
|
||||
_maskLayer.bounds = CGRectMake(0.0, 0.0, fullShimmerLength, CGRectGetHeight(_contentLayer.bounds));
|
||||
if (_shimmeringDirection == FBShimmerDirectionDown ||
|
||||
_shimmeringDirection == FBShimmerDirectionUp) {
|
||||
_maskLayer.startPoint = CGPointMake(0.0, startPoint);
|
||||
_maskLayer.endPoint = CGPointMake(0.0, endPoint);
|
||||
_maskLayer.position = CGPointMake(0.0, -travelDistance);
|
||||
_maskLayer.bounds = CGRectMake(0.0, 0.0, CGRectGetWidth(_contentLayer.bounds), fullShimmerLength);
|
||||
} else {
|
||||
_maskLayer.startPoint = CGPointMake(startPoint, 0.0);
|
||||
_maskLayer.endPoint = CGPointMake(endPoint, 0.0);
|
||||
_maskLayer.position = CGPointMake(-travelDistance, 0.0);
|
||||
_maskLayer.bounds = CGRectMake(0.0, 0.0, fullShimmerLength, CGRectGetHeight(_contentLayer.bounds));
|
||||
}
|
||||
}
|
||||
|
||||
- (void)_updateShimmering
|
||||
@@ -292,7 +367,7 @@ static CAAnimation *shimmer_slide_finish(CAAnimation *a)
|
||||
return;
|
||||
}
|
||||
|
||||
// ensure layed out
|
||||
// ensure layout
|
||||
[self layoutIfNeeded];
|
||||
|
||||
BOOL disableActions = [CATransaction disableActions];
|
||||
@@ -306,7 +381,8 @@ static CAAnimation *shimmer_slide_finish(CAAnimation *a)
|
||||
|
||||
CAAnimation *slideAnimation = [_maskLayer animationForKey:kFBShimmerSlideAnimationKey];
|
||||
if (slideAnimation != nil) {
|
||||
// determing total time sliding
|
||||
|
||||
// determine total time sliding
|
||||
CFTimeInterval now = CACurrentMediaTime();
|
||||
CFTimeInterval slideTotalDuration = now - slideAnimation.beginTime;
|
||||
|
||||
@@ -325,7 +401,9 @@ static CAAnimation *shimmer_slide_finish(CAAnimation *a)
|
||||
}
|
||||
|
||||
// fade in text at slideEndTime
|
||||
CABasicAnimation *fadeInAnimation = shimmer_end_fade_animation(self, _maskLayer.fadeLayer, 1.0, _shimmeringEndFadeDuration);
|
||||
CABasicAnimation *fadeInAnimation = fade_animation(_maskLayer.fadeLayer, 1.0, _shimmeringEndFadeDuration);
|
||||
fadeInAnimation.delegate = self;
|
||||
[fadeInAnimation setValue:@YES forKey:kFBEndFadeAnimationKey];
|
||||
fadeInAnimation.beginTime = slideEndTime;
|
||||
[_maskLayer.fadeLayer addAnimation:fadeInAnimation forKey:kFBFadeAnimationKey];
|
||||
|
||||
@@ -336,33 +414,44 @@ static CAAnimation *shimmer_slide_finish(CAAnimation *a)
|
||||
// fade out text, optionally animated
|
||||
CABasicAnimation *fadeOutAnimation = nil;
|
||||
if (_shimmeringBeginFadeDuration > 0.0 && !disableActions) {
|
||||
fadeOutAnimation = shimmer_begin_fade_animation(self, _maskLayer.fadeLayer, 0.0, _shimmeringBeginFadeDuration);
|
||||
fadeOutAnimation = fade_animation(_maskLayer.fadeLayer, 0.0, _shimmeringBeginFadeDuration);
|
||||
[_maskLayer.fadeLayer addAnimation:fadeOutAnimation forKey:kFBFadeAnimationKey];
|
||||
} else {
|
||||
BOOL disableActions = [CATransaction disableActions];
|
||||
BOOL innerDisableActions = [CATransaction disableActions];
|
||||
[CATransaction setDisableActions:YES];
|
||||
|
||||
_maskLayer.fadeLayer.opacity = 0.0;
|
||||
[_maskLayer.fadeLayer removeAllAnimations];
|
||||
|
||||
[CATransaction setDisableActions:disableActions];
|
||||
[CATransaction setDisableActions:innerDisableActions];
|
||||
}
|
||||
|
||||
// begin slide animation
|
||||
CAAnimation *slideAnimation = [_maskLayer animationForKey:kFBShimmerSlideAnimationKey];
|
||||
|
||||
// compute shimmer duration
|
||||
CFTimeInterval animationDuration = (CGRectGetWidth(_contentLayer.bounds) / _shimmeringSpeed) + _shimmeringPauseDuration;
|
||||
CGFloat length = 0.0f;
|
||||
if (_shimmeringDirection == FBShimmerDirectionDown ||
|
||||
_shimmeringDirection == FBShimmerDirectionUp) {
|
||||
length = CGRectGetHeight(_contentLayer.bounds);
|
||||
} else {
|
||||
length = CGRectGetWidth(_contentLayer.bounds);
|
||||
}
|
||||
CFTimeInterval animationDuration = (length / _shimmeringSpeed) + _shimmeringPauseDuration;
|
||||
|
||||
if (slideAnimation != nil) {
|
||||
// ensure existing slide animation repeats
|
||||
[_maskLayer addAnimation:shimmer_slide_repeat(slideAnimation, animationDuration) forKey:kFBShimmerSlideAnimationKey];
|
||||
[_maskLayer addAnimation:shimmer_slide_repeat(slideAnimation, animationDuration, _shimmeringDirection) forKey:kFBShimmerSlideAnimationKey];
|
||||
} else {
|
||||
// add slide animation
|
||||
slideAnimation = shimmer_slide_animation(self, animationDuration);
|
||||
slideAnimation = shimmer_slide_animation(animationDuration, _shimmeringDirection);
|
||||
slideAnimation.fillMode = kCAFillModeForwards;
|
||||
slideAnimation.removedOnCompletion = NO;
|
||||
slideAnimation.beginTime = CACurrentMediaTime() + fadeOutAnimation.duration;
|
||||
if (_shimmeringBeginTime == FBShimmerDefaultBeginTime) {
|
||||
_shimmeringBeginTime = CACurrentMediaTime() + fadeOutAnimation.duration;
|
||||
}
|
||||
slideAnimation.beginTime = _shimmeringBeginTime;
|
||||
|
||||
[_maskLayer addAnimation:slideAnimation forKey:kFBShimmerSlideAnimationKey];
|
||||
}
|
||||
}
|
||||
@@ -381,6 +470,8 @@ static CAAnimation *shimmer_slide_finish(CAAnimation *a)
|
||||
- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag
|
||||
{
|
||||
if (flag && [[anim valueForKey:kFBEndFadeAnimationKey] boolValue]) {
|
||||
[_maskLayer.fadeLayer removeAnimationForKey:kFBFadeAnimationKey];
|
||||
|
||||
[self _clearMask];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
|
||||
#import "FBShimmeringLayer.h"
|
||||
|
||||
#if !__has_feature(objc_arc)
|
||||
#error This file must be compiled with ARC. Convert your project to ARC or specify the -fobjc-arc flag.
|
||||
#endif
|
||||
|
||||
@implementation FBShimmeringView
|
||||
|
||||
+ (Class)layerClass
|
||||
@@ -34,13 +38,17 @@
|
||||
LAYER_ACCESSOR (accessor, ctype) \
|
||||
LAYER_MUTATOR (mutator, ctype)
|
||||
|
||||
LAYER_RW_PROPERTY(isShimmering, setShimmering:, BOOL);
|
||||
LAYER_RW_PROPERTY(shimmeringPauseDuration, setShimmeringPauseDuration:, CFTimeInterval);
|
||||
LAYER_RW_PROPERTY(shimmeringOpacity, setShimmeringOpacity:, CGFloat);
|
||||
LAYER_RW_PROPERTY(shimmeringSpeed, setShimmeringSpeed:, CGFloat);
|
||||
LAYER_ACCESSOR(shimmeringFadeTime, CFTimeInterval);
|
||||
LAYER_RW_PROPERTY(shimmeringBeginFadeDuration, setShimmeringBeginFadeDuration:, CFTimeInterval);
|
||||
LAYER_RW_PROPERTY(shimmeringEndFadeDuration, setShimmeringEndFadeDuration:, CFTimeInterval);
|
||||
LAYER_RW_PROPERTY(isShimmering, setShimmering:, BOOL)
|
||||
LAYER_RW_PROPERTY(shimmeringPauseDuration, setShimmeringPauseDuration:, CFTimeInterval)
|
||||
LAYER_RW_PROPERTY(shimmeringAnimationOpacity, setShimmeringAnimationOpacity:, CGFloat)
|
||||
LAYER_RW_PROPERTY(shimmeringOpacity, setShimmeringOpacity:, CGFloat)
|
||||
LAYER_RW_PROPERTY(shimmeringSpeed, setShimmeringSpeed:, CGFloat)
|
||||
LAYER_RW_PROPERTY(shimmeringHighlightLength, setShimmeringHighlightLength:, CGFloat)
|
||||
LAYER_RW_PROPERTY(shimmeringDirection, setShimmeringDirection:, FBShimmerDirection)
|
||||
LAYER_ACCESSOR(shimmeringFadeTime, CFTimeInterval)
|
||||
LAYER_RW_PROPERTY(shimmeringBeginFadeDuration, setShimmeringBeginFadeDuration:, CFTimeInterval)
|
||||
LAYER_RW_PROPERTY(shimmeringEndFadeDuration, setShimmeringEndFadeDuration:, CFTimeInterval)
|
||||
LAYER_RW_PROPERTY(shimmeringBeginTime, setShimmeringBeginTime:, CFTimeInterval)
|
||||
|
||||
- (void)setContentView:(UIView *)contentView
|
||||
{
|
||||
@@ -51,4 +59,15 @@ LAYER_RW_PROPERTY(shimmeringEndFadeDuration, setShimmeringEndFadeDuration:, CFTi
|
||||
}
|
||||
}
|
||||
|
||||
- (void)layoutSubviews
|
||||
{
|
||||
// Autolayout requires these to be set on the UIView, not the CALayer.
|
||||
// Do this *before* the layer has a chance to set the properties, as the
|
||||
// setters would be ignored (even for autolayout) if set to the same value.
|
||||
_contentView.bounds = self.bounds;
|
||||
_contentView.center = self.center;
|
||||
|
||||
[super layoutSubviews];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
Copyright (c) 2014-present, Facebook, Inc.
|
||||
All rights reserved.
|
||||
|
||||
This source code is licensed under the BSD-style license found in the
|
||||
LICENSE file in the root directory of this source tree. An additional grant
|
||||
of patent rights can be found in the PATENTS file in the same directory.
|
||||
*/
|
||||
|
||||
#import <Shimmer/FBShimmering.h>
|
||||
#import <Shimmer/FBShimmeringView.h>
|
||||
#import <Shimmer/FBShimmeringLayer.h>
|
||||
@@ -1,23 +0,0 @@
|
||||
Additional Grant of Patent Rights
|
||||
|
||||
"Software" means the Shimmer software distributed by Facebook, Inc.
|
||||
|
||||
Facebook hereby grants you a perpetual, worldwide, royalty-free, non-exclusive,
|
||||
irrevocable (subject to the termination provision below) license under any
|
||||
rights in any patent claims owned by Facebook, to make, have made, use, sell,
|
||||
offer to sell, import, and otherwise transfer the Software. For avoidance of
|
||||
doubt, no license is granted under Facebook’s rights in any patent claims that
|
||||
are infringed by (i) modifications to the Software made by you or a third party,
|
||||
or (ii) the Software in combination with any software or other technology
|
||||
provided by you or a third party.
|
||||
|
||||
The license granted hereunder will terminate, automatically and without notice,
|
||||
for anyone that makes any claim (including by filing any lawsuit, assertion or
|
||||
other action) alleging (a) direct, indirect, or contributory infringement or
|
||||
inducement to infringe any patent: (i) by Facebook or any of its subsidiaries or
|
||||
affiliates, whether or not such claim is related to the Software, (ii) by any
|
||||
party if such claim arises in whole or in part from any software, product or
|
||||
service of Facebook or any of its subsidiaries or affiliates, whether or not
|
||||
such claim is related to the Software, or (iii) by any party relating to the
|
||||
Software; or (b) that any right in any patent claim of Facebook is invalid or
|
||||
unenforceable.
|
||||
@@ -11,7 +11,7 @@ To use Shimmer, create a `FBShimmeringView` or `FBShimmeringLayer` and add your
|
||||
An example of making a label shimmer:
|
||||
|
||||
```objective-c
|
||||
FBShimmeringView *shimmeringView = [[FBShimeringView alloc] initWithFrame:self.view.bounds];
|
||||
FBShimmeringView *shimmeringView = [[FBShimmeringView alloc] initWithFrame:self.view.bounds];
|
||||
[self.view addSubview:shimmeringView];
|
||||
|
||||
UILabel *loadingLabel = [[UILabel alloc] initWithFrame:shimmeringView.bounds];
|
||||
@@ -23,12 +23,12 @@ shimmeringView.contentView = loadingLabel;
|
||||
shimmeringView.shimmering = YES;
|
||||
```
|
||||
|
||||
There's also an example project. In the example, you can swipe horizontally and vertically to try various shimmering parameters, or tap to start or stop shimmering.
|
||||
There's also an example project. In the example, you can swipe horizontally and vertically to try various shimmering parameters, or tap to start or stop shimmering. (To build the example locally, you'll need to open `FBShimmering.xcworkpace` rather than the `.xcodeproj`.)
|
||||
|
||||
## Installation
|
||||
There are two options:
|
||||
|
||||
1. Use [Cocoapods](http://cocoapods.org). Shimmer isn't yet available in the main Cocoapods repository, but it will be soon. For now, you can reference this repository directly.
|
||||
1. Shimmer is available as `Shimmer` in [Cocoapods](http://cocoapods.org).
|
||||
2. Manually add the files into your Xcode project. Slightly simpler, but updates are also manual.
|
||||
|
||||
Shimmer requires iOS 6 or later.
|
||||
@@ -36,9 +36,13 @@ Shimmer requires iOS 6 or later.
|
||||
## How it works
|
||||
Shimmer uses the `-[CALayer mask]` property to enable shimmering, similar to what's described in John Harper's 2009 WWDC talk (unfortunately no longer online). Shimmer uses CoreAnimation's timing features to smoothly transition "on-beat" when starting and stopping the shimmer.
|
||||
|
||||
## Other Platforms
|
||||
|
||||
We have a version of Shimmer for Android, too! It's [also available on GitHub](https://github.com/facebook/shimmer-android).
|
||||
|
||||
## Contributing
|
||||
See the CONTRIBUTING file for how to help out.
|
||||
|
||||
## License
|
||||
Shimmer is BSD-licensed. We also provide an additional patent grant.
|
||||
Shimmer is BSD-licensed.
|
||||
|
||||
|
||||
+2
-2
@@ -1,11 +1,11 @@
|
||||
Pod::Spec.new do |spec|
|
||||
spec.name = 'Shimmer'
|
||||
spec.version = '0.0.1'
|
||||
spec.version = '1.0.2'
|
||||
spec.license = { :type => 'BSD' }
|
||||
spec.homepage = 'https://github.com/facebook/Shimmer'
|
||||
spec.authors = { 'Grant Paul' => 'shimmer@grantpaul.com', 'Kimon Tsinteris' => 'kimon@mac.com' }
|
||||
spec.summary = 'Simple shimmering effect.'
|
||||
spec.source = { :git => 'https://github.com/facebook/Shimmer.git', :commit => '313cab89e74238dfea940151561e407042cade51' }
|
||||
spec.source = { :git => 'https://github.com/facebook/Shimmer.git', :tag => '1.0.2' }
|
||||
spec.source_files = 'FBShimmering/FBShimmering{,View,Layer}.{h,m}'
|
||||
spec.requires_arc = true
|
||||
|
||||
|
||||
Reference in New Issue
Block a user