├── loadingSkeletonDemo ├── loadingSkeletonDemo │ ├── Assets.xcassets │ │ ├── Contents.json │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── ViewController.h │ ├── AppDelegate.h │ ├── TableViewController.h │ ├── main.m │ ├── ViewController.m │ ├── Info.plist │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── AppDelegate.m │ └── TableViewController.m ├── loadingSkeletonDemo.xcodeproj │ ├── xcuserdata │ │ └── kevin.xcuserdatad │ │ │ ├── xcdebugger │ │ │ └── Breakpoints_v2.xcbkptlist │ │ │ └── xcschemes │ │ │ └── xcschememanagement.plist │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcuserdata │ │ │ └── kevin.xcuserdatad │ │ │ │ └── UserInterfaceState.xcuserstate │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── project.pbxproj └── loadingSkeletonView │ ├── JKSkeletonLoader.h │ └── JKSkeletonLoader.m ├── README.md └── LICENSE /loadingSkeletonDemo/loadingSkeletonDemo/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /loadingSkeletonDemo/loadingSkeletonDemo.xcodeproj/xcuserdata/kevin.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /loadingSkeletonDemo/loadingSkeletonDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /loadingSkeletonDemo/loadingSkeletonDemo.xcodeproj/project.xcworkspace/xcuserdata/kevin.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangjk4859/loadingSkeletonView/HEAD/loadingSkeletonDemo/loadingSkeletonDemo.xcodeproj/project.xcworkspace/xcuserdata/kevin.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /loadingSkeletonDemo/loadingSkeletonDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // loadingSkeletonDemo 4 | // 5 | // Created by kevin on 2019/4/24. 6 | // Copyright © 2019 kevin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /loadingSkeletonDemo/loadingSkeletonDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /loadingSkeletonDemo/loadingSkeletonDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // loadingSkeletonDemo 4 | // 5 | // Created by kevin on 2019/4/24. 6 | // Copyright © 2019 kevin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /loadingSkeletonDemo/loadingSkeletonDemo/TableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TableViewController.h 3 | // loadingSkeletonDemo 4 | // 5 | // Created by kevin on 2019/4/24. 6 | // Copyright © 2019 kevin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface TableViewController : UITableViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /loadingSkeletonDemo/loadingSkeletonDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // loadingSkeletonDemo 4 | // 5 | // Created by kevin on 2019/4/24. 6 | // Copyright © 2019 kevin. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # loadingSkeletonView 简介 2 | 效果: 3 | ![Preview](http://g.recordit.co/xAV7KP5lCz.gif) 4 | 5 | 此代码是 [loader.swift](https://github.com/samhann/Loader.swift) 的OC版 6 | 7 | #使用方法 8 | - JKSkeletonLoader类拖进工程 9 | - import "JKSkeletonLoader.h" 10 | - 调用 11 | ``` 12 | //加载视图 13 | [JKSkeletonLoader addLoaderToTargetView:self.tableView]; 14 | //移除视图 15 | [JKSkeletonLoader removeLoaderFromTargetView:self.tableView]; 16 | ``` 17 | 18 | 后续还有待继续改进... 19 | -------------------------------------------------------------------------------- /loadingSkeletonDemo/loadingSkeletonDemo.xcodeproj/xcuserdata/kevin.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | loadingSkeletonDemo.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /loadingSkeletonDemo/loadingSkeletonView/JKSkeletonLoader.h: -------------------------------------------------------------------------------- 1 | // 2 | // JKSkeletonLoader.h 3 | // loadingSkeletonDemo 4 | // 5 | // Created by kevin on 2019/4/24. 6 | // Copyright © 2019 kevin. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface JKSkeletonLoader : NSObject 15 | +(void)addLoaderToTargetView:(UIView *)listView; 16 | +(void)removeLoaderFromTargetView:(UIView *)listView; 17 | @end 18 | 19 | NS_ASSUME_NONNULL_END 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /loadingSkeletonDemo/loadingSkeletonDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // loadingSkeletonDemo 4 | // 5 | // Created by kevin on 2019/4/24. 6 | // Copyright © 2019 kevin. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "JKSkeletonLoader.h" 11 | @interface ViewController () 12 | 13 | @end 14 | 15 | @implementation ViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view, typically from a nib. 20 | [JKSkeletonLoader addLoaderToTargetView:self.view]; 21 | } 22 | 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 kevinZhang 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /loadingSkeletonDemo/loadingSkeletonDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /loadingSkeletonDemo/loadingSkeletonDemo/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /loadingSkeletonDemo/loadingSkeletonDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /loadingSkeletonDemo/loadingSkeletonDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // loadingSkeletonDemo 4 | // 5 | // Created by kevin on 2019/4/24. 6 | // Copyright © 2019 kevin. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 27 | } 28 | 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 38 | } 39 | 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 43 | } 44 | 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /loadingSkeletonDemo/loadingSkeletonDemo/TableViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // TableViewController.m 3 | // loadingSkeletonDemo 4 | // 5 | // Created by kevin on 2019/4/24. 6 | // Copyright © 2019 kevin. All rights reserved. 7 | // 8 | 9 | #import "TableViewController.h" 10 | #import "JKSkeletonLoader.h" 11 | 12 | @interface TableViewController () 13 | 14 | @end 15 | 16 | @implementation TableViewController 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | 21 | // Uncomment the following line to preserve selection between presentations. 22 | // self.clearsSelectionOnViewWillAppear = NO; 23 | 24 | // Uncomment the following line to display an Edit button in the navigation bar for this view controller. 25 | // self.navigationItem.rightBarButtonItem = self.editButtonItem; 26 | } 27 | 28 | -(void)viewDidAppear:(BOOL)animated{ 29 | [super viewDidAppear:animated]; 30 | 31 | [self.tableView reloadData]; 32 | 33 | [JKSkeletonLoader addLoaderToTargetView:self.tableView]; 34 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(4.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 35 | [self loaded]; 36 | }); 37 | } 38 | 39 | -(void)loaded{ 40 | [JKSkeletonLoader removeLoaderFromTargetView:self.tableView]; 41 | } 42 | 43 | 44 | #pragma mark - Table view data source 45 | 46 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 47 | 48 | return 1; 49 | } 50 | 51 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 52 | 53 | return 3; 54 | } 55 | 56 | 57 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 58 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath]; 59 | 60 | 61 | return cell; 62 | } 63 | 64 | 65 | /* 66 | // Override to support conditional editing of the table view. 67 | - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { 68 | // Return NO if you do not want the specified item to be editable. 69 | return YES; 70 | } 71 | */ 72 | 73 | /* 74 | // Override to support editing the table view. 75 | - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { 76 | if (editingStyle == UITableViewCellEditingStyleDelete) { 77 | // Delete the row from the data source 78 | [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade]; 79 | } else if (editingStyle == UITableViewCellEditingStyleInsert) { 80 | // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view 81 | } 82 | } 83 | */ 84 | 85 | /* 86 | // Override to support rearranging the table view. 87 | - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath { 88 | } 89 | */ 90 | 91 | /* 92 | // Override to support conditional rearranging of the table view. 93 | - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath { 94 | // Return NO if you do not want the item to be re-orderable. 95 | return YES; 96 | } 97 | */ 98 | 99 | /* 100 | #pragma mark - Navigation 101 | 102 | // In a storyboard-based application, you will often want to do a little preparation before navigation 103 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 104 | // Get the new view controller using [segue destinationViewController]. 105 | // Pass the selected object to the new view controller. 106 | } 107 | */ 108 | 109 | @end 110 | -------------------------------------------------------------------------------- /loadingSkeletonDemo/loadingSkeletonView/JKSkeletonLoader.m: -------------------------------------------------------------------------------- 1 | // 2 | // JKSkeletonLoader.m 3 | // loadingSkeletonDemo 4 | // 5 | // Created by kevin on 2019/4/24. 6 | // Copyright © 2019 kevin. All rights reserved. 7 | // 8 | 9 | #import "JKSkeletonLoader.h" 10 | #import 11 | 12 | @protocol ListLoadable 13 | -(NSArray *)jk_visibleContentViews; 14 | @end 15 | 16 | static UInt8 cutoutHandle = 0; 17 | static UInt8 gradientHandle = 0; 18 | static CGFloat loaderDuration = 0.85; 19 | static CGFloat gradientWidth = 0.17; 20 | static CGFloat gradientFirstStop = 0.1; 21 | 22 | 23 | @implementation UITableView (ListLoadable) 24 | -(NSArray *)jk_visibleContentViews{ 25 | NSArray *views = [self.visibleCells valueForKey:@"contentView"]; 26 | return views; 27 | } 28 | @end 29 | 30 | @implementation UICollectionView (ListLoadable) 31 | -(NSArray *)jk_visibleContentViews{ 32 | NSArray *views = [self.visibleCells valueForKey:@"contentView"]; 33 | return views; 34 | } 35 | @end 36 | 37 | 38 | 39 | @implementation UIColor (ListLoadable) 40 | +(UIColor *)backgroundFadedGrey{ 41 | return [UIColor colorWithRed:246.0/255.0 green:247.0/255.0 blue:248.0/255.0 alpha:1.0]; 42 | } 43 | +(UIColor *)gradientFirstStop{ 44 | return [UIColor colorWithRed:238/255.0 green:238/255.0 blue:238/255.0 alpha:1.0]; 45 | } 46 | +(UIColor *)gradientSecondStop{ 47 | return [UIColor colorWithRed:221/255.0 green:221/255.0 blue:221/255.0 alpha:1.0]; 48 | } 49 | @end 50 | 51 | 52 | @interface CutoutView : UIView 53 | 54 | @end 55 | 56 | /*** 57 | 如不遵循协议,私有分类只需实现@implementation即可🐭🐂🐅🐇🐉🐍🐴🐑🐒🐔🐩🐖 58 | */ 59 | @implementation UIView (ListLoadable) 60 | -(NSArray *)jk_visibleContentViews{ 61 | NSArray *views = @[self]; 62 | return views; 63 | } 64 | -(void)boundInside:(UIView *)superView{ 65 | //关闭 自适应 66 | self.translatesAutoresizingMaskIntoConstraints = NO; 67 | 68 | NSArray *horizotalCons = [NSLayoutConstraint constraintsWithVisualFormat:@"H:|-0-[subview]-0-|" options:NSLayoutFormatDirectionLeadingToTrailing metrics:nil views:@{@"subview":self}]; 69 | [superView addConstraints:horizotalCons]; 70 | 71 | NSArray *verticalCons = [NSLayoutConstraint constraintsWithVisualFormat:@"V:|-0-[subview]-0-|" options:NSLayoutFormatDirectionLeadingToTrailing metrics:nil views:@{@"subview":self}]; 72 | [superView addConstraints:verticalCons]; 73 | } 74 | 75 | -(UIView *)ld_getCutoutView{ 76 | return (UIView *)objc_getAssociatedObject(self, &cutoutHandle); 77 | } 78 | 79 | -(void)ld_setCutoutView:(UIView *)aView{ 80 | objc_setAssociatedObject(self, &cutoutHandle, aView, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 81 | } 82 | 83 | -(CAGradientLayer *)ld_getGradient{ 84 | return (CAGradientLayer *)objc_getAssociatedObject(self, &gradientHandle); 85 | } 86 | 87 | -(void)ld_setGradient:(CAGradientLayer *)aLayer{ 88 | objc_setAssociatedObject(self, &gradientHandle, aLayer,OBJC_ASSOCIATION_RETAIN); 89 | } 90 | 91 | -(void)ld_addLoader{ 92 | CAGradientLayer *gradient = [[CAGradientLayer alloc] init]; 93 | gradient.frame = CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height); 94 | [self.layer insertSublayer:gradient atIndex:0]; 95 | [self configureAndAddAnimationToGradient:gradient]; 96 | [self addCutoutView]; 97 | } 98 | 99 | -(void)ld_removeLoader{ 100 | [[self ld_getCutoutView] removeFromSuperview]; 101 | [[self ld_getGradient] removeAllAnimations]; 102 | [[self ld_getGradient] removeFromSuperlayer]; 103 | [self.subviews enumerateObjectsUsingBlock:^(__kindof UIView * _Nonnull subView, NSUInteger idx, BOOL * _Nonnull stop) { 104 | subView.alpha = 1.0f; 105 | }]; 106 | } 107 | 108 | 109 | -(void)configureAndAddAnimationToGradient:(CAGradientLayer *)gradient{ 110 | //-0.83 111 | gradient.startPoint = CGPointMake(-1.0 + gradientWidth, 0); 112 | //1.17 113 | gradient.endPoint = CGPointMake(1.0 + gradientWidth, 0); 114 | 115 | // 116 | gradient.colors = @[ 117 | (id)[UIColor backgroundFadedGrey].CGColor, 118 | (id)[UIColor gradientFirstStop].CGColor, 119 | (id)[UIColor gradientSecondStop].CGColor, 120 | (id)[UIColor gradientFirstStop].CGColor, 121 | (id)[UIColor backgroundFadedGrey].CGColor 122 | 123 | ]; 124 | 125 | NSArray *startLocations = @[ 126 | @(gradient.startPoint.x),//will be double in 64bit arch 127 | @(gradient.startPoint.x), 128 | @(0.0), 129 | @(gradientWidth), 130 | @(1 + gradientWidth) 131 | ]; 132 | gradient.locations = startLocations; 133 | NSString *keyPath = @"locations"; 134 | CABasicAnimation *gradientAnimation = [CABasicAnimation animationWithKeyPath:keyPath]; 135 | 136 | gradientAnimation.fromValue = startLocations; 137 | gradientAnimation.toValue = @[@(0.0),@(1.0),@(1.0),@(1 + (gradientWidth - gradientFirstStop)),@( 1.0 + gradientWidth)]; 138 | 139 | gradientAnimation.repeatCount = MAXFLOAT; 140 | gradientAnimation.fillMode = kCAFillModeForwards; 141 | gradientAnimation.removedOnCompletion = NO; 142 | gradientAnimation.duration = loaderDuration; 143 | [gradient addAnimation:gradientAnimation forKey:keyPath]; 144 | [self ld_setGradient:gradient]; 145 | 146 | } 147 | 148 | -(void)addCutoutView{ 149 | CutoutView *cutout = [[CutoutView alloc] init]; 150 | cutout.frame = self.bounds; 151 | cutout.backgroundColor = [UIColor clearColor]; 152 | [self addSubview:cutout]; 153 | [cutout setNeedsDisplay]; 154 | [cutout boundInside:self]; 155 | 156 | for (UIView *subview in self.subviews) { 157 | if (subview != cutout) { 158 | subview.alpha = 0; 159 | } 160 | } 161 | [self ld_setCutoutView:cutout]; 162 | } 163 | @end 164 | 165 | 166 | 167 | 168 | @implementation JKSkeletonLoader 169 | +(void)addLoaderToTargetView:(UIView *)listView{ 170 | NSArray *array = [listView jk_visibleContentViews]; 171 | [self addLoaderToViews:array]; 172 | } 173 | +(void)removeLoaderFromTargetView:(UIView *)listView{ 174 | [self removeLoaderFromViews:[listView jk_visibleContentViews]]; 175 | } 176 | 177 | 178 | 179 | +(void)addLoaderToViews:(NSArray *)views{ 180 | [CATransaction begin]; 181 | 182 | [views enumerateObjectsUsingBlock:^(UIView * _Nonnull subview, NSUInteger idx, BOOL * _Nonnull stop) { 183 | [subview ld_addLoader]; 184 | }]; 185 | 186 | [CATransaction commit]; 187 | } 188 | 189 | +(void)removeLoaderFromViews:(NSArray *)views{ 190 | [CATransaction begin]; 191 | 192 | [views enumerateObjectsUsingBlock:^(UIView * _Nonnull subview, NSUInteger idx, BOOL * _Nonnull stop) { 193 | [subview ld_removeLoader]; 194 | }]; 195 | 196 | [CATransaction commit]; 197 | } 198 | @end 199 | 200 | 201 | @implementation CutoutView 202 | - (void)drawRect:(CGRect)rect { 203 | [super drawRect:rect]; 204 | // C API make backgroungColor white 205 | CGContextRef context = UIGraphicsGetCurrentContext(); 206 | CGContextSetFillColorWithColor(context, [UIColor whiteColor].CGColor); 207 | CGContextFillRect(context, self.bounds); 208 | 209 | for (UIView *subView in self.superview.subviews) { 210 | if (subView == self) { 211 | continue; 212 | } 213 | //make position of subviews clear 214 | CGContextSetBlendMode(context, kCGBlendModeClear); 215 | CGContextFillRect(context, subView.frame); 216 | } 217 | 218 | } 219 | 220 | -(void)layoutSubviews{ 221 | [super layoutSubviews]; 222 | [self setNeedsDisplay]; 223 | CAGradientLayer *layer = [self.superview ld_getGradient]; 224 | layer.frame = self.superview.bounds; 225 | } 226 | 227 | @end 228 | 229 | 230 | 231 | 232 | 233 | 234 | -------------------------------------------------------------------------------- /loadingSkeletonDemo/loadingSkeletonDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 0A812C2A22700EBE00F9B288 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A812C2922700EBE00F9B288 /* AppDelegate.m */; }; 11 | 0A812C2D22700EBE00F9B288 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A812C2C22700EBE00F9B288 /* ViewController.m */; }; 12 | 0A812C3022700EBE00F9B288 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0A812C2E22700EBE00F9B288 /* Main.storyboard */; }; 13 | 0A812C3222700EC100F9B288 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0A812C3122700EC100F9B288 /* Assets.xcassets */; }; 14 | 0A812C3522700EC100F9B288 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0A812C3322700EC100F9B288 /* LaunchScreen.storyboard */; }; 15 | 0A812C3822700EC100F9B288 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A812C3722700EC100F9B288 /* main.m */; }; 16 | 0A812C4122700FC400F9B288 /* JKSkeletonLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A812C4022700FC400F9B288 /* JKSkeletonLoader.m */; }; 17 | 0AAB33CF227045F20045D28A /* TableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0AAB33CE227045F20045D28A /* TableViewController.m */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXFileReference section */ 21 | 0A812C2522700EBE00F9B288 /* loadingSkeletonDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = loadingSkeletonDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 22 | 0A812C2822700EBE00F9B288 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 23 | 0A812C2922700EBE00F9B288 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 24 | 0A812C2B22700EBE00F9B288 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 25 | 0A812C2C22700EBE00F9B288 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 26 | 0A812C2F22700EBE00F9B288 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 27 | 0A812C3122700EC100F9B288 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 28 | 0A812C3422700EC100F9B288 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 29 | 0A812C3622700EC100F9B288 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 30 | 0A812C3722700EC100F9B288 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 31 | 0A812C3F22700FC400F9B288 /* JKSkeletonLoader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JKSkeletonLoader.h; sourceTree = ""; }; 32 | 0A812C4022700FC400F9B288 /* JKSkeletonLoader.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = JKSkeletonLoader.m; sourceTree = ""; }; 33 | 0AAB33CD227045F20045D28A /* TableViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TableViewController.h; sourceTree = ""; }; 34 | 0AAB33CE227045F20045D28A /* TableViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TableViewController.m; sourceTree = ""; }; 35 | /* End PBXFileReference section */ 36 | 37 | /* Begin PBXFrameworksBuildPhase section */ 38 | 0A812C2222700EBE00F9B288 /* Frameworks */ = { 39 | isa = PBXFrameworksBuildPhase; 40 | buildActionMask = 2147483647; 41 | files = ( 42 | ); 43 | runOnlyForDeploymentPostprocessing = 0; 44 | }; 45 | /* End PBXFrameworksBuildPhase section */ 46 | 47 | /* Begin PBXGroup section */ 48 | 0A812C1C22700EBE00F9B288 = { 49 | isa = PBXGroup; 50 | children = ( 51 | 0A812C2722700EBE00F9B288 /* loadingSkeletonDemo */, 52 | 0A812C2622700EBE00F9B288 /* Products */, 53 | ); 54 | sourceTree = ""; 55 | }; 56 | 0A812C2622700EBE00F9B288 /* Products */ = { 57 | isa = PBXGroup; 58 | children = ( 59 | 0A812C2522700EBE00F9B288 /* loadingSkeletonDemo.app */, 60 | ); 61 | name = Products; 62 | sourceTree = ""; 63 | }; 64 | 0A812C2722700EBE00F9B288 /* loadingSkeletonDemo */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | 0A812C3E22700F3900F9B288 /* loadingSkeletonView */, 68 | 0A812C2822700EBE00F9B288 /* AppDelegate.h */, 69 | 0A812C2922700EBE00F9B288 /* AppDelegate.m */, 70 | 0A812C2B22700EBE00F9B288 /* ViewController.h */, 71 | 0A812C2C22700EBE00F9B288 /* ViewController.m */, 72 | 0AAB33CD227045F20045D28A /* TableViewController.h */, 73 | 0AAB33CE227045F20045D28A /* TableViewController.m */, 74 | 0A812C2E22700EBE00F9B288 /* Main.storyboard */, 75 | 0A812C3122700EC100F9B288 /* Assets.xcassets */, 76 | 0A812C3322700EC100F9B288 /* LaunchScreen.storyboard */, 77 | 0A812C3622700EC100F9B288 /* Info.plist */, 78 | 0A812C3722700EC100F9B288 /* main.m */, 79 | ); 80 | path = loadingSkeletonDemo; 81 | sourceTree = ""; 82 | }; 83 | 0A812C3E22700F3900F9B288 /* loadingSkeletonView */ = { 84 | isa = PBXGroup; 85 | children = ( 86 | 0A812C3F22700FC400F9B288 /* JKSkeletonLoader.h */, 87 | 0A812C4022700FC400F9B288 /* JKSkeletonLoader.m */, 88 | ); 89 | path = loadingSkeletonView; 90 | sourceTree = SOURCE_ROOT; 91 | }; 92 | /* End PBXGroup section */ 93 | 94 | /* Begin PBXNativeTarget section */ 95 | 0A812C2422700EBE00F9B288 /* loadingSkeletonDemo */ = { 96 | isa = PBXNativeTarget; 97 | buildConfigurationList = 0A812C3B22700EC100F9B288 /* Build configuration list for PBXNativeTarget "loadingSkeletonDemo" */; 98 | buildPhases = ( 99 | 0A812C2122700EBE00F9B288 /* Sources */, 100 | 0A812C2222700EBE00F9B288 /* Frameworks */, 101 | 0A812C2322700EBE00F9B288 /* Resources */, 102 | ); 103 | buildRules = ( 104 | ); 105 | dependencies = ( 106 | ); 107 | name = loadingSkeletonDemo; 108 | productName = loadingSkeletonDemo; 109 | productReference = 0A812C2522700EBE00F9B288 /* loadingSkeletonDemo.app */; 110 | productType = "com.apple.product-type.application"; 111 | }; 112 | /* End PBXNativeTarget section */ 113 | 114 | /* Begin PBXProject section */ 115 | 0A812C1D22700EBE00F9B288 /* Project object */ = { 116 | isa = PBXProject; 117 | attributes = { 118 | LastUpgradeCheck = 1010; 119 | ORGANIZATIONNAME = jumu; 120 | TargetAttributes = { 121 | 0A812C2422700EBE00F9B288 = { 122 | CreatedOnToolsVersion = 10.1; 123 | LastSwiftMigration = 1010; 124 | }; 125 | }; 126 | }; 127 | buildConfigurationList = 0A812C2022700EBE00F9B288 /* Build configuration list for PBXProject "loadingSkeletonDemo" */; 128 | compatibilityVersion = "Xcode 9.3"; 129 | developmentRegion = en; 130 | hasScannedForEncodings = 0; 131 | knownRegions = ( 132 | en, 133 | Base, 134 | ); 135 | mainGroup = 0A812C1C22700EBE00F9B288; 136 | productRefGroup = 0A812C2622700EBE00F9B288 /* Products */; 137 | projectDirPath = ""; 138 | projectRoot = ""; 139 | targets = ( 140 | 0A812C2422700EBE00F9B288 /* loadingSkeletonDemo */, 141 | ); 142 | }; 143 | /* End PBXProject section */ 144 | 145 | /* Begin PBXResourcesBuildPhase section */ 146 | 0A812C2322700EBE00F9B288 /* Resources */ = { 147 | isa = PBXResourcesBuildPhase; 148 | buildActionMask = 2147483647; 149 | files = ( 150 | 0A812C3522700EC100F9B288 /* LaunchScreen.storyboard in Resources */, 151 | 0A812C3222700EC100F9B288 /* Assets.xcassets in Resources */, 152 | 0A812C3022700EBE00F9B288 /* Main.storyboard in Resources */, 153 | ); 154 | runOnlyForDeploymentPostprocessing = 0; 155 | }; 156 | /* End PBXResourcesBuildPhase section */ 157 | 158 | /* Begin PBXSourcesBuildPhase section */ 159 | 0A812C2122700EBE00F9B288 /* Sources */ = { 160 | isa = PBXSourcesBuildPhase; 161 | buildActionMask = 2147483647; 162 | files = ( 163 | 0A812C2D22700EBE00F9B288 /* ViewController.m in Sources */, 164 | 0A812C3822700EC100F9B288 /* main.m in Sources */, 165 | 0A812C4122700FC400F9B288 /* JKSkeletonLoader.m in Sources */, 166 | 0AAB33CF227045F20045D28A /* TableViewController.m in Sources */, 167 | 0A812C2A22700EBE00F9B288 /* AppDelegate.m in Sources */, 168 | ); 169 | runOnlyForDeploymentPostprocessing = 0; 170 | }; 171 | /* End PBXSourcesBuildPhase section */ 172 | 173 | /* Begin PBXVariantGroup section */ 174 | 0A812C2E22700EBE00F9B288 /* Main.storyboard */ = { 175 | isa = PBXVariantGroup; 176 | children = ( 177 | 0A812C2F22700EBE00F9B288 /* Base */, 178 | ); 179 | name = Main.storyboard; 180 | sourceTree = ""; 181 | }; 182 | 0A812C3322700EC100F9B288 /* LaunchScreen.storyboard */ = { 183 | isa = PBXVariantGroup; 184 | children = ( 185 | 0A812C3422700EC100F9B288 /* Base */, 186 | ); 187 | name = LaunchScreen.storyboard; 188 | sourceTree = ""; 189 | }; 190 | /* End PBXVariantGroup section */ 191 | 192 | /* Begin XCBuildConfiguration section */ 193 | 0A812C3922700EC100F9B288 /* Debug */ = { 194 | isa = XCBuildConfiguration; 195 | buildSettings = { 196 | ALWAYS_SEARCH_USER_PATHS = NO; 197 | CLANG_ANALYZER_NONNULL = YES; 198 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 199 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 200 | CLANG_CXX_LIBRARY = "libc++"; 201 | CLANG_ENABLE_MODULES = YES; 202 | CLANG_ENABLE_OBJC_ARC = YES; 203 | CLANG_ENABLE_OBJC_WEAK = YES; 204 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 205 | CLANG_WARN_BOOL_CONVERSION = YES; 206 | CLANG_WARN_COMMA = YES; 207 | CLANG_WARN_CONSTANT_CONVERSION = YES; 208 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 209 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 210 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 211 | CLANG_WARN_EMPTY_BODY = YES; 212 | CLANG_WARN_ENUM_CONVERSION = YES; 213 | CLANG_WARN_INFINITE_RECURSION = YES; 214 | CLANG_WARN_INT_CONVERSION = YES; 215 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 216 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 217 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 218 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 219 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 220 | CLANG_WARN_STRICT_PROTOTYPES = YES; 221 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 222 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 223 | CLANG_WARN_UNREACHABLE_CODE = YES; 224 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 225 | CODE_SIGN_IDENTITY = "iPhone Developer"; 226 | COPY_PHASE_STRIP = NO; 227 | DEBUG_INFORMATION_FORMAT = dwarf; 228 | ENABLE_STRICT_OBJC_MSGSEND = YES; 229 | ENABLE_TESTABILITY = YES; 230 | GCC_C_LANGUAGE_STANDARD = gnu11; 231 | GCC_DYNAMIC_NO_PIC = NO; 232 | GCC_NO_COMMON_BLOCKS = YES; 233 | GCC_OPTIMIZATION_LEVEL = 0; 234 | GCC_PREPROCESSOR_DEFINITIONS = ( 235 | "DEBUG=1", 236 | "$(inherited)", 237 | ); 238 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 239 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 240 | GCC_WARN_UNDECLARED_SELECTOR = YES; 241 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 242 | GCC_WARN_UNUSED_FUNCTION = YES; 243 | GCC_WARN_UNUSED_VARIABLE = YES; 244 | IPHONEOS_DEPLOYMENT_TARGET = 12.1; 245 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 246 | MTL_FAST_MATH = YES; 247 | ONLY_ACTIVE_ARCH = YES; 248 | SDKROOT = iphoneos; 249 | }; 250 | name = Debug; 251 | }; 252 | 0A812C3A22700EC100F9B288 /* Release */ = { 253 | isa = XCBuildConfiguration; 254 | buildSettings = { 255 | ALWAYS_SEARCH_USER_PATHS = NO; 256 | CLANG_ANALYZER_NONNULL = YES; 257 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 258 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 259 | CLANG_CXX_LIBRARY = "libc++"; 260 | CLANG_ENABLE_MODULES = YES; 261 | CLANG_ENABLE_OBJC_ARC = YES; 262 | CLANG_ENABLE_OBJC_WEAK = YES; 263 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 264 | CLANG_WARN_BOOL_CONVERSION = YES; 265 | CLANG_WARN_COMMA = YES; 266 | CLANG_WARN_CONSTANT_CONVERSION = YES; 267 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 268 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 269 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 270 | CLANG_WARN_EMPTY_BODY = YES; 271 | CLANG_WARN_ENUM_CONVERSION = YES; 272 | CLANG_WARN_INFINITE_RECURSION = YES; 273 | CLANG_WARN_INT_CONVERSION = YES; 274 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 275 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 276 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 277 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 278 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 279 | CLANG_WARN_STRICT_PROTOTYPES = YES; 280 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 281 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 282 | CLANG_WARN_UNREACHABLE_CODE = YES; 283 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 284 | CODE_SIGN_IDENTITY = "iPhone Developer"; 285 | COPY_PHASE_STRIP = NO; 286 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 287 | ENABLE_NS_ASSERTIONS = NO; 288 | ENABLE_STRICT_OBJC_MSGSEND = YES; 289 | GCC_C_LANGUAGE_STANDARD = gnu11; 290 | GCC_NO_COMMON_BLOCKS = YES; 291 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 292 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 293 | GCC_WARN_UNDECLARED_SELECTOR = YES; 294 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 295 | GCC_WARN_UNUSED_FUNCTION = YES; 296 | GCC_WARN_UNUSED_VARIABLE = YES; 297 | IPHONEOS_DEPLOYMENT_TARGET = 12.1; 298 | MTL_ENABLE_DEBUG_INFO = NO; 299 | MTL_FAST_MATH = YES; 300 | SDKROOT = iphoneos; 301 | VALIDATE_PRODUCT = YES; 302 | }; 303 | name = Release; 304 | }; 305 | 0A812C3C22700EC100F9B288 /* Debug */ = { 306 | isa = XCBuildConfiguration; 307 | buildSettings = { 308 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 309 | CLANG_ENABLE_MODULES = YES; 310 | CODE_SIGN_STYLE = Automatic; 311 | DEVELOPMENT_TEAM = KSQ99GBANE; 312 | EMBED_ASSET_PACKS_IN_PRODUCT_BUNDLE = YES; 313 | GCC_PREFIX_HEADER = ""; 314 | INFOPLIST_FILE = loadingSkeletonDemo/Info.plist; 315 | LD_RUNPATH_SEARCH_PATHS = ( 316 | "$(inherited)", 317 | "@executable_path/Frameworks", 318 | ); 319 | PRODUCT_BUNDLE_IDENTIFIER = com.iosfactory.skeleton.loadingSkeletonDemo; 320 | PRODUCT_NAME = "$(TARGET_NAME)"; 321 | SWIFT_OBJC_BRIDGING_HEADER = "loadingSkeletonView/loadingSkeletonDemo-Bridging-Header.h"; 322 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 323 | SWIFT_VERSION = 4.2; 324 | TARGETED_DEVICE_FAMILY = "1,2"; 325 | }; 326 | name = Debug; 327 | }; 328 | 0A812C3D22700EC100F9B288 /* Release */ = { 329 | isa = XCBuildConfiguration; 330 | buildSettings = { 331 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 332 | CLANG_ENABLE_MODULES = YES; 333 | CODE_SIGN_STYLE = Automatic; 334 | DEVELOPMENT_TEAM = KSQ99GBANE; 335 | EMBED_ASSET_PACKS_IN_PRODUCT_BUNDLE = YES; 336 | GCC_PREFIX_HEADER = ""; 337 | INFOPLIST_FILE = loadingSkeletonDemo/Info.plist; 338 | LD_RUNPATH_SEARCH_PATHS = ( 339 | "$(inherited)", 340 | "@executable_path/Frameworks", 341 | ); 342 | PRODUCT_BUNDLE_IDENTIFIER = com.iosfactory.skeleton.loadingSkeletonDemo; 343 | PRODUCT_NAME = "$(TARGET_NAME)"; 344 | SWIFT_OBJC_BRIDGING_HEADER = "loadingSkeletonView/loadingSkeletonDemo-Bridging-Header.h"; 345 | SWIFT_VERSION = 4.2; 346 | TARGETED_DEVICE_FAMILY = "1,2"; 347 | }; 348 | name = Release; 349 | }; 350 | /* End XCBuildConfiguration section */ 351 | 352 | /* Begin XCConfigurationList section */ 353 | 0A812C2022700EBE00F9B288 /* Build configuration list for PBXProject "loadingSkeletonDemo" */ = { 354 | isa = XCConfigurationList; 355 | buildConfigurations = ( 356 | 0A812C3922700EC100F9B288 /* Debug */, 357 | 0A812C3A22700EC100F9B288 /* Release */, 358 | ); 359 | defaultConfigurationIsVisible = 0; 360 | defaultConfigurationName = Release; 361 | }; 362 | 0A812C3B22700EC100F9B288 /* Build configuration list for PBXNativeTarget "loadingSkeletonDemo" */ = { 363 | isa = XCConfigurationList; 364 | buildConfigurations = ( 365 | 0A812C3C22700EC100F9B288 /* Debug */, 366 | 0A812C3D22700EC100F9B288 /* Release */, 367 | ); 368 | defaultConfigurationIsVisible = 0; 369 | defaultConfigurationName = Release; 370 | }; 371 | /* End XCConfigurationList section */ 372 | }; 373 | rootObject = 0A812C1D22700EBE00F9B288 /* Project object */; 374 | } 375 | -------------------------------------------------------------------------------- /loadingSkeletonDemo/loadingSkeletonDemo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 28 | 35 | 42 | 49 | 56 | 63 | 64 | 65 | 66 | 67 | 72 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 110 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | --------------------------------------------------------------------------------