├── .gitignore ├── JsenProjectEncapsulation ├── JsenProjectEncapsulation.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── WangXuesen.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ └── WangXuesen.xcuserdatad │ │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ ├── JsenProjectEncapsulation.xcscheme │ │ └── xcschememanagement.plist ├── JsenProjectEncapsulation.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── WangXuesen.xcuserdatad │ │ ├── UserInterfaceState.xcuserstate │ │ └── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist ├── JsenProjectEncapsulation │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ ├── Contents.json │ │ ├── tab_background.imageset │ │ │ ├── Contents.json │ │ │ └── tabbar_background_os7@2x.png │ │ ├── tab_found_nor.imageset │ │ │ ├── Contents.json │ │ │ └── mycity_normal@2x.png │ │ ├── tab_found_sel.imageset │ │ │ ├── Contents.json │ │ │ └── mycity_highlight@2x.png │ │ ├── tab_friend_nor.imageset │ │ │ ├── Contents.json │ │ │ └── message_normal@2x.png │ │ ├── tab_friend_sel.imageset │ │ │ ├── Contents.json │ │ │ └── message_highlight@2x.png │ │ ├── tab_home_nor.imageset │ │ │ ├── Contents.json │ │ │ └── home_normal@2x.png │ │ ├── tab_home_sel.imageset │ │ │ ├── Contents.json │ │ │ └── home_highlight@2x.png │ │ ├── tab_plus.imageset │ │ │ ├── Contents.json │ │ │ └── post_normal@2x.png │ │ ├── tab_setting_nor.imageset │ │ │ ├── Contents.json │ │ │ └── account_normal@2x.png │ │ ├── tab_setting_sel.imageset │ │ │ ├── Contents.json │ │ │ └── account_highlight@2x.png │ │ └── tab_top_line.imageset │ │ │ ├── Contents.json │ │ │ └── tapbar_top_line@2x.png │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Info.plist │ ├── JsenKit │ │ ├── Additions │ │ │ └── JsenAddition.h │ │ ├── AppCofig │ │ │ ├── AppConfig.pch │ │ │ ├── Common.h │ │ │ ├── Fonts.h │ │ │ ├── JsenAppConfig.h │ │ │ └── Services.h │ │ ├── Category │ │ │ ├── NSDictionary+Expansion.h │ │ │ ├── NSDictionary+Expansion.m │ │ │ ├── NSString+Expansion.h │ │ │ ├── NSString+Expansion.m │ │ │ ├── UIImage+Expansion.h │ │ │ ├── UIImage+Expansion.m │ │ │ ├── UINavigationBar+Expansion.h │ │ │ ├── UINavigationBar+Expansion.m │ │ │ ├── UINavigationItem+Expansion.h │ │ │ └── UINavigationItem+Expansion.m │ │ ├── CustomControl │ │ │ ├── JsenNavigationBar │ │ │ │ ├── JsenTitleView.h │ │ │ │ ├── JsenTitleView.m │ │ │ │ ├── JsenTitleViewAttribute.h │ │ │ │ ├── JsenTitleViewAttribute.m │ │ │ │ └── jsen_titleview_placeholder.png │ │ │ ├── JsenProgressHUD │ │ │ │ ├── JsenProgressHUD.h │ │ │ │ ├── JsenProgressHUD.m │ │ │ │ ├── error@2x.png │ │ │ │ └── success@2x.png │ │ │ ├── JsenTabBarController │ │ │ │ ├── JsenCustomTabBarView.h │ │ │ │ ├── JsenCustomTabBarView.m │ │ │ │ ├── JsenTabBarConfig.h │ │ │ │ ├── JsenTabBarController.h │ │ │ │ ├── JsenTabBarController.m │ │ │ │ ├── JsenTabBarControllerMgr.h │ │ │ │ ├── JsenTabBarControllerMgr.m │ │ │ │ ├── JsenTabBarItem.h │ │ │ │ ├── JsenTabBarItem.m │ │ │ │ ├── JsenTabBarItemAttribute.h │ │ │ │ ├── JsenTabBarItemAttribute.m │ │ │ │ ├── JsenTabBarItemMgr.h │ │ │ │ └── JsenTabBarItemMgr.m │ │ │ ├── JumpView │ │ │ │ ├── JsenJumpView.h │ │ │ │ ├── JsenJumpView.m │ │ │ │ ├── praise.png │ │ │ │ ├── praised.png │ │ │ │ └── shadow.png │ │ │ └── TransitionAnimation │ │ │ │ ├── PingInvertTransition.h │ │ │ │ ├── PingInvertTransition.m │ │ │ │ ├── PingTransition.h │ │ │ │ └── PingTransition.m │ │ ├── MVC │ │ │ ├── JsenBaseModel.h │ │ │ ├── JsenBaseModel.m │ │ │ ├── JsenBaseView.h │ │ │ ├── JsenBaseView.m │ │ │ ├── JsenBaseViewController.h │ │ │ └── JsenBaseViewController.m │ │ ├── Macros │ │ │ └── JsenLog.h │ │ ├── Networks │ │ │ ├── JsenNetworkMonitor.h │ │ │ ├── JsenNetworkMonitor.m │ │ │ ├── JsenRequest.h │ │ │ ├── JsenRequest.m │ │ │ ├── JsenRequestClient.h │ │ │ ├── JsenRequestClient.m │ │ │ ├── JsenRequestParamsModel.h │ │ │ ├── JsenRequestParamsModel.m │ │ │ ├── JsenRequestParamsModelManager.h │ │ │ ├── JsenRequestParamsModelManager.m │ │ │ ├── JsenRequestProtocol.h │ │ │ ├── JsenRequestResponseFailure.h │ │ │ ├── JsenRequestResponseFailure.m │ │ │ ├── JsenRequestResponseSelectors.h │ │ │ ├── JsenRequestResponseSelectors.m │ │ │ ├── JsenRequestResponseSuccess.h │ │ │ ├── JsenRequestResponseSuccess.m │ │ │ ├── Reachability.h │ │ │ └── Reachability.m │ │ └── Tools │ │ │ ├── JsenFrameKit.h │ │ │ ├── JsenFrameKit.m │ │ │ ├── JsenValidationKit.h │ │ │ └── JsenValidationKit.m │ ├── Resource │ │ ├── Test │ │ │ ├── JsenLoginModel.h │ │ │ ├── JsenLoginModel.m │ │ │ ├── JsenMessageModel.h │ │ │ ├── JsenMessageModel.m │ │ │ ├── JsenModel.h │ │ │ ├── JsenModel.m │ │ │ ├── JsenModel2.h │ │ │ ├── JsenModel2.m │ │ │ ├── JsenVariablesModel.h │ │ │ ├── JsenVariablesModel.m │ │ │ └── img_avatar.png │ │ └── logo.png │ ├── ViewController.h │ ├── ViewController.m │ ├── codes │ │ ├── part1 │ │ │ ├── JsenHomeViewController.h │ │ │ └── JsenHomeViewController.m │ │ ├── part2 │ │ │ ├── JsenFriendViewController.h │ │ │ └── JsenFriendViewController.m │ │ ├── part3 │ │ │ ├── JsenFoundViewController.h │ │ │ ├── JsenFoundViewController.m │ │ │ ├── JsenPraiseTableViewCell.h │ │ │ ├── JsenPraiseTableViewCell.m │ │ │ ├── JsenPraiseViewController.h │ │ │ └── JsenPraiseViewController.m │ │ └── part4 │ │ │ ├── JsenSettingViewController.h │ │ │ └── JsenSettingViewController.m │ └── main.m ├── JsenProjectEncapsulationTests │ ├── Info.plist │ └── JsenProjectEncapsulationTests.m ├── JsenProjectEncapsulationUITests │ ├── Info.plist │ └── JsenProjectEncapsulationUITests.m ├── Podfile ├── Podfile.lock └── Pods │ ├── Headers │ ├── Private │ │ ├── SDWebImage │ │ │ ├── NSData+ImageContentType.h │ │ │ ├── SDImageCache.h │ │ │ ├── SDWebImageCompat.h │ │ │ ├── SDWebImageDecoder.h │ │ │ ├── SDWebImageDownloader.h │ │ │ ├── SDWebImageDownloaderOperation.h │ │ │ ├── SDWebImageManager.h │ │ │ ├── SDWebImageOperation.h │ │ │ ├── SDWebImagePrefetcher.h │ │ │ ├── UIButton+WebCache.h │ │ │ ├── UIImage+GIF.h │ │ │ ├── UIImage+MultiFormat.h │ │ │ ├── UIImageView+HighlightedWebCache.h │ │ │ ├── UIImageView+WebCache.h │ │ │ └── UIView+WebCacheOperation.h │ │ └── YYModel │ │ │ ├── NSObject+YYModel.h │ │ │ ├── YYClassInfo.h │ │ │ └── YYModel.h │ └── Public │ │ ├── SDWebImage │ │ ├── NSData+ImageContentType.h │ │ ├── SDImageCache.h │ │ ├── SDWebImageCompat.h │ │ ├── SDWebImageDecoder.h │ │ ├── SDWebImageDownloader.h │ │ ├── SDWebImageDownloaderOperation.h │ │ ├── SDWebImageManager.h │ │ ├── SDWebImageOperation.h │ │ ├── SDWebImagePrefetcher.h │ │ ├── UIButton+WebCache.h │ │ ├── UIImage+GIF.h │ │ ├── UIImage+MultiFormat.h │ │ ├── UIImageView+HighlightedWebCache.h │ │ ├── UIImageView+WebCache.h │ │ └── UIView+WebCacheOperation.h │ │ └── YYModel │ │ ├── NSObject+YYModel.h │ │ ├── YYClassInfo.h │ │ └── YYModel.h │ ├── Manifest.lock │ ├── Pods.xcodeproj │ ├── project.pbxproj │ └── xcuserdata │ │ └── WangXuesen.xcuserdatad │ │ └── xcschemes │ │ ├── Pods.xcscheme │ │ ├── SDWebImage.xcscheme │ │ ├── YYModel.xcscheme │ │ └── xcschememanagement.plist │ ├── SDWebImage │ ├── LICENSE │ ├── README.md │ └── SDWebImage │ │ ├── NSData+ImageContentType.h │ │ ├── NSData+ImageContentType.m │ │ ├── SDImageCache.h │ │ ├── SDImageCache.m │ │ ├── SDWebImageCompat.h │ │ ├── SDWebImageCompat.m │ │ ├── SDWebImageDecoder.h │ │ ├── SDWebImageDecoder.m │ │ ├── SDWebImageDownloader.h │ │ ├── SDWebImageDownloader.m │ │ ├── SDWebImageDownloaderOperation.h │ │ ├── SDWebImageDownloaderOperation.m │ │ ├── SDWebImageManager.h │ │ ├── SDWebImageManager.m │ │ ├── SDWebImageOperation.h │ │ ├── SDWebImagePrefetcher.h │ │ ├── SDWebImagePrefetcher.m │ │ ├── UIButton+WebCache.h │ │ ├── UIButton+WebCache.m │ │ ├── UIImage+GIF.h │ │ ├── UIImage+GIF.m │ │ ├── UIImage+MultiFormat.h │ │ ├── UIImage+MultiFormat.m │ │ ├── UIImageView+HighlightedWebCache.h │ │ ├── UIImageView+HighlightedWebCache.m │ │ ├── UIImageView+WebCache.h │ │ ├── UIImageView+WebCache.m │ │ ├── UIView+WebCacheOperation.h │ │ └── UIView+WebCacheOperation.m │ ├── Target Support Files │ ├── Pods │ │ ├── Pods-acknowledgements.markdown │ │ ├── Pods-acknowledgements.plist │ │ ├── Pods-dummy.m │ │ ├── Pods-frameworks.sh │ │ ├── Pods-resources.sh │ │ ├── Pods.debug.xcconfig │ │ └── Pods.release.xcconfig │ ├── SDWebImage │ │ ├── SDWebImage-dummy.m │ │ ├── SDWebImage-prefix.pch │ │ └── SDWebImage.xcconfig │ └── YYModel │ │ ├── YYModel-dummy.m │ │ ├── YYModel-prefix.pch │ │ └── YYModel.xcconfig │ └── YYModel │ ├── LICENSE │ ├── README.md │ └── YYModel │ ├── NSObject+YYModel.h │ ├── NSObject+YYModel.m │ ├── YYClassInfo.h │ ├── YYClassInfo.m │ └── YYModel.h ├── README.md └── resource ├── jsen_titleview_remote.JPG ├── loading.gif ├── navigationbar.gif ├── page.gif ├── praise.gif ├── tabbar.gif └── transition.gif /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | *.xcuserstate 3 | 4 | JsenProjectEncapsulation/JsenProjectEncapsulation.xcodeproj/project.xcworkspace/xcuserdata/WangXuesen.xcuserdatad/UserInterfaceState.xcuserstate 5 | 6 | *.xcuserstate 7 | 8 | *.xcuserstate 9 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation.xcodeproj/project.xcworkspace/xcuserdata/WangXuesen.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imwangxuesen/HUD_TransformationAnimation_CustomTabBar/f4f02647925d6d9a76590b0d86ea991d298d7698/JsenProjectEncapsulation/JsenProjectEncapsulation.xcodeproj/project.xcworkspace/xcuserdata/WangXuesen.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation.xcodeproj/xcuserdata/WangXuesen.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 20 | 21 | 22 | 24 | 36 | 37 | 38 | 40 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation.xcodeproj/xcuserdata/WangXuesen.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | JsenProjectEncapsulation.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 4C5672CE1C1FBACE00ABDAAA 16 | 17 | primary 18 | 19 | 20 | 4C5672E71C1FBACE00ABDAAA 21 | 22 | primary 23 | 24 | 25 | 4C5672F21C1FBACE00ABDAAA 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation.xcworkspace/xcuserdata/WangXuesen.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imwangxuesen/HUD_TransformationAnimation_CustomTabBar/f4f02647925d6d9a76590b0d86ea991d298d7698/JsenProjectEncapsulation/JsenProjectEncapsulation.xcworkspace/xcuserdata/WangXuesen.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // JsenProjectEncapsulation 4 | // 5 | // Created by WangXuesen on 15/12/15. 6 | // Copyright © 2015年 Jsen. 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 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/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 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/Assets.xcassets/tab_background.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "tabbar_background_os7@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/Assets.xcassets/tab_background.imageset/tabbar_background_os7@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imwangxuesen/HUD_TransformationAnimation_CustomTabBar/f4f02647925d6d9a76590b0d86ea991d298d7698/JsenProjectEncapsulation/JsenProjectEncapsulation/Assets.xcassets/tab_background.imageset/tabbar_background_os7@2x.png -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/Assets.xcassets/tab_found_nor.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "mycity_normal@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/Assets.xcassets/tab_found_nor.imageset/mycity_normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imwangxuesen/HUD_TransformationAnimation_CustomTabBar/f4f02647925d6d9a76590b0d86ea991d298d7698/JsenProjectEncapsulation/JsenProjectEncapsulation/Assets.xcassets/tab_found_nor.imageset/mycity_normal@2x.png -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/Assets.xcassets/tab_found_sel.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "mycity_highlight@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/Assets.xcassets/tab_found_sel.imageset/mycity_highlight@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imwangxuesen/HUD_TransformationAnimation_CustomTabBar/f4f02647925d6d9a76590b0d86ea991d298d7698/JsenProjectEncapsulation/JsenProjectEncapsulation/Assets.xcassets/tab_found_sel.imageset/mycity_highlight@2x.png -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/Assets.xcassets/tab_friend_nor.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "message_normal@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/Assets.xcassets/tab_friend_nor.imageset/message_normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imwangxuesen/HUD_TransformationAnimation_CustomTabBar/f4f02647925d6d9a76590b0d86ea991d298d7698/JsenProjectEncapsulation/JsenProjectEncapsulation/Assets.xcassets/tab_friend_nor.imageset/message_normal@2x.png -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/Assets.xcassets/tab_friend_sel.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "message_highlight@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/Assets.xcassets/tab_friend_sel.imageset/message_highlight@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imwangxuesen/HUD_TransformationAnimation_CustomTabBar/f4f02647925d6d9a76590b0d86ea991d298d7698/JsenProjectEncapsulation/JsenProjectEncapsulation/Assets.xcassets/tab_friend_sel.imageset/message_highlight@2x.png -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/Assets.xcassets/tab_home_nor.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "home_normal@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/Assets.xcassets/tab_home_nor.imageset/home_normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imwangxuesen/HUD_TransformationAnimation_CustomTabBar/f4f02647925d6d9a76590b0d86ea991d298d7698/JsenProjectEncapsulation/JsenProjectEncapsulation/Assets.xcassets/tab_home_nor.imageset/home_normal@2x.png -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/Assets.xcassets/tab_home_sel.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "home_highlight@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/Assets.xcassets/tab_home_sel.imageset/home_highlight@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imwangxuesen/HUD_TransformationAnimation_CustomTabBar/f4f02647925d6d9a76590b0d86ea991d298d7698/JsenProjectEncapsulation/JsenProjectEncapsulation/Assets.xcassets/tab_home_sel.imageset/home_highlight@2x.png -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/Assets.xcassets/tab_plus.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "post_normal@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/Assets.xcassets/tab_plus.imageset/post_normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imwangxuesen/HUD_TransformationAnimation_CustomTabBar/f4f02647925d6d9a76590b0d86ea991d298d7698/JsenProjectEncapsulation/JsenProjectEncapsulation/Assets.xcassets/tab_plus.imageset/post_normal@2x.png -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/Assets.xcassets/tab_setting_nor.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "account_normal@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/Assets.xcassets/tab_setting_nor.imageset/account_normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imwangxuesen/HUD_TransformationAnimation_CustomTabBar/f4f02647925d6d9a76590b0d86ea991d298d7698/JsenProjectEncapsulation/JsenProjectEncapsulation/Assets.xcassets/tab_setting_nor.imageset/account_normal@2x.png -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/Assets.xcassets/tab_setting_sel.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "account_highlight@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/Assets.xcassets/tab_setting_sel.imageset/account_highlight@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imwangxuesen/HUD_TransformationAnimation_CustomTabBar/f4f02647925d6d9a76590b0d86ea991d298d7698/JsenProjectEncapsulation/JsenProjectEncapsulation/Assets.xcassets/tab_setting_sel.imageset/account_highlight@2x.png -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/Assets.xcassets/tab_top_line.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "tapbar_top_line@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/Assets.xcassets/tab_top_line.imageset/tapbar_top_line@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imwangxuesen/HUD_TransformationAnimation_CustomTabBar/f4f02647925d6d9a76590b0d86ea991d298d7698/JsenProjectEncapsulation/JsenProjectEncapsulation/Assets.xcassets/tab_top_line.imageset/tapbar_top_line@2x.png -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/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 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSAppTransportSecurity 6 | 7 | NSAllowsArbitraryLoads 8 | 9 | 10 | CFBundleDevelopmentRegion 11 | en 12 | CFBundleExecutable 13 | $(EXECUTABLE_NAME) 14 | CFBundleIdentifier 15 | $(PRODUCT_BUNDLE_IDENTIFIER) 16 | CFBundleInfoDictionaryVersion 17 | 6.0 18 | CFBundleName 19 | $(PRODUCT_NAME) 20 | CFBundlePackageType 21 | APPL 22 | CFBundleShortVersionString 23 | 1.0 24 | CFBundleSignature 25 | ???? 26 | CFBundleVersion 27 | 1 28 | LSRequiresIPhoneOS 29 | 30 | UILaunchStoryboardName 31 | LaunchScreen 32 | UIRequiredDeviceCapabilities 33 | 34 | armv7 35 | 36 | UISupportedInterfaceOrientations 37 | 38 | UIInterfaceOrientationPortrait 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UISupportedInterfaceOrientations~ipad 43 | 44 | UIInterfaceOrientationPortrait 45 | UIInterfaceOrientationPortraitUpsideDown 46 | UIInterfaceOrientationLandscapeLeft 47 | UIInterfaceOrientationLandscapeRight 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/Additions/JsenAddition.h: -------------------------------------------------------------------------------- 1 | // 2 | // JsenAddition.h 3 | // 美妆嘉人 4 | // 5 | // Created by WangXuesen on 15/12/1. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #ifndef JsenAddition_h 10 | #define JsenAddition_h 11 | 12 | 13 | #endif /* JsenAddition_h */ 14 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/AppCofig/AppConfig.pch: -------------------------------------------------------------------------------- 1 | // 2 | // AppConfig.pch 3 | // 美妆嘉人 4 | // 5 | // Created by WangXuesen on 15/12/1. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #ifndef AppConfig_pch 10 | #define AppConfig_pch 11 | 12 | #import 13 | #import 14 | 15 | #import "JsenLog.h" 16 | #import "JsenAppConfig.h" 17 | 18 | #endif /* AppConfig_pch */ 19 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/AppCofig/Common.h: -------------------------------------------------------------------------------- 1 | // 2 | // Common.h 3 | // HearstMCB 4 | // 5 | // Created by WangXuesen on 15/12/8. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #ifndef Common_h 10 | #define Common_h 11 | 12 | #define USER_DEFAULT [NSUserDefaults standardUserDefaults] 13 | #define ImageNamed(_pointer) [UIImage imageNamed:_pointer] 14 | //颜色 15 | #define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0] 16 | 17 | // EXAMPLE 18 | #define BTN_ENABLE_BG_COLOR UIColorFromRGB(0xAC0005) 19 | #define BTN_DISABLE_BG_COLOR UIColorFromRGB(0xD7D7D7) 20 | #define BTN_ENABLE_TITLE_COLOR UIColorFromRGB(0xFFFFFF) 21 | #define BTN_DISABLE_TITLE_COLOR UIColorFromRGB(0x000000) 22 | //////////////////////////////////////////////////////////////////////////////// 23 | #pragma mark - degrees/radian functions 24 | 25 | #define degreesToRadian(x) (M_PI * (x) / 180.0) 26 | 27 | #define radianToDegrees(radian) (radian*180.0)/(M_PI) 28 | 29 | //////////////////////////////////////////////////////////////////////////////// 30 | 31 | //////////////////////////////////////////////////////////////////////////////// 32 | #pragma mark - System and Screen adapter 33 | #define IS_IPAD [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad 34 | #define IS_IPHONE [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone 35 | #define IS_IPHONE_4 (fabs((double)[[UIScreen mainScreen] bounds].size.height - (double )480) < DBL_EPSILON ) 36 | #define IS_IPHONE_5 (fabs((double)[[UIScreen mainScreen] bounds].size.height - (double )568) < DBL_EPSILON ) 37 | #define IS_IPHONE_6 (fabs((double)[[UIScreen mainScreen] bounds].size.height - (double )667) < DBL_EPSILON ) 38 | #define IS_IPHONE_6_PLUS (fabs((double)[[UIScreen mainScreen] bounds].size.height - (double )960) < DBL_EPSILON ) 39 | 40 | #define IPHONE_OS [NSString stringWithFormat:@"%@%@",[UIDevice currentDevice].systemName,[UIDevice currentDevice].systemVersion] 41 | #define iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO) 42 | #define iPhone6 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(750, 1334), [[UIScreen mainScreen] currentMode].size) : NO) 43 | #define iPhone6plus ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2208), [[UIScreen mainScreen] currentMode].size) : NO) 44 | 45 | #define IS_IOS_VERSION floorf([[UIDevice currentDevice].systemVersion floatValue] 46 | #define IS_IOS_5 floorf([[UIDevice currentDevice].systemVersion floatValue]) == 5.0 ? 1 : 0 47 | #define IS_IOS_6 floorf([[UIDevice currentDevice].systemVersion floatValue]) == 6.0 ? 1 : 0 48 | #define IS_IOS_7 floorf([[UIDevice currentDevice].systemVersion floatValue]) == 7.0 ? 1 : 0 49 | #define IS_IOS_8 floorf([[UIDevice currentDevice].systemVersion floatValue]) == 8.0 ? 1 : 0 50 | #define IS_IOS_9 floorf([[UIDevice currentDevice].systemVersion floatValue]) == 9.0 ? 1 : 0 51 | #define IS_IOS_8_LATER ( (IS_IOS_VERSION > 8.0) || (IS_IOS_VERSION == 8.0) ) ? 1 : 0 52 | 53 | // 获取设备屏幕的物理尺寸 54 | #define ScreenBoundHeight [UIScreen mainScreen].bounds.size.height 55 | #define ScreenBoundWidth [UIScreen mainScreen].bounds.size.width 56 | 57 | #define IH_IS_IPHONE ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) 58 | 59 | //////////////////////////////////////////////////////////////////////////////// 60 | 61 | 62 | #endif /* Common_h */ 63 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/AppCofig/Fonts.h: -------------------------------------------------------------------------------- 1 | // 2 | // Fonts.h 3 | // 美妆嘉人 4 | // 5 | // Created by WangXuesen on 15/12/1. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #ifndef Fonts_h 10 | #define Fonts_h 11 | 12 | 13 | #endif /* Fonts_h */ 14 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/AppCofig/JsenAppConfig.h: -------------------------------------------------------------------------------- 1 | // 2 | // JsenAppConfig.h 3 | // 美妆嘉人 4 | // 5 | // Created by WangXuesen on 15/12/1. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #ifndef JsenAppConfig_h 10 | #define JsenAppConfig_h 11 | #import "Fonts.h" 12 | #import "Services.h" 13 | #import "Common.h" 14 | 15 | #endif /* JsenAppConfig_h */ 16 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/AppCofig/Services.h: -------------------------------------------------------------------------------- 1 | // 2 | // Services.h 3 | // 美妆嘉人 4 | // 5 | // Created by WangXuesen on 15/12/1. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #ifndef Services_h 10 | #define Services_h 11 | 12 | 13 | //****************************************************************************************************************// 14 | //************************************************ Http Settings ************************************************// 15 | //****************************************************************************************************************// 16 | 17 | 18 | /** 19 | * 为1,切换到生产环境,其它,切换到测试环境 20 | * 21 | * @return 生产,测试 的baseurl 22 | */ 23 | #define APP_PRODUCTION_ENVIRONMENT 1 24 | 25 | /** 26 | * http请求超时时间 (s) 27 | * 28 | */ 29 | #define Service_TimeOut 30 30 | 31 | /** 32 | * 生产环境baseurl 33 | * 34 | */ 35 | #define Domain_Online_BaseURL @"http://bbs.mcchina.com/" 36 | 37 | /** 38 | * 测试环境baseurl 39 | * 40 | */ 41 | #define Domain_Test_BaseURL @"http://116.236.249.249/mcbbe/" 42 | 43 | /** 44 | * 根据APP_PRODUCTION_ENVIRONMENT切换到我们预设置的baseurl 45 | * 46 | */ 47 | #define Domain_Ture_BaseURL (APP_PRODUCTION_ENVIRONMENT == 1 ? Domain_Online_BaseURL : Domain_Test_BaseURL) 48 | 49 | /** 50 | * 当前环境下的请求接口 51 | * 52 | * @param interface 子接口的宏 53 | * 54 | */ 55 | #define Domain_Sub_Interface(interface) ([NSString stringWithFormat:@"%@%@",Domain_Ture_BaseURL,interface]) 56 | 57 | 58 | //****************************************************************************************************************// 59 | //************************************************ Sub Interface ************************************************// 60 | //****************************************************************************************************************// 61 | 62 | //example 63 | 64 | #define Home @"api/mobile/index.php?module=homepagelist&nbp=1" 65 | #define Login @"api/mobile/index.php?module=login&nbp=1" 66 | #define UploadHeader @"api/mobile/index.php?module=updateprofile&nbp=1" 67 | 68 | #endif /* Services_h */ 69 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/Category/NSDictionary+Expansion.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSDictionary+Expansion.h 3 | // HearstMCB 4 | // 5 | // Created by WangXuesen on 15/12/2. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSDictionary (Expansion) 12 | 13 | //字典转字符串 14 | - (NSString *)SplicingNetParams; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/Category/NSDictionary+Expansion.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSDictionary+Expansion.m 3 | // HearstMCB 4 | // 5 | // Created by WangXuesen on 15/12/2. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #import "NSDictionary+Expansion.h" 10 | 11 | @implementation NSDictionary (Expansion) 12 | - (NSString *)SplicingNetParams { 13 | 14 | if (self.count != 0 && self != nil) { 15 | NSMutableString * paramStr = [[NSMutableString alloc] init]; 16 | for (id obj in self) { 17 | [paramStr appendFormat:@"%@=%@&",obj,[self valueForKey:obj]]; 18 | } 19 | [paramStr deleteCharactersInRange:NSMakeRange([paramStr length]-1, 1)]; 20 | return paramStr; 21 | } 22 | return @""; 23 | } 24 | @end 25 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/Category/NSString+Expansion.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+Expansion.h 3 | // JsenProjectEncapsulation 4 | // 5 | // Created by WangXuesen on 15/12/16. 6 | // Copyright © 2015年 Jsen. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSString (Expansion) 12 | - (CGSize)sizeWithMaxWidth:(CGFloat)maxWidth font:(UIFont *)font; 13 | @end 14 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/Category/NSString+Expansion.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+Expansion.m 3 | // JsenProjectEncapsulation 4 | // 5 | // Created by WangXuesen on 15/12/16. 6 | // Copyright © 2015年 Jsen. All rights reserved. 7 | // 8 | 9 | #import "NSString+Expansion.h" 10 | 11 | @implementation NSString (Expansion) 12 | - (CGSize)sizeWithMaxWidth:(CGFloat)maxWidth font:(UIFont *)font { 13 | 14 | CGSize boundSize = CGSizeMake(maxWidth, MAXFLOAT); 15 | NSDictionary *attributes = @{ 16 | NSFontAttributeName:font, 17 | }; 18 | CGSize countSize = [self boundingRectWithSize:boundSize options:NSStringDrawingUsesLineFragmentOrigin attributes:attributes context:nil].size; 19 | return countSize; 20 | 21 | } 22 | @end 23 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/Category/UIImage+Expansion.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+Expansion.h 3 | // JsenProjectEncapsulation 4 | // 5 | // Created by WangXuesen on 15/12/16. 6 | // Copyright © 2015年 Jsen. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIImage (Expansion) 12 | + (UIImage *)imageWithColor:(UIColor *)color; 13 | //裁剪 14 | -(UIImage*)getSubImage:(CGRect)rect; 15 | //参见中心最大的正方形 16 | - (UIImage *)getCenterSquareImage:(CGRect)rect; 17 | @end 18 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/Category/UIImage+Expansion.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+Expansion.m 3 | // JsenProjectEncapsulation 4 | // 5 | // Created by WangXuesen on 15/12/16. 6 | // Copyright © 2015年 Jsen. All rights reserved. 7 | // 8 | 9 | #import "UIImage+Expansion.h" 10 | 11 | @implementation UIImage (Expansion) 12 | + (UIImage *)imageWithColor:(UIColor *)color 13 | { 14 | NSParameterAssert(color != nil); 15 | 16 | CGRect rect = CGRectMake(0, 0, 1, 1); 17 | // Create a 1 by 1 pixel context 18 | UIGraphicsBeginImageContextWithOptions(rect.size, NO, 0); 19 | [color setFill]; 20 | UIRectFill(rect); // Fill it with your color 21 | UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); 22 | UIGraphicsEndImageContext(); 23 | 24 | return image; 25 | } 26 | 27 | //截取部分图像 28 | -(UIImage*)getSubImage:(CGRect)rect 29 | { 30 | CGImageRef subImageRef = CGImageCreateWithImageInRect(self.CGImage, rect); 31 | CGRect smallBounds = CGRectMake(0, 0, CGImageGetWidth(subImageRef), CGImageGetHeight(subImageRef)); 32 | 33 | UIGraphicsBeginImageContext(smallBounds.size); 34 | CGContextRef context = UIGraphicsGetCurrentContext(); 35 | 36 | CGContextDrawImage(context, smallBounds, subImageRef); 37 | UIImage* smallImage = [UIImage imageWithCGImage:subImageRef]; 38 | UIGraphicsEndImageContext(); 39 | 40 | return smallImage; 41 | } 42 | 43 | - (UIImage *)getCenterSquareImage:(CGRect)rect { 44 | 45 | CGFloat squareWH = rect.size.width >= rect.size.height ? rect.size.height : rect.size.width; 46 | CGPoint squareCenter = CGPointMake(rect.size.width / 2.0, rect.size.height / 2.0); 47 | CGFloat squareX = squareCenter.x - squareWH/2.0; 48 | CGFloat squareY = squareCenter.y - squareWH/2.0; 49 | CGRect squareRect = CGRectMake(squareX, squareY, squareWH, squareWH); 50 | return [self getSubImage:squareRect]; 51 | 52 | }; 53 | 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/Category/UINavigationBar+Expansion.h: -------------------------------------------------------------------------------- 1 | // 2 | // UINavigationBar+Expansion.h 3 | // JsenProjectEncapsulation 4 | // 5 | // Created by WangXuesen on 15/12/16. 6 | // Copyright © 2015年 Jsen. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UINavigationBar (Expansion) 12 | /** 13 | * 设置背景色 14 | * 15 | * @return nil 16 | */ 17 | - (void)jsen_setBackgroundColor:(UIColor *)backgroundColor; 18 | 19 | /** 20 | * 设置透明度 21 | * 22 | * @param alpha 透明度 0-1 23 | */ 24 | - (void)jsen_setElementsAlpha:(CGFloat)alpha; 25 | 26 | 27 | /** 28 | * 设置y轴上的偏移量 29 | * 30 | * @param translationY y轴偏移量 31 | */ 32 | - (void)jsen_setTranslationY:(CGFloat)translationY; 33 | 34 | 35 | /** 36 | * 重置overlayer 37 | */ 38 | - (void)jsen_reset; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/Category/UINavigationBar+Expansion.m: -------------------------------------------------------------------------------- 1 | // 2 | // UINavigationBar+Expansion.m 3 | // JsenProjectEncapsulation 4 | // 5 | // Created by WangXuesen on 15/12/16. 6 | // Copyright © 2015年 Jsen. All rights reserved. 7 | // 8 | 9 | #import "UINavigationBar+Expansion.h" 10 | #import 11 | 12 | @implementation UINavigationBar (Expansion) 13 | static char overlayKey; 14 | 15 | - (UIView *)overlay { 16 | 17 | return objc_getAssociatedObject(self, &overlayKey); 18 | } 19 | 20 | - (void)setOverlay:(UIView *)overlay { 21 | 22 | objc_setAssociatedObject(self, &overlayKey, overlay, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 23 | 24 | } 25 | 26 | - (void)jsen_setBackgroundColor:(UIColor *)backgroundColor { 27 | if (!self.overlay) { 28 | [self setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault]; 29 | self.overlay = [[UIView alloc] initWithFrame:CGRectMake(-1, -20, [UIScreen mainScreen].bounds.size.width+1, CGRectGetHeight(self.bounds) + 20)]; 30 | self.overlay.userInteractionEnabled = NO; 31 | self.overlay.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight; 32 | [self insertSubview:self.overlay atIndex:0]; 33 | } 34 | self.overlay.backgroundColor = backgroundColor; 35 | } 36 | 37 | - (void)jsen_setTranslationY:(CGFloat)translationY { 38 | 39 | self.transform = CGAffineTransformMakeTranslation(1,translationY); 40 | } 41 | 42 | - (void)jsen_setElementsAlpha:(CGFloat)alpha { 43 | [[self valueForKey:@"_leftViews"] enumerateObjectsUsingBlock:^(UIView *view, NSUInteger idx, BOOL * _Nonnull stop) { 44 | view.alpha = alpha; 45 | }]; 46 | 47 | [[self valueForKey:@"_rightViews"] enumerateObjectsUsingBlock:^(UIView *view, NSUInteger idx, BOOL * _Nonnull stop) { 48 | view.alpha = alpha; 49 | }]; 50 | 51 | UIView *titleView = [self valueForKey:@"_titleView"]; 52 | titleView.alpha = alpha; 53 | 54 | } 55 | 56 | - (void)jsen_reset 57 | { 58 | [self setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault]; 59 | [self.overlay removeFromSuperview]; 60 | self.overlay = nil; 61 | } 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/Category/UINavigationItem+Expansion.h: -------------------------------------------------------------------------------- 1 | // 2 | // UINavigationItem+Expansion.h 3 | // JsenProjectEncapsulation 4 | // 5 | // Created by WangXuesen on 15/12/16. 6 | // Copyright © 2015年 Jsen. All rights reserved. 7 | // 8 | 9 | #import 10 | @class JsenTitleView; 11 | @interface UINavigationItem (Expansion) 12 | 13 | - (void)jsen_setTitleView:(JsenTitleView *)titleView; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/Category/UINavigationItem+Expansion.m: -------------------------------------------------------------------------------- 1 | // 2 | // UINavigationItem+Expansion.m 3 | // JsenProjectEncapsulation 4 | // 5 | // Created by WangXuesen on 15/12/16. 6 | // Copyright © 2015年 Jsen. All rights reserved. 7 | // 8 | 9 | #import "UINavigationItem+Expansion.h" 10 | #import "JsenTitleView.h" 11 | @implementation UINavigationItem (Expansion) 12 | 13 | - (void)jsen_setTitleView:(JsenTitleView *)titleView { 14 | self.titleView = titleView; 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/CustomControl/JsenNavigationBar/JsenTitleView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JsenTitleView.h 3 | // JsenProjectEncapsulation 4 | // 5 | // Created by WangXuesen on 15/12/16. 6 | // Copyright © 2015年 Jsen. All rights reserved. 7 | // 8 | 9 | #import "JsenBaseView.h" 10 | #import "JsenTitleViewAttribute.h" 11 | @interface JsenTitleView : JsenBaseView 12 | @property (nonatomic , strong)JsenTitleViewAttribute * attribute; 13 | 14 | /** 15 | * 传入参数创建一个titleview 16 | * 17 | * @param imageName 本地图片名字 18 | * @param imageUrlStr 远程图片url 19 | * @param title 标题 20 | * @param type title 类型 (不支持只有图片的情况下,图片是远程的) 21 | * 22 | * @return titleview 23 | */ 24 | + (JsenTitleView *)imageName:(NSString *)imageName 25 | imageUrl:(NSString *)imageUrlStr 26 | title:(NSString *)title 27 | type:(JsenTitleViewType)type; 28 | 29 | @end 30 | 31 | 32 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/CustomControl/JsenNavigationBar/JsenTitleViewAttribute.h: -------------------------------------------------------------------------------- 1 | // 2 | // JsenTitleViewAttribute.h 3 | // JsenProjectEncapsulation 4 | // 5 | // Created by WangXuesen on 15/12/16. 6 | // Copyright © 2015年 Jsen. All rights reserved. 7 | // 8 | 9 | #import 10 | @class JsenTitleView; 11 | 12 | typedef enum{ 13 | JsenTitleViewTypeTitle = 0,//只有标题 14 | JsenTitleViewTypeImage, //只有图片 15 | JsenTitleViewTypeTitleAndImage, //图片标题都有,默认图片在标题左侧,图片圆形显示 16 | }JsenTitleViewType; 17 | 18 | @interface JsenTitleViewAttribute : NSObject 19 | @property (nonatomic , copy ) NSString * imageName; 20 | 21 | @property (nonatomic , copy ) NSString * imageUrlStr; 22 | 23 | @property (nonatomic , copy ) NSString * title; 24 | 25 | @property (nonatomic , assign) JsenTitleViewType titleViewType; 26 | @end 27 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/CustomControl/JsenNavigationBar/JsenTitleViewAttribute.m: -------------------------------------------------------------------------------- 1 | // 2 | // JsenTitleViewAttribute.m 3 | // JsenProjectEncapsulation 4 | // 5 | // Created by WangXuesen on 15/12/16. 6 | // Copyright © 2015年 Jsen. All rights reserved. 7 | // 8 | 9 | #import "JsenTitleViewAttribute.h" 10 | 11 | @implementation JsenTitleViewAttribute 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/CustomControl/JsenNavigationBar/jsen_titleview_placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imwangxuesen/HUD_TransformationAnimation_CustomTabBar/f4f02647925d6d9a76590b0d86ea991d298d7698/JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/CustomControl/JsenNavigationBar/jsen_titleview_placeholder.png -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/CustomControl/JsenProgressHUD/JsenProgressHUD.h: -------------------------------------------------------------------------------- 1 | // 2 | // JsenProgressHUD.h 3 | // JsenProjectEncapsulation 4 | // 5 | // Created by WangXuesen on 15/12/17. 6 | // Copyright © 2015年 Jsen. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #define Jsen_HUD_FONT [UIFont boldSystemFontOfSize:14] 12 | #define Jsen_HUD_COLOR UIColorFromRGB(0x353535) 13 | 14 | #define Jsen_HUD_SPINNER_COLOR UIColorFromRGB(0xb9dc2f) 15 | #define Jsen_HUD_BACKGROUND_COLOR UIColorFromRGB(0xffffff) 16 | #define Jsen_HUD_WINDOW_COLOR [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.2] 17 | 18 | #define Jsen_HUD_IMAGE_SUCCESS [UIImage imageNamed:@"success"] 19 | #define Jsen_HUD_IMAGE_ERROR [UIImage imageNamed:@"error"] 20 | 21 | 22 | @interface JsenProgressHUD : UIView 23 | 24 | @property (nonatomic , assign) BOOL interaction; 25 | 26 | @property (nonatomic, retain) UIWindow *window; 27 | @property (nonatomic, retain) UIView *background; 28 | @property (nonatomic, retain) UIToolbar *hud; 29 | @property (nonatomic, retain) UIActivityIndicatorView *spinner; 30 | @property (nonatomic, retain) UIImageView *image; 31 | @property (nonatomic, retain) UILabel *label; 32 | 33 | + (JsenProgressHUD *)shareDefault; 34 | 35 | + (void)dismiss; 36 | 37 | + (void)showText:(NSString *)text interaction:(BOOL)interaction; 38 | + (void)showText:(NSString *)text; 39 | 40 | + (void)showSuccess:(NSString *)text; 41 | + (void)showSuccess:(NSString *)text interaction:(BOOL)interaction; 42 | 43 | + (void)showError:(NSString *)text; 44 | + (void)showError:(NSString *)text interaction:(BOOL)interaction; 45 | 46 | 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/CustomControl/JsenProgressHUD/error@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imwangxuesen/HUD_TransformationAnimation_CustomTabBar/f4f02647925d6d9a76590b0d86ea991d298d7698/JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/CustomControl/JsenProgressHUD/error@2x.png -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/CustomControl/JsenProgressHUD/success@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imwangxuesen/HUD_TransformationAnimation_CustomTabBar/f4f02647925d6d9a76590b0d86ea991d298d7698/JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/CustomControl/JsenProgressHUD/success@2x.png -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/CustomControl/JsenTabBarController/JsenCustomTabBarView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JsenCustomTabBarView.h 3 | // HearstMCB 4 | // 5 | // Created by WangXuesen on 15/12/14. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #import "JsenBaseView.h" 10 | #import "JsenTabBarItem.h" 11 | 12 | @protocol JsenCustomTabBarViewDelegate 13 | 14 | - (void)plusItemClicked:(UIButton *)item; 15 | - (void)firstItemClicked:(JsenTabBarItem *)item; 16 | - (void)secondItemClicked:(JsenTabBarItem *)item; 17 | - (void)thirdItemClicked:(JsenTabBarItem *)item; 18 | - (void)fouthItemClicked:(JsenTabBarItem *)item; 19 | 20 | @end 21 | 22 | @interface JsenCustomTabBarView : JsenBaseView 23 | //------------------------------------------------------------------------------------------------------------------------------------------------- 24 | @property (nonatomic , strong) JsenTabBarItem * firstItem; 25 | @property (nonatomic , strong) JsenTabBarItem * secondItem; 26 | @property (nonatomic , strong) JsenTabBarItem * thirdItem; 27 | @property (nonatomic , strong) JsenTabBarItem * fouthItem; 28 | @property (nonatomic , strong) UIButton * plusItem; 29 | //------------------------------------------------------------------------------------------------------------------------------------------------- 30 | @property (nonatomic , strong) NSArray * attributes; 31 | @property (nonatomic , assign) BOOL showPlusButton; 32 | //------------------------------------------------------------------------------------------------------------------------------------------------- 33 | @property (nonatomic , weak) iddelegate; 34 | 35 | //------------------------------------------------------------------------------------------------------------------------------------------------ 36 | 37 | - (void)configFirstBage:(NSString *)bageNum; 38 | - (void)configSecondBage:(NSString *)bageNum; 39 | - (void)configThirdBage:(NSString *)bageNum; 40 | - (void)configFourthBage:(NSString *)bageNum; 41 | @end 42 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/CustomControl/JsenTabBarController/JsenTabBarConfig.h: -------------------------------------------------------------------------------- 1 | // 2 | // JsenTabBarConfig.h 3 | // JsenProjectEncapsulation 4 | // 5 | // Created by WangXuesen on 15/12/15. 6 | // Copyright © 2015年 Jsen. All rights reserved. 7 | // 8 | 9 | #ifndef JsenTabBarConfig_h 10 | #define JsenTabBarConfig_h 11 | 12 | ///////////////////////////////////////////////////////////////////// 13 | // title 字号大小 14 | static const NSInteger TabBarItem_TitleFontSize = 10; 15 | // title label 的高度 16 | static const CGFloat TabBarItem_TitleH = 10; 17 | 18 | ///////////////////////////////////////////////////////////////////// 19 | // 按钮的背景颜色 20 | static const int TabBarItem_BackgroundColor = 0xffffff; 21 | // 标题的背景颜色 22 | static const int TabBarItem_TitleBackgroundColor = 0xffffff; 23 | // 正常状态下标题的颜色 24 | static const int TabBarItem_TitleTextColor_Nor = 0xe4dede; 25 | // 选中状态下的标题颜色 26 | static const int TabBarItem_TitleTextColor_Sel = 0xDC143C; 27 | // 高亮状态下的标题颜色 28 | static const int TabBarItem_TitleTextColor_HL = 0xDC143C; 29 | 30 | ///////////////////////////////////////////////////////////////////// 31 | // image的宽高 32 | static const CGFloat TabBarItem_ItemImageWH = 25; 33 | // image 和 title 之间的间距 34 | static const CGFloat TabBarItem_ImageTextBorad = 3; 35 | 36 | ///////////////////////////////////////////////////////////////////// 37 | // bagelabel 的宽高(直径) 38 | static const CGFloat TabBarItem_BageWH = 14; 39 | // bagelabel 的背景颜色 40 | static const int TabBarItem_BageBackgroundColor = 0xCC99090; 41 | // bagelabel 的字体颜色 42 | static const int TabBarItem_BageTextColor = 0xffffff; 43 | // bagelabel 的字号 44 | static const NSInteger TabBarItem_BageFontSize = 9; 45 | 46 | ///////////////////////////////////////////////////////////////////// 47 | // bagelabel 的字体名字 48 | #define TabBarItem_BageFontName @"AppleGothic" 49 | // 加号按钮的图片名字 50 | #define TabBarItem_BageFontName_PlusButtonImageName @"tab_plus" 51 | 52 | #endif /* JsenTabBarConfig_h */ 53 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/CustomControl/JsenTabBarController/JsenTabBarController.h: -------------------------------------------------------------------------------- 1 | // 2 | // JsenTabBarController.h 3 | // HearstMCB 4 | // 5 | // Created by WangXuesen on 15/12/13. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface JsenTabBarController : UITabBarController 12 | 13 | @property (nonatomic , strong) NSArray * controllers; 14 | @property (nonatomic , strong) NSArray * attributes; 15 | @property (nonatomic , assign) BOOL showPlusItem; 16 | 17 | //配置tabbarcontroller 的属性 18 | - (void)configAttributes:(NSArray *)attributes controllers:(NSArray *)controllers showPlusItem:(BOOL)showPlusItem; 19 | 20 | //config bage 数目 21 | - (void)configFirstBage:(NSString *)bageNum; 22 | - (void)configSecondBage:(NSString *)bageNum; 23 | - (void)configThirdBage:(NSString *)bageNum; 24 | - (void)configFourthBage:(NSString *)bageNum; 25 | 26 | //隐藏显示tabbar 27 | - (void)showWithAnimation:(BOOL)animation; 28 | - (void)hidenWithAnimation:(BOOL)animation; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/CustomControl/JsenTabBarController/JsenTabBarControllerMgr.h: -------------------------------------------------------------------------------- 1 | // 2 | // JsenTabBarControllerMgr.h 3 | // HearstMCB 4 | // 5 | // Created by WangXuesen on 15/12/13. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JsenTabBarController.h" 11 | @interface JsenTabBarControllerMgr : NSObject 12 | @property (nonatomic,strong)JsenTabBarController * tabBarController; 13 | 14 | + (instancetype)shareMgr; 15 | 16 | //配置attribute 目前只支持2个 或者 4个 17 | - (JsenTabBarController *)mgrTabBarController; 18 | 19 | //配置tabbar item 上的bage 数目 20 | - (void)configFirstBage:(NSString *)bageNum; 21 | - (void)configSecondBage:(NSString *)bageNum; 22 | - (void)configThirdBage:(NSString *)bageNum; 23 | - (void)configFourthBage:(NSString *)bageNum; 24 | 25 | //隐藏显示tabbar 26 | - (void)showWithAnimation:(BOOL)animation; 27 | - (void)hidenWithAnimation:(BOOL)animation; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/CustomControl/JsenTabBarController/JsenTabBarControllerMgr.m: -------------------------------------------------------------------------------- 1 | // 2 | // JsenTabBarControllerMgr.m 3 | // HearstMCB 4 | // 5 | // Created by WangXuesen on 15/12/13. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #import "JsenTabBarControllerMgr.h" 10 | 11 | #import "JsenHomeViewController.h" 12 | #import "JsenFriendViewController.h" 13 | #import "JsenFoundViewController.h" 14 | #import "JsenSettingViewController.h" 15 | 16 | #import "JsenTabBarItemAttribute.h" 17 | 18 | @implementation JsenTabBarControllerMgr 19 | 20 | +(instancetype)shareMgr 21 | { 22 | static JsenTabBarControllerMgr *instance ; 23 | 24 | //dispatch_once_t是线程安全的,onceToken默认为0 25 | static dispatch_once_t onceToken; 26 | 27 | //dispatch_once宏可以保证块代码中的指令只被执行一次 28 | dispatch_once (&onceToken,^{ 29 | instance = [[JsenTabBarControllerMgr alloc] init]; 30 | }); 31 | return instance; 32 | } 33 | 34 | - (JsenTabBarController *)mgrTabBarController { 35 | 36 | //配置attribute 目前只支持2个 或者 4个 37 | JsenTabBarItemAttribute * homeAttribute = [[JsenTabBarItemAttribute alloc] initWithTitle:@"首页" imageNameForSel:@"tab_home_sel" imageNameForNor:@"tab_home_nor"]; 38 | JsenTabBarItemAttribute * friendAttribute = [[JsenTabBarItemAttribute alloc] initWithTitle:@"朋友" imageNameForSel:@"tab_friend_sel" imageNameForNor:@"tab_friend_nor"]; 39 | JsenTabBarItemAttribute * foundAttribute = [[JsenTabBarItemAttribute alloc] initWithTitle:@"发现" imageNameForSel:@"tab_found_sel" imageNameForNor:@"tab_found_nor"]; 40 | JsenTabBarItemAttribute * settingAttribute = [[JsenTabBarItemAttribute alloc] initWithTitle:@"设置" imageNameForSel:@"tab_setting_sel" imageNameForNor:@"tab_setting_nor"]; 41 | NSArray * attributes = @[ 42 | homeAttribute, 43 | friendAttribute, 44 | foundAttribute, 45 | settingAttribute, 46 | ]; 47 | 48 | JsenHomeViewController * home = [[JsenHomeViewController alloc] init]; 49 | home.title = @"首页"; 50 | 51 | JsenFriendViewController * friend = [[JsenFriendViewController alloc] init]; 52 | friend.title = @"朋友"; 53 | 54 | JsenFoundViewController * found = [[JsenFoundViewController alloc] init]; 55 | found.title = @"发现"; 56 | 57 | JsenSettingViewController * setting = [[JsenSettingViewController alloc] init]; 58 | setting.title = @"设置"; 59 | 60 | NSArray * controllers = @[ 61 | home, 62 | friend, 63 | found, 64 | setting, 65 | ]; 66 | 67 | JsenTabBarController * tabBar = [[JsenTabBarController alloc] init]; 68 | [tabBar configAttributes:attributes controllers:controllers showPlusItem:YES]; 69 | self.tabBarController = tabBar; 70 | return self.tabBarController; 71 | } 72 | 73 | #pragma mark - Config Page Number 74 | - (void)configFirstBage:(NSString *)bageNum { 75 | [self.tabBarController configFirstBage:bageNum]; 76 | } 77 | 78 | - (void)configSecondBage:(NSString *)bageNum { 79 | [self.tabBarController configSecondBage:bageNum]; 80 | } 81 | 82 | - (void)configThirdBage:(NSString *)bageNum { 83 | [self.tabBarController configThirdBage:bageNum]; 84 | } 85 | 86 | - (void)configFourthBage:(NSString *)bageNum { 87 | [self.tabBarController configFourthBage:bageNum]; 88 | } 89 | 90 | 91 | #pragma mark - Show Or hiden 92 | - (void)showWithAnimation:(BOOL)animation { 93 | 94 | [self.tabBarController showWithAnimation:animation]; 95 | } 96 | 97 | - (void)hidenWithAnimation:(BOOL)animation { 98 | 99 | [self.tabBarController hidenWithAnimation:animation]; 100 | } 101 | @end 102 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/CustomControl/JsenTabBarController/JsenTabBarItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // JsenTabBarItem.h 3 | // HearstMCB 4 | // 5 | // Created by WangXuesen on 15/12/13. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #import 10 | @class JsenTabBarItemAttribute; 11 | @interface JsenTabBarItem : UIButton 12 | 13 | @property (nonatomic , strong) JsenTabBarItemAttribute * attribute; 14 | @property (nonatomic , strong) UILabel * bageLabel; 15 | 16 | // 配置bagelabel 的数字 17 | - (void)configBageNum:(NSString *)bageNum; 18 | 19 | // 是否显示bagelabel 20 | - (void)showBage:(BOOL)showBage; 21 | @end 22 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/CustomControl/JsenTabBarController/JsenTabBarItem.m: -------------------------------------------------------------------------------- 1 | // 2 | // JsenTabBarItem.m 3 | // HearstMCB 4 | // 5 | // Created by WangXuesen on 15/12/13. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | 10 | 11 | #import "JsenTabBarItem.h" 12 | #import "JsenTabBarItemAttribute.h" 13 | #import "JsenValidationKit.h" 14 | #import "JsenTabBarConfig.h" 15 | @implementation JsenTabBarItem 16 | - (instancetype)init 17 | { 18 | self = [super init]; 19 | if (self) { 20 | 21 | } 22 | return self; 23 | } 24 | 25 | - (void)setAttribute:(JsenTabBarItemAttribute *)attribute { 26 | _attribute = attribute; 27 | [self setTitle:attribute.title forState:UIControlStateNormal]; 28 | [self setImage:[UIImage imageNamed:attribute.imageNameForNor] forState:UIControlStateNormal]; 29 | [self setImage:[UIImage imageNamed:attribute.imageNameForSel] forState:UIControlStateSelected]; 30 | [self setBackgroundColor:UIColorFromRGB(TabBarItem_BackgroundColor)]; 31 | [self setTitleColor:UIColorFromRGB(TabBarItem_TitleTextColor_Nor) forState:UIControlStateNormal]; 32 | [self setTitleColor:UIColorFromRGB(TabBarItem_TitleTextColor_Sel) forState:UIControlStateSelected]; 33 | [self.titleLabel setFont:[UIFont fontWithName:@"AppleGothic" size:TabBarItem_TitleFontSize]]; 34 | 35 | 36 | } 37 | 38 | - (void)configBageNum:(NSString *)bageNum { 39 | 40 | BOOL hidenBage = [JsenValidationKit isValueEmpty:bageNum] || [bageNum intValue] <= 0; 41 | BOOL bageBigerThanMax = [bageNum intValue] > 99; 42 | hidenBage ? [self showBage:NO] : [self showBage:YES]; 43 | bageBigerThanMax ? [self.bageLabel setText:@".."]:[self.bageLabel setText:bageNum]; 44 | 45 | } 46 | 47 | - (void)showBage:(BOOL)showBage { 48 | self.bageLabel.hidden = !showBage; 49 | 50 | } 51 | 52 | @end 53 | 54 | 55 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/CustomControl/JsenTabBarController/JsenTabBarItemAttribute.h: -------------------------------------------------------------------------------- 1 | // 2 | // JsenTabBarItemAttribute.h 3 | // HearstMCB 4 | // 5 | // Created by WangXuesen on 15/12/13. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #import "JsenTabBarItemAttribute.h" 10 | @interface JsenTabBarItemAttribute : NSObject 11 | 12 | @property (nonatomic , copy) NSString * attributeKey;//用作runtime添加和取得对应的item,建议和本属性名称相符 13 | @property (nonatomic , copy) NSString * title; 14 | @property (nonatomic , copy) NSString * imageNameForSel; 15 | @property (nonatomic , copy) NSString * imageNameForNor; 16 | 17 | - (instancetype)initWithTitle:(NSString *)title imageNameForSel:(NSString *)imageNameForSel imageNameForNor:(NSString *)imageNameForNor; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/CustomControl/JsenTabBarController/JsenTabBarItemAttribute.m: -------------------------------------------------------------------------------- 1 | // 2 | // JsenTabBarItemAttribute.m 3 | // HearstMCB 4 | // 5 | // Created by WangXuesen on 15/12/13. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #import "JsenTabBarItemAttribute.h" 10 | 11 | @implementation JsenTabBarItemAttribute 12 | 13 | - (instancetype)initWithTitle:(NSString *)title imageNameForSel:(NSString *)imageNameForSel imageNameForNor:(NSString *)imageNameForNor 14 | { 15 | self = [super init]; 16 | if (self) { 17 | self.title = title; 18 | self.imageNameForNor = imageNameForNor; 19 | self.imageNameForSel = imageNameForSel; 20 | } 21 | return self; 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/CustomControl/JsenTabBarController/JsenTabBarItemMgr.h: -------------------------------------------------------------------------------- 1 | // 2 | // JsenTabBarItemMgr.h 3 | // HearstMCB 4 | // 5 | // Created by WangXuesen on 15/12/14. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #import "JsenTabBarItemAttribute.h" 10 | #import "JsenTabBarItem.h" 11 | @interface JsenTabBarItemMgr : NSObject 12 | 13 | + (JsenTabBarItem *)mgrTabBarItem:(JsenTabBarItemAttribute *)attribute frame:(CGRect)frame tag:(NSInteger)tag; 14 | 15 | + (UIButton *)configPlusButton:(NSString *)image_nor; 16 | @end 17 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/CustomControl/JsenTabBarController/JsenTabBarItemMgr.m: -------------------------------------------------------------------------------- 1 | // 2 | // JsenTabBarItemMgr.m 3 | // HearstMCB 4 | // 5 | // Created by WangXuesen on 15/12/14. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JsenTabBarItemMgr.h" 11 | #import "JsenTabBarItemAttribute.h" 12 | #import "JsenTabBarItem.h" 13 | #import "JsenTabBarConfig.h" 14 | @implementation JsenTabBarItemMgr 15 | 16 | 17 | + (JsenTabBarItem *)mgrTabBarItem:(JsenTabBarItemAttribute *)attribute frame:(CGRect)frame tag:(NSInteger)tag { 18 | JsenTabBarItem * item = [[JsenTabBarItem alloc] initWithFrame:frame]; 19 | item.attribute = attribute; 20 | item.tag = tag; 21 | 22 | CGFloat btnW = item.frame.size.width; 23 | CGFloat btnH = item.frame.size.height; 24 | 25 | CGRect imageFrame = item.imageView.frame; 26 | CGRect titleFrame = item.titleLabel.frame; 27 | 28 | CGFloat imageX = imageFrame.origin.x; 29 | CGFloat imageY = imageFrame.origin.y; 30 | CGFloat imageW = imageFrame.size.width; 31 | CGFloat imageH = imageFrame.size.height; 32 | 33 | CGFloat labelX = titleFrame.origin.x; 34 | CGFloat labelY = titleFrame.origin.y; 35 | CGFloat labelW = titleFrame.size.width; 36 | CGFloat labelH = titleFrame.size.height; 37 | 38 | // 计算按钮图片与文字的总高度(包含间距) 39 | CGFloat space = 3.f; 40 | CGFloat controlsHeight = imageH+labelH; 41 | // 边界总距离 42 | CGFloat top = (btnH - controlsHeight - space); 43 | 44 | [item.imageView setContentMode:UIViewContentModeCenter]; 45 | [item.titleLabel setContentMode:UIViewContentModeCenter]; 46 | 47 | //设置图片的偏移 48 | CGFloat imageEdgeInsetsTop = imageY > top*2/3 ? top*2/3-imageY : imageY; 49 | CGFloat imageEdgeInsetsLeft = (btnW - imageW)/2 - imageX; 50 | CGFloat imageEdgeInsetsBottom = -imageEdgeInsetsTop; 51 | CGFloat imageEdgeInsetsRight = -(btnW - imageW)/2 + imageX; 52 | [item setImageEdgeInsets:UIEdgeInsetsMake(imageEdgeInsetsTop, imageEdgeInsetsLeft, imageEdgeInsetsBottom, imageEdgeInsetsRight)]; 53 | 54 | //设置标题的偏移 55 | CGFloat labelEdgeInsetsTop = (imageY+imageH+imageEdgeInsetsTop+space)-labelY; 56 | CGFloat labelEdgeInsetsRight = labelX-(btnW - labelW)/2; 57 | CGFloat labelEdgeInsetsLeft = -labelEdgeInsetsRight; 58 | CGFloat labelEdgeInsetsBottom = -labelEdgeInsetsTop; 59 | 60 | [item setTitleEdgeInsets:UIEdgeInsetsMake(labelEdgeInsetsTop, labelEdgeInsetsLeft, labelEdgeInsetsBottom, labelEdgeInsetsRight)]; 61 | 62 | //设置bagelabel 的属性 63 | CGFloat bageRadius = TabBarItem_BageWH/2.0; 64 | UILabel * bageLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(item.imageView.frame) - bageRadius, 0, TabBarItem_BageWH, TabBarItem_BageWH)]; 65 | bageLabel.backgroundColor = UIColorFromRGB(TabBarItem_BageBackgroundColor); 66 | bageLabel.textAlignment = NSTextAlignmentCenter; 67 | bageLabel.font = [UIFont fontWithName:TabBarItem_BageFontName size:TabBarItem_BageFontSize]; 68 | bageLabel.textColor = UIColorFromRGB(TabBarItem_BageTextColor); 69 | bageLabel.layer.cornerRadius = bageRadius; 70 | bageLabel.layer.masksToBounds = YES; 71 | bageLabel.hidden = YES; 72 | [item addSubview:bageLabel]; 73 | item.bageLabel = bageLabel; 74 | return item; 75 | } 76 | 77 | + (UIButton *)configPlusButton:(NSString *)image_nor { 78 | 79 | CGFloat plusW = 64; 80 | CGFloat plusH = 59; 81 | CGFloat plusY = -15; 82 | CGFloat plusX = (ScreenBoundWidth - plusW)/2.0; 83 | CGRect plusFrame = CGRectMake(plusX, plusY, plusW, plusH); 84 | UIButton * plusButton = [[UIButton alloc] initWithFrame:plusFrame]; 85 | if (image_nor !=nil) { 86 | [plusButton setBackgroundImage:[UIImage imageNamed:image_nor] forState:UIControlStateNormal]; 87 | 88 | } else { 89 | [plusButton setBackgroundImage:[UIImage imageNamed:TabBarItem_BageFontName_PlusButtonImageName] forState:UIControlStateNormal]; 90 | } 91 | return plusButton; 92 | } 93 | 94 | @end 95 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/CustomControl/JumpView/JsenJumpView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JsenJumpView.h 3 | // JsenProjectEncapsulation 4 | // 5 | // Created by WangXuesen on 16/1/4. 6 | // Copyright © 2016年 Jsen. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | typedef NS_ENUM(NSInteger, JsenJumpViewState) { 13 | /** 14 | * 上跳状态. 15 | */ 16 | JsenJumpViewStateJump, 17 | /** 18 | * 下落状态. 19 | */ 20 | JsenJumpViewStateDown, 21 | }; 22 | 23 | 24 | @interface JsenJumpView : UIView 25 | 26 | @property (nonatomic , assign) JsenJumpViewState state; 27 | @property (nonatomic , strong) UIImage * markedImage; 28 | @property (nonatomic , strong) UIImage * non_markedImage; 29 | - (instancetype)initWithFrame:(CGRect)frame markImage:(NSString *)markImage nonMarkImage:(NSString *)nonMarkImage; 30 | 31 | - (instancetype)initWithMarkImage:(NSString *)markImage nonMarkImage:(NSString *)nonMarkImage; 32 | 33 | - (void)animate; 34 | @end 35 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/CustomControl/JumpView/praise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imwangxuesen/HUD_TransformationAnimation_CustomTabBar/f4f02647925d6d9a76590b0d86ea991d298d7698/JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/CustomControl/JumpView/praise.png -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/CustomControl/JumpView/praised.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imwangxuesen/HUD_TransformationAnimation_CustomTabBar/f4f02647925d6d9a76590b0d86ea991d298d7698/JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/CustomControl/JumpView/praised.png -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/CustomControl/JumpView/shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imwangxuesen/HUD_TransformationAnimation_CustomTabBar/f4f02647925d6d9a76590b0d86ea991d298d7698/JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/CustomControl/JumpView/shadow.png -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/CustomControl/TransitionAnimation/PingInvertTransition.h: -------------------------------------------------------------------------------- 1 | // 2 | // PingInvertTransition.h 3 | // 美妆嘉人 4 | // 5 | // Created by WangXuesen on 15/12/29. 6 | // Copyright © 2015年 美妆嘉人. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface PingInvertTransition : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/CustomControl/TransitionAnimation/PingInvertTransition.m: -------------------------------------------------------------------------------- 1 | // 2 | // PingInvertTransition.m 3 | // 美妆嘉人 4 | // 5 | // Created by WangXuesen on 15/12/29. 6 | // Copyright © 2015年 美妆嘉人. All rights reserved. 7 | // 8 | 9 | #import "PingInvertTransition.h" 10 | #import "JsenFoundViewController.h" 11 | #import "JsenSettingViewController.h" 12 | 13 | @interface PingInvertTransition() 14 | 15 | @property (nonatomic , strong) idtransitionContext; 16 | 17 | @end 18 | 19 | @implementation PingInvertTransition 20 | 21 | 22 | 23 | - (NSTimeInterval)transitionDuration:(nullable id )transitionContext{ 24 | 25 | return 0.7f; 26 | 27 | } 28 | - (void)animateTransition:(id )transitionContext { 29 | 30 | self.transitionContext = transitionContext; 31 | 32 | JsenFoundViewController *toVC = (JsenFoundViewController *)[self.transitionContext viewControllerForKey:UITransitionContextToViewControllerKey]; 33 | JsenSettingViewController * fromVC = (JsenSettingViewController *)[self.transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey]; 34 | UIView * contView = [transitionContext containerView]; 35 | // UIButton * button = (UIButton *)toVC.navigationItem.leftBarButtonItem.customView; 36 | 37 | //这里因为获取不到item的bounds自定义个触发位置 38 | UIButton * button = [[UIButton alloc] initWithFrame:CGRectMake(20, 20, 39, 39)]; 39 | 40 | [contView addSubview:toVC.view]; 41 | [contView addSubview:fromVC.view]; 42 | 43 | UIBezierPath *finalPath = [UIBezierPath bezierPathWithOvalInRect:button.frame]; 44 | 45 | CGPoint finalPoint; 46 | 47 | 48 | if (button.frame.origin.x > (toVC.view.bounds.size.width / 2)) { 49 | if (button.frame.origin.y < (toVC.view.bounds.size.height / 2)) { 50 | //第一象限 51 | finalPoint = CGPointMake(button.frame.origin.x - 0 , CGRectGetMaxY(toVC.view.bounds) - button.center.y + 30); 52 | } else { 53 | //第四象限 54 | finalPoint = CGPointMake(button.frame.origin.x - 0, button.center.y - 0); 55 | } 56 | } else { 57 | 58 | if (button.frame.origin.y < (toVC.view.bounds.size.height / 2)) { 59 | //第二象限 60 | finalPoint = CGPointMake(CGRectGetMaxX(toVC.view.bounds) - button.center.x, CGRectGetMaxY(toVC.view.bounds) - button.center.y + 30); 61 | } else { 62 | //第三象限 63 | finalPoint = CGPointMake(CGRectGetMaxX(toVC.view.bounds) - button.center.x, CGRectGetMaxY(toVC.view.bounds)- button.center.y + 30); 64 | } 65 | } 66 | 67 | CGFloat radius = sqrt(finalPoint.x * finalPoint.x + finalPoint.y * finalPoint.y); 68 | UIBezierPath *startPath = [UIBezierPath bezierPathWithOvalInRect:CGRectInset(button.frame, -radius,-radius)]; 69 | 70 | CAShapeLayer * maskLayer = [CAShapeLayer layer]; 71 | maskLayer.path = finalPath.CGPath; 72 | fromVC.view.layer.mask = maskLayer; 73 | 74 | CABasicAnimation *pingAnimation = [CABasicAnimation animationWithKeyPath:@"path"]; 75 | pingAnimation.fromValue = (__bridge id)(startPath.CGPath); 76 | pingAnimation.toValue = (__bridge id)(finalPath.CGPath); 77 | pingAnimation.duration = [self transitionDuration:transitionContext]; 78 | pingAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]; 79 | 80 | pingAnimation.delegate = self; 81 | 82 | [maskLayer addAnimation:pingAnimation forKey:@"pingInvert"]; 83 | 84 | 85 | } 86 | 87 | 88 | - (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag{ 89 | 90 | [self.transitionContext completeTransition:![self.transitionContext transitionWasCancelled]]; 91 | [self.transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey].view.layer.mask = nil; 92 | [self.transitionContext viewControllerForKey:UITransitionContextToViewControllerKey].view.layer.mask = nil; 93 | 94 | } 95 | 96 | 97 | @end 98 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/CustomControl/TransitionAnimation/PingTransition.h: -------------------------------------------------------------------------------- 1 | // 2 | // PingTransition.h 3 | // 美妆嘉人 4 | // 5 | // Created by WangXuesen on 15/12/29. 6 | // Copyright © 2015年 美妆嘉人. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | @interface PingTransition : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/CustomControl/TransitionAnimation/PingTransition.m: -------------------------------------------------------------------------------- 1 | // 2 | // PingTransition.m 3 | // 美妆嘉人 4 | // 5 | // Created by WangXuesen on 15/12/29. 6 | // Copyright © 2015年 美妆嘉人. All rights reserved. 7 | // 8 | 9 | #import "PingTransition.h" 10 | #import "JsenFoundViewController.h" 11 | #import "JsenSettingViewController.h" 12 | @interface PingTransition() 13 | @property (nonatomic , strong) id transitionContext; 14 | 15 | 16 | @end 17 | 18 | @implementation PingTransition 19 | 20 | - (NSTimeInterval)transitionDuration:(id)transitionContext { 21 | 22 | return 0.7f; 23 | } 24 | 25 | - (void)animateTransition:(id)transitionContext { 26 | 27 | self.transitionContext = transitionContext; 28 | 29 | JsenFoundViewController * fromVC = (JsenFoundViewController *)[transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey]; 30 | JsenSettingViewController * toVC = (JsenSettingViewController *)[transitionContext viewControllerForKey:UITransitionContextToViewControllerKey]; 31 | UIView * contView = [transitionContext containerView]; 32 | // UIButton * button = (UIButton *)fromVC.navigationItem.rightBarButtonItem.customView; 33 | 34 | //这里因为获取不到item的bounds自定义个触发位置 35 | UIButton * button = [[UIButton alloc]initWithFrame:CGRectMake(toVC.view.bounds.size.width - 39 - 20, 20, 39, 39)]; 36 | 37 | UIBezierPath *maskStartBP = [UIBezierPath bezierPathWithOvalInRect:button.frame]; 38 | [contView addSubview:fromVC.view]; 39 | [contView addSubview:toVC.view]; 40 | 41 | CGPoint finalPoint; 42 | if (button.frame.origin.x > (toVC.view.bounds.size.width / 2)) { 43 | if (button.frame.origin.y < (toVC.view.bounds.size.height / 2)) { 44 | //第一象限: 45 | finalPoint = CGPointMake(button.center.x - 0, button.center.y - CGRectGetMaxY(toVC.view.bounds) + 30); 46 | } else { 47 | //第四象限: 48 | finalPoint = CGPointMake(button.center.x - 0,button.center.y - 0); 49 | 50 | } 51 | } else { 52 | if (button.frame.origin.y < (toVC.view.bounds.size.height / 2)) { 53 | //第二象限 54 | finalPoint = CGPointMake(button.center.x - CGRectGetMaxX(toVC.view.bounds) , button.center.y - CGRectGetMaxX(toVC.view.bounds)); 55 | } else { 56 | //第三象限 57 | finalPoint = CGPointMake(button.center.x - CGRectGetMaxX(toVC.view.bounds), button.center.y - 0); 58 | } 59 | } 60 | 61 | CGFloat radius = sqrt((finalPoint.x * finalPoint.x) + (finalPoint.y * finalPoint.y)); 62 | UIBezierPath * maskFinalBP = [UIBezierPath bezierPathWithOvalInRect:CGRectInset(button.frame, -radius, -radius)]; 63 | 64 | 65 | //创建一个CAShapeLayer 来扶额展示圆形覆盖 66 | CAShapeLayer * maskLayer = [CAShapeLayer layer]; 67 | maskLayer.path = maskFinalBP.CGPath; //将它的path 指定为最终的path 来避免在动画完成后会弹 68 | toVC.view.layer.mask = maskLayer; 69 | 70 | CABasicAnimation * maskLayerAnimation = [CABasicAnimation animationWithKeyPath:@"path"]; 71 | maskLayerAnimation.fromValue = (__bridge id)(maskStartBP.CGPath); 72 | maskLayerAnimation.toValue = (__bridge id)(maskFinalBP.CGPath); 73 | maskLayerAnimation.duration = [self transitionDuration:transitionContext]; 74 | maskLayerAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]; 75 | maskLayerAnimation.delegate = self; 76 | [maskLayer addAnimation:maskLayerAnimation forKey:@"path"]; 77 | 78 | } 79 | 80 | 81 | #pragma mark - CABasicAnimation Delegate 82 | - (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag { 83 | 84 | //告诉iOS这个 transition 完成 85 | [self.transitionContext completeTransition:![self.transitionContext transitionWasCancelled]]; 86 | 87 | //清除fromvc 的 mask 88 | [self.transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey].view.layer.mask = nil; 89 | [self.transitionContext viewControllerForKey:UITransitionContextToViewControllerKey].view.layer.mask = nil; 90 | } 91 | 92 | @end 93 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/MVC/JsenBaseModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JsenBaseModel.h 3 | // HearstMCB 4 | // 5 | // Created by WangXuesen on 15/12/4. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JsenBaseModel.h" 11 | #import "JsenRequest.h" 12 | #import "JsenRequestResponseSelectors.h" 13 | @protocol JsenBaseModelDelegate 14 | 15 | @end 16 | 17 | @interface JsenBaseModel : NSObject 18 | - (void)docallRequest:(NSString *)requestName 19 | forServiceUrl:(NSString *)serviceUrl 20 | requestMethod:(JRequestMethod)requestMethod 21 | responseParseFormat:(JResponseParseFormat)responseParseFormat 22 | params:params 23 | responseSelectors:(JsenRequestResponseSelectors *)selectors; 24 | 25 | 26 | - (void)docallRequestUseDelegate:(NSString *)requestName 27 | forServiceUrl:(NSString *)serviceUrl 28 | requestMethod:(JRequestMethod)requestMethod 29 | responseParseFormat:(JResponseParseFormat)responseParseFormat 30 | params:params 31 | responseSelectors:(JsenRequestResponseSelectors *)selectors; 32 | @property (nonatomic , weak) idmodelDelegate; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/MVC/JsenBaseModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // JsenBaseModel.m 3 | // HearstMCB 4 | // 5 | // Created by WangXuesen on 15/12/4. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #import "JsenBaseModel.h" 10 | 11 | @interface JsenBaseModel() 12 | 13 | 14 | @end 15 | 16 | @implementation JsenBaseModel 17 | 18 | #pragma mark - 19 | #pragma mark - Request with block 20 | 21 | - (void)docallRequest:(NSString *)requestName 22 | forServiceUrl:(NSString *)serviceUrl 23 | requestMethod:(JRequestMethod)requestMethod 24 | responseParseFormat:(JResponseParseFormat)responseParseFormat 25 | params:params 26 | responseSelectors:(JsenRequestResponseSelectors *)selectors{ 27 | 28 | JsenRequest * request = [JsenRequest requestWithName:requestName 29 | forServiceUrl:serviceUrl 30 | requestMethod:requestMethod 31 | responseParseFormat:responseParseFormat 32 | params:params 33 | withRequestBlock:^(JsenRequest *request, JRequestingStatus requestingStatus, JsenRequestResponseSuccess *responseSuccess, JsenRequestResponseFailure *responseFailed) { 34 | switch (requestingStatus) { 35 | case JRequestingStatusStarted: 36 | if (self.modelDelegate &&[self.modelDelegate respondsToSelector:selectors.didStartedSEL]) { 37 | [self.modelDelegate performSelector:selectors.didStartedSEL withObject:nil]; 38 | } 39 | break; 40 | case JRequestingStatusCanceled: 41 | if (self.modelDelegate &&[self.modelDelegate respondsToSelector:selectors.didCanceledSEL]) { 42 | [self.modelDelegate performSelector:selectors.didCanceledSEL withObject:responseFailed]; 43 | } 44 | break; 45 | case JRequestingStatusFailed: 46 | if (self.modelDelegate &&[self.modelDelegate respondsToSelector:selectors.didFailedSEL]) { 47 | [self.modelDelegate performSelector:selectors.didFailedSEL withObject:responseFailed]; 48 | } 49 | break; 50 | case JRequestingStatusFinished: 51 | if (self.modelDelegate &&[self.modelDelegate respondsToSelector:selectors.didFinishedSEL]) { 52 | [self.modelDelegate performSelector:selectors.didFinishedSEL withObject:responseSuccess]; 53 | } 54 | break; 55 | 56 | default: 57 | break; 58 | } 59 | 60 | }]; 61 | [request start]; 62 | } 63 | 64 | #pragma mark - 65 | #pragma mark - Request with delegate 66 | 67 | - (void)docallRequestUseDelegate:(NSString *)requestName 68 | forServiceUrl:(NSString *)serviceUrl 69 | requestMethod:(JRequestMethod)requestMethod 70 | responseParseFormat:(JResponseParseFormat)responseParseFormat 71 | params:params 72 | responseSelectors:(JsenRequestResponseSelectors *)selectors { 73 | 74 | JsenRequest * request = [JsenRequest requestWithName:requestName 75 | forServiceUrl:serviceUrl 76 | requestMethod:requestMethod 77 | responseParseFormat:responseParseFormat 78 | params:params 79 | withDelegate:self]; 80 | [request start]; 81 | 82 | } 83 | 84 | 85 | 86 | 87 | 88 | @end 89 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/MVC/JsenBaseView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JsenBaseView.h 3 | // HearstMCB 4 | // 5 | // Created by WangXuesen on 15/12/4. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface JsenBaseView : UIView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/MVC/JsenBaseView.m: -------------------------------------------------------------------------------- 1 | // 2 | // JsenBaseView.m 3 | // HearstMCB 4 | // 5 | // Created by WangXuesen on 15/12/4. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #import "JsenBaseView.h" 10 | 11 | @implementation JsenBaseView 12 | 13 | /* 14 | // Only override drawRect: if you perform custom drawing. 15 | // An empty implementation adversely affects performance during animation. 16 | - (void)drawRect:(CGRect)rect { 17 | // Drawing code 18 | } 19 | */ 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/MVC/JsenBaseViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // JsenBaseViewController.h 3 | // HearstMCB 4 | // 5 | // Created by WangXuesen on 15/12/4. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface JsenBaseViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/MVC/JsenBaseViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // JsenBaseViewController.m 3 | // HearstMCB 4 | // 5 | // Created by WangXuesen on 15/12/4. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #import "JsenBaseViewController.h" 10 | 11 | @interface JsenBaseViewController () 12 | 13 | @end 14 | 15 | @implementation JsenBaseViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view. 20 | } 21 | 22 | - (void)didReceiveMemoryWarning { 23 | [super didReceiveMemoryWarning]; 24 | // Dispose of any resources that can be recreated. 25 | } 26 | 27 | /* 28 | #pragma mark - Navigation 29 | 30 | // In a storyboard-based application, you will often want to do a little preparation before navigation 31 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 32 | // Get the new view controller using [segue destinationViewController]. 33 | // Pass the selected object to the new view controller. 34 | } 35 | */ 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/Macros/JsenLog.h: -------------------------------------------------------------------------------- 1 | // 2 | // JsenLog.h 3 | // 美妆嘉人 4 | // 5 | // Created by WangXuesen on 15/12/1. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #ifndef JsenLog_h 10 | #define JsenLog_h 11 | 12 | #define JSENLOGPRINT(xx, ...) NSLog(@"%s(%d): " xx, __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__) 13 | 14 | #if APP_PRODUCTION_ENVIRONMENT == 0 15 | #define JSENLOGINFO(xx, ...) JSENLOGPRINT(xx, ##__VA_ARGS__) 16 | #else 17 | #define JSENLOGINFO(xx, ...) ((void)0) 18 | #endif 19 | 20 | 21 | #endif /* JsenLog_h */ 22 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/Networks/JsenNetworkMonitor.h: -------------------------------------------------------------------------------- 1 | // 2 | // JsenNetworkMonitor.h 3 | // 美妆嘉人 4 | // 5 | // Created by WangXuesen on 15/12/1. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface JsenNetworkMonitor : NSObject 12 | - (void)startNotifer; 13 | - (void)stopNotifier; 14 | - (BOOL)isReachable; 15 | - (NSString *)getReadableTrafficInfo; 16 | 17 | // Class Methods 18 | + (JsenNetworkMonitor *)sharedInstance; 19 | @end 20 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/Networks/JsenNetworkMonitor.m: -------------------------------------------------------------------------------- 1 | // 2 | // JsenNetworkMonitor.m 3 | // 美妆嘉人 4 | // 5 | // Created by WangXuesen on 15/12/1. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #import "JsenNetworkMonitor.h" 10 | #import "Reachability.h" 11 | static JsenNetworkMonitor * singletonInstance = nil; 12 | 13 | @interface JsenNetworkMonitor() { 14 | Reachability *_reachAbility; 15 | BOOL _networkReachable; 16 | NSString *_networkType; 17 | 18 | } 19 | 20 | @end 21 | 22 | @implementation JsenNetworkMonitor 23 | 24 | - (id)init { 25 | self = [super init]; 26 | if (self) { 27 | _networkReachable = YES; 28 | _networkType = nil; 29 | } 30 | return self; 31 | } 32 | 33 | #pragma mark - Public Methods 34 | - (void)dealloc { 35 | [self removeObserver]; 36 | } 37 | 38 | - (void)startNotifer { 39 | [self addObserver]; 40 | _reachAbility = [Reachability reachabilityForInternetConnection]; 41 | [self updateNetwordStatus:_reachAbility.currentReachabilityStatus]; 42 | [_reachAbility startNotifier]; 43 | } 44 | 45 | - (void)stopNotifier { 46 | [self removeObserver]; 47 | if (_reachAbility) { 48 | [_reachAbility stopNotifier]; 49 | } 50 | } 51 | 52 | - (BOOL)isReachable { 53 | return _networkReachable; 54 | } 55 | 56 | - (NSString *)getReadableTrafficInfo { 57 | return _networkType; 58 | } 59 | 60 | #pragma mark - Private Methods 61 | - (void)networkStateDidChanged:(NSNotification*)n 62 | { 63 | Reachability* curReach = [n object]; 64 | NSParameterAssert([curReach isKindOfClass: [Reachability class]]); 65 | [self updateNetwordStatus:curReach.currentReachabilityStatus]; 66 | } 67 | 68 | - (void)updateNetwordStatus:(NetworkStatus)status 69 | { 70 | _networkReachable = YES; 71 | switch (status) { 72 | case ReachableViaWiFi: 73 | { 74 | _networkType = @"wifi"; 75 | } 76 | break; 77 | case ReachableViaWWAN: 78 | { 79 | _networkType = @"wwan"; 80 | } 81 | break; 82 | case NotReachable: 83 | { 84 | _networkType = @"unavailable"; 85 | _networkReachable = NO; 86 | } 87 | break; 88 | default: 89 | { 90 | _networkReachable = NO; 91 | _networkType = @"unknown"; 92 | } 93 | break; 94 | } 95 | 96 | 97 | JSENLOGPRINT(@"%@", _networkType); 98 | } 99 | 100 | - (void)addObserver { 101 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkStateDidChanged:) name:kReachabilityChangedNotification object:nil]; 102 | } 103 | 104 | - (void)removeObserver { 105 | [[NSNotificationCenter defaultCenter] removeObserver:self name:kReachabilityChangedNotification object:nil]; 106 | } 107 | 108 | #pragma mark - Class Methods 109 | + (JsenNetworkMonitor *)sharedInstance { 110 | @synchronized(self){ 111 | if (!singletonInstance) { 112 | singletonInstance = [[JsenNetworkMonitor alloc] init]; 113 | } 114 | return singletonInstance; 115 | } 116 | 117 | return nil; 118 | } 119 | 120 | 121 | 122 | 123 | @end 124 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/Networks/JsenRequestClient.h: -------------------------------------------------------------------------------- 1 | // 2 | // JsenBaseRequest.h 3 | // JsenProjectEncapsulation 4 | // 5 | // Created by WangXuesen on 16/4/6. 6 | // Copyright © 2016年 Jsen. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JsenRequest.h" 11 | 12 | 13 | @interface JsenRequestClient : NSObject 14 | 15 | + (JsenRequestClient *)shareClient; 16 | 17 | //TODO : wxs 18 | - (nullable id)requestWithName:(nullable NSString *)name 19 | success:(nullable JsenRequestSuccess)success 20 | failed:(nullable JsenRequestFailed)failed; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/Networks/JsenRequestClient.m: -------------------------------------------------------------------------------- 1 | // 2 | // JsenBaseRequest.m 3 | // JsenProjectEncapsulation 4 | // 5 | // Created by WangXuesen on 16/4/6. 6 | // Copyright © 2016年 Jsen. All rights reserved. 7 | // 8 | 9 | #import "JsenRequestClient.h" 10 | #import "JsenRequestParamsModelManager.h" 11 | #import "JsenLoginModel.h" 12 | @implementation JsenRequestClient 13 | 14 | 15 | + (JsenRequestClient *)shareClient { 16 | 17 | static JsenRequestClient * client; 18 | static dispatch_once_t onceToken; 19 | dispatch_once(&onceToken, ^{ 20 | client = [[JsenRequestClient alloc] init]; 21 | }); 22 | return client; 23 | } 24 | 25 | #pragma mark - Request Method 26 | 27 | 28 | - (id)requestWithName:(NSString *)name success:(JsenRequestSuccess)success failed:(JsenRequestFailed)failed { 29 | 30 | JsenRequestParamsModel * paramsModel = [[JsenRequestParamsModelManager shared] getRequestModel:name]; 31 | 32 | JsenRequest * request = [JsenRequest requestWithName:paramsModel.requestName forServiceUrl:paramsModel.subRequestURL requestMethod:paramsModel.requestMethod responseParseFormat:paramsModel.responseParseFormat params:paramsModel.params success:^(JsenRequest *request, JRequestingStatus requestingStatus, JsenRequestResponseSuccess *responseSuccess) { 33 | 34 | id model = [self transfor:responseSuccess modelClass:paramsModel.modelClass]; 35 | responseSuccess.model = model; 36 | success(request,requestingStatus,responseSuccess); 37 | 38 | NSLog(@"base request success "); 39 | } failed:^(JsenRequest *request, JRequestingStatus requestingStatus, JsenRequestResponseFailure *responseFailed) { 40 | NSLog(@"base request fail "); 41 | }]; 42 | [request start]; 43 | 44 | return nil; 45 | } 46 | 47 | - (id)transfor:(JsenRequestResponseSuccess *)success modelClass:(Class)modelClass{ 48 | return [modelClass yy_modelWithJSON:success.userInfo[@"data"]]; 49 | // return [modelClass yy_modelWithDictionary:]; 50 | } 51 | 52 | #pragma mark - config Method 53 | 54 | 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/Networks/JsenRequestParamsModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JsenRequestParamsModel.h 3 | // JsenProjectEncapsulation 4 | // 5 | // Created by WangXuesen on 16/4/7. 6 | // Copyright © 2016年 Jsen. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JsenRequest.h" 11 | @interface JsenRequestParamsModel : NSObject 12 | 13 | /** 14 | * 公共参数 15 | */ 16 | @property (nonatomic , strong) NSDictionary * publishParams; 17 | 18 | /** 19 | * 请求 子url 20 | */ 21 | @property (nonatomic , copy) NSString * subRequestURL; 22 | 23 | /** 24 | * 请求方式 25 | */ 26 | @property (nonatomic , assign) JRequestMethod requestMethod; 27 | 28 | /** 29 | * 返回的数据格式 30 | */ 31 | @property (nonatomic , assign) JResponseParseFormat responseParseFormat; 32 | 33 | /** 34 | * 成功解析的model class 35 | */ 36 | @property (nonatomic , strong) Class modelClass; 37 | 38 | 39 | /** 40 | * 请求参数 41 | */ 42 | @property (nonatomic , strong) NSMutableDictionary * params; 43 | 44 | /** 45 | * 请求名字 46 | */ 47 | @property (nonatomic , strong) NSString * requestName; 48 | 49 | 50 | /** 51 | * 初始化一个request params model 52 | * 53 | * @param method 请求方式 get post put malitpart 54 | * @param name 请求名称 nsstring 55 | * @param subUrl 子url nsstring 56 | * @param modelClass 数据模型的class 57 | * @param params 请求参数 nsmutabledictionary 58 | * 59 | * @return JsenRequestParamsModel 60 | */ 61 | - (instancetype)initWithRequestMethod:(JRequestMethod)method 62 | name:(NSString *)name 63 | subUrl:(NSString *)subUrl 64 | modelClass:(Class)modelClass 65 | params:(NSMutableDictionary *)params; 66 | @end 67 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/Networks/JsenRequestParamsModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // JsenRequestParamsModel.m 3 | // JsenProjectEncapsulation 4 | // 5 | // Created by WangXuesen on 16/4/7. 6 | // Copyright © 2016年 Jsen. All rights reserved. 7 | // 8 | 9 | #import "JsenRequestParamsModel.h" 10 | 11 | @implementation JsenRequestParamsModel 12 | 13 | #pragma mark - Init 14 | 15 | - (instancetype)initWithRequestMethod:(JRequestMethod)method name:(NSString *)name subUrl:(NSString *)subUrl modelClass:(Class)modelClass params:(NSMutableDictionary *)params 16 | { 17 | self = [super init]; 18 | if (self) { 19 | _requestMethod = method; 20 | _requestName = name; 21 | _subRequestURL = subUrl; 22 | _modelClass = modelClass; 23 | _params = params; 24 | 25 | } 26 | return self; 27 | } 28 | 29 | #pragma mark - Getter 30 | - (NSDictionary *)publishParams { 31 | if (!_publishParams) { 32 | _publishParams = @{ 33 | @"uid":@"123" 34 | }; 35 | } 36 | return _publishParams; 37 | 38 | } 39 | 40 | - (NSMutableDictionary *)params { 41 | _params = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"123",@"456", nil]; 42 | if (self.publishParams) { 43 | [_params addEntriesFromDictionary:self.publishParams]; 44 | } 45 | return _params; 46 | } 47 | 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/Networks/JsenRequestParamsModelManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // JsenRequestParamsModelManager.h 3 | // JsenProjectEncapsulation 4 | // 5 | // Created by WangXuesen on 16/4/7. 6 | // Copyright © 2016年 Jsen. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JsenRequestParamsModel.h" 11 | @interface JsenRequestParamsModelManager : NSObject 12 | 13 | 14 | /** 15 | * 登录的请求参数 16 | */ 17 | @property (nonatomic , strong)JsenRequestParamsModel * requestLoginModel; 18 | 19 | 20 | + (JsenRequestParamsModelManager *)shared; 21 | 22 | - (JsenRequestParamsModel *)getRequestModel:(NSString *)name; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/Networks/JsenRequestParamsModelManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // JsenRequestParamsModelManager.m 3 | // JsenProjectEncapsulation 4 | // 5 | // Created by WangXuesen on 16/4/7. 6 | // Copyright © 2016年 Jsen. All rights reserved. 7 | // 8 | 9 | #import "JsenRequestParamsModelManager.h" 10 | #import "JsenLoginModel.h" 11 | @implementation JsenRequestParamsModelManager 12 | 13 | #pragma mark - Public Method 14 | + (JsenRequestParamsModelManager *)shared { 15 | 16 | static JsenRequestParamsModelManager * mgr; 17 | static dispatch_once_t onceToken; 18 | dispatch_once(&onceToken, ^{ 19 | mgr = [[JsenRequestParamsModelManager alloc] init]; 20 | }); 21 | return mgr; 22 | } 23 | 24 | - (JsenRequestParamsModel *)getRequestModel:(NSString *)name { 25 | 26 | return [self valueForKeyPath:name]; 27 | } 28 | 29 | 30 | #pragma mark - Private Method 31 | 32 | #pragma mark - Getter 33 | 34 | 35 | - (JsenRequestParamsModel *)requestLoginModel { 36 | if (!_requestLoginModel) { 37 | _requestLoginModel = [[JsenRequestParamsModel alloc] initWithRequestMethod:JRequestMethodPost 38 | name:@"lllllll" 39 | subUrl:Login 40 | modelClass:[JsenLoginModel class] 41 | params:[NSMutableDictionary dictionaryWithObjectsAndKeys:@"username",@"wangxuesen" 42 | ,@"password",@"123456" 43 | ,@"loginsubmit" ,@"ture", nil]]; 44 | } 45 | return _requestLoginModel; 46 | } 47 | @end 48 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/Networks/JsenRequestProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // JsenRequestProtocol.h 3 | // 美妆嘉人 4 | // 5 | // Created by WangXuesen on 15/12/1. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #ifndef JsenRequestProtocol_h 10 | #define JsenRequestProtocol_h 11 | 12 | @protocol JsenRequestProtocol 13 | 14 | @required 15 | @property(nonatomic, copy) NSString *serviceName; 16 | @property(nonatomic, copy) NSString *status; 17 | @property(nonatomic, strong) id userInfo; 18 | 19 | - (id)initWithResponse:(NSDictionary *)responseDic; 20 | 21 | @optional 22 | @property(nonatomic, copy) NSString *errorInfo; 23 | 24 | @end 25 | 26 | #endif /* JsenRequestProtocol_h */ 27 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/Networks/JsenRequestResponseFailure.h: -------------------------------------------------------------------------------- 1 | // 2 | // JsenRequestResponseFailure.h 3 | // 美妆嘉人 4 | // 5 | // Created by WangXuesen on 15/12/1. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JsenRequestProtocol.h" 11 | 12 | @interface JsenRequestResponseFailure : NSObject 13 | 14 | @property (nonatomic , copy ) NSString *serviceName; 15 | @property (nonatomic , copy ) NSString *status; 16 | @property (nonatomic , strong) id userInfo; 17 | @property (nonatomic , copy ) NSString *errorInfo; 18 | 19 | - (id)initWithResponse:(NSDictionary *)responseDic; 20 | 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/Networks/JsenRequestResponseFailure.m: -------------------------------------------------------------------------------- 1 | // 2 | // JsenRequestResponseFailure.m 3 | // 美妆嘉人 4 | // 5 | // Created by WangXuesen on 15/12/1. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #import "JsenRequestResponseFailure.h" 10 | 11 | @implementation JsenRequestResponseFailure 12 | 13 | - (id)initWithResponse:(NSDictionary *)responseDic { 14 | NSAssert(responseDic != nil, @"JsenRequestResponseFailure' init data Dictionary is empty"); 15 | self = [super init]; 16 | if (self) { 17 | self.serviceName = responseDic[@"serviceName"]; 18 | self.status = responseDic[@"status"]; 19 | self.userInfo = responseDic[@"userInfoDic"]; 20 | self.errorInfo = responseDic[@"errorInfo"]; 21 | } 22 | return self; 23 | } 24 | 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/Networks/JsenRequestResponseSelectors.h: -------------------------------------------------------------------------------- 1 | // 2 | // JsenRequestResponseSelectors.h 3 | // HearstMCB 4 | // 5 | // Created by WangXuesen on 15/12/10. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface JsenRequestResponseSelectors : NSObject 12 | @property (nonatomic , assign)SEL didStartedSEL; 13 | @property (nonatomic , assign)SEL didCanceledSEL; 14 | @property (nonatomic , assign)SEL didFinishedSEL; 15 | @property (nonatomic , assign)SEL didFailedSEL; 16 | 17 | + (id)getResponsSelectorsWithStart:(SEL)start cancel:(SEL)cancel fail:(SEL)fail finish:(SEL)finish; 18 | @end 19 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/Networks/JsenRequestResponseSelectors.m: -------------------------------------------------------------------------------- 1 | // 2 | // JsenRequestResponseSelectors.m 3 | // HearstMCB 4 | // 5 | // Created by WangXuesen on 15/12/10. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #import "JsenRequestResponseSelectors.h" 10 | 11 | @implementation JsenRequestResponseSelectors 12 | - (instancetype)initWithStart:(SEL)start cancel:(SEL)cancel fail:(SEL)fail finish:(SEL)finish 13 | { 14 | self = [super init]; 15 | if (self) { 16 | self.didCanceledSEL = cancel; 17 | self.didStartedSEL = start; 18 | self.didFailedSEL = fail; 19 | self.didFinishedSEL = finish; 20 | } 21 | return self; 22 | } 23 | 24 | + (id)getResponsSelectorsWithStart:(SEL)start cancel:(SEL)cancel fail:(SEL)fail finish:(SEL)finish { 25 | 26 | JsenRequestResponseSelectors *selectors = [[JsenRequestResponseSelectors alloc] initWithStart:start cancel:cancel fail:fail finish:finish]; 27 | return selectors; 28 | } 29 | @end 30 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/Networks/JsenRequestResponseSuccess.h: -------------------------------------------------------------------------------- 1 | // 2 | // JsenRequestResponseSuccess.h 3 | // 美妆嘉人 4 | // 5 | // Created by WangXuesen on 15/12/1. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JsenRequestProtocol.h" 11 | 12 | @interface JsenRequestResponseSuccess : NSObject 13 | 14 | @property(nonatomic, strong) NSString *serviceName; 15 | @property(nonatomic, strong) NSString *status; 16 | @property(nonatomic, strong) id userInfo; 17 | @property(nonatomic, strong) id model; 18 | 19 | - (id)initWithResponse:(NSDictionary *)responseDic; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/Networks/JsenRequestResponseSuccess.m: -------------------------------------------------------------------------------- 1 | // 2 | // JsenRequestResponseSuccess.m 3 | // 美妆嘉人 4 | // 5 | // Created by WangXuesen on 15/12/1. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #import "JsenRequestResponseSuccess.h" 10 | 11 | @implementation JsenRequestResponseSuccess 12 | 13 | - (id)initWithResponse:(NSDictionary *)responseDic { 14 | 15 | NSAssert(responseDic != nil, @"JsenRequestResponseSuccess' init data Dictionary is empty"); 16 | self = [super init]; 17 | if (self) { 18 | self.serviceName = responseDic[@"serviceName"]; 19 | self.status = responseDic[@"status"]; 20 | self.userInfo = responseDic[@"userInfoDic"]; 21 | } 22 | return self; 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/Networks/Reachability.h: -------------------------------------------------------------------------------- 1 | /* 2 | File: Reachability.h 3 | Abstract: Basic demonstration of how to use the SystemConfiguration Reachablity APIs. 4 | Version: 3.5 5 | 6 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple 7 | Inc. ("Apple") in consideration of your agreement to the following 8 | terms, and your use, installation, modification or redistribution of 9 | this Apple software constitutes acceptance of these terms. If you do 10 | not agree with these terms, please do not use, install, modify or 11 | redistribute this Apple software. 12 | 13 | In consideration of your agreement to abide by the following terms, and 14 | subject to these terms, Apple grants you a personal, non-exclusive 15 | license, under Apple's copyrights in this original Apple software (the 16 | "Apple Software"), to use, reproduce, modify and redistribute the Apple 17 | Software, with or without modifications, in source and/or binary forms; 18 | provided that if you redistribute the Apple Software in its entirety and 19 | without modifications, you must retain this notice and the following 20 | text and disclaimers in all such redistributions of the Apple Software. 21 | Neither the name, trademarks, service marks or logos of Apple Inc. may 22 | be used to endorse or promote products derived from the Apple Software 23 | without specific prior written permission from Apple. Except as 24 | expressly stated in this notice, no other rights or licenses, express or 25 | implied, are granted by Apple herein, including but not limited to any 26 | patent rights that may be infringed by your derivative works or by other 27 | works in which the Apple Software may be incorporated. 28 | 29 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE 30 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 31 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS 32 | FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 33 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 34 | 35 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 36 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 37 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 38 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 39 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 40 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 41 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 42 | POSSIBILITY OF SUCH DAMAGE. 43 | 44 | Copyright (C) 2014 Apple Inc. All Rights Reserved. 45 | 46 | */ 47 | 48 | #import 49 | #import 50 | #import 51 | 52 | 53 | typedef enum : NSInteger { 54 | NotReachable = 0, 55 | ReachableViaWiFi, 56 | ReachableViaWWAN 57 | } NetworkStatus; 58 | 59 | 60 | extern NSString *kReachabilityChangedNotification; 61 | 62 | 63 | @interface Reachability : NSObject 64 | 65 | /*! 66 | * Use to check the reachability of a given host name. 67 | */ 68 | + (instancetype)reachabilityWithHostName:(NSString *)hostName; 69 | 70 | /*! 71 | * Use to check the reachability of a given IP address. 72 | */ 73 | + (instancetype)reachabilityWithAddress:(const struct sockaddr_in *)hostAddress; 74 | 75 | /*! 76 | * Checks whether the default route is available. Should be used by applications that do not connect to a particular host. 77 | */ 78 | + (instancetype)reachabilityForInternetConnection; 79 | 80 | /*! 81 | * Checks whether a local WiFi connection is available. 82 | */ 83 | + (instancetype)reachabilityForLocalWiFi; 84 | 85 | /*! 86 | * Start listening for reachability notifications on the current run loop. 87 | */ 88 | - (BOOL)startNotifier; 89 | - (void)stopNotifier; 90 | 91 | - (NetworkStatus)currentReachabilityStatus; 92 | 93 | /*! 94 | * WWAN may be available, but not active until a connection has been established. WiFi may require a connection for VPN on Demand. 95 | */ 96 | - (BOOL)connectionRequired; 97 | 98 | @end 99 | 100 | 101 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/Tools/JsenFrameKit.h: -------------------------------------------------------------------------------- 1 | // 2 | // JsenFrameKit.h 3 | // JsenProjectEncapsulation 4 | // 5 | // Created by WangXuesen on 15/12/16. 6 | // Copyright © 2015年 Jsen. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface JsenFrameKit : NSObject 12 | 13 | // rect 中最大的中心正方型的frame 14 | + (CGRect)getMAXCenterSquareFrameFrom:(CGRect)rect; 15 | 16 | // father rect 中最大的同 son rect比例相同的 rect 17 | + (CGRect)getMAXEqualScaleRectWithFatherRect:(CGRect)fatherRect sonRect:(CGRect)sonRect; 18 | @end 19 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/Tools/JsenFrameKit.m: -------------------------------------------------------------------------------- 1 | // 2 | // JsenFrameKit.m 3 | // JsenProjectEncapsulation 4 | // 5 | // Created by WangXuesen on 15/12/16. 6 | // Copyright © 2015年 Jsen. All rights reserved. 7 | // 8 | 9 | #import "JsenFrameKit.h" 10 | 11 | @implementation JsenFrameKit 12 | 13 | + (CGRect)getMAXCenterSquareFrameFrom:(CGRect)rect { 14 | CGFloat squareWH; 15 | CGFloat whScale = rect.size.width / rect.size.height; 16 | if (whScale) { 17 | squareWH = rect.size.height; 18 | } 19 | 20 | CGPoint rectCenter = CGPointMake(rect.size.width/2.0, rect.size.height/2.0); 21 | CGFloat squareX = rectCenter.x - squareWH/2.0; 22 | CGFloat squareY = rectCenter.y - squareWH/2.0; 23 | CGRect squareRect = CGRectMake(squareX, squareY, squareWH, squareWH); 24 | return squareRect; 25 | 26 | } 27 | 28 | + (CGRect)getMAXEqualScaleRectWithFatherRect:(CGRect)fatherRect sonRect:(CGRect)sonRect { 29 | 30 | CGFloat fatherW = fatherRect.size.width; 31 | CGFloat fatherH = fatherRect.size.height; 32 | 33 | CGFloat fatherCenterX = fatherW/2.0; 34 | CGFloat fatherCenterY = fatherH/2.0; 35 | 36 | CGFloat sonX = sonRect.origin.x; 37 | CGFloat sonY = sonRect.origin.y; 38 | CGFloat sonW = sonRect.size.width; 39 | CGFloat sonH = sonRect.size.height; 40 | 41 | CGFloat fatherWHScale = fatherW/fatherH; 42 | CGFloat sonWHScale = sonW/sonH; 43 | 44 | BOOL fatherWScaleMore = fatherWHScale >= sonWHScale ? YES : NO; 45 | BOOL fatherHLongerThanSonH = fatherH >= sonH ? YES : NO; 46 | BOOL fatherWLongerThanSonW = fatherW >= sonW ? YES : NO; 47 | if (fatherWScaleMore && !fatherHLongerThanSonH) { 48 | sonW = fatherH / sonH * sonW; 49 | sonH = fatherH; 50 | } else if (!fatherWScaleMore && !fatherWLongerThanSonW) { 51 | sonH = fatherW / sonW * sonH; 52 | sonW = fatherW; 53 | 54 | } 55 | sonX = fatherCenterX - sonW/2.0; 56 | sonY = fatherCenterY - sonH/2.0; 57 | 58 | return CGRectMake(sonX, sonY, sonW, sonH); 59 | 60 | } 61 | @end 62 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/JsenKit/Tools/JsenValidationKit.h: -------------------------------------------------------------------------------- 1 | // 2 | // JsenValidationKit.h 3 | // HearstMCB 4 | // 5 | // Created by WangXuesen on 15/12/14. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface JsenValidationKit : NSObject 12 | /** 13 | * 判断值是否为null nil @“” 14 | * 15 | * @param value id(对象类型) 16 | * 17 | * @return yes是“空”的 no不是“空”的 18 | */ 19 | + (BOOL)isValueEmpty:(id)value; 20 | 21 | // 对网络请求后含有空字符串或字段为空的字段进行处理 22 | + (NSMutableDictionary *)isUnEmptyDict:(NSDictionary *)dict; 23 | 24 | 25 | /** 26 | * 判断是否符合邮箱格式 27 | * 28 | * @param email 需要检测的字符串 29 | * 30 | * @return yes是email no不符合邮箱格式 31 | */ 32 | + (BOOL)doCheckEmailFormat:(NSString *)email; 33 | 34 | /** 35 | * 判断是否符合手机号码格式 36 | * 37 | * @param phoneNumber 需要检测的字符串 38 | * 39 | * @return yes符合手机号码格式 no不符合邮箱格式 40 | */ 41 | + (BOOL)doCheckMobilePhoneNumber:(NSString *)phoneNumber; 42 | 43 | /** 44 | * 判断是否符合美国身份id 45 | * 46 | * @param idNumber 需要检测的id字符串 47 | * 48 | * @return yes符合格式 no不符合格式 49 | */ 50 | + (BOOL)doCheckIdNumber:(NSString *)idNumber; 51 | 52 | /** 53 | * 判断是否符合中国护照号 54 | * 55 | * @param passportNumber 需要检测的字符串 56 | * 57 | * @return yes符合护照号格式 no不符合护照号格式 58 | */ 59 | + (BOOL)doCheckPassportNumber:(NSString *)passportNumber; 60 | 61 | /** 62 | * 判断是否符合url格式 63 | * 64 | * @param url 需要检测的字符串 65 | * 66 | * @return yes符合url格式 no 不符合url格式 67 | */ 68 | + (BOOL)doCheckURL:(NSString *)url; 69 | 70 | /** 71 | * 72 | * 73 | * @param passport 74 | * 75 | * @return 76 | */ 77 | + (BOOL)doPassport:(NSString *)passport; 78 | 79 | 80 | /** 81 | * 判断是否符合float格式 82 | * 83 | * @param strNumber 需要检测的字符串 84 | * 85 | * @return yes 符合 no 不符合 86 | */ 87 | + (BOOL)doCheckFloatNumber:(NSString *)strNumber; 88 | + (BOOL)doCheckDigitalNumber:(NSString *)strNumber; 89 | 90 | + (BOOL)doCheckPassword:(NSString *)pwdStr; 91 | @end 92 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/Resource/Test/JsenLoginModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JsenLoginModel.h 3 | // JsenProjectEncapsulation 4 | // 5 | // Created by WangXuesen on 16/4/7. 6 | // Copyright © 2016年 Jsen. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "YYModel.h" 11 | @class JsenMessageModel,JsenVariablesModel; 12 | @interface JsenLoginModel : NSObject 13 | 14 | @property (nonatomic , copy)NSString * Charset; 15 | 16 | @property (nonatomic , strong)JsenVariablesModel * Variables; 17 | 18 | @property (nonatomic , strong)JsenMessageModel * Message; 19 | 20 | @property (nonatomic , copy)NSString *Version; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/Resource/Test/JsenLoginModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // JsenLoginModel.m 3 | // JsenProjectEncapsulation 4 | // 5 | // Created by WangXuesen on 16/4/7. 6 | // Copyright © 2016年 Jsen. All rights reserved. 7 | // 8 | 9 | #import "JsenLoginModel.h" 10 | 11 | @implementation JsenLoginModel 12 | - (void)encodeWithCoder:(NSCoder *)aCoder { [self yy_modelEncodeWithCoder:aCoder]; } 13 | - (id)initWithCoder:(NSCoder *)aDecoder { self = [super init]; return [self yy_modelInitWithCoder:aDecoder]; } 14 | - (id)copyWithZone:(NSZone *)zone { return [self yy_modelCopy]; } 15 | - (NSUInteger)hash { return [self yy_modelHash]; } 16 | - (BOOL)isEqual:(id)object { return [self yy_modelIsEqual:object]; } 17 | - (NSString *)description { return [self yy_modelDescription]; } 18 | @end 19 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/Resource/Test/JsenMessageModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JsenMessageModel.h 3 | // JsenProjectEncapsulation 4 | // 5 | // Created by WangXuesen on 16/4/7. 6 | // Copyright © 2016年 Jsen. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "YYModel.h" 11 | @interface JsenMessageModel : NSObject 12 | @property (nonatomic , copy)NSString * messagepvl; 13 | @property (nonatomic , copy)NSString * messagestr; 14 | @property (nonatomic , copy)NSString * messageval; 15 | @end 16 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/Resource/Test/JsenMessageModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // JsenMessageModel.m 3 | // JsenProjectEncapsulation 4 | // 5 | // Created by WangXuesen on 16/4/7. 6 | // Copyright © 2016年 Jsen. All rights reserved. 7 | // 8 | 9 | #import "JsenMessageModel.h" 10 | 11 | @implementation JsenMessageModel 12 | - (void)encodeWithCoder:(NSCoder *)aCoder { [self yy_modelEncodeWithCoder:aCoder]; } 13 | - (id)initWithCoder:(NSCoder *)aDecoder { self = [super init]; return [self yy_modelInitWithCoder:aDecoder]; } 14 | - (id)copyWithZone:(NSZone *)zone { return [self yy_modelCopy]; } 15 | - (NSUInteger)hash { return [self yy_modelHash]; } 16 | - (BOOL)isEqual:(id)object { return [self yy_modelIsEqual:object]; } 17 | - (NSString *)description { return [self yy_modelDescription]; } 18 | @end 19 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/Resource/Test/JsenModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JsenModel.h 3 | // HearstMCB 4 | // 5 | // Created by WangXuesen on 15/12/7. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | 10 | @protocol JsenModelDelegate 11 | 12 | 13 | @end 14 | #import 15 | #import "JsenModel.h" 16 | #import "JsenBaseModel.h" 17 | 18 | @interface JsenModel : JsenBaseModel 19 | 20 | - (void)docallHomeRequest:(NSDictionary *)params; 21 | 22 | - (void)docallLoginRequest:(NSDictionary *)params; 23 | 24 | - (void)docallUploadHeaderRequest:(NSDictionary *)params; 25 | 26 | @property (nonatomic , weak)iddelegate; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/Resource/Test/JsenModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // JsenModel.m 3 | // HearstMCB 4 | // 5 | // Created by WangXuesen on 15/12/7. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #import "JsenModel.h" 10 | 11 | 12 | #define HomeRequestName @"Home_Request_Name" 13 | #define LoginRequestName @"Login_Request_Name" 14 | #define UploadHeaderRequestName @"Upload_Header_Request_Name" 15 | 16 | @interface JsenModel() 17 | 18 | @end 19 | 20 | @implementation JsenModel 21 | 22 | - (void)docallHomeRequest:(NSDictionary *)params { 23 | 24 | [self docallRequestUseDelegate:HomeRequestName 25 | forServiceUrl:Home 26 | requestMethod:JRequestMethodGet 27 | responseParseFormat:JResponseParseFormatJSON 28 | params:params 29 | responseSelectors:[JsenRequestResponseSelectors getResponsSelectorsWithStart:@selector(homeRequestStarted:) 30 | cancel:@selector(homeRequestCanceled:) 31 | fail:@selector(homeRequestFailed:) 32 | finish:@selector(homeRequestFinished:)]]; 33 | 34 | } 35 | 36 | - (void)docallLoginRequest:(NSDictionary *)params { 37 | [self docallRequest:LoginRequestName 38 | forServiceUrl:Login 39 | requestMethod:JRequestMethodPost 40 | responseParseFormat:JResponseParseFormatJSON 41 | params:params 42 | responseSelectors:[JsenRequestResponseSelectors getResponsSelectorsWithStart:@selector(loginRequestStarted:) 43 | cancel:@selector(loginRequestCanceled:) 44 | fail:@selector(loginRequestFailed:) 45 | finish:@selector(loginRequestFinished:)]]; 46 | 47 | } 48 | 49 | 50 | #warning upload file api have some problem. 51 | //TODO:wxs 52 | - (void)docallUploadHeaderRequest:(NSDictionary *)params { 53 | 54 | 55 | [self docallRequest:UploadHeaderRequestName 56 | forServiceUrl:UploadHeader 57 | requestMethod:JRequestMethodMultipartPost 58 | responseParseFormat:JResponseParseFormatJSON 59 | params:params 60 | responseSelectors:[JsenRequestResponseSelectors getResponsSelectorsWithStart:@selector(uploadHeaderRequestStarted:) 61 | cancel:@selector(uploadHeaderRequestCanceled:) 62 | fail:@selector(uploadHeaderRequestFailed:) 63 | finish:@selector(uploadHeaderRequestFinished:)]]; 64 | 65 | } 66 | 67 | 68 | #pragma mark - 69 | - (void)requestDidStarted:(NSString *)serviceName{ 70 | if ([serviceName isEqualToString:HomeRequestName] && self.delegate && [self.delegate respondsToSelector:@selector(homeRequestStarted:)]) { 71 | [self.delegate performSelector:@selector(homeRequestStarted:) withObject:serviceName]; 72 | } 73 | } 74 | 75 | - (void)requestDidCanceled:(NSString *)serviceName{ 76 | if ([serviceName isEqualToString:HomeRequestName] && self.delegate && [self.delegate respondsToSelector:@selector(homeRequestCanceled:)]) { 77 | [self.delegate performSelector:@selector(homeRequestCanceled:) withObject:serviceName]; 78 | } 79 | } 80 | 81 | - (void)requestDidFinished:(JsenRequestResponseSuccess *)response{ 82 | if ([response.serviceName isEqualToString:HomeRequestName] && self.delegate && [self.delegate respondsToSelector:@selector(homeRequestFinished:)]) { 83 | [self.delegate performSelector:@selector(homeRequestFinished:) withObject:response]; 84 | }else if ([response.serviceName isEqualToString:UploadHeaderRequestName] && self.delegate && [self.delegate respondsToSelector:@selector(uploadHeaderRequestFinished:)]) { 85 | [self.delegate performSelector:@selector(uploadHeaderRequestFinished:) withObject:response]; 86 | } 87 | 88 | } 89 | 90 | - (void)requestDidFailed:(JsenRequestResponseFailure *)response{ 91 | if ([response.serviceName isEqualToString:HomeRequestName] && self.delegate && [self.delegate respondsToSelector:@selector(homeRequestFailed:)]) { 92 | [self.delegate performSelector:@selector(homeRequestFailed:) withObject:response]; 93 | } else if ([response.serviceName isEqualToString:UploadHeaderRequestName] && self.delegate && [self.delegate respondsToSelector:@selector(uploadHeaderRequestFailed:)]) { 94 | [self.delegate performSelector:@selector(uploadHeaderRequestFailed:) withObject:response]; 95 | } 96 | } 97 | @end 98 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/Resource/Test/JsenModel2.h: -------------------------------------------------------------------------------- 1 | // 2 | // JsenModel2.h 3 | // HearstMCB 4 | // 5 | // Created by WangXuesen on 15/12/11. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #import "JsenBaseViewController.h" 10 | 11 | @interface JsenModel2 : JsenBaseViewController 12 | 13 | - (void)docallHomeRequest:(NSDictionary *)params; 14 | @end 15 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/Resource/Test/JsenModel2.m: -------------------------------------------------------------------------------- 1 | // 2 | // JsenModel2.m 3 | // HearstMCB 4 | // 5 | // Created by WangXuesen on 15/12/11. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #import "JsenModel2.h" 10 | #import "JsenRequestResponseSelectors.h" 11 | #import "JsenBaseModel.h" 12 | @implementation JsenModel2 13 | - (void)docallHomeRequest:(NSDictionary *)params { 14 | 15 | // JsenBaseModel *baseModel = [[JsenBaseModel alloc] init]; 16 | // baseModel.modelDelegate = self; 17 | // [baseModel docallRequest:HomeRequestName 18 | // forServiceUrl:Home 19 | // requestMethod:JRequestMethodGet 20 | // responseParseFormat:JResponseParseFormatJSON 21 | // params:params 22 | // delegate:self 23 | // responseSelectors:[JsenRequestResponseSelectors getResponsSelectorsWithStart:@selector(homeRequestStarted:) cancel:@selector(homeRequestCanceled:) fail:@selector(homeRequestFailed:) finish:@selector(homeRequestFinished:)]]; 24 | } 25 | @end 26 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/Resource/Test/JsenVariablesModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JsenVariablesModel.h 3 | // JsenProjectEncapsulation 4 | // 5 | // Created by WangXuesen on 16/4/7. 6 | // Copyright © 2016年 Jsen. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "YYModel.h" 11 | @interface JsenVariablesModel : NSObject 12 | @property (nonatomic , copy)NSString *auth; 13 | @property (nonatomic , copy)NSString *cookiepre; 14 | @property (nonatomic , copy)NSString *formhash; 15 | @property (nonatomic , copy)NSString *member_avatar; 16 | @property (nonatomic , copy)NSString *member_uid; 17 | @property (nonatomic , copy)NSString *member_username; 18 | @property (nonatomic , copy)NSString *saltkey; 19 | @end 20 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/Resource/Test/JsenVariablesModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // JsenVariablesModel.m 3 | // JsenProjectEncapsulation 4 | // 5 | // Created by WangXuesen on 16/4/7. 6 | // Copyright © 2016年 Jsen. All rights reserved. 7 | // 8 | 9 | #import "JsenVariablesModel.h" 10 | 11 | @implementation JsenVariablesModel 12 | - (void)encodeWithCoder:(NSCoder *)aCoder { [self yy_modelEncodeWithCoder:aCoder]; } 13 | - (id)initWithCoder:(NSCoder *)aDecoder { self = [super init]; return [self yy_modelInitWithCoder:aDecoder]; } 14 | - (id)copyWithZone:(NSZone *)zone { return [self yy_modelCopy]; } 15 | - (NSUInteger)hash { return [self yy_modelHash]; } 16 | - (BOOL)isEqual:(id)object { return [self yy_modelIsEqual:object]; } 17 | - (NSString *)description { return [self yy_modelDescription]; } 18 | @end 19 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/Resource/Test/img_avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imwangxuesen/HUD_TransformationAnimation_CustomTabBar/f4f02647925d6d9a76590b0d86ea991d298d7698/JsenProjectEncapsulation/JsenProjectEncapsulation/Resource/Test/img_avatar.png -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/Resource/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imwangxuesen/HUD_TransformationAnimation_CustomTabBar/f4f02647925d6d9a76590b0d86ea991d298d7698/JsenProjectEncapsulation/JsenProjectEncapsulation/Resource/logo.png -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // JsenProjectEncapsulation 4 | // 5 | // Created by WangXuesen on 15/12/15. 6 | // Copyright © 2015年 Jsen. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // JsenProjectEncapsulation 4 | // 5 | // Created by WangXuesen on 15/12/15. 6 | // Copyright © 2015年 Jsen. All rights reserved. 7 | // 8 | 9 | 10 | #import "ViewController.h" 11 | #import "JsenModel.h" 12 | #import "JsenRequestClient.h" 13 | #import "JsenTabBarItem.h" 14 | #import "JsenTabBarItemMgr.h" 15 | #import "JsenTabBarItemAttribute.h" 16 | @interface ViewController () 17 | @property (nonatomic , strong)JsenModel * jsenModel; 18 | @end 19 | 20 | @implementation ViewController 21 | 22 | - (void)viewDidLoad { 23 | [super viewDidLoad]; 24 | 25 | self.jsenModel = [[JsenModel alloc] init]; 26 | self.jsenModel.modelDelegate = self; 27 | self.jsenModel.delegate = self; 28 | NSMutableDictionary *home_dict = [[NSMutableDictionary alloc] init]; 29 | [home_dict setObject:@"" forKey:@"fromdateline"]; 30 | [home_dict setObject:@"" forKey:@"todateline"]; 31 | [home_dict setObject:@"0" forKey:@"page"]; 32 | [home_dict setObject:@"20" forKey:@"perpage"]; 33 | 34 | NSDictionary *params = @{ 35 | @"username" :@"wangxuesen", 36 | @"password" :@"123456", 37 | @"loginsubmit" :@"ture" 38 | }; 39 | 40 | 41 | [self.jsenModel docallLoginRequest:params]; 42 | [self.jsenModel docallHomeRequest:home_dict]; 43 | 44 | 45 | JsenRequest * request = [JsenRequest requestWithName:@"test1" forServiceUrl:Home requestMethod:JRequestMethodPost responseParseFormat:JResponseParseFormatJSON params:home_dict success:^(JsenRequest *request, JRequestingStatus requestingStatus, JsenRequestResponseSuccess *responseSuccess) { 46 | NSLog(@"home ------ success ------ :%@",responseSuccess.userInfo); 47 | } failed:^(JsenRequest *request, JRequestingStatus requestingStatus, JsenRequestResponseFailure *responseFailed) { 48 | NSLog(@"home ------ Failure ------ :%@",responseFailed); 49 | }]; 50 | [request start]; 51 | 52 | 53 | [[JsenRequestClient shareClient] requestWithName:@"requestLoginModel" success:^(JsenRequest *request, JRequestingStatus requestingStatus, JsenRequestResponseSuccess *responseSuccess) { 54 | NSLog(@"requestLoginModel success"); 55 | } failed:^(JsenRequest *request, JRequestingStatus requestingStatus, JsenRequestResponseFailure *responseFailed) { 56 | NSLog(@"requestLoginModel failure"); 57 | }]; 58 | 59 | } 60 | 61 | - (void)didReceiveMemoryWarning { 62 | [super didReceiveMemoryWarning]; 63 | // Dispose of any resources that can be recreated. 64 | } 65 | 66 | 67 | #pragma mark - JsenBaseModelDelegate 68 | - (void)homeRequestStarted:(id)obj { 69 | JSENLOGINFO(@"home1 homeRequestStarted"); 70 | } 71 | 72 | - (void)homeRequestCanceled:(JsenRequestResponseFailure *)jsenFail { 73 | JSENLOGINFO(@"home1 homeRequestCanceled"); 74 | } 75 | 76 | - (void)homeRequestFailed:(JsenRequestResponseFailure *)jsenFail { 77 | JSENLOGINFO(@"home1 homeRequestFailed"); 78 | } 79 | 80 | - (void)homeRequestFinished:(JsenRequestResponseSuccess *)suceess { 81 | JSENLOGINFO(@"home1 homeRequestFinished"); 82 | 83 | } 84 | 85 | - (void)loginRequestStarted:(id)obj { 86 | JSENLOGINFO(@"login loginRequestStarted"); 87 | } 88 | 89 | - (void)loginRequestCanceled:(JsenRequestResponseFailure *)jsenFail { 90 | JSENLOGINFO(@"login loginRequestCanceled"); 91 | 92 | } 93 | 94 | - (void)loginRequestFailed:(JsenRequestResponseFailure *)jsenFail { 95 | JSENLOGINFO(@"login loginRequestFailed"); 96 | } 97 | 98 | - (void)loginRequestFinished:(JsenRequestResponseSuccess *)suceess { 99 | NSDictionary *dic = (NSDictionary *)suceess.userInfo; 100 | NSDictionary *dat = dic[@"data"]; 101 | NSDictionary *var = dat[@"Variables"]; 102 | NSString *forhash = var[@"formhash"]; 103 | 104 | JSENLOGINFO(@"login loginRequestFinished"); 105 | [USER_DEFAULT setObject:forhash forKey:@"forhash"]; 106 | [USER_DEFAULT synchronize]; 107 | 108 | 109 | NSDictionary *paramsup = @{@"avatarsubmit":@"yes", 110 | @"formhash" :[USER_DEFAULT objectForKey:@"forhash"], 111 | @"img_avatar" :[UIImage imageNamed:@"img_avatar.png"], 112 | }; 113 | 114 | [self.jsenModel docallUploadHeaderRequest:paramsup]; 115 | } 116 | 117 | - (void)uploadHeaderRequestFinished:(JsenRequestResponseSuccess *)success { 118 | JSENLOGINFO(@"uploadHeader success"); 119 | 120 | 121 | } 122 | 123 | - (void)uploadHeaderRequestFailed:(JsenRequestResponseFailure *)failure { 124 | 125 | JSENLOGINFO(@"uploadHeader failure"); 126 | } 127 | 128 | @end -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/codes/part1/JsenHomeViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // JsenHomeViewController.h 3 | // HearstMCB 4 | // 5 | // Created by WangXuesen on 15/12/11. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #import "JsenBaseViewController.h" 10 | 11 | @interface JsenHomeViewController : JsenBaseViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/codes/part1/JsenHomeViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // JsenHomeViewController.m 3 | // HearstMCB 4 | // 5 | // Created by WangXuesen on 15/12/11. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #import "JsenHomeViewController.h" 10 | #import "JsenTabBarControllerMgr.h" 11 | #import "UINavigationBar+Expansion.h" 12 | #import "JsenPraiseViewController.h" 13 | 14 | #import "ViewController.h" 15 | @implementation JsenHomeViewController 16 | 17 | static int bage = 0; 18 | 19 | - (void)viewDidLoad { 20 | 21 | [super viewDidLoad]; 22 | self.view.backgroundColor = [UIColor grayColor]; 23 | 24 | 25 | ViewController * vc = [[ViewController alloc] init]; 26 | [self.navigationController pushViewController:vc animated:YES]; 27 | 28 | 29 | //添加功能按钮 30 | UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(100, 200, 150, 30)]; 31 | [btn setTitle:@"home加bage" forState:UIControlStateNormal]; 32 | [btn addTarget:self action:@selector(btnclicked:) forControlEvents:UIControlEventTouchUpInside]; 33 | [self.view addSubview:btn]; 34 | 35 | UIButton *btn1 = [[UIButton alloc] initWithFrame:CGRectMake(100, 250, 150, 30)]; 36 | [btn1 setTitle:@"home减bage" forState:UIControlStateNormal]; 37 | [btn1.titleLabel setTextColor:[UIColor blackColor]]; 38 | [btn1 addTarget:self action:@selector(btn1clicked:) forControlEvents:UIControlEventTouchUpInside]; 39 | [self.view addSubview:btn1]; 40 | 41 | 42 | UIButton *btn2 = [[UIButton alloc] initWithFrame:CGRectMake(100, 300, 150, 30)]; 43 | [btn2 setTitle:@"显示tabbar" forState:UIControlStateNormal]; 44 | [btn2 addTarget:self action:@selector(btn2clicked:) forControlEvents:UIControlEventTouchUpInside]; 45 | [self.view addSubview:btn2]; 46 | 47 | UIButton *btn3 = [[UIButton alloc] initWithFrame:CGRectMake(100,350, 150, 30)]; 48 | [btn3 setTitle:@"隐藏tabbar" forState:UIControlStateNormal]; 49 | [btn3 addTarget:self action:@selector(btn3clicked:) forControlEvents:UIControlEventTouchUpInside]; 50 | [self.view addSubview:btn3]; 51 | 52 | UIButton *btn4 = [[UIButton alloc] initWithFrame:CGRectMake(100,400, 150, 30)]; 53 | [btn4 setTitle:@"跳转动画" forState:UIControlStateNormal]; 54 | [btn4 addTarget:self action:@selector(btn4clicked:) forControlEvents:UIControlEventTouchUpInside]; 55 | [self.view addSubview:btn4]; 56 | 57 | [self.navigationController.navigationBar jsen_setBackgroundColor:[UIColor blueColor]]; 58 | 59 | } 60 | 61 | - (void)viewWillAppear:(BOOL)animated { 62 | [super viewWillAppear:animated]; 63 | [self.navigationController.navigationBar setShadowImage:[UIImage new]]; 64 | } 65 | 66 | - (void)viewWillDisappear:(BOOL)animated { 67 | [super viewWillDisappear:animated]; 68 | [self.navigationController.navigationBar jsen_reset]; 69 | } 70 | 71 | #pragma mark - actions 72 | - (void)btnclicked:(UIButton *)btn { 73 | bage++; 74 | [[JsenTabBarControllerMgr shareMgr] configFirstBage:[NSString stringWithFormat:@"%d",bage]]; 75 | 76 | } 77 | - (void)btn1clicked:(UIButton *)btn { 78 | bage--; 79 | [[JsenTabBarControllerMgr shareMgr] configFirstBage:[NSString stringWithFormat:@"%d",bage]]; 80 | 81 | } 82 | - (void)btn2clicked:(UIButton *)btn { 83 | 84 | [[JsenTabBarControllerMgr shareMgr] showWithAnimation:YES]; 85 | } 86 | 87 | - (void)btn3clicked:(UIButton *)btn { 88 | [[JsenTabBarControllerMgr shareMgr] hidenWithAnimation:YES]; 89 | 90 | } 91 | 92 | - (void)btn4clicked:(UIButton *)btn { 93 | UIStoryboard *stb = [UIStoryboard storyboardWithName:@"Main"bundle:[NSBundle mainBundle]]; 94 | JsenPraiseViewController *vc = (JsenPraiseViewController *)[stb instantiateViewControllerWithIdentifier:@"PraiseViewController"]; 95 | [self.navigationController pushViewController:vc animated:YES]; 96 | 97 | } 98 | @end 99 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/codes/part2/JsenFriendViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // JsenFriendViewController.h 3 | // HearstMCB 4 | // 5 | // Created by WangXuesen on 15/12/11. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #import "JsenBaseViewController.h" 10 | 11 | @interface JsenFriendViewController : JsenBaseViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/codes/part3/JsenFoundViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // JsenFoundViewController.h 3 | // HearstMCB 4 | // 5 | // Created by WangXuesen on 15/12/11. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #import "JsenBaseViewController.h" 10 | 11 | @interface JsenFoundViewController : JsenBaseViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/codes/part3/JsenFoundViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // JsenFoundViewController.m 3 | // HearstMCB 4 | // 5 | // Created by WangXuesen on 15/12/11. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #import "JsenFoundViewController.h" 10 | #import "UINavigationBar+Expansion.h" 11 | #import "JsenSettingViewController.h" 12 | #import "PingTransition.h" 13 | 14 | #define NAVBAR_CHANGE_POINT 50 15 | 16 | @interface JsenFoundViewController() 17 | @property (nonatomic , strong) UITableView * tableView; 18 | @end 19 | 20 | @implementation JsenFoundViewController 21 | - (void)viewDidLoad { 22 | 23 | [super viewDidLoad]; 24 | self.title = nil; 25 | self.view.backgroundColor = [UIColor blackColor]; 26 | 27 | 28 | //items 29 | UIBarButtonItem * right = [[UIBarButtonItem alloc] initWithTitle:@"next" style:UIBarButtonItemStyleDone target:self action:@selector(rightItemClicked:)]; 30 | NSArray *rights = @[ 31 | right, 32 | ]; 33 | [self.navigationItem setRightBarButtonItems:rights animated:YES]; 34 | 35 | //tableview 36 | UITableView *table = [[UITableView alloc] initWithFrame:CGRectMake(0, -64, self.view.bounds.size.width, self.view.bounds.size.height+ 64) style:UITableViewStyleGrouped]; 37 | table.dataSource = self; 38 | table.delegate = self; 39 | UIImageView *headerView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, ScreenBoundWidth, 264)]; 40 | headerView.image = [UIImage imageNamed:@"img_avatar"]; 41 | table.tableHeaderView = headerView; 42 | [self.view addSubview:table]; 43 | self.tableView = table; 44 | [table reloadData]; 45 | 46 | } 47 | 48 | 49 | - (void)viewWillAppear:(BOOL)animated { 50 | [super viewWillAppear:animated]; 51 | self.tableView.delegate = self; 52 | self.navigationController.delegate = self; 53 | [self scrollViewDidScroll:self.tableView]; 54 | [self.navigationController.navigationBar setShadowImage:[UIImage new]]; 55 | } 56 | 57 | - (void)viewWillDisappear:(BOOL)animated { 58 | [super viewWillDisappear:animated]; 59 | [self.navigationController.navigationBar jsen_reset]; 60 | } 61 | 62 | 63 | #pragma mark - Private Method 64 | - (void)rightItemClicked:(UIBarButtonItem *)item { 65 | JsenSettingViewController * setting = [[JsenSettingViewController alloc] init]; 66 | [self.navigationController pushViewController:setting animated:YES]; 67 | } 68 | 69 | #pragma mark - UITableViewDataSource 70 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ 71 | 72 | return 1; 73 | } 74 | 75 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 76 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"jsen"]; 77 | if (!cell) { 78 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"jsen"]; 79 | } 80 | [cell.textLabel setText:[NSString stringWithFormat:@"%ld",indexPath.section]]; 81 | return cell; 82 | 83 | } 84 | 85 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{ 86 | 87 | return 60; 88 | } 89 | 90 | #pragma mark - UITableViewDelegate 91 | 92 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { 93 | 94 | return 30; 95 | } 96 | 97 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView 98 | { 99 | UIColor * color = [UIColor colorWithRed:0/255.0 green:175/255.0 blue:240/255.0 alpha:1]; 100 | CGFloat offsetY = scrollView.contentOffset.y; 101 | if (offsetY > NAVBAR_CHANGE_POINT) { 102 | CGFloat alpha = MIN(1, 1 - ((NAVBAR_CHANGE_POINT + 64 - offsetY) / 64)); 103 | [self.navigationController.navigationBar jsen_setBackgroundColor:[color colorWithAlphaComponent:alpha]]; 104 | } else { 105 | [self.navigationController.navigationBar jsen_setBackgroundColor:[color colorWithAlphaComponent:0]]; 106 | } 107 | } 108 | 109 | #pragma mark - transition animation 110 | #pragma mark - UINavigationControllerDelegate 111 | - (id )navigationController:(UINavigationController *)navigationController 112 | animationControllerForOperation:(UINavigationControllerOperation)operation 113 | fromViewController:(UIViewController *)fromVC 114 | toViewController:(UIViewController *)toVC{ 115 | if (operation == UINavigationControllerOperationPush) { 116 | 117 | PingTransition *ping = [PingTransition new]; 118 | return ping; 119 | }else{ 120 | return nil; 121 | } 122 | } 123 | 124 | 125 | 126 | @end 127 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/codes/part3/JsenPraiseTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // JsenPraiseTableViewCell.h 3 | // JsenProjectEncapsulation 4 | // 5 | // Created by WangXuesen on 16/1/5. 6 | // Copyright © 2016年 Jsen. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JsenJumpView.h" 11 | @interface JsenPraiseTableViewCell : UITableViewCell 12 | @property (weak, nonatomic) IBOutlet JsenJumpView *jumpView; 13 | @property (weak, nonatomic) IBOutlet UIImageView *praiseImageView; 14 | @property (weak, nonatomic) IBOutlet UILabel *praiseLabel; 15 | @property (weak, nonatomic) IBOutlet UIImageView *priaisedImageView; 16 | @property (weak, nonatomic) IBOutlet UILabel *priaisedLabel; 17 | 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/codes/part3/JsenPraiseTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // JsenPraiseTableViewCell.m 3 | // JsenProjectEncapsulation 4 | // 5 | // Created by WangXuesen on 16/1/5. 6 | // Copyright © 2016年 Jsen. All rights reserved. 7 | // 8 | 9 | #import "JsenPraiseTableViewCell.h" 10 | #import "JsenJumpView.h" 11 | @implementation JsenPraiseTableViewCell 12 | 13 | - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(nullable NSString *)reuseIdentifier{ 14 | 15 | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; 16 | if (self) { 17 | [self.jumpView layoutIfNeeded]; 18 | self.jumpView.markedImage = [UIImage imageNamed:@"praised"]; 19 | self.jumpView.non_markedImage = [UIImage imageNamed:@"praise"]; 20 | UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tap:)]; 21 | [self.jumpView addGestureRecognizer:tap]; 22 | } 23 | return self; 24 | } 25 | 26 | - (void)awakeFromNib { 27 | // Initialization code 28 | [self.jumpView layoutIfNeeded]; 29 | self.jumpView.markedImage = [UIImage imageNamed:@"praised"]; 30 | self.jumpView.non_markedImage = [UIImage imageNamed:@"praise"]; 31 | self.jumpView.state = JsenJumpViewStateDown; 32 | UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tap:)]; 33 | [self.jumpView addGestureRecognizer:tap]; 34 | 35 | } 36 | 37 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 38 | [super setSelected:selected animated:animated]; 39 | 40 | // Configure the view for the selected state 41 | } 42 | 43 | 44 | - (void)tap:(UITapGestureRecognizer *)tap { 45 | NSLog(@"aaaaa"); 46 | [self.jumpView animate]; 47 | } 48 | @end 49 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/codes/part3/JsenPraiseViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // JsenPraiseViewController.h 3 | // JsenProjectEncapsulation 4 | // 5 | // Created by WangXuesen on 16/1/5. 6 | // Copyright © 2016年 Jsen. All rights reserved. 7 | // 8 | 9 | #import "JsenBaseViewController.h" 10 | 11 | @interface JsenPraiseViewController : JsenBaseViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/codes/part3/JsenPraiseViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // JsenPraiseViewController.m 3 | // JsenProjectEncapsulation 4 | // 5 | // Created by WangXuesen on 16/1/5. 6 | // Copyright © 2016年 Jsen. All rights reserved. 7 | // 8 | 9 | #import "JsenPraiseViewController.h" 10 | #import "JsenPraiseTableViewCell.h" 11 | @interface JsenPraiseViewController () 12 | @property (weak, nonatomic) IBOutlet UITableView *tableView; 13 | 14 | @end 15 | 16 | @implementation JsenPraiseViewController 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | // Do any additional setup after loading the view. 21 | } 22 | 23 | - (void)didReceiveMemoryWarning { 24 | [super didReceiveMemoryWarning]; 25 | // Dispose of any resources that can be recreated. 26 | } 27 | 28 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ 29 | 30 | return 4; 31 | } 32 | 33 | - (JsenPraiseTableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 34 | 35 | JsenPraiseTableViewCell * cell = [self.tableView dequeueReusableCellWithIdentifier:@"JsenPraiseTableViewCell"]; 36 | if (indexPath.row % 2) { 37 | cell.backgroundColor = [UIColor yellowColor]; 38 | } 39 | return cell; 40 | 41 | } 42 | 43 | /* 44 | #pragma mark - Navigation 45 | 46 | // In a storyboard-based application, you will often want to do a little preparation before navigation 47 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 48 | // Get the new view controller using [segue destinationViewController]. 49 | // Pass the selected object to the new view controller. 50 | } 51 | */ 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/codes/part4/JsenSettingViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // JsenSettingViewController.h 3 | // HearstMCB 4 | // 5 | // Created by WangXuesen on 15/12/11. 6 | // Copyright © 2015年 hearst. All rights reserved. 7 | // 8 | 9 | #import "JsenBaseViewController.h" 10 | 11 | @interface JsenSettingViewController : JsenBaseViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulation/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // JsenProjectEncapsulation 4 | // 5 | // Created by WangXuesen on 15/12/15. 6 | // Copyright © 2015年 Jsen. 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 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulationTests/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 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulationTests/JsenProjectEncapsulationTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // JsenProjectEncapsulationTests.m 3 | // JsenProjectEncapsulationTests 4 | // 5 | // Created by WangXuesen on 15/12/15. 6 | // Copyright © 2015年 Jsen. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface JsenProjectEncapsulationTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation JsenProjectEncapsulationTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulationUITests/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 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/JsenProjectEncapsulationUITests/JsenProjectEncapsulationUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // JsenProjectEncapsulationUITests.m 3 | // JsenProjectEncapsulationUITests 4 | // 5 | // Created by WangXuesen on 15/12/15. 6 | // Copyright © 2015年 Jsen. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface JsenProjectEncapsulationUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation JsenProjectEncapsulationUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | 3 | platform :ios, '8.0' 4 | 5 | target 'JsenProjectEncapsulation' do 6 | 7 | inhibit_all_warnings! 8 | pod 'YYModel' 9 | pod 'SDWebImage' 10 | 11 | end 12 | 13 | 14 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - SDWebImage (3.7.5): 3 | - SDWebImage/Core (= 3.7.5) 4 | - SDWebImage/Core (3.7.5) 5 | - YYModel (1.0.2) 6 | 7 | DEPENDENCIES: 8 | - SDWebImage (~> 3.7) 9 | - YYModel 10 | 11 | SPEC CHECKSUMS: 12 | SDWebImage: 69c6303e3348fba97e03f65d65d4fbc26740f461 13 | YYModel: 7a467eff45ae3641c33efb136c262d33b6f48c1a 14 | 15 | COCOAPODS: 0.39.0 16 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Headers/Private/SDWebImage/NSData+ImageContentType.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/NSData+ImageContentType.h -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Headers/Private/SDWebImage/SDImageCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDImageCache.h -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Headers/Private/SDWebImage/SDWebImageCompat.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageCompat.h -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Headers/Private/SDWebImage/SDWebImageDecoder.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageDecoder.h -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Headers/Private/SDWebImage/SDWebImageDownloader.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageDownloader.h -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Headers/Private/SDWebImage/SDWebImageDownloaderOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageDownloaderOperation.h -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Headers/Private/SDWebImage/SDWebImageManager.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageManager.h -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Headers/Private/SDWebImage/SDWebImageOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageOperation.h -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Headers/Private/SDWebImage/SDWebImagePrefetcher.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImagePrefetcher.h -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Headers/Private/SDWebImage/UIButton+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIButton+WebCache.h -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Headers/Private/SDWebImage/UIImage+GIF.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImage+GIF.h -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Headers/Private/SDWebImage/UIImage+MultiFormat.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImage+MultiFormat.h -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Headers/Private/SDWebImage/UIImageView+HighlightedWebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Headers/Private/SDWebImage/UIImageView+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImageView+WebCache.h -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Headers/Private/SDWebImage/UIView+WebCacheOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIView+WebCacheOperation.h -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Headers/Private/YYModel/NSObject+YYModel.h: -------------------------------------------------------------------------------- 1 | ../../../YYModel/YYModel/NSObject+YYModel.h -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Headers/Private/YYModel/YYClassInfo.h: -------------------------------------------------------------------------------- 1 | ../../../YYModel/YYModel/YYClassInfo.h -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Headers/Private/YYModel/YYModel.h: -------------------------------------------------------------------------------- 1 | ../../../YYModel/YYModel/YYModel.h -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Headers/Public/SDWebImage/NSData+ImageContentType.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/NSData+ImageContentType.h -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Headers/Public/SDWebImage/SDImageCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDImageCache.h -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Headers/Public/SDWebImage/SDWebImageCompat.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageCompat.h -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Headers/Public/SDWebImage/SDWebImageDecoder.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageDecoder.h -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Headers/Public/SDWebImage/SDWebImageDownloader.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageDownloader.h -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Headers/Public/SDWebImage/SDWebImageDownloaderOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageDownloaderOperation.h -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Headers/Public/SDWebImage/SDWebImageManager.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageManager.h -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Headers/Public/SDWebImage/SDWebImageOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageOperation.h -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Headers/Public/SDWebImage/SDWebImagePrefetcher.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImagePrefetcher.h -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Headers/Public/SDWebImage/UIButton+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIButton+WebCache.h -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Headers/Public/SDWebImage/UIImage+GIF.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImage+GIF.h -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Headers/Public/SDWebImage/UIImage+MultiFormat.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImage+MultiFormat.h -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Headers/Public/SDWebImage/UIImageView+HighlightedWebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Headers/Public/SDWebImage/UIImageView+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImageView+WebCache.h -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Headers/Public/SDWebImage/UIView+WebCacheOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIView+WebCacheOperation.h -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Headers/Public/YYModel/NSObject+YYModel.h: -------------------------------------------------------------------------------- 1 | ../../../YYModel/YYModel/NSObject+YYModel.h -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Headers/Public/YYModel/YYClassInfo.h: -------------------------------------------------------------------------------- 1 | ../../../YYModel/YYModel/YYClassInfo.h -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Headers/Public/YYModel/YYModel.h: -------------------------------------------------------------------------------- 1 | ../../../YYModel/YYModel/YYModel.h -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - SDWebImage (3.7.5): 3 | - SDWebImage/Core (= 3.7.5) 4 | - SDWebImage/Core (3.7.5) 5 | - YYModel (1.0.2) 6 | 7 | DEPENDENCIES: 8 | - SDWebImage (~> 3.7) 9 | - YYModel 10 | 11 | SPEC CHECKSUMS: 12 | SDWebImage: 69c6303e3348fba97e03f65d65d4fbc26740f461 13 | YYModel: 7a467eff45ae3641c33efb136c262d33b6f48c1a 14 | 15 | COCOAPODS: 0.39.0 16 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Pods.xcodeproj/xcuserdata/WangXuesen.xcuserdatad/xcschemes/Pods.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Pods.xcodeproj/xcuserdata/WangXuesen.xcuserdatad/xcschemes/SDWebImage.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Pods.xcodeproj/xcuserdata/WangXuesen.xcuserdatad/xcschemes/YYModel.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Pods.xcodeproj/xcuserdata/WangXuesen.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Pods.xcscheme 8 | 9 | isShown 10 | 11 | 12 | SDWebImage.xcscheme 13 | 14 | isShown 15 | 16 | 17 | YYModel.xcscheme 18 | 19 | isShown 20 | 21 | 22 | 23 | SuppressBuildableAutocreation 24 | 25 | 3AE3E3418B23E3C874C60A32B0AEB58C 26 | 27 | primary 28 | 29 | 30 | 581AADBE5E77B33F035EB75E01E3E379 31 | 32 | primary 33 | 34 | 35 | BB9955743CED79658B3762403911D799 36 | 37 | primary 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/SDWebImage/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 Olivier Poitrey 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | 21 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/SDWebImage/SDWebImage/NSData+ImageContentType.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Fabrice Aneche on 06/01/14. 3 | // Copyright (c) 2014 Dailymotion. All rights reserved. 4 | // 5 | 6 | #import 7 | 8 | @interface NSData (ImageContentType) 9 | 10 | /** 11 | * Compute the content type for an image data 12 | * 13 | * @param data the input data 14 | * 15 | * @return the content type as string (i.e. image/jpeg, image/gif) 16 | */ 17 | + (NSString *)sd_contentTypeForImageData:(NSData *)data; 18 | 19 | @end 20 | 21 | 22 | @interface NSData (ImageContentTypeDeprecated) 23 | 24 | + (NSString *)contentTypeForImageData:(NSData *)data __deprecated_msg("Use `sd_contentTypeForImageData:`"); 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/SDWebImage/SDWebImage/NSData+ImageContentType.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Fabrice Aneche on 06/01/14. 3 | // Copyright (c) 2014 Dailymotion. All rights reserved. 4 | // 5 | 6 | #import "NSData+ImageContentType.h" 7 | 8 | 9 | @implementation NSData (ImageContentType) 10 | 11 | + (NSString *)sd_contentTypeForImageData:(NSData *)data { 12 | uint8_t c; 13 | [data getBytes:&c length:1]; 14 | switch (c) { 15 | case 0xFF: 16 | return @"image/jpeg"; 17 | case 0x89: 18 | return @"image/png"; 19 | case 0x47: 20 | return @"image/gif"; 21 | case 0x49: 22 | case 0x4D: 23 | return @"image/tiff"; 24 | case 0x52: 25 | // R as RIFF for WEBP 26 | if ([data length] < 12) { 27 | return nil; 28 | } 29 | 30 | NSString *testString = [[NSString alloc] initWithData:[data subdataWithRange:NSMakeRange(0, 12)] encoding:NSASCIIStringEncoding]; 31 | if ([testString hasPrefix:@"RIFF"] && [testString hasSuffix:@"WEBP"]) { 32 | return @"image/webp"; 33 | } 34 | 35 | return nil; 36 | } 37 | return nil; 38 | } 39 | 40 | @end 41 | 42 | 43 | @implementation NSData (ImageContentTypeDeprecated) 44 | 45 | + (NSString *)contentTypeForImageData:(NSData *)data { 46 | return [self sd_contentTypeForImageData:data]; 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/SDWebImage/SDWebImage/SDWebImageCompat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Jamie Pinkham 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import 11 | 12 | #ifdef __OBJC_GC__ 13 | #error SDWebImage does not support Objective-C Garbage Collection 14 | #endif 15 | 16 | #if __IPHONE_OS_VERSION_MIN_REQUIRED != 20000 && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_5_0 17 | #error SDWebImage doesn't support Deployment Target version < 5.0 18 | #endif 19 | 20 | #if !TARGET_OS_IPHONE 21 | #import 22 | #ifndef UIImage 23 | #define UIImage NSImage 24 | #endif 25 | #ifndef UIImageView 26 | #define UIImageView NSImageView 27 | #endif 28 | #else 29 | 30 | #import 31 | 32 | #endif 33 | 34 | #ifndef NS_ENUM 35 | #define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type 36 | #endif 37 | 38 | #ifndef NS_OPTIONS 39 | #define NS_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type 40 | #endif 41 | 42 | #if OS_OBJECT_USE_OBJC 43 | #undef SDDispatchQueueRelease 44 | #undef SDDispatchQueueSetterSementics 45 | #define SDDispatchQueueRelease(q) 46 | #define SDDispatchQueueSetterSementics strong 47 | #else 48 | #undef SDDispatchQueueRelease 49 | #undef SDDispatchQueueSetterSementics 50 | #define SDDispatchQueueRelease(q) (dispatch_release(q)) 51 | #define SDDispatchQueueSetterSementics assign 52 | #endif 53 | 54 | extern UIImage *SDScaledImageForKey(NSString *key, UIImage *image); 55 | 56 | typedef void(^SDWebImageNoParamsBlock)(); 57 | 58 | extern NSString *const SDWebImageErrorDomain; 59 | 60 | #define dispatch_main_sync_safe(block)\ 61 | if ([NSThread isMainThread]) {\ 62 | block();\ 63 | } else {\ 64 | dispatch_sync(dispatch_get_main_queue(), block);\ 65 | } 66 | 67 | #define dispatch_main_async_safe(block)\ 68 | if ([NSThread isMainThread]) {\ 69 | block();\ 70 | } else {\ 71 | dispatch_async(dispatch_get_main_queue(), block);\ 72 | } 73 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/SDWebImage/SDWebImage/SDWebImageCompat.m: -------------------------------------------------------------------------------- 1 | // 2 | // SDWebImageCompat.m 3 | // SDWebImage 4 | // 5 | // Created by Olivier Poitrey on 11/12/12. 6 | // Copyright (c) 2012 Dailymotion. All rights reserved. 7 | // 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if !__has_feature(objc_arc) 12 | #error SDWebImage is ARC only. Either turn on ARC for the project or use -fobjc-arc flag 13 | #endif 14 | 15 | inline UIImage *SDScaledImageForKey(NSString *key, UIImage *image) { 16 | if (!image) { 17 | return nil; 18 | } 19 | 20 | if ([image.images count] > 0) { 21 | NSMutableArray *scaledImages = [NSMutableArray array]; 22 | 23 | for (UIImage *tempImage in image.images) { 24 | [scaledImages addObject:SDScaledImageForKey(key, tempImage)]; 25 | } 26 | 27 | return [UIImage animatedImageWithImages:scaledImages duration:image.duration]; 28 | } 29 | else { 30 | if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) { 31 | CGFloat scale = [UIScreen mainScreen].scale; 32 | if (key.length >= 8) { 33 | NSRange range = [key rangeOfString:@"@2x."]; 34 | if (range.location != NSNotFound) { 35 | scale = 2.0; 36 | } 37 | 38 | range = [key rangeOfString:@"@3x."]; 39 | if (range.location != NSNotFound) { 40 | scale = 3.0; 41 | } 42 | } 43 | 44 | UIImage *scaledImage = [[UIImage alloc] initWithCGImage:image.CGImage scale:scale orientation:image.imageOrientation]; 45 | image = scaledImage; 46 | } 47 | return image; 48 | } 49 | } 50 | 51 | NSString *const SDWebImageErrorDomain = @"SDWebImageErrorDomain"; 52 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/SDWebImage/SDWebImage/SDWebImageDecoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * Created by james on 9/28/11. 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | #import 12 | #import "SDWebImageCompat.h" 13 | 14 | @interface UIImage (ForceDecode) 15 | 16 | + (UIImage *)decodedImageWithImage:(UIImage *)image; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/SDWebImage/SDWebImage/SDWebImageDecoder.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * Created by james on 9/28/11. 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | #import "SDWebImageDecoder.h" 12 | 13 | @implementation UIImage (ForceDecode) 14 | 15 | + (UIImage *)decodedImageWithImage:(UIImage *)image { 16 | // while downloading huge amount of images 17 | // autorelease the bitmap context 18 | // and all vars to help system to free memory 19 | // when there are memory warning. 20 | // on iOS7, do not forget to call 21 | // [[SDImageCache sharedImageCache] clearMemory]; 22 | @autoreleasepool{ 23 | // do not decode animated images 24 | if (image.images) { return image; } 25 | 26 | CGImageRef imageRef = image.CGImage; 27 | 28 | CGImageAlphaInfo alpha = CGImageGetAlphaInfo(imageRef); 29 | BOOL anyAlpha = (alpha == kCGImageAlphaFirst || 30 | alpha == kCGImageAlphaLast || 31 | alpha == kCGImageAlphaPremultipliedFirst || 32 | alpha == kCGImageAlphaPremultipliedLast); 33 | 34 | if (anyAlpha) { return image; } 35 | 36 | size_t width = CGImageGetWidth(imageRef); 37 | size_t height = CGImageGetHeight(imageRef); 38 | 39 | // current 40 | CGColorSpaceModel imageColorSpaceModel = CGColorSpaceGetModel(CGImageGetColorSpace(imageRef)); 41 | CGColorSpaceRef colorspaceRef = CGImageGetColorSpace(imageRef); 42 | 43 | bool unsupportedColorSpace = (imageColorSpaceModel == 0 || imageColorSpaceModel == -1 || imageColorSpaceModel == kCGColorSpaceModelCMYK || imageColorSpaceModel == kCGColorSpaceModelIndexed); 44 | if (unsupportedColorSpace) 45 | colorspaceRef = CGColorSpaceCreateDeviceRGB(); 46 | 47 | CGContextRef context = CGBitmapContextCreate(NULL, width, 48 | height, 49 | CGImageGetBitsPerComponent(imageRef), 50 | 0, 51 | colorspaceRef, 52 | kCGBitmapByteOrderDefault | kCGImageAlphaPremultipliedFirst); 53 | 54 | // Draw the image into the context and retrieve the new image, which will now have an alpha layer 55 | CGContextDrawImage(context, CGRectMake(0, 0, width, height), imageRef); 56 | CGImageRef imageRefWithAlpha = CGBitmapContextCreateImage(context); 57 | UIImage *imageWithAlpha = [UIImage imageWithCGImage:imageRefWithAlpha scale:image.scale orientation:image.imageOrientation]; 58 | 59 | if (unsupportedColorSpace) 60 | CGColorSpaceRelease(colorspaceRef); 61 | 62 | CGContextRelease(context); 63 | CGImageRelease(imageRefWithAlpha); 64 | 65 | return imageWithAlpha; 66 | } 67 | } 68 | 69 | @end 70 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/SDWebImage/SDWebImage/SDWebImageDownloaderOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageDownloader.h" 11 | #import "SDWebImageOperation.h" 12 | 13 | extern NSString *const SDWebImageDownloadStartNotification; 14 | extern NSString *const SDWebImageDownloadReceiveResponseNotification; 15 | extern NSString *const SDWebImageDownloadStopNotification; 16 | extern NSString *const SDWebImageDownloadFinishNotification; 17 | 18 | @interface SDWebImageDownloaderOperation : NSOperation 19 | 20 | /** 21 | * The request used by the operation's connection. 22 | */ 23 | @property (strong, nonatomic, readonly) NSURLRequest *request; 24 | 25 | 26 | @property (assign, nonatomic) BOOL shouldDecompressImages; 27 | 28 | /** 29 | * Whether the URL connection should consult the credential storage for authenticating the connection. `YES` by default. 30 | * 31 | * This is the value that is returned in the `NSURLConnectionDelegate` method `-connectionShouldUseCredentialStorage:`. 32 | */ 33 | @property (nonatomic, assign) BOOL shouldUseCredentialStorage; 34 | 35 | /** 36 | * The credential used for authentication challenges in `-connection:didReceiveAuthenticationChallenge:`. 37 | * 38 | * This will be overridden by any shared credentials that exist for the username or password of the request URL, if present. 39 | */ 40 | @property (nonatomic, strong) NSURLCredential *credential; 41 | 42 | /** 43 | * The SDWebImageDownloaderOptions for the receiver. 44 | */ 45 | @property (assign, nonatomic, readonly) SDWebImageDownloaderOptions options; 46 | 47 | /** 48 | * The expected size of data. 49 | */ 50 | @property (assign, nonatomic) NSInteger expectedSize; 51 | 52 | /** 53 | * The response returned by the operation's connection. 54 | */ 55 | @property (strong, nonatomic) NSURLResponse *response; 56 | 57 | /** 58 | * Initializes a `SDWebImageDownloaderOperation` object 59 | * 60 | * @see SDWebImageDownloaderOperation 61 | * 62 | * @param request the URL request 63 | * @param options downloader options 64 | * @param progressBlock the block executed when a new chunk of data arrives. 65 | * @note the progress block is executed on a background queue 66 | * @param completedBlock the block executed when the download is done. 67 | * @note the completed block is executed on the main queue for success. If errors are found, there is a chance the block will be executed on a background queue 68 | * @param cancelBlock the block executed if the download (operation) is cancelled 69 | * 70 | * @return the initialized instance 71 | */ 72 | - (id)initWithRequest:(NSURLRequest *)request 73 | options:(SDWebImageDownloaderOptions)options 74 | progress:(SDWebImageDownloaderProgressBlock)progressBlock 75 | completed:(SDWebImageDownloaderCompletedBlock)completedBlock 76 | cancelled:(SDWebImageNoParamsBlock)cancelBlock; 77 | 78 | @end 79 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/SDWebImage/SDWebImage/SDWebImageOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | 11 | @protocol SDWebImageOperation 12 | 13 | - (void)cancel; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/SDWebImage/SDWebImage/SDWebImagePrefetcher.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageManager.h" 11 | 12 | @class SDWebImagePrefetcher; 13 | 14 | @protocol SDWebImagePrefetcherDelegate 15 | 16 | @optional 17 | 18 | /** 19 | * Called when an image was prefetched. 20 | * 21 | * @param imagePrefetcher The current image prefetcher 22 | * @param imageURL The image url that was prefetched 23 | * @param finishedCount The total number of images that were prefetched (successful or not) 24 | * @param totalCount The total number of images that were to be prefetched 25 | */ 26 | - (void)imagePrefetcher:(SDWebImagePrefetcher *)imagePrefetcher didPrefetchURL:(NSURL *)imageURL finishedCount:(NSUInteger)finishedCount totalCount:(NSUInteger)totalCount; 27 | 28 | /** 29 | * Called when all images are prefetched. 30 | * @param imagePrefetcher The current image prefetcher 31 | * @param totalCount The total number of images that were prefetched (whether successful or not) 32 | * @param skippedCount The total number of images that were skipped 33 | */ 34 | - (void)imagePrefetcher:(SDWebImagePrefetcher *)imagePrefetcher didFinishWithTotalCount:(NSUInteger)totalCount skippedCount:(NSUInteger)skippedCount; 35 | 36 | @end 37 | 38 | typedef void(^SDWebImagePrefetcherProgressBlock)(NSUInteger noOfFinishedUrls, NSUInteger noOfTotalUrls); 39 | typedef void(^SDWebImagePrefetcherCompletionBlock)(NSUInteger noOfFinishedUrls, NSUInteger noOfSkippedUrls); 40 | 41 | /** 42 | * Prefetch some URLs in the cache for future use. Images are downloaded in low priority. 43 | */ 44 | @interface SDWebImagePrefetcher : NSObject 45 | 46 | /** 47 | * The web image manager 48 | */ 49 | @property (strong, nonatomic, readonly) SDWebImageManager *manager; 50 | 51 | /** 52 | * Maximum number of URLs to prefetch at the same time. Defaults to 3. 53 | */ 54 | @property (nonatomic, assign) NSUInteger maxConcurrentDownloads; 55 | 56 | /** 57 | * SDWebImageOptions for prefetcher. Defaults to SDWebImageLowPriority. 58 | */ 59 | @property (nonatomic, assign) SDWebImageOptions options; 60 | 61 | /** 62 | * Queue options for Prefetcher. Defaults to Main Queue. 63 | */ 64 | @property (nonatomic, assign) dispatch_queue_t prefetcherQueue; 65 | 66 | @property (weak, nonatomic) id delegate; 67 | 68 | /** 69 | * Return the global image prefetcher instance. 70 | */ 71 | + (SDWebImagePrefetcher *)sharedImagePrefetcher; 72 | 73 | /** 74 | * Allows you to instantiate a prefetcher with any arbitrary image manager. 75 | */ 76 | - (id)initWithImageManager:(SDWebImageManager *)manager; 77 | 78 | /** 79 | * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching, 80 | * currently one image is downloaded at a time, 81 | * and skips images for failed downloads and proceed to the next image in the list 82 | * 83 | * @param urls list of URLs to prefetch 84 | */ 85 | - (void)prefetchURLs:(NSArray *)urls; 86 | 87 | /** 88 | * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching, 89 | * currently one image is downloaded at a time, 90 | * and skips images for failed downloads and proceed to the next image in the list 91 | * 92 | * @param urls list of URLs to prefetch 93 | * @param progressBlock block to be called when progress updates; 94 | * first parameter is the number of completed (successful or not) requests, 95 | * second parameter is the total number of images originally requested to be prefetched 96 | * @param completionBlock block to be called when prefetching is completed 97 | * first param is the number of completed (successful or not) requests, 98 | * second parameter is the number of skipped requests 99 | */ 100 | - (void)prefetchURLs:(NSArray *)urls progress:(SDWebImagePrefetcherProgressBlock)progressBlock completed:(SDWebImagePrefetcherCompletionBlock)completionBlock; 101 | 102 | /** 103 | * Remove and cancel queued list 104 | */ 105 | - (void)cancelPrefetching; 106 | 107 | 108 | @end 109 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/SDWebImage/SDWebImage/UIImage+GIF.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+GIF.h 3 | // LBGIFImage 4 | // 5 | // Created by Laurin Brandner on 06.01.12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIImage (GIF) 12 | 13 | + (UIImage *)sd_animatedGIFNamed:(NSString *)name; 14 | 15 | + (UIImage *)sd_animatedGIFWithData:(NSData *)data; 16 | 17 | - (UIImage *)sd_animatedImageByScalingAndCroppingToSize:(CGSize)size; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+MultiFormat.h 3 | // SDWebImage 4 | // 5 | // Created by Olivier Poitrey on 07/06/13. 6 | // Copyright (c) 2013 Dailymotion. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIImage (MultiFormat) 12 | 13 | + (UIImage *)sd_imageWithData:(NSData *)data; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+MultiFormat.m 3 | // SDWebImage 4 | // 5 | // Created by Olivier Poitrey on 07/06/13. 6 | // Copyright (c) 2013 Dailymotion. All rights reserved. 7 | // 8 | 9 | #import "UIImage+MultiFormat.h" 10 | #import "UIImage+GIF.h" 11 | #import "NSData+ImageContentType.h" 12 | #import 13 | 14 | #ifdef SD_WEBP 15 | #import "UIImage+WebP.h" 16 | #endif 17 | 18 | @implementation UIImage (MultiFormat) 19 | 20 | + (UIImage *)sd_imageWithData:(NSData *)data { 21 | if (!data) { 22 | return nil; 23 | } 24 | 25 | UIImage *image; 26 | NSString *imageContentType = [NSData sd_contentTypeForImageData:data]; 27 | if ([imageContentType isEqualToString:@"image/gif"]) { 28 | image = [UIImage sd_animatedGIFWithData:data]; 29 | } 30 | #ifdef SD_WEBP 31 | else if ([imageContentType isEqualToString:@"image/webp"]) 32 | { 33 | image = [UIImage sd_imageWithWebPData:data]; 34 | } 35 | #endif 36 | else { 37 | image = [[UIImage alloc] initWithData:data]; 38 | UIImageOrientation orientation = [self sd_imageOrientationFromImageData:data]; 39 | if (orientation != UIImageOrientationUp) { 40 | image = [UIImage imageWithCGImage:image.CGImage 41 | scale:image.scale 42 | orientation:orientation]; 43 | } 44 | } 45 | 46 | 47 | return image; 48 | } 49 | 50 | 51 | +(UIImageOrientation)sd_imageOrientationFromImageData:(NSData *)imageData { 52 | UIImageOrientation result = UIImageOrientationUp; 53 | CGImageSourceRef imageSource = CGImageSourceCreateWithData((__bridge CFDataRef)imageData, NULL); 54 | if (imageSource) { 55 | CFDictionaryRef properties = CGImageSourceCopyPropertiesAtIndex(imageSource, 0, NULL); 56 | if (properties) { 57 | CFTypeRef val; 58 | int exifOrientation; 59 | val = CFDictionaryGetValue(properties, kCGImagePropertyOrientation); 60 | if (val) { 61 | CFNumberGetValue(val, kCFNumberIntType, &exifOrientation); 62 | result = [self sd_exifOrientationToiOSOrientation:exifOrientation]; 63 | } // else - if it's not set it remains at up 64 | CFRelease((CFTypeRef) properties); 65 | } else { 66 | //NSLog(@"NO PROPERTIES, FAIL"); 67 | } 68 | CFRelease(imageSource); 69 | } 70 | return result; 71 | } 72 | 73 | #pragma mark EXIF orientation tag converter 74 | // Convert an EXIF image orientation to an iOS one. 75 | // reference see here: http://sylvana.net/jpegcrop/exif_orientation.html 76 | + (UIImageOrientation) sd_exifOrientationToiOSOrientation:(int)exifOrientation { 77 | UIImageOrientation orientation = UIImageOrientationUp; 78 | switch (exifOrientation) { 79 | case 1: 80 | orientation = UIImageOrientationUp; 81 | break; 82 | 83 | case 3: 84 | orientation = UIImageOrientationDown; 85 | break; 86 | 87 | case 8: 88 | orientation = UIImageOrientationLeft; 89 | break; 90 | 91 | case 6: 92 | orientation = UIImageOrientationRight; 93 | break; 94 | 95 | case 2: 96 | orientation = UIImageOrientationUpMirrored; 97 | break; 98 | 99 | case 4: 100 | orientation = UIImageOrientationDownMirrored; 101 | break; 102 | 103 | case 5: 104 | orientation = UIImageOrientationLeftMirrored; 105 | break; 106 | 107 | case 7: 108 | orientation = UIImageOrientationRightMirrored; 109 | break; 110 | default: 111 | break; 112 | } 113 | return orientation; 114 | } 115 | 116 | 117 | 118 | @end 119 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageManager.h" 11 | 12 | @interface UIView (WebCacheOperation) 13 | 14 | /** 15 | * Set the image load operation (storage in a UIView based dictionary) 16 | * 17 | * @param operation the operation 18 | * @param key key for storing the operation 19 | */ 20 | - (void)sd_setImageLoadOperation:(id)operation forKey:(NSString *)key; 21 | 22 | /** 23 | * Cancel all operations for the current UIView and key 24 | * 25 | * @param key key for identifying the operations 26 | */ 27 | - (void)sd_cancelImageLoadOperationWithKey:(NSString *)key; 28 | 29 | /** 30 | * Just remove the operations corresponding to the current UIView and key without cancelling them 31 | * 32 | * @param key key for identifying the operations 33 | */ 34 | - (void)sd_removeImageLoadOperationWithKey:(NSString *)key; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "UIView+WebCacheOperation.h" 10 | #import "objc/runtime.h" 11 | 12 | static char loadOperationKey; 13 | 14 | @implementation UIView (WebCacheOperation) 15 | 16 | - (NSMutableDictionary *)operationDictionary { 17 | NSMutableDictionary *operations = objc_getAssociatedObject(self, &loadOperationKey); 18 | if (operations) { 19 | return operations; 20 | } 21 | operations = [NSMutableDictionary dictionary]; 22 | objc_setAssociatedObject(self, &loadOperationKey, operations, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 23 | return operations; 24 | } 25 | 26 | - (void)sd_setImageLoadOperation:(id)operation forKey:(NSString *)key { 27 | [self sd_cancelImageLoadOperationWithKey:key]; 28 | NSMutableDictionary *operationDictionary = [self operationDictionary]; 29 | [operationDictionary setObject:operation forKey:key]; 30 | } 31 | 32 | - (void)sd_cancelImageLoadOperationWithKey:(NSString *)key { 33 | // Cancel in progress downloader from queue 34 | NSMutableDictionary *operationDictionary = [self operationDictionary]; 35 | id operations = [operationDictionary objectForKey:key]; 36 | if (operations) { 37 | if ([operations isKindOfClass:[NSArray class]]) { 38 | for (id operation in operations) { 39 | if (operation) { 40 | [operation cancel]; 41 | } 42 | } 43 | } else if ([operations conformsToProtocol:@protocol(SDWebImageOperation)]){ 44 | [(id) operations cancel]; 45 | } 46 | [operationDictionary removeObjectForKey:key]; 47 | } 48 | } 49 | 50 | - (void)sd_removeImageLoadOperationWithKey:(NSString *)key { 51 | NSMutableDictionary *operationDictionary = [self operationDictionary]; 52 | [operationDictionary removeObjectForKey:key]; 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## SDWebImage 5 | 6 | Copyright (c) 2009 Olivier Poitrey 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is furnished 13 | to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in all 16 | copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | 27 | 28 | ## YYModel 29 | 30 | The MIT License (MIT) 31 | 32 | Copyright (c) 2015 ibireme 33 | 34 | Permission is hereby granted, free of charge, to any person obtaining a copy 35 | of this software and associated documentation files (the "Software"), to deal 36 | in the Software without restriction, including without limitation the rights 37 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 38 | copies of the Software, and to permit persons to whom the Software is 39 | furnished to do so, subject to the following conditions: 40 | 41 | The above copyright notice and this permission notice shall be included in all 42 | copies or substantial portions of the Software. 43 | 44 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 45 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 46 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 47 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 48 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 49 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 50 | SOFTWARE. 51 | 52 | 53 | Generated by CocoaPods - http://cocoapods.org 54 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Target Support Files/Pods/Pods-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2009 Olivier Poitrey <rs@dailymotion.com> 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is furnished 24 | to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in all 27 | copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | 38 | Title 39 | SDWebImage 40 | Type 41 | PSGroupSpecifier 42 | 43 | 44 | FooterText 45 | The MIT License (MIT) 46 | 47 | Copyright (c) 2015 ibireme <ibireme@gmail.com> 48 | 49 | Permission is hereby granted, free of charge, to any person obtaining a copy 50 | of this software and associated documentation files (the "Software"), to deal 51 | in the Software without restriction, including without limitation the rights 52 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 53 | copies of the Software, and to permit persons to whom the Software is 54 | furnished to do so, subject to the following conditions: 55 | 56 | The above copyright notice and this permission notice shall be included in all 57 | copies or substantial portions of the Software. 58 | 59 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 60 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 61 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 62 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 63 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 64 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 65 | SOFTWARE. 66 | 67 | 68 | Title 69 | YYModel 70 | Type 71 | PSGroupSpecifier 72 | 73 | 74 | FooterText 75 | Generated by CocoaPods - http://cocoapods.org 76 | Title 77 | 78 | Type 79 | PSGroupSpecifier 80 | 81 | 82 | StringsTable 83 | Acknowledgements 84 | Title 85 | Acknowledgements 86 | 87 | 88 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Target Support Files/Pods/Pods-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods : NSObject 3 | @end 4 | @implementation PodsDummy_Pods 5 | @end 6 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Target Support Files/Pods/Pods-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 47 | local swift_runtime_libs 48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 49 | for lib in $swift_runtime_libs; do 50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 52 | code_sign_if_enabled "${destination}/${lib}" 53 | done 54 | fi 55 | } 56 | 57 | # Signs a framework with the provided identity 58 | code_sign_if_enabled() { 59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 60 | # Use the current code_sign_identitiy 61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements \"$1\"" 63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1" 64 | fi 65 | } 66 | 67 | # Strip invalid architectures 68 | strip_invalid_archs() { 69 | binary="$1" 70 | # Get architectures for current file 71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 72 | stripped="" 73 | for arch in $archs; do 74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 75 | # Strip non-valid architectures in-place 76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 77 | stripped="$stripped $arch" 78 | fi 79 | done 80 | if [[ "$stripped" ]]; then 81 | echo "Stripped $binary of architectures:$stripped" 82 | fi 83 | } 84 | 85 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Target Support Files/Pods/Pods.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/YYModel" 3 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/SDWebImage" -isystem "${PODS_ROOT}/Headers/Public/YYModel" 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"SDWebImage" -l"YYModel" -framework "CoreFoundation" -framework "Foundation" -framework "ImageIO" 5 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Target Support Files/Pods/Pods.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/YYModel" 3 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/SDWebImage" -isystem "${PODS_ROOT}/Headers/Public/YYModel" 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"SDWebImage" -l"YYModel" -framework "CoreFoundation" -framework "Foundation" -framework "ImageIO" 5 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Target Support Files/SDWebImage/SDWebImage-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_SDWebImage : NSObject 3 | @end 4 | @implementation PodsDummy_SDWebImage 5 | @end 6 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Target Support Files/SDWebImage/SDWebImage-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Target Support Files/SDWebImage/SDWebImage.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/SDWebImage" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/YYModel" 3 | OTHER_LDFLAGS = -framework "ImageIO" 4 | PODS_ROOT = ${SRCROOT} 5 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Target Support Files/YYModel/YYModel-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_YYModel : NSObject 3 | @end 4 | @implementation PodsDummy_YYModel 5 | @end 6 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Target Support Files/YYModel/YYModel-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/Target Support Files/YYModel/YYModel.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/YYModel" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/YYModel" 3 | OTHER_LDFLAGS = -framework "CoreFoundation" -framework "Foundation" 4 | PODS_ROOT = ${SRCROOT} 5 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/YYModel/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 ibireme 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 | 23 | -------------------------------------------------------------------------------- /JsenProjectEncapsulation/Pods/YYModel/YYModel/YYModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // YYModel.h 3 | // YYModel 4 | // 5 | // Created by ibireme on 15/5/10. 6 | // Copyright (c) 2015 ibireme. 7 | // 8 | // This source code is licensed under the MIT-style license found in the 9 | // LICENSE file in the root directory of this source tree. 10 | // 11 | 12 | #import 13 | 14 | #if __has_include() 15 | FOUNDATION_EXPORT double YYModelVersionNumber; 16 | FOUNDATION_EXPORT const unsigned char YYModelVersionString[]; 17 | #import 18 | #import 19 | #else 20 | #import "NSObject+YYModel.h" 21 | #import "YYClassInfo.h" 22 | #endif 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # JsenProjectEncapsulation 2 | 1).封装项目开发常用的网络请求框架. 3 | 2).封装自定义的TabBar(可带中间加号按钮,微博样式). 4 | 3).封装自定义的NavigationBar,系统原生和完全自定义类型,可随时变动左右item样式及响应,titleLabel多样式. 5 | 4).loading覆盖层,空白页面指示框. 6 | 5).常用的字符串.字典操作. 7 | 6).纯代码坐标适配工具类封装等等. 8 | 9 | ##截止2016年11月22日,https://github.com/imwangxuesen/JsenKit 是我正在封装的一个iOS通用项目通用框架,支持pods,目前完善中 10 | 11 | # 效果图 12 | loading: 13 | 14 | ![ShotItems](https://github.com/imwangxuesen/JsenProjectEncapsulation/blob/master/resource/loading.gif) 15 | 16 | 导航栏效果图: 17 | 18 | ![ShotItems](https://github.com/imwangxuesen/JsenProjectEncapsulation/blob/master/resource/navigationbar.gif) 19 | 20 | tabbar上的红点数字变动: 21 | 22 | ![ShotItems](https://github.com/imwangxuesen/JsenProjectEncapsulation/blob/master/resource/page.gif) 23 | 24 | 跳动点赞动画: 25 | 26 | ![ShotItems](https://github.com/imwangxuesen/JsenProjectEncapsulation/blob/master/resource/praise.gif) 27 | 28 | 显示/隐藏tabbar: 29 | 30 | ![ShotItems](https://github.com/imwangxuesen/JsenProjectEncapsulation/blob/master/resource/tabbar.gif) 31 | 32 | 页面跳转动画: 33 | 34 | ![ShotItems](https://github.com/imwangxuesen/JsenProjectEncapsulation/blob/master/resource/transition.gif) 35 | -------------------------------------------------------------------------------- /resource/jsen_titleview_remote.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imwangxuesen/HUD_TransformationAnimation_CustomTabBar/f4f02647925d6d9a76590b0d86ea991d298d7698/resource/jsen_titleview_remote.JPG -------------------------------------------------------------------------------- /resource/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imwangxuesen/HUD_TransformationAnimation_CustomTabBar/f4f02647925d6d9a76590b0d86ea991d298d7698/resource/loading.gif -------------------------------------------------------------------------------- /resource/navigationbar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imwangxuesen/HUD_TransformationAnimation_CustomTabBar/f4f02647925d6d9a76590b0d86ea991d298d7698/resource/navigationbar.gif -------------------------------------------------------------------------------- /resource/page.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imwangxuesen/HUD_TransformationAnimation_CustomTabBar/f4f02647925d6d9a76590b0d86ea991d298d7698/resource/page.gif -------------------------------------------------------------------------------- /resource/praise.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imwangxuesen/HUD_TransformationAnimation_CustomTabBar/f4f02647925d6d9a76590b0d86ea991d298d7698/resource/praise.gif -------------------------------------------------------------------------------- /resource/tabbar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imwangxuesen/HUD_TransformationAnimation_CustomTabBar/f4f02647925d6d9a76590b0d86ea991d298d7698/resource/tabbar.gif -------------------------------------------------------------------------------- /resource/transition.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imwangxuesen/HUD_TransformationAnimation_CustomTabBar/f4f02647925d6d9a76590b0d86ea991d298d7698/resource/transition.gif --------------------------------------------------------------------------------