├── gif ├── 01.gif ├── 03.gif ├── 04.gif ├── 05.gif ├── 06.gif └── 2.gif ├── JHudViewDemo ├── Assets.xcassets │ ├── Contents.json │ ├── biubiubiu │ │ ├── Contents.json │ │ ├── 0.imageset │ │ │ ├── 0.png │ │ │ └── Contents.json │ │ ├── 1.imageset │ │ │ ├── 1.png │ │ │ └── Contents.json │ │ ├── 2.imageset │ │ │ ├── 2.png │ │ │ └── Contents.json │ │ ├── 3.imageset │ │ │ ├── 3.png │ │ │ └── Contents.json │ │ ├── 4.imageset │ │ │ ├── 4.png │ │ │ └── Contents.json │ │ ├── 5.imageset │ │ │ ├── 5.png │ │ │ └── Contents.json │ │ ├── 6.imageset │ │ │ ├── 6.png │ │ │ └── Contents.json │ │ ├── 7.imageset │ │ │ ├── 7.png │ │ │ └── Contents.json │ │ ├── 8.imageset │ │ │ ├── 8.png │ │ │ └── Contents.json │ │ ├── 9.imageset │ │ │ ├── 9.png │ │ │ └── Contents.json │ │ ├── 10.imageset │ │ │ ├── 10.png │ │ │ └── Contents.json │ │ ├── 11.imageset │ │ │ ├── 11.png │ │ │ └── Contents.json │ │ ├── 12.imageset │ │ │ ├── 12.png │ │ │ └── Contents.json │ │ ├── 13.imageset │ │ │ ├── 13.png │ │ │ └── Contents.json │ │ ├── 14.imageset │ │ │ ├── 14.png │ │ │ └── Contents.json │ │ ├── 15.imageset │ │ │ ├── 15.png │ │ │ └── Contents.json │ │ ├── 16.imageset │ │ │ ├── 16.png │ │ │ └── Contents.json │ │ ├── 17.imageset │ │ │ ├── 17.png │ │ │ └── Contents.json │ │ ├── 18.imageset │ │ │ ├── 18.png │ │ │ └── Contents.json │ │ └── 19.imageset │ │ │ ├── 19.png │ │ │ └── Contents.json │ ├── null.imageset │ │ ├── null.png │ │ └── Contents.json │ ├── failed.imageset │ │ ├── failed.png │ │ └── Contents.json │ ├── nullData.imageset │ │ ├── nullData.png │ │ └── Contents.json │ └── AppIcon.appiconset │ │ └── Contents.json ├── ViewController.h ├── DetailViewController.h ├── AppDelegate.h ├── main.m ├── JHUD │ ├── JHUDLoadingAnimationView.h │ ├── UIView+JHUDAutoLayout.h │ ├── JHUD.h │ ├── UIView+JHUDAutoLayout.m │ ├── JHUDLoadingAnimationView.m │ └── JHUD.m ├── Info.plist ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── AppDelegate.m ├── ViewController.m └── DetailViewController.m ├── JHudViewDemo.xcodeproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── jinxiansen.xcuserdatad │ │ └── UserInterfaceState.xcuserstate ├── xcuserdata │ └── jinxiansen.xcuserdatad │ │ ├── xcschemes │ │ ├── xcschememanagement.plist │ │ └── JHudViewDemo.xcscheme │ │ └── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist └── project.pbxproj ├── JHUD.podspec ├── README.zh.md ├── LICENSE └── README.md /gif/01.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animations/JHUD/master/gif/01.gif -------------------------------------------------------------------------------- /gif/03.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animations/JHUD/master/gif/03.gif -------------------------------------------------------------------------------- /gif/04.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animations/JHUD/master/gif/04.gif -------------------------------------------------------------------------------- /gif/05.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animations/JHUD/master/gif/05.gif -------------------------------------------------------------------------------- /gif/06.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animations/JHUD/master/gif/06.gif -------------------------------------------------------------------------------- /gif/2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animations/JHUD/master/gif/2.gif -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/biubiubiu/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/null.imageset/null.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animations/JHUD/master/JHudViewDemo/Assets.xcassets/null.imageset/null.png -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/biubiubiu/0.imageset/0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animations/JHUD/master/JHudViewDemo/Assets.xcassets/biubiubiu/0.imageset/0.png -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/biubiubiu/1.imageset/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animations/JHUD/master/JHudViewDemo/Assets.xcassets/biubiubiu/1.imageset/1.png -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/biubiubiu/2.imageset/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animations/JHUD/master/JHudViewDemo/Assets.xcassets/biubiubiu/2.imageset/2.png -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/biubiubiu/3.imageset/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animations/JHUD/master/JHudViewDemo/Assets.xcassets/biubiubiu/3.imageset/3.png -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/biubiubiu/4.imageset/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animations/JHUD/master/JHudViewDemo/Assets.xcassets/biubiubiu/4.imageset/4.png -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/biubiubiu/5.imageset/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animations/JHUD/master/JHudViewDemo/Assets.xcassets/biubiubiu/5.imageset/5.png -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/biubiubiu/6.imageset/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animations/JHUD/master/JHudViewDemo/Assets.xcassets/biubiubiu/6.imageset/6.png -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/biubiubiu/7.imageset/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animations/JHUD/master/JHudViewDemo/Assets.xcassets/biubiubiu/7.imageset/7.png -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/biubiubiu/8.imageset/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animations/JHUD/master/JHudViewDemo/Assets.xcassets/biubiubiu/8.imageset/8.png -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/biubiubiu/9.imageset/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animations/JHUD/master/JHudViewDemo/Assets.xcassets/biubiubiu/9.imageset/9.png -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/failed.imageset/failed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animations/JHUD/master/JHudViewDemo/Assets.xcassets/failed.imageset/failed.png -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/biubiubiu/10.imageset/10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animations/JHUD/master/JHudViewDemo/Assets.xcassets/biubiubiu/10.imageset/10.png -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/biubiubiu/11.imageset/11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animations/JHUD/master/JHudViewDemo/Assets.xcassets/biubiubiu/11.imageset/11.png -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/biubiubiu/12.imageset/12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animations/JHUD/master/JHudViewDemo/Assets.xcassets/biubiubiu/12.imageset/12.png -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/biubiubiu/13.imageset/13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animations/JHUD/master/JHudViewDemo/Assets.xcassets/biubiubiu/13.imageset/13.png -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/biubiubiu/14.imageset/14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animations/JHUD/master/JHudViewDemo/Assets.xcassets/biubiubiu/14.imageset/14.png -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/biubiubiu/15.imageset/15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animations/JHUD/master/JHudViewDemo/Assets.xcassets/biubiubiu/15.imageset/15.png -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/biubiubiu/16.imageset/16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animations/JHUD/master/JHudViewDemo/Assets.xcassets/biubiubiu/16.imageset/16.png -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/biubiubiu/17.imageset/17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animations/JHUD/master/JHudViewDemo/Assets.xcassets/biubiubiu/17.imageset/17.png -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/biubiubiu/18.imageset/18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animations/JHUD/master/JHudViewDemo/Assets.xcassets/biubiubiu/18.imageset/18.png -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/biubiubiu/19.imageset/19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animations/JHUD/master/JHudViewDemo/Assets.xcassets/biubiubiu/19.imageset/19.png -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/nullData.imageset/nullData.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animations/JHUD/master/JHudViewDemo/Assets.xcassets/nullData.imageset/nullData.png -------------------------------------------------------------------------------- /JHudViewDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /JHudViewDemo.xcodeproj/project.xcworkspace/xcuserdata/jinxiansen.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/animations/JHUD/master/JHudViewDemo.xcodeproj/project.xcworkspace/xcuserdata/jinxiansen.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /JHudViewDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // JHudViewDemo 4 | // 5 | // Created by 晋先森 on 16/7/11. 6 | // Copyright © 2016年 晋先森. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /JHudViewDemo/DetailViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DetailViewController.h 3 | // JHudViewDemo 4 | // 5 | // Created by 晋先森 on 16/7/15. 6 | // Copyright © 2016年 晋先森. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DetailViewController : UIViewController 12 | 13 | @property (nonatomic) NSString *selName; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /JHudViewDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // JHudViewDemo 4 | // 5 | // Created by 晋先森 on 16/7/11. 6 | // Copyright © 2016年 晋先森. 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 | -------------------------------------------------------------------------------- /JHudViewDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // JHudViewDemo 4 | // 5 | // Created by 晋先森 on 16/7/11. 6 | // Copyright © 2016年 晋先森. 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 | -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/null.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "null.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/biubiubiu/0.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "0.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/biubiubiu/1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "1.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/biubiubiu/2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "2.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/biubiubiu/3.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "3.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/biubiubiu/4.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "4.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/biubiubiu/5.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "5.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/biubiubiu/6.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "6.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/biubiubiu/7.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "7.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/biubiubiu/8.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "8.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/biubiubiu/9.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "9.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/failed.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "failed.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/biubiubiu/10.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "10.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/biubiubiu/11.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "11.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/biubiubiu/12.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "12.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/biubiubiu/13.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "13.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/biubiubiu/14.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "14.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/biubiubiu/15.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "15.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/biubiubiu/16.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "16.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/biubiubiu/17.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "17.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/biubiubiu/18.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "18.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/biubiubiu/19.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "19.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/nullData.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "nullData.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /JHUD.podspec: -------------------------------------------------------------------------------- 1 | 2 | Pod::Spec.new do |s| 3 | s.name = "JHUD" 4 | s.version = "0.1.0" 5 | s.summary = "A full screen of the Hud when loading the data (Objective-C)." 6 | s.homepage = "https://github.com/jinxiansen/JHUD" 7 | s.license = "MIT (LICENSE)" 8 | s.author = { "“jinxiansen”" => "hi@jinxiansen.com" } 9 | s.platform = :ios, '6.0' 10 | s.source = { :git => "https://github.com/jinxiansen/JHUD.git", :tag => s.version } 11 | s.source_files = "JHudViewDemo/JHUD/*.{h,m}" 12 | s.requires_arc = true 13 | end 14 | -------------------------------------------------------------------------------- /JHudViewDemo.xcodeproj/xcuserdata/jinxiansen.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | JHudViewDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 41BDF33A1D3399B90013BA46 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /JHudViewDemo/JHUD/JHUDLoadingAnimationView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JHUDLoadingAnimationView.h 3 | // JHudViewDemo 4 | // 5 | // Created by 晋先森 on 16/7/16. 6 | // Copyright © 2016年 晋先森. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef NS_ENUM(NSUInteger, JHUDAnimationType) { 12 | JHUDAnimationTypeCircle = 0, 13 | JHUDAnimationTypeCircleJoin, 14 | JHUDAnimationTypeDot, 15 | }; 16 | 17 | @interface JHUDLoadingAnimationView : UIView 18 | 19 | @property (nonatomic,assign) NSInteger count; 20 | 21 | @property (nonatomic) UIColor *defaultBackGroundColor;// 22 | 23 | @property (nonatomic) UIColor *foregroundColor; 24 | 25 | - (void)showAnimationAtView:(UIView *)view animationType:(JHUDAnimationType)animationType; 26 | 27 | -(void)removeSubLayer; 28 | 29 | @end 30 | 31 | -------------------------------------------------------------------------------- /JHudViewDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /JHudViewDemo/JHUD/UIView+JHUDAutoLayout.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+JHUDAutoLayout.h 3 | // JHudViewDemo 4 | // 5 | // Created by 晋先森 on 16/7/16. 6 | // Copyright © 2016年 晋先森. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIView (JHUDAutoLayout) 12 | 13 | - (void)addConstraintWidth:(CGFloat)width 14 | height:(CGFloat)height; 15 | 16 | - (void)addConstraintCenterXToView:(UIView *)xView 17 | centerYToView:(UIView *)yView; 18 | 19 | - (NSLayoutConstraint *)addConstraintCenterYToView:(UIView *)yView 20 | constant:(CGFloat)constant; 21 | 22 | - (NSLayoutConstraint *)addConstarintWithTopView:(UIView *)topView 23 | toBottomView:(UIView *)bottomView 24 | constarint:(CGFloat)constarint; 25 | 26 | - (void)removeConstraintWithAttribte:(NSLayoutAttribute)attribute; 27 | 28 | - (void)removeAllConstraints; 29 | 30 | @end -------------------------------------------------------------------------------- /README.zh.md: -------------------------------------------------------------------------------- 1 | 2 | ##中文说明 3 | ####`JHUD` 是一个用于加载数据时全屏显示的HUD,使用Objective-C编写. 4 | 5 | ##须知 6 | `JHUD` 基于 "Xcode 7.3 , iOS 6+ 和ARC ,请使用最新正式版来编译JHUD,旧版本的Xcode可能有效,但不保证会出现一些兼容性问题。 7 | 8 | ##CocoaPods 9 | 10 | 推荐使用 CocoaPods 安装。 11 | 12 | 1. 在 Podfile 中添加 `pod 'YYKit'`。 13 | 2. 执行 `pod install` 或 `pod update`。 14 | 3. 导入 `"JHUD.h"`。 15 | 16 | 17 | ##手动安装 18 | 1. 通过 Clone or download 下载 JHUD 文件夹内的所有内容。 19 | 2. 将 JHUD 内的源文件添加(拖放)到你的工程。 20 | 3. 导入 `JHUD.h` 。 21 | 22 | ##使用 23 | 24 | ``` 25 | hudView = [[JHUD alloc]initWithFrame:self.view.bounds]; 26 | 27 | hudView.messageLabel.text = @"hello ,this is a circle animation"; 28 | 29 | //显示 30 | [hudView showAtView:self.view hudType:JHUDLoadingTypeCircle]; 31 | 32 | //隐藏 33 | [hudView hide]; 34 | ``` 35 | 或者 36 | 37 | ``` 38 | [JHUD showAtView:self.view message:@"Hello, this is a message"]; 39 | 40 | [JHUD hide]; 41 | ``` 42 | 43 | 44 | 更多的使用用例可以看Demo工程演示以及头文件(JHUD.h)。 45 | 46 | 47 | ##许可 48 | 49 | JHUD 使用 MIT 许可证,详情可见 [LICENSE](LICENSE) 文件。 -------------------------------------------------------------------------------- /JHudViewDemo.xcodeproj/xcuserdata/jinxiansen.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 14 | 15 | 16 | 18 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 晋先森 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 | -------------------------------------------------------------------------------- /JHudViewDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 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 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /JHudViewDemo/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 | 27 | 28 | -------------------------------------------------------------------------------- /JHudViewDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // JHudViewDemo 4 | // 5 | // Created by 晋先森 on 16/7/11. 6 | // Copyright © 2016年 晋先森. 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 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // 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. 25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // 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. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // 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. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /JHudViewDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // JHudViewDemo 4 | // 5 | // Created by 晋先森 on 16/7/11. 6 | // Copyright © 2016年 晋先森. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "DetailViewController.h" 11 | 12 | @interface ViewController () 13 | 14 | @property (weak, nonatomic) IBOutlet UITableView *tableView; 15 | 16 | @property (nonatomic) NSArray *datas; 17 | 18 | 19 | @end 20 | 21 | @implementation ViewController 22 | 23 | - (void)viewDidLoad { 24 | [super viewDidLoad]; 25 | 26 | self.datas = @[@"loadingCircleAnimation", 27 | @"loadingCircleJoinAnimation", 28 | @"loadingDotAnimation", 29 | @"loadingCustomAnimations", 30 | @"loadingFailure", 31 | @"loadingFailure2" 32 | ]; 33 | 34 | [self.tableView reloadData]; 35 | } 36 | 37 | #pragma mark -- 38 | 39 | -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 40 | { 41 | return _datas.count; 42 | } 43 | 44 | 45 | -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 46 | { 47 | static NSString * cellID = @"JHUD"; 48 | UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:cellID]; 49 | if (!cell) { 50 | cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID]; 51 | cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; 52 | } 53 | cell.textLabel.text = _datas[indexPath.row]; 54 | 55 | return cell; 56 | } 57 | 58 | -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 59 | { 60 | [tableView deselectRowAtIndexPath:indexPath animated:NO]; 61 | 62 | DetailViewController * detailVC = [DetailViewController new]; 63 | detailVC.selName = _datas[indexPath.row]; 64 | [self.navigationController pushViewController:detailVC animated:YES]; 65 | } 66 | 67 | 68 | 69 | - (void)didReceiveMemoryWarning { 70 | [super didReceiveMemoryWarning]; 71 | // Dispose of any resources that can be recreated. 72 | } 73 | 74 | @end 75 | -------------------------------------------------------------------------------- /JHudViewDemo/JHUD/JHUD.h: -------------------------------------------------------------------------------- 1 | // 2 | // JHUD.h 3 | // JHUDDemo 4 | // 5 | // Created by 晋先森 https://github.com/jinxiansen on 16/7/11. 6 | // Copyright © 2016年 晋先森. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef NS_ENUM(NSUInteger, JHUDLoadingType) { 12 | JHUDLoadingTypeCircle = 0, 13 | JHUDLoadingTypeCircleJoin, 14 | JHUDLoadingTypeDot, 15 | JHUDLoadingTypeCustomAnimations, 16 | JHUDLoadingTypeFailure, 17 | }; 18 | 19 | @interface JHUD : UIView 20 | 21 | /** 22 | * When JHUDLoadingTypeFailure, there will be a "refresh" button, and the method. 23 | */ 24 | @property (nonatomic,copy) void(^JHUDReloadButtonClickedBlock)(); 25 | 26 | @property (nonatomic,strong) UIView *indicatorView; 27 | 28 | @property (nonatomic,strong) UILabel *messageLabel; 29 | 30 | @property (nonatomic,strong) UIButton * refreshButton; 31 | 32 | // Default color is [UIColor colorWithRed:0.1 green:0.1 blue:0.1 alpha:0.2] 33 | @property (nonatomic,strong) UIColor *indicatorBackGroundColor;// 34 | 35 | // Default color is [UIColor colorWithRed:0.2 green:0.2 blue:0.2 alpha:0.6] 36 | @property (nonatomic,strong) UIColor *indicatorForegroundColor; 37 | 38 | /** 39 | * Only JHUDLoadingType is JHUDLoadingTypeCustomAnimations or JHUDLoadingTypeFailure, indicatorViewSize values can be changed. 40 | */ 41 | @property (nonatomic,assign) CGSize indicatorViewSize; 42 | 43 | /** 44 | * Only when JHUDLoadingType is JHUDLoadingTypeCustomAnimations will only take effect . 45 | */ 46 | @property (nonatomic,strong) NSArray *customAnimationImages; 47 | 48 | @property (nonatomic,strong) UIImage *customImage; 49 | 50 | -(void)showAtView:(UIView *)view hudType:(JHUDLoadingType)hudType; 51 | 52 | -(void)hide; 53 | 54 | 55 | #pragma mark - Class method 56 | 57 | /** 58 | * This method of JHUDLoadingType default is JHUDLoadingTypeCircle. 59 | * 60 | * @param view The parent view JHUD. 61 | * @param message The label display content. 62 | */ 63 | +(void)showAtView:(UIView *)view message:(NSString *)message; 64 | 65 | +(void)showAtView:(UIView *)view message:(NSString *)message hudType:(JHUDLoadingType)hudType; 66 | 67 | +(void)hide; 68 | 69 | @end 70 | 71 | 72 | 73 | @interface UIView (MainQueue) 74 | 75 | -(void)dispatchMainQueue:(dispatch_block_t)block; 76 | 77 | @end 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # JHUD 2 | 3 | [![Version](https://img.shields.io/cocoapods/v/JHUD.svg?style=flat)](http://cocoapods.org/pods/JHUD) 4 | [![License](https://img.shields.io/cocoapods/l/JHUD.svg?style=flat)](http://cocoapods.org/pods/JHUD) 5 | [![Platform](https://img.shields.io/cocoapods/p/JHUD.svg?style=flat)](http://cocoapods.org/pods/JHUD) 6 | [![Support](https://img.shields.io/badge/support-iOS%206%2B%20-blue.svg?style=flat)](https://www.apple.com/nl/ios/)  7 | 8 | ####`JHUD` is a full screen of the HUD when loading the data (Objective-C) . 9 | 10 | #### ![cn](https://raw.githubusercontent.com/gosquared/flags/master/flags/flags/shiny/24/China.png) **Chinese (Simplified)**: 11 | ####[中文说明](README.zh.md) 12 | ######[简书介绍](http://www.jianshu.com/p/fc07f027680c) 13 | 14 | ##screenshots 15 | 16 | ![](gif/01.gif) 17 | ![](gif/2.gif) 18 | ![](gif/03.gif) 19 | ![](gif/04.gif) 20 | ![](gif/05.gif) 21 | ![](gif/06.gif) 22 | 23 | 24 | ## Requirements 25 | 26 | `JHUD` works on "Xcode 7.3 , iOS 6+ and requires ARC to build. 27 | You will need the latest developer tools in order to build `JHUD`. Old Xcode versions might work, but compatibility will not be explicitly maintained. 28 | 29 | 30 | ##CocoaPods 31 | 32 | CocoaPods is the recommended way to add JHUD to your project. 33 | 34 | Add a pod entry for JHUD to your Podfile. 35 | 36 | ``` 37 | pod 'JHUD' 38 | ``` 39 | Second, install JHUD into your project: 40 | 41 | ``` 42 | pod install 43 | ``` 44 | Include JHUD wherever you need it with `#import "JHUD.h"`. 45 | 46 | ## Manually 47 | 48 | 1. Download the latest code version . 49 | 2. Open your project in Xcode,drag the `JHUD` folder into your project. Make sure to select Copy items when asked if you extracted the code archive outside of your project. 50 | 3. You need it with `#import "JHUD.h"`. 51 | 52 | 53 | ## Usage 54 | 55 | ``` 56 | hudView = [[JHUD alloc]initWithFrame:self.view.bounds]; 57 | 58 | hudView.messageLabel.text = @"hello ,this is a circle animation"; 59 | 60 | //show 61 | [hudView showAtView:self.view hudType:JHUDLoadingTypeCircle]; 62 | 63 | //hide 64 | [hudView hide]; 65 | ``` 66 | 67 | Class method : 68 | 69 | ``` 70 | [JHUD showAtView:self.view message:@"Hello, this is a message"]; 71 | 72 | [JHUD hide]; 73 | ``` 74 | 75 | For more examples, including how to use JHUD , take a look at the bundled demo project. API documentation is provided in the header file (JHUD.h). 76 | 77 | ## Contacts 78 | 79 | ####If you wish to contact me, email at: hi@jinxiansen.com 80 | 81 | #####Sina : [@晋先森](http://weibo.com/3205872327/) 82 | #####Twitter : [@jinxiansen](https://twitter.com/jinxiansen) 83 | 84 | ## License 85 | 86 | JHUD is released under the [MIT license](LICENSE). See LICENSE for details. -------------------------------------------------------------------------------- /JHudViewDemo.xcodeproj/xcuserdata/jinxiansen.xcuserdatad/xcschemes/JHudViewDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /JHudViewDemo/JHUD/UIView+JHUDAutoLayout.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+JHUDAutoLayout.m 3 | // JHudViewDemo 4 | // 5 | // Created by 晋先森 on 16/7/16. 6 | // Copyright © 2016年 晋先森. All rights reserved. 7 | // 8 | 9 | #import "UIView+JHUDAutoLayout.h" 10 | 11 | 12 | @implementation UIView (JHUDAutoLayout) 13 | 14 | - (void)addConstraintWidth:(CGFloat)width height:(CGFloat)height 15 | { 16 | if (width > 0) { 17 | [self addConstraint:[NSLayoutConstraint 18 | constraintWithItem:self 19 | attribute:NSLayoutAttributeWidth 20 | relatedBy:NSLayoutRelationEqual 21 | toItem:nil 22 | attribute:0 23 | multiplier:1 24 | constant:width]]; 25 | } 26 | 27 | if (height > 0) { 28 | [self addConstraint:[NSLayoutConstraint 29 | constraintWithItem:self 30 | attribute:NSLayoutAttributeHeight 31 | relatedBy:NSLayoutRelationEqual 32 | toItem:nil 33 | attribute:0 34 | multiplier:1 35 | constant:height]]; 36 | } 37 | } 38 | - (void)addConstraintCenterXToView:(UIView *)xView 39 | centerYToView:(UIView *)yView 40 | { 41 | if (xView) { 42 | [self addConstraint:[NSLayoutConstraint 43 | constraintWithItem:xView 44 | attribute:NSLayoutAttributeCenterX 45 | relatedBy:NSLayoutRelationEqual 46 | toItem:self 47 | attribute:NSLayoutAttributeCenterX 48 | multiplier:1.0 49 | constant:0]]; 50 | } 51 | 52 | if (yView) { 53 | [self addConstraint:[NSLayoutConstraint 54 | constraintWithItem:yView 55 | attribute:NSLayoutAttributeCenterY 56 | relatedBy:NSLayoutRelationEqual 57 | toItem:self 58 | attribute:NSLayoutAttributeCenterY 59 | multiplier:1.0 60 | constant:0]]; 61 | } 62 | } 63 | 64 | - (NSLayoutConstraint *)addConstraintCenterYToView:(UIView *)yView 65 | constant:(CGFloat)constant; 66 | { 67 | if (yView) { 68 | NSLayoutConstraint *centerYConstraint = [NSLayoutConstraint 69 | constraintWithItem:yView 70 | attribute:NSLayoutAttributeCenterY 71 | relatedBy:NSLayoutRelationEqual 72 | toItem:self 73 | attribute:NSLayoutAttributeCenterY 74 | multiplier:1.0 75 | constant:constant]; 76 | [self addConstraint:centerYConstraint]; 77 | return centerYConstraint; 78 | } 79 | return nil; 80 | } 81 | 82 | - (NSLayoutConstraint *)addConstarintWithTopView:(UIView *)indicatorView 83 | toBottomView:(UIView *)bottomView 84 | constarint:(CGFloat)constarint 85 | { 86 | NSLayoutConstraint *topButtomConstraint =[NSLayoutConstraint 87 | constraintWithItem:indicatorView 88 | attribute:NSLayoutAttributeBottom 89 | relatedBy:NSLayoutRelationEqual 90 | toItem:bottomView 91 | attribute:NSLayoutAttributeTop 92 | multiplier:1 93 | constant:-constarint]; 94 | [self addConstraint:topButtomConstraint]; 95 | return topButtomConstraint; 96 | } 97 | 98 | - (void)removeConstraintWithAttribte:(NSLayoutAttribute)attribute 99 | { 100 | for (NSLayoutConstraint *constraint in self.constraints) { 101 | if (constraint.firstAttribute == attribute) { 102 | [self removeConstraint:constraint]; 103 | break; 104 | } 105 | } 106 | } 107 | 108 | - (void)removeAllConstraints 109 | { 110 | [self removeConstraints:self.constraints]; 111 | } 112 | 113 | 114 | @end 115 | 116 | -------------------------------------------------------------------------------- /JHudViewDemo/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 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /JHudViewDemo/DetailViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // DetailViewController.m 3 | // JHudViewDemo 4 | // 5 | // Created by 晋先森 on 16/7/15. 6 | // Copyright © 2016年 晋先森. All rights reserved. 7 | // 8 | 9 | #import "DetailViewController.h" 10 | 11 | #import "JHUD.h" 12 | 13 | // 格式 0xff3737 14 | #define JHUDRGBHexAlpha(rgbValue,a) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:(a)] 15 | 16 | #define JHUDRGBA(r,g,b,a) [UIColor colorWithRed:r/255.0f green:g/255.0f blue:b/255.0f alpha:a] 17 | 18 | @interface DetailViewController () 19 | 20 | @property (nonatomic) JHUD *hudView; 21 | 22 | @end 23 | 24 | @implementation DetailViewController 25 | 26 | - (void)viewDidLoad { 27 | [super viewDidLoad]; 28 | 29 | self.title = self.selName; 30 | self.view.backgroundColor = [UIColor whiteColor]; 31 | 32 | // 建议基类中Lazy创建,进行二次封装,使用时直接调用,避免子类中频繁创建产生冗余代码的问题。 33 | self.hudView = [[JHUD alloc]initWithFrame:self.view.bounds]; 34 | 35 | __weak typeof(self) _self = self; 36 | [self.hudView setJHUDReloadButtonClickedBlock:^() { 37 | NSLog(@"refreshButton"); 38 | [_self loadingCustomAnimations]; 39 | }]; 40 | 41 | 42 | SEL sel = NSSelectorFromString(self.selName); 43 | #pragma clang diagnostic push 44 | #pragma clang diagnostic ignored "-Warc-performSelector-leaks" 45 | [self performSelector:sel withObject:nil]; 46 | #pragma clang diagnostic pop 47 | 48 | self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:[self rightButton]]; 49 | 50 | } 51 | 52 | -(void)rightButtonClick:(UIButton *)button 53 | { 54 | button.selected = !button.selected; 55 | 56 | if (button.selected) { 57 | [self hide]; 58 | }else 59 | { 60 | [self loadingFailure]; 61 | } 62 | 63 | } 64 | 65 | -(UIButton *)rightButton 66 | { 67 | UIButton * rightButton = [UIButton buttonWithType:UIButtonTypeCustom]; 68 | rightButton.frame = CGRectMake(0, 0,45, 35); 69 | [rightButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; 70 | [rightButton setTitle:@"Hide" forState:UIControlStateNormal]; 71 | [rightButton setTitle:@"Show" forState:UIControlStateSelected]; 72 | [rightButton addTarget:self action:@selector(rightButtonClick:) forControlEvents:UIControlEventTouchUpInside]; 73 | return rightButton; 74 | } 75 | 76 | -(void)loadingCircleAnimation 77 | { 78 | self.hudView.messageLabel.text = @"Hello ,this is a circle animation"; 79 | self.hudView.indicatorBackGroundColor = [[UIColor darkGrayColor] colorWithAlphaComponent:0.1]; 80 | self.hudView.indicatorForegroundColor = [UIColor lightGrayColor]; 81 | [self.hudView showAtView:self.view hudType:JHUDLoadingTypeCircle]; 82 | } 83 | 84 | -(void)loadingCircleJoinAnimation 85 | { 86 | self.hudView.messageLabel.text = @"Hello ,this is a circleJoin animation"; 87 | self.hudView.indicatorForegroundColor = JHUDRGBA(60, 139, 246, .5); 88 | self.hudView.indicatorBackGroundColor = JHUDRGBA(185, 186, 200, 0.3); 89 | [self.hudView showAtView:self.view hudType:JHUDLoadingTypeCircleJoin]; 90 | } 91 | 92 | -(void)loadingDotAnimation 93 | { 94 | self.hudView.messageLabel.text = @"Hello ,this is a dot animation"; 95 | self.hudView.indicatorBackGroundColor = [UIColor whiteColor]; 96 | self.hudView.indicatorForegroundColor = [UIColor orangeColor]; 97 | [self.hudView showAtView:self.view hudType:JHUDLoadingTypeDot]; 98 | } 99 | 100 | 101 | -(void)loadingCustomAnimations 102 | { 103 | NSMutableArray * images = [NSMutableArray array]; 104 | for (int index = 0; index<=19; index++) { 105 | NSString * imageName = [NSString stringWithFormat:@"%d.png",index]; 106 | UIImage *image = [UIImage imageNamed:imageName]; 107 | [images addObject:image]; 108 | } 109 | 110 | self.hudView.indicatorViewSize = CGSizeMake(60, 60); 111 | self.hudView.customAnimationImages = images; 112 | self.hudView.messageLabel.text = @"无人问我粥可温\n无人与我共黄昏"; 113 | [self.hudView showAtView:self.view hudType:JHUDLoadingTypeCustomAnimations]; 114 | 115 | // Recommend two web sites 116 | // http://preloaders.net/en/people_and_animals 117 | // https://convertio.co/zh/gif-png/ 118 | // http://spiffygif.com 119 | } 120 | 121 | 122 | -(void)loadingFailure 123 | { 124 | self.hudView.indicatorViewSize = CGSizeMake(100, 100); 125 | self.hudView.messageLabel.text = @"Can't get data, please make sure the interface is correct !"; 126 | [self.hudView.refreshButton setTitle:@"Refresh" forState:UIControlStateNormal]; 127 | self.hudView.customImage = [UIImage imageNamed:@"null"]; 128 | 129 | [self.hudView showAtView:self.view hudType:JHUDLoadingTypeFailure]; 130 | 131 | } 132 | 133 | -(void)loadingFailure2 134 | { 135 | self.hudView.indicatorViewSize = CGSizeMake(150, 150); 136 | self.hudView.messageLabel.text = @"Failed to get data, please try again later"; 137 | [self.hudView.refreshButton setTitle:@"Refresh ?" forState:UIControlStateNormal]; 138 | self.hudView.customImage = [UIImage imageNamed:@"nullData"]; 139 | 140 | [self.hudView showAtView:self.view hudType:JHUDLoadingTypeFailure]; 141 | } 142 | 143 | 144 | -(void)hide 145 | { 146 | [self.hudView hide]; 147 | 148 | } 149 | 150 | 151 | 152 | - (void)didReceiveMemoryWarning { 153 | [super didReceiveMemoryWarning]; 154 | // Dispose of any resources that can be recreated. 155 | } 156 | 157 | /* 158 | #pragma mark - Navigation 159 | 160 | // In a storyboard-based application, you will often want to do a little preparation before navigation 161 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 162 | // Get the new view controller using [segue destinationViewController]. 163 | // Pass the selected object to the new view controller. 164 | } 165 | */ 166 | 167 | @end 168 | -------------------------------------------------------------------------------- /JHudViewDemo/JHUD/JHUDLoadingAnimationView.m: -------------------------------------------------------------------------------- 1 | // 2 | // JHUDLoadingAnimationView.m 3 | // JHudViewDemo 4 | // 5 | // Created by 晋先森 on 16/7/16. 6 | // Copyright © 2016年 晋先森. All rights reserved. 7 | // 8 | 9 | #import "JHUDLoadingAnimationView.h" 10 | #import "JHUD.h" 11 | 12 | #pragma mark - JHUDLoadingAnimationView Class 13 | 14 | #define JHUDDefaultBackGroundColor [UIColor colorWithRed:0.1 green:0.1 blue:0.1 alpha:0.2] 15 | #define JHUDForegroundColor [UIColor colorWithRed:0.2 green:0.2 blue:0.2 alpha:0.6] 16 | 17 | @interface JHUDLoadingAnimationView () 18 | 19 | @property (nonatomic,strong) CAReplicatorLayer * replicatorLayer ; 20 | 21 | @property (nonatomic,strong) CALayer * mylayer; 22 | 23 | @property (nonatomic,strong) CABasicAnimation * basicAnimation; 24 | 25 | @property (nonatomic) JHUDAnimationType type ; 26 | 27 | @end 28 | 29 | 30 | @implementation JHUDLoadingAnimationView 31 | 32 | - (instancetype)init 33 | { 34 | self = [super init]; 35 | if (self) { 36 | 37 | self.defaultBackGroundColor = JHUDDefaultBackGroundColor; 38 | self.foregroundColor = JHUDForegroundColor; 39 | self.count = 10; 40 | } 41 | return self; 42 | } 43 | 44 | -(CAReplicatorLayer *)replicatorLayer 45 | { 46 | if (_replicatorLayer) { 47 | return _replicatorLayer; 48 | } 49 | self.replicatorLayer = [CAReplicatorLayer layer]; 50 | self.replicatorLayer.cornerRadius = 10.0; 51 | 52 | return self.replicatorLayer; 53 | } 54 | 55 | -(CALayer *)mylayer 56 | { 57 | if (_mylayer) { 58 | return _mylayer; 59 | } 60 | self.mylayer = [CALayer layer]; 61 | self.mylayer.masksToBounds = YES; 62 | return self.mylayer; 63 | } 64 | 65 | -(CABasicAnimation *)basicAnimation 66 | { 67 | if (_basicAnimation) { 68 | return _basicAnimation; 69 | } 70 | self.basicAnimation = [CABasicAnimation animation]; 71 | self.basicAnimation.repeatCount = MAXFLOAT; 72 | self.basicAnimation.removedOnCompletion = NO; 73 | self.basicAnimation.fillMode = kCAFillModeForwards; 74 | 75 | return self.basicAnimation; 76 | } 77 | 78 | -(void)setDefaultBackGroundColor:(UIColor *)defaultBackGroundColor 79 | { 80 | _defaultBackGroundColor = defaultBackGroundColor; 81 | 82 | self.replicatorLayer.backgroundColor = defaultBackGroundColor.CGColor; 83 | 84 | } 85 | 86 | -(void)setForegroundColor:(UIColor *)foregroundColor 87 | { 88 | _foregroundColor = foregroundColor; 89 | 90 | self.mylayer.backgroundColor = foregroundColor.CGColor; 91 | 92 | } 93 | 94 | #pragma mark - ShowAnimation method 95 | 96 | -(void)showAnimationAtView:(UIView *)view animationType:(JHUDAnimationType)animationType 97 | { 98 | 99 | [self dispatchMainQueue:^{ 100 | [self removeSubLayer]; 101 | }]; 102 | 103 | self.type = animationType; 104 | 105 | switch (animationType) { 106 | case JHUDAnimationTypeCircle: 107 | self.count = 10; 108 | [self configCircle]; 109 | break; 110 | case JHUDAnimationTypeCircleJoin: 111 | self.count = 100; 112 | [self configCircle]; 113 | break; 114 | case JHUDAnimationTypeDot: 115 | self.count = 3; 116 | [self configDot]; 117 | break; 118 | default: 119 | break; 120 | } 121 | 122 | [self dispatchMainQueue:^{ 123 | [self addSubLayer]; 124 | }]; 125 | 126 | } 127 | 128 | 129 | -(void)configCircle 130 | { 131 | CGFloat width = 10; 132 | 133 | self.mylayer.frame = CGRectMake(0, 0, width, width); 134 | self.mylayer.cornerRadius = width / 2; 135 | self.mylayer.transform = CATransform3DMakeScale(0.01, 0.01, 0.01); 136 | 137 | self.replicatorLayer.instanceCount = self.count; 138 | 139 | CGFloat angle = 2 * M_PI / self.count; 140 | self.replicatorLayer.instanceTransform = CATransform3DMakeRotation(angle, 0, 0, 1); 141 | self.replicatorLayer.instanceDelay = 1.0 / self.count; 142 | 143 | self.basicAnimation.keyPath = @"transform.scale"; 144 | self.basicAnimation.duration = 1; 145 | self.basicAnimation.fromValue = @1; 146 | self.basicAnimation.toValue = @0.1; 147 | 148 | } 149 | 150 | 151 | -(void)configDot 152 | { 153 | CGFloat width = 15 ; 154 | 155 | self.mylayer.frame = CGRectMake(0, 0, width, width); 156 | self.mylayer.transform = CATransform3DMakeScale(0, 0, 0); 157 | self.mylayer.cornerRadius = width / 2; 158 | self.replicatorLayer.instanceCount = self.count; 159 | 160 | self.replicatorLayer.instanceTransform = CATransform3DMakeTranslation(100/3, 0, 0); 161 | self.replicatorLayer.instanceDelay = 0.8 / self.count; 162 | 163 | self.basicAnimation.keyPath = @"transform.scale"; 164 | self.basicAnimation.duration = 0.8; 165 | self.basicAnimation.fromValue = @1; 166 | self.basicAnimation.toValue = @0; 167 | 168 | } 169 | 170 | -(void)removeSubLayer 171 | { 172 | [self.replicatorLayer removeFromSuperlayer]; 173 | [self.mylayer removeFromSuperlayer]; 174 | [self.mylayer removeAnimationForKey:@"JHUD"]; 175 | 176 | } 177 | 178 | -(void)addSubLayer 179 | { 180 | [self.layer addSublayer:self.replicatorLayer]; 181 | [self.replicatorLayer addSublayer:self.mylayer]; 182 | [self.mylayer addAnimation:self.basicAnimation forKey:@"JHUD"]; 183 | 184 | } 185 | 186 | -(void)layoutSubviews 187 | { 188 | [super layoutSubviews]; 189 | 190 | self.replicatorLayer.frame = self.bounds; 191 | self.replicatorLayer.position = self.center; 192 | 193 | switch (self.type) { 194 | case JHUDAnimationTypeCircle: 195 | case JHUDAnimationTypeCircleJoin: 196 | self.mylayer.position = CGPointMake(50,20); 197 | 198 | break; 199 | 200 | case JHUDAnimationTypeDot: 201 | self.mylayer.position = CGPointMake(15, 50); 202 | 203 | break; 204 | 205 | default: 206 | break; 207 | } 208 | } 209 | 210 | 211 | @end -------------------------------------------------------------------------------- /JHudViewDemo/JHUD/JHUD.m: -------------------------------------------------------------------------------- 1 | // 2 | // JHUD.m 3 | // JHudViewDemo 4 | // 5 | // Created by 晋先森 https://github.com/jinxiansen on 16/7/11. 6 | // Copyright © 2016年 晋先森. All rights reserved. 7 | // 8 | 9 | #import "JHUD.h" 10 | #import "JHUDLoadingAnimationView.h" 11 | #import "UIView+JHUDAutoLayout.h" 12 | #import 13 | 14 | #define KLastWindow [[UIApplication sharedApplication].windows lastObject] 15 | 16 | #define JOBJCSetObject(object,value) objc_setAssociatedObject(object,@"JHUDOBJC" , value, OBJC_ASSOCIATION_RETAIN_NONATOMIC) 17 | 18 | #define JOBJCGetObject(object) objc_getAssociatedObject(object, @"JHUDOBJC") 19 | 20 | //#define JHUDMainThreadAssert() NSAssert([NSThread isMainThread], @"JHUD needs to be accessed on the main thread."); 21 | 22 | 23 | #pragma mark - JHUD Class 24 | 25 | @interface JHUD () 26 | 27 | @property (nonatomic) JHUDLoadingType hudType; 28 | 29 | @property (nonatomic,strong) JHUDLoadingAnimationView *loadingView; 30 | 31 | @property (nonatomic,strong) UIImageView *imageView; 32 | 33 | @end 34 | 35 | @implementation JHUD 36 | 37 | - (instancetype)initWithFrame:(CGRect)frame 38 | { 39 | self = [super initWithFrame:frame]; 40 | if (self) { 41 | 42 | [self configureBaseInfo]; 43 | [self configureSubViews]; 44 | 45 | } 46 | return self; 47 | } 48 | 49 | -(void)configureBaseInfo 50 | { 51 | self.backgroundColor = [UIColor groupTableViewBackgroundColor]; 52 | self.indicatorViewSize = CGSizeMake(100, 100); 53 | } 54 | 55 | -(void)configureSubViews 56 | { 57 | [self addSubview:self.indicatorView]; 58 | 59 | [self addSubview:self.messageLabel]; 60 | 61 | [self addSubview:self.refreshButton]; 62 | 63 | [self.indicatorView addSubview:self.loadingView]; 64 | [self.indicatorView addSubview:self.imageView]; 65 | } 66 | 67 | #pragma mark - show method 68 | 69 | -(void)showAtView:(UIView *)view hudType:(JHUDLoadingType)hudType 70 | { 71 | NSAssert(![self isEmptySize], @"啊! self 的 size 没有设置正确 !self.frame not be nil(JHudView)"); 72 | 73 | self.hudType = hudType; 74 | 75 | [self hide]; 76 | 77 | [self setupSubViewsWithHudType:hudType]; 78 | 79 | [self dispatchMainQueue:^{ 80 | 81 | view ? [view addSubview:self]:[KLastWindow addSubview:self]; 82 | [self.superview bringSubviewToFront:self]; 83 | }]; 84 | } 85 | 86 | +(void)showAtView:(UIView *)view message:(NSString *)message 87 | { 88 | [self showAtView:view message:message hudType:JHUDLoadingTypeCircle]; 89 | } 90 | 91 | +(void)showAtView:(UIView *)view message:(NSString *)message hudType:(JHUDLoadingType)hudType 92 | { 93 | JHUD * hud = [[self alloc]initWithFrame:view.bounds]; 94 | hud.messageLabel.text = message; 95 | 96 | JOBJCSetObject(self, hud); 97 | 98 | [hud showAtView:view hudType:hudType]; 99 | } 100 | 101 | //+(void)hideForView:(UIView *)view 102 | //{ 103 | // NSEnumerator *subviewsEnum = [view.subviews reverseObjectEnumerator]; 104 | // for (UIView *subview in subviewsEnum) { 105 | // if ([subview isKindOfClass:self]) { 106 | // JHUD * hud = (JHUD *)subview; 107 | // [hud hide]; 108 | // } 109 | // } 110 | //} 111 | 112 | +(void)hide 113 | { 114 | JHUD * hud = JOBJCGetObject(self); 115 | if (hud) { 116 | [hud hide]; 117 | } 118 | } 119 | 120 | -(void)hide 121 | { 122 | [self dispatchMainQueue:^{ 123 | if (self.superview) { 124 | [self removeFromSuperview]; 125 | [self.loadingView removeSubLayer]; 126 | } 127 | }]; 128 | 129 | } 130 | 131 | 132 | -(void)setindicatorViewSize:(CGSize)indicatorViewSize 133 | { 134 | _indicatorViewSize = indicatorViewSize; 135 | 136 | [self setNeedsUpdateConstraints]; 137 | } 138 | 139 | -(void)setCustomAnimationImages:(NSArray *)customAnimationImages 140 | { 141 | _customAnimationImages = customAnimationImages; 142 | 143 | if (customAnimationImages.count>1) { 144 | self.imageView.animationImages = _customAnimationImages; 145 | [self.imageView startAnimating]; 146 | } 147 | [self setNeedsUpdateConstraints]; 148 | } 149 | 150 | -(void)setCustomImage:(UIImage *)customImage 151 | { 152 | _customImage = customImage; 153 | 154 | [self.imageView stopAnimating]; 155 | 156 | self.imageView.image = customImage; 157 | } 158 | 159 | -(void)setIndicatorBackGroundColor:(UIColor *)indicatorBackGroundColor 160 | { 161 | _indicatorBackGroundColor = indicatorBackGroundColor; 162 | self.loadingView.defaultBackGroundColor = _indicatorBackGroundColor; 163 | 164 | } 165 | 166 | -(void)setIndicatorForegroundColor:(UIColor *)indicatorForegroundColor 167 | { 168 | _indicatorForegroundColor = indicatorForegroundColor; 169 | 170 | self.loadingView.foregroundColor = _indicatorForegroundColor; 171 | 172 | } 173 | 174 | +(BOOL)requiresConstraintBasedLayout 175 | { 176 | return YES; 177 | } 178 | 179 | - (void)setupSubViewsWithHudType:(JHUDLoadingType)hudType 180 | { 181 | hudType == JHUDLoadingTypeFailure ? 182 | [self isShowRefreshButton:YES]: 183 | [self isShowRefreshButton:NO]; 184 | 185 | if ((hudType == JHUDLoadingTypeCustomAnimations) | (hudType == JHUDLoadingTypeFailure) ) { 186 | self.imageView.hidden = NO; 187 | [self.loadingView removeFromSuperview]; 188 | 189 | }else 190 | { 191 | self.imageView.hidden = YES; 192 | 193 | //The size of the fixed loadingView . 194 | self.indicatorViewSize = CGSizeMake(100, 100); 195 | 196 | if (!self.loadingView.superview) { 197 | [self.indicatorView addSubview:self.loadingView]; 198 | } 199 | } 200 | 201 | switch (hudType) { 202 | case JHUDLoadingTypeCircle: 203 | [self.loadingView showAnimationAtView:self animationType:JHUDAnimationTypeCircle]; 204 | break; 205 | case JHUDLoadingTypeCircleJoin: 206 | [self.loadingView showAnimationAtView:self animationType:JHUDAnimationTypeCircleJoin]; 207 | break; 208 | case JHUDLoadingTypeDot: 209 | [self.loadingView showAnimationAtView:self animationType:JHUDAnimationTypeDot]; 210 | break; 211 | case JHUDLoadingTypeCustomAnimations: 212 | break; 213 | case JHUDLoadingTypeFailure: 214 | break; 215 | 216 | default: 217 | break; 218 | } 219 | 220 | } 221 | 222 | #pragma mark -- Lazy method 223 | 224 | -(JHUDLoadingAnimationView *)loadingView 225 | { 226 | if (_loadingView) { 227 | return _loadingView; 228 | } 229 | self.loadingView = [[JHUDLoadingAnimationView alloc]init]; 230 | self.loadingView.translatesAutoresizingMaskIntoConstraints = NO; 231 | self.loadingView.backgroundColor = [UIColor clearColor]; 232 | 233 | return self.loadingView; 234 | } 235 | 236 | -(UIView *)indicatorView 237 | { 238 | if (_indicatorView) { 239 | return _indicatorView; 240 | } 241 | self.indicatorView = [[UIView alloc]init]; 242 | self.indicatorView.translatesAutoresizingMaskIntoConstraints = NO; 243 | self.indicatorView.backgroundColor = [UIColor clearColor]; 244 | 245 | return self.indicatorView; 246 | } 247 | 248 | -(UIImageView *)imageView 249 | { 250 | if (_imageView) { 251 | return _imageView; 252 | } 253 | self.imageView = [[UIImageView alloc]init]; 254 | self.imageView.translatesAutoresizingMaskIntoConstraints = NO ; 255 | self.imageView.animationDuration = 1; 256 | self.imageView.animationRepeatCount = 0; 257 | 258 | return self.imageView; 259 | } 260 | 261 | -(UILabel *)messageLabel 262 | { 263 | if (_messageLabel) { 264 | return _messageLabel; 265 | } 266 | 267 | self.messageLabel = [UILabel new]; 268 | self.messageLabel.translatesAutoresizingMaskIntoConstraints = NO; 269 | self.messageLabel.textAlignment = NSTextAlignmentCenter ; 270 | self.messageLabel.text = @"Please wait ..."; 271 | self.messageLabel.textColor = [UIColor lightGrayColor]; 272 | self.messageLabel.font = [UIFont systemFontOfSize:16]; 273 | self.messageLabel.backgroundColor = [UIColor clearColor]; 274 | self.messageLabel.numberOfLines = 0; 275 | 276 | return self.messageLabel; 277 | } 278 | 279 | -(UIButton *)refreshButton 280 | { 281 | if (_refreshButton) { 282 | return _refreshButton; 283 | } 284 | 285 | self.refreshButton = [UIButton buttonWithType:UIButtonTypeCustom]; 286 | self.refreshButton.translatesAutoresizingMaskIntoConstraints = NO; 287 | [self.refreshButton setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal]; 288 | [self.refreshButton setTitleColor:[UIColor blackColor] forState:UIControlStateHighlighted]; 289 | self.refreshButton.titleLabel.textAlignment = NSTextAlignmentCenter; 290 | self.refreshButton.titleLabel.font = [UIFont systemFontOfSize:18]; 291 | [self.refreshButton setTitle:@"Refresh" forState:UIControlStateNormal]; 292 | self.refreshButton.layer.borderColor = [UIColor lightGrayColor].CGColor; 293 | self.refreshButton.layer.borderWidth = 0.5; 294 | [self.refreshButton addTarget:self action:@selector(refreshButtonClick) forControlEvents:UIControlEventTouchUpInside]; 295 | 296 | return self.refreshButton; 297 | } 298 | 299 | 300 | #pragma mark -- updateConstraints 301 | 302 | -(void)updateConstraints 303 | { 304 | [self removeAllConstraints]; 305 | 306 | [self.refreshButton removeAllConstraints]; 307 | [self.messageLabel removeConstraintWithAttribte:NSLayoutAttributeWidth]; 308 | [self.indicatorView removeAllConstraints]; 309 | [self.loadingView removeAllConstraints]; 310 | [self.imageView removeAllConstraints]; 311 | 312 | // messageLabel.constraint 313 | [self addConstraintCenterXToView:self.messageLabel centerYToView:self.messageLabel]; 314 | [self.messageLabel addConstraintWidth:250 height:0]; 315 | 316 | // indicatorView.constraint 317 | [self addConstraintCenterXToView:self.indicatorView centerYToView:nil]; 318 | [self addConstarintWithTopView:self.indicatorView toBottomView:self.messageLabel constarint:10]; 319 | [self.indicatorView addConstraintWidth:self.indicatorViewSize.width height:self.indicatorViewSize.height]; 320 | 321 | // imageView.constraint 322 | [self.indicatorView addConstraintCenterXToView:self.imageView centerYToView:self.imageView]; 323 | [self.imageView addConstraintWidth:self.indicatorViewSize.width height:self.indicatorViewSize.height]; 324 | 325 | // loadingView.constraint 326 | if (self.loadingView.superview) { 327 | [self.indicatorView addConstraintCenterXToView:self.loadingView centerYToView:self.loadingView]; 328 | [self.loadingView addConstraintWidth:self.indicatorViewSize.width height:self.indicatorViewSize.height]; 329 | 330 | } 331 | // refreshButton..constraint 332 | [self addConstraintCenterXToView:self.refreshButton centerYToView:nil]; 333 | [self addConstarintWithTopView:self.messageLabel toBottomView:self.refreshButton constarint:10]; 334 | [self.refreshButton addConstraintWidth:100 height:35]; 335 | 336 | // NSLog(@"self.constraint.count %lu ",self.constraints.count); 337 | 338 | [super updateConstraints]; 339 | } 340 | 341 | -(void)layoutSubviews 342 | { 343 | [super layoutSubviews]; 344 | 345 | } 346 | 347 | #pragma mark -- Other method 348 | 349 | -(void)isShowRefreshButton:(BOOL)isShowRefreshButton 350 | { 351 | if (isShowRefreshButton) { 352 | 353 | self.refreshButton.hidden = NO; 354 | } else { 355 | self.refreshButton.hidden = YES; 356 | } 357 | 358 | } 359 | 360 | // When JHUDLoadingTypeFailure, there will be a "refresh" button, and the method. 361 | -(void)refreshButtonClick 362 | { 363 | [self.loadingView removeSubLayer]; 364 | 365 | if (self.JHUDReloadButtonClickedBlock) { 366 | self.JHUDReloadButtonClickedBlock(); 367 | } 368 | } 369 | 370 | -(BOOL)isEmptySize 371 | { 372 | if (self.frame.size.width>0 && self.frame.size.height >0) { 373 | return NO; 374 | } 375 | return YES; 376 | } 377 | 378 | @end 379 | 380 | #pragma mark - UIView (MainQueue) 381 | 382 | @implementation UIView (MainQueue) 383 | 384 | -(void)dispatchMainQueue:(dispatch_block_t)block 385 | { 386 | dispatch_async(dispatch_get_main_queue(), ^{ 387 | block(); 388 | }); 389 | } 390 | 391 | @end 392 | 393 | 394 | 395 | 396 | 397 | 398 | -------------------------------------------------------------------------------- /JHudViewDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 41BDF3401D3399B90013BA46 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 41BDF33F1D3399B90013BA46 /* main.m */; }; 11 | 41BDF3431D3399B90013BA46 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 41BDF3421D3399B90013BA46 /* AppDelegate.m */; }; 12 | 41BDF3461D3399B90013BA46 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 41BDF3451D3399B90013BA46 /* ViewController.m */; }; 13 | 41BDF3491D3399B90013BA46 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 41BDF3471D3399B90013BA46 /* Main.storyboard */; }; 14 | 41BDF34B1D3399B90013BA46 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 41BDF34A1D3399B90013BA46 /* Assets.xcassets */; }; 15 | 41BDF34E1D3399B90013BA46 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 41BDF34C1D3399B90013BA46 /* LaunchScreen.storyboard */; }; 16 | 41E4952C1D3A4E140012263A /* JHUD.m in Sources */ = {isa = PBXBuildFile; fileRef = 41E495271D3A4E140012263A /* JHUD.m */; }; 17 | 41E4952D1D3A4E140012263A /* JHUDLoadingAnimationView.m in Sources */ = {isa = PBXBuildFile; fileRef = 41E495291D3A4E140012263A /* JHUDLoadingAnimationView.m */; }; 18 | 41E4952E1D3A4E140012263A /* UIView+JHUDAutoLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = 41E4952B1D3A4E140012263A /* UIView+JHUDAutoLayout.m */; }; 19 | 41FF47CC1D38B856009468A7 /* DetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 41FF47CB1D38B856009468A7 /* DetailViewController.m */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXFileReference section */ 23 | 41BDF33B1D3399B90013BA46 /* JHudViewDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = JHudViewDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 24 | 41BDF33F1D3399B90013BA46 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 25 | 41BDF3411D3399B90013BA46 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 26 | 41BDF3421D3399B90013BA46 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 27 | 41BDF3441D3399B90013BA46 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 28 | 41BDF3451D3399B90013BA46 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 29 | 41BDF3481D3399B90013BA46 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 30 | 41BDF34A1D3399B90013BA46 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 31 | 41BDF34D1D3399B90013BA46 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 32 | 41BDF34F1D3399B90013BA46 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 33 | 41E495261D3A4E140012263A /* JHUD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JHUD.h; sourceTree = ""; }; 34 | 41E495271D3A4E140012263A /* JHUD.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JHUD.m; sourceTree = ""; }; 35 | 41E495281D3A4E140012263A /* JHUDLoadingAnimationView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JHUDLoadingAnimationView.h; sourceTree = ""; }; 36 | 41E495291D3A4E140012263A /* JHUDLoadingAnimationView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JHUDLoadingAnimationView.m; sourceTree = ""; }; 37 | 41E4952A1D3A4E140012263A /* UIView+JHUDAutoLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+JHUDAutoLayout.h"; sourceTree = ""; }; 38 | 41E4952B1D3A4E140012263A /* UIView+JHUDAutoLayout.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+JHUDAutoLayout.m"; sourceTree = ""; }; 39 | 41FF47CA1D38B856009468A7 /* DetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DetailViewController.h; sourceTree = ""; }; 40 | 41FF47CB1D38B856009468A7 /* DetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DetailViewController.m; sourceTree = ""; }; 41 | /* End PBXFileReference section */ 42 | 43 | /* Begin PBXFrameworksBuildPhase section */ 44 | 41BDF3381D3399B90013BA46 /* Frameworks */ = { 45 | isa = PBXFrameworksBuildPhase; 46 | buildActionMask = 2147483647; 47 | files = ( 48 | ); 49 | runOnlyForDeploymentPostprocessing = 0; 50 | }; 51 | /* End PBXFrameworksBuildPhase section */ 52 | 53 | /* Begin PBXGroup section */ 54 | 41BDF3321D3399B90013BA46 = { 55 | isa = PBXGroup; 56 | children = ( 57 | 41BDF33D1D3399B90013BA46 /* JHudViewDemo */, 58 | 41BDF33C1D3399B90013BA46 /* Products */, 59 | ); 60 | sourceTree = ""; 61 | }; 62 | 41BDF33C1D3399B90013BA46 /* Products */ = { 63 | isa = PBXGroup; 64 | children = ( 65 | 41BDF33B1D3399B90013BA46 /* JHudViewDemo.app */, 66 | ); 67 | name = Products; 68 | sourceTree = ""; 69 | }; 70 | 41BDF33D1D3399B90013BA46 /* JHudViewDemo */ = { 71 | isa = PBXGroup; 72 | children = ( 73 | 41E495251D3A4E140012263A /* JHUD */, 74 | 41BDF3411D3399B90013BA46 /* AppDelegate.h */, 75 | 41BDF3421D3399B90013BA46 /* AppDelegate.m */, 76 | 41BDF3441D3399B90013BA46 /* ViewController.h */, 77 | 41BDF3451D3399B90013BA46 /* ViewController.m */, 78 | 41FF47CA1D38B856009468A7 /* DetailViewController.h */, 79 | 41FF47CB1D38B856009468A7 /* DetailViewController.m */, 80 | 41BDF3471D3399B90013BA46 /* Main.storyboard */, 81 | 41BDF34A1D3399B90013BA46 /* Assets.xcassets */, 82 | 41BDF34C1D3399B90013BA46 /* LaunchScreen.storyboard */, 83 | 41BDF34F1D3399B90013BA46 /* Info.plist */, 84 | 41BDF33E1D3399B90013BA46 /* Supporting Files */, 85 | ); 86 | path = JHudViewDemo; 87 | sourceTree = ""; 88 | }; 89 | 41BDF33E1D3399B90013BA46 /* Supporting Files */ = { 90 | isa = PBXGroup; 91 | children = ( 92 | 41BDF33F1D3399B90013BA46 /* main.m */, 93 | ); 94 | name = "Supporting Files"; 95 | sourceTree = ""; 96 | }; 97 | 41E495251D3A4E140012263A /* JHUD */ = { 98 | isa = PBXGroup; 99 | children = ( 100 | 41E495261D3A4E140012263A /* JHUD.h */, 101 | 41E495271D3A4E140012263A /* JHUD.m */, 102 | 41E495281D3A4E140012263A /* JHUDLoadingAnimationView.h */, 103 | 41E495291D3A4E140012263A /* JHUDLoadingAnimationView.m */, 104 | 41E4952A1D3A4E140012263A /* UIView+JHUDAutoLayout.h */, 105 | 41E4952B1D3A4E140012263A /* UIView+JHUDAutoLayout.m */, 106 | ); 107 | path = JHUD; 108 | sourceTree = ""; 109 | }; 110 | /* End PBXGroup section */ 111 | 112 | /* Begin PBXNativeTarget section */ 113 | 41BDF33A1D3399B90013BA46 /* JHudViewDemo */ = { 114 | isa = PBXNativeTarget; 115 | buildConfigurationList = 41BDF3521D3399B90013BA46 /* Build configuration list for PBXNativeTarget "JHudViewDemo" */; 116 | buildPhases = ( 117 | 41BDF3371D3399B90013BA46 /* Sources */, 118 | 41BDF3381D3399B90013BA46 /* Frameworks */, 119 | 41BDF3391D3399B90013BA46 /* Resources */, 120 | ); 121 | buildRules = ( 122 | ); 123 | dependencies = ( 124 | ); 125 | name = JHudViewDemo; 126 | productName = JHudViewDemo; 127 | productReference = 41BDF33B1D3399B90013BA46 /* JHudViewDemo.app */; 128 | productType = "com.apple.product-type.application"; 129 | }; 130 | /* End PBXNativeTarget section */ 131 | 132 | /* Begin PBXProject section */ 133 | 41BDF3331D3399B90013BA46 /* Project object */ = { 134 | isa = PBXProject; 135 | attributes = { 136 | LastUpgradeCheck = 0730; 137 | ORGANIZATIONNAME = "晋先森"; 138 | TargetAttributes = { 139 | 41BDF33A1D3399B90013BA46 = { 140 | CreatedOnToolsVersion = 7.3; 141 | }; 142 | }; 143 | }; 144 | buildConfigurationList = 41BDF3361D3399B90013BA46 /* Build configuration list for PBXProject "JHudViewDemo" */; 145 | compatibilityVersion = "Xcode 3.2"; 146 | developmentRegion = English; 147 | hasScannedForEncodings = 0; 148 | knownRegions = ( 149 | en, 150 | Base, 151 | ); 152 | mainGroup = 41BDF3321D3399B90013BA46; 153 | productRefGroup = 41BDF33C1D3399B90013BA46 /* Products */; 154 | projectDirPath = ""; 155 | projectRoot = ""; 156 | targets = ( 157 | 41BDF33A1D3399B90013BA46 /* JHudViewDemo */, 158 | ); 159 | }; 160 | /* End PBXProject section */ 161 | 162 | /* Begin PBXResourcesBuildPhase section */ 163 | 41BDF3391D3399B90013BA46 /* Resources */ = { 164 | isa = PBXResourcesBuildPhase; 165 | buildActionMask = 2147483647; 166 | files = ( 167 | 41BDF34E1D3399B90013BA46 /* LaunchScreen.storyboard in Resources */, 168 | 41BDF34B1D3399B90013BA46 /* Assets.xcassets in Resources */, 169 | 41BDF3491D3399B90013BA46 /* Main.storyboard in Resources */, 170 | ); 171 | runOnlyForDeploymentPostprocessing = 0; 172 | }; 173 | /* End PBXResourcesBuildPhase section */ 174 | 175 | /* Begin PBXSourcesBuildPhase section */ 176 | 41BDF3371D3399B90013BA46 /* Sources */ = { 177 | isa = PBXSourcesBuildPhase; 178 | buildActionMask = 2147483647; 179 | files = ( 180 | 41E4952C1D3A4E140012263A /* JHUD.m in Sources */, 181 | 41FF47CC1D38B856009468A7 /* DetailViewController.m in Sources */, 182 | 41BDF3461D3399B90013BA46 /* ViewController.m in Sources */, 183 | 41BDF3431D3399B90013BA46 /* AppDelegate.m in Sources */, 184 | 41E4952E1D3A4E140012263A /* UIView+JHUDAutoLayout.m in Sources */, 185 | 41BDF3401D3399B90013BA46 /* main.m in Sources */, 186 | 41E4952D1D3A4E140012263A /* JHUDLoadingAnimationView.m in Sources */, 187 | ); 188 | runOnlyForDeploymentPostprocessing = 0; 189 | }; 190 | /* End PBXSourcesBuildPhase section */ 191 | 192 | /* Begin PBXVariantGroup section */ 193 | 41BDF3471D3399B90013BA46 /* Main.storyboard */ = { 194 | isa = PBXVariantGroup; 195 | children = ( 196 | 41BDF3481D3399B90013BA46 /* Base */, 197 | ); 198 | name = Main.storyboard; 199 | sourceTree = ""; 200 | }; 201 | 41BDF34C1D3399B90013BA46 /* LaunchScreen.storyboard */ = { 202 | isa = PBXVariantGroup; 203 | children = ( 204 | 41BDF34D1D3399B90013BA46 /* Base */, 205 | ); 206 | name = LaunchScreen.storyboard; 207 | sourceTree = ""; 208 | }; 209 | /* End PBXVariantGroup section */ 210 | 211 | /* Begin XCBuildConfiguration section */ 212 | 41BDF3501D3399B90013BA46 /* Debug */ = { 213 | isa = XCBuildConfiguration; 214 | buildSettings = { 215 | ALWAYS_SEARCH_USER_PATHS = NO; 216 | CLANG_ANALYZER_NONNULL = YES; 217 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 218 | CLANG_CXX_LIBRARY = "libc++"; 219 | CLANG_ENABLE_MODULES = YES; 220 | CLANG_ENABLE_OBJC_ARC = YES; 221 | CLANG_WARN_BOOL_CONVERSION = YES; 222 | CLANG_WARN_CONSTANT_CONVERSION = YES; 223 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 224 | CLANG_WARN_EMPTY_BODY = YES; 225 | CLANG_WARN_ENUM_CONVERSION = YES; 226 | CLANG_WARN_INT_CONVERSION = YES; 227 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 228 | CLANG_WARN_UNREACHABLE_CODE = YES; 229 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 230 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 231 | COPY_PHASE_STRIP = NO; 232 | DEBUG_INFORMATION_FORMAT = dwarf; 233 | ENABLE_STRICT_OBJC_MSGSEND = YES; 234 | ENABLE_TESTABILITY = YES; 235 | GCC_C_LANGUAGE_STANDARD = gnu99; 236 | GCC_DYNAMIC_NO_PIC = NO; 237 | GCC_NO_COMMON_BLOCKS = YES; 238 | GCC_OPTIMIZATION_LEVEL = 0; 239 | GCC_PREPROCESSOR_DEFINITIONS = ( 240 | "DEBUG=1", 241 | "$(inherited)", 242 | ); 243 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 244 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 245 | GCC_WARN_UNDECLARED_SELECTOR = YES; 246 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 247 | GCC_WARN_UNUSED_FUNCTION = YES; 248 | GCC_WARN_UNUSED_VARIABLE = YES; 249 | IPHONEOS_DEPLOYMENT_TARGET = 6.0; 250 | MTL_ENABLE_DEBUG_INFO = YES; 251 | ONLY_ACTIVE_ARCH = YES; 252 | SDKROOT = iphoneos; 253 | }; 254 | name = Debug; 255 | }; 256 | 41BDF3511D3399B90013BA46 /* Release */ = { 257 | isa = XCBuildConfiguration; 258 | buildSettings = { 259 | ALWAYS_SEARCH_USER_PATHS = NO; 260 | CLANG_ANALYZER_NONNULL = YES; 261 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 262 | CLANG_CXX_LIBRARY = "libc++"; 263 | CLANG_ENABLE_MODULES = YES; 264 | CLANG_ENABLE_OBJC_ARC = YES; 265 | CLANG_WARN_BOOL_CONVERSION = YES; 266 | CLANG_WARN_CONSTANT_CONVERSION = YES; 267 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 268 | CLANG_WARN_EMPTY_BODY = YES; 269 | CLANG_WARN_ENUM_CONVERSION = YES; 270 | CLANG_WARN_INT_CONVERSION = YES; 271 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 272 | CLANG_WARN_UNREACHABLE_CODE = YES; 273 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 274 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 275 | COPY_PHASE_STRIP = NO; 276 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 277 | ENABLE_NS_ASSERTIONS = NO; 278 | ENABLE_STRICT_OBJC_MSGSEND = YES; 279 | GCC_C_LANGUAGE_STANDARD = gnu99; 280 | GCC_NO_COMMON_BLOCKS = YES; 281 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 282 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 283 | GCC_WARN_UNDECLARED_SELECTOR = YES; 284 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 285 | GCC_WARN_UNUSED_FUNCTION = YES; 286 | GCC_WARN_UNUSED_VARIABLE = YES; 287 | IPHONEOS_DEPLOYMENT_TARGET = 6.0; 288 | MTL_ENABLE_DEBUG_INFO = NO; 289 | SDKROOT = iphoneos; 290 | VALIDATE_PRODUCT = YES; 291 | }; 292 | name = Release; 293 | }; 294 | 41BDF3531D3399B90013BA46 /* Debug */ = { 295 | isa = XCBuildConfiguration; 296 | buildSettings = { 297 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 298 | INFOPLIST_FILE = JHudViewDemo/Info.plist; 299 | IPHONEOS_DEPLOYMENT_TARGET = 6.0; 300 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 301 | PRODUCT_BUNDLE_IDENTIFIER = com.jinxiansen.JHudViewDemo; 302 | PRODUCT_NAME = "$(TARGET_NAME)"; 303 | }; 304 | name = Debug; 305 | }; 306 | 41BDF3541D3399B90013BA46 /* Release */ = { 307 | isa = XCBuildConfiguration; 308 | buildSettings = { 309 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 310 | INFOPLIST_FILE = JHudViewDemo/Info.plist; 311 | IPHONEOS_DEPLOYMENT_TARGET = 6.0; 312 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 313 | PRODUCT_BUNDLE_IDENTIFIER = com.jinxiansen.JHudViewDemo; 314 | PRODUCT_NAME = "$(TARGET_NAME)"; 315 | }; 316 | name = Release; 317 | }; 318 | /* End XCBuildConfiguration section */ 319 | 320 | /* Begin XCConfigurationList section */ 321 | 41BDF3361D3399B90013BA46 /* Build configuration list for PBXProject "JHudViewDemo" */ = { 322 | isa = XCConfigurationList; 323 | buildConfigurations = ( 324 | 41BDF3501D3399B90013BA46 /* Debug */, 325 | 41BDF3511D3399B90013BA46 /* Release */, 326 | ); 327 | defaultConfigurationIsVisible = 0; 328 | defaultConfigurationName = Release; 329 | }; 330 | 41BDF3521D3399B90013BA46 /* Build configuration list for PBXNativeTarget "JHudViewDemo" */ = { 331 | isa = XCConfigurationList; 332 | buildConfigurations = ( 333 | 41BDF3531D3399B90013BA46 /* Debug */, 334 | 41BDF3541D3399B90013BA46 /* Release */, 335 | ); 336 | defaultConfigurationIsVisible = 0; 337 | defaultConfigurationName = Release; 338 | }; 339 | /* End XCConfigurationList section */ 340 | }; 341 | rootObject = 41BDF3331D3399B90013BA46 /* Project object */; 342 | } 343 | --------------------------------------------------------------------------------