├── HKPTimeLine.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcuserdata │ └── YHIOS002.xcuserdatad │ └── xcschemes │ ├── HKPTimeLine.xcscheme │ └── xcschememanagement.plist ├── HKPTimeLine.xcworkspace ├── contents.xcworkspacedata └── xcuserdata │ └── YHIOS002.xcuserdatad │ ├── UserInterfaceState.xcuserstate │ └── xcdebugger │ └── Breakpoints_v2.xcbkptlist ├── HKPTimeLine ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── common_avatar_120px.imageset │ │ ├── Contents.json │ │ ├── common_img_defaultAvtar@2x.png │ │ └── common_img_defaultAvtar@3x.png │ ├── workgroup_img_comment.imageset │ │ ├── Contents.json │ │ ├── workgroup_img_comment@2x.png │ │ └── workgroup_img_comment@3x.png │ ├── workgroup_img_defaultPhoto.imageset │ │ ├── Contents.json │ │ ├── workgroup_img_defaultPhoto@2x.png │ │ └── workgroup_img_defaultPhoto@3x.png │ ├── workgroup_img_like.imageset │ │ ├── Contents.json │ │ ├── workgroup_img_like@2x.png │ │ └── workgroup_img_like@3x.png │ ├── workgroup_img_like_sel.imageset │ │ ├── Contents.json │ │ ├── workgroup_img_like_sel@2x.png │ │ └── workgroup_img_like_sel@3x.png │ ├── workgroup_img_more.imageset │ │ ├── Contents.json │ │ ├── workgroup_img_more@2x.png │ │ └── workgroup_img_more@3x.png │ ├── workgroup_img_share.imageset │ │ ├── Contents.json │ │ ├── workgroup_img_share@2x.png │ │ └── workgroup_img_share@3x.png │ ├── workgroup_sharetopikewaydynamic.imageset │ │ ├── Contents.json │ │ ├── workgroup_sharetopikewaydynamic@2x.png │ │ └── workgroup_sharetopikewaydynamic@3x.png │ ├── workgroup_sharetopikewayfriend.imageset │ │ ├── Contents.json │ │ ├── workgroup_sharetopikewayfriend@2x.png │ │ └── workgroup_sharetopikewayfriend@3x.png │ ├── workgroup_sharetowechatfriend.imageset │ │ ├── Contents.json │ │ ├── workgroup_sharetowechatfriend@2x.png │ │ └── workgroup_sharetowechatfriend@3x.png │ └── workgroup_sharetowechatfriendcircle.imageset │ │ ├── Contents.json │ │ ├── workgroup_sharetowechatfriendcircle@2x.png │ │ └── workgroup_sharetowechatfriendcircle@3x.png ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── HKPTimeLine.pch ├── Info.plist ├── Manager │ ├── YHUserInfoManager.h │ └── YHUserInfoManager.m ├── Model │ ├── YHEducationExperienceModel.h │ ├── YHEducationExperienceModel.m │ ├── YHUserInfo.h │ ├── YHUserInfo.m │ ├── YHUserSetting.h │ ├── YHUserSetting.m │ ├── YHWorkExperienceModel.h │ ├── YHWorkExperienceModel.m │ ├── YHWorkGroup.h │ └── YHWorkGroup.m ├── Others │ └── ThirdParty │ │ ├── HYBMasonryAutoCellHeight │ │ ├── UITableView+HYBCacheHeight.h │ │ ├── UITableView+HYBCacheHeight.m │ │ ├── UITableViewCell+HYBMasonryAutoCellHeight.h │ │ └── UITableViewCell+HYBMasonryAutoCellHeight.m │ │ └── SDPhotoBrowser │ │ ├── SDBrowserImageView.h │ │ ├── SDBrowserImageView.m │ │ ├── SDPhotoBrowser.h │ │ ├── SDPhotoBrowser.m │ │ ├── SDPhotoBrowserConfig.h │ │ ├── SDWaitingView.h │ │ └── SDWaitingView.m ├── Tools │ ├── HKPCommon.h │ ├── HKPCommon.m │ ├── NSDate+LYXCategory.h │ ├── NSDate+LYXCategory.m │ ├── YHUtils.h │ └── YHUtils.m ├── View │ ├── CellForWorkGroup.h │ ├── CellForWorkGroup.m │ ├── CellForWorkGroupRepost.h │ ├── CellForWorkGroupRepost.m │ ├── HKPBotView.h │ ├── HKPBotView.m │ ├── YHActionSheet.h │ ├── YHActionSheet.m │ ├── YHRefreshTableView.h │ ├── YHRefreshTableView.m │ ├── YHSharePresentView.h │ ├── YHSharePresentView.m │ ├── YHWorkGroupButton.h │ ├── YHWorkGroupButton.m │ ├── YHWorkGroupPhotoContainer.h │ └── YHWorkGroupPhotoContainer.m ├── ViewController │ ├── YHTimeLineListController.h │ └── YHTimeLineListController.m └── main.m ├── Podfile ├── Podfile.lock ├── Pods ├── Headers │ ├── Private │ │ ├── MJRefresh │ │ │ ├── MJRefresh.h │ │ │ ├── MJRefreshAutoFooter.h │ │ │ ├── MJRefreshAutoGifFooter.h │ │ │ ├── MJRefreshAutoNormalFooter.h │ │ │ ├── MJRefreshAutoStateFooter.h │ │ │ ├── MJRefreshBackFooter.h │ │ │ ├── MJRefreshBackGifFooter.h │ │ │ ├── MJRefreshBackNormalFooter.h │ │ │ ├── MJRefreshBackStateFooter.h │ │ │ ├── MJRefreshComponent.h │ │ │ ├── MJRefreshConst.h │ │ │ ├── MJRefreshFooter.h │ │ │ ├── MJRefreshGifHeader.h │ │ │ ├── MJRefreshHeader.h │ │ │ ├── MJRefreshNormalHeader.h │ │ │ ├── MJRefreshStateHeader.h │ │ │ ├── NSBundle+MJRefresh.h │ │ │ ├── UIScrollView+MJExtension.h │ │ │ ├── UIScrollView+MJRefresh.h │ │ │ └── UIView+MJExtension.h │ │ ├── Masonry │ │ │ ├── MASCompositeConstraint.h │ │ │ ├── MASConstraint+Private.h │ │ │ ├── MASConstraint.h │ │ │ ├── MASConstraintMaker.h │ │ │ ├── MASLayoutConstraint.h │ │ │ ├── MASUtilities.h │ │ │ ├── MASViewAttribute.h │ │ │ ├── MASViewConstraint.h │ │ │ ├── Masonry.h │ │ │ ├── NSArray+MASAdditions.h │ │ │ ├── NSArray+MASShorthandAdditions.h │ │ │ ├── NSLayoutConstraint+MASDebugAdditions.h │ │ │ ├── View+MASAdditions.h │ │ │ ├── View+MASShorthandAdditions.h │ │ │ └── ViewController+MASAdditions.h │ │ └── 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 │ └── Public │ │ ├── MJRefresh │ │ ├── MJRefresh.h │ │ ├── MJRefreshAutoFooter.h │ │ ├── MJRefreshAutoGifFooter.h │ │ ├── MJRefreshAutoNormalFooter.h │ │ ├── MJRefreshAutoStateFooter.h │ │ ├── MJRefreshBackFooter.h │ │ ├── MJRefreshBackGifFooter.h │ │ ├── MJRefreshBackNormalFooter.h │ │ ├── MJRefreshBackStateFooter.h │ │ ├── MJRefreshComponent.h │ │ ├── MJRefreshConst.h │ │ ├── MJRefreshFooter.h │ │ ├── MJRefreshGifHeader.h │ │ ├── MJRefreshHeader.h │ │ ├── MJRefreshNormalHeader.h │ │ ├── MJRefreshStateHeader.h │ │ ├── NSBundle+MJRefresh.h │ │ ├── UIScrollView+MJExtension.h │ │ ├── UIScrollView+MJRefresh.h │ │ └── UIView+MJExtension.h │ │ ├── Masonry │ │ ├── MASCompositeConstraint.h │ │ ├── MASConstraint+Private.h │ │ ├── MASConstraint.h │ │ ├── MASConstraintMaker.h │ │ ├── MASLayoutConstraint.h │ │ ├── MASUtilities.h │ │ ├── MASViewAttribute.h │ │ ├── MASViewConstraint.h │ │ ├── Masonry.h │ │ ├── NSArray+MASAdditions.h │ │ ├── NSArray+MASShorthandAdditions.h │ │ ├── NSLayoutConstraint+MASDebugAdditions.h │ │ ├── View+MASAdditions.h │ │ ├── View+MASShorthandAdditions.h │ │ └── ViewController+MASAdditions.h │ │ └── 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 ├── MJRefresh │ ├── LICENSE │ ├── MJRefresh │ │ ├── Base │ │ │ ├── MJRefreshAutoFooter.h │ │ │ ├── MJRefreshAutoFooter.m │ │ │ ├── MJRefreshBackFooter.h │ │ │ ├── MJRefreshBackFooter.m │ │ │ ├── MJRefreshComponent.h │ │ │ ├── MJRefreshComponent.m │ │ │ ├── MJRefreshFooter.h │ │ │ ├── MJRefreshFooter.m │ │ │ ├── MJRefreshHeader.h │ │ │ └── MJRefreshHeader.m │ │ ├── Custom │ │ │ ├── Footer │ │ │ │ ├── Auto │ │ │ │ │ ├── MJRefreshAutoGifFooter.h │ │ │ │ │ ├── MJRefreshAutoGifFooter.m │ │ │ │ │ ├── MJRefreshAutoNormalFooter.h │ │ │ │ │ ├── MJRefreshAutoNormalFooter.m │ │ │ │ │ ├── MJRefreshAutoStateFooter.h │ │ │ │ │ └── MJRefreshAutoStateFooter.m │ │ │ │ └── Back │ │ │ │ │ ├── MJRefreshBackGifFooter.h │ │ │ │ │ ├── MJRefreshBackGifFooter.m │ │ │ │ │ ├── MJRefreshBackNormalFooter.h │ │ │ │ │ ├── MJRefreshBackNormalFooter.m │ │ │ │ │ ├── MJRefreshBackStateFooter.h │ │ │ │ │ └── MJRefreshBackStateFooter.m │ │ │ └── Header │ │ │ │ ├── MJRefreshGifHeader.h │ │ │ │ ├── MJRefreshGifHeader.m │ │ │ │ ├── MJRefreshNormalHeader.h │ │ │ │ ├── MJRefreshNormalHeader.m │ │ │ │ ├── MJRefreshStateHeader.h │ │ │ │ └── MJRefreshStateHeader.m │ │ ├── MJRefresh.bundle │ │ │ ├── arrow@2x.png │ │ │ ├── en.lproj │ │ │ │ └── Localizable.strings │ │ │ ├── zh-Hans.lproj │ │ │ │ └── Localizable.strings │ │ │ └── zh-Hant.lproj │ │ │ │ └── Localizable.strings │ │ ├── MJRefresh.h │ │ ├── MJRefreshConst.h │ │ ├── MJRefreshConst.m │ │ ├── NSBundle+MJRefresh.h │ │ ├── NSBundle+MJRefresh.m │ │ ├── UIScrollView+MJExtension.h │ │ ├── UIScrollView+MJExtension.m │ │ ├── UIScrollView+MJRefresh.h │ │ ├── UIScrollView+MJRefresh.m │ │ ├── UIView+MJExtension.h │ │ └── UIView+MJExtension.m │ └── README.md ├── Manifest.lock ├── Masonry │ ├── LICENSE │ ├── Masonry │ │ ├── MASCompositeConstraint.h │ │ ├── MASCompositeConstraint.m │ │ ├── MASConstraint+Private.h │ │ ├── MASConstraint.h │ │ ├── MASConstraint.m │ │ ├── MASConstraintMaker.h │ │ ├── MASConstraintMaker.m │ │ ├── MASLayoutConstraint.h │ │ ├── MASLayoutConstraint.m │ │ ├── MASUtilities.h │ │ ├── MASViewAttribute.h │ │ ├── MASViewAttribute.m │ │ ├── MASViewConstraint.h │ │ ├── MASViewConstraint.m │ │ ├── Masonry.h │ │ ├── NSArray+MASAdditions.h │ │ ├── NSArray+MASAdditions.m │ │ ├── NSArray+MASShorthandAdditions.h │ │ ├── NSLayoutConstraint+MASDebugAdditions.h │ │ ├── NSLayoutConstraint+MASDebugAdditions.m │ │ ├── View+MASAdditions.h │ │ ├── View+MASAdditions.m │ │ ├── View+MASShorthandAdditions.h │ │ ├── ViewController+MASAdditions.h │ │ └── ViewController+MASAdditions.m │ └── README.md ├── Pods.xcodeproj │ ├── project.pbxproj │ └── xcuserdata │ │ └── YHIOS002.xcuserdatad │ │ └── xcschemes │ │ ├── MJRefresh.xcscheme │ │ ├── Masonry.xcscheme │ │ ├── Pods.xcscheme │ │ ├── SDWebImage.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 │ ├── MJRefresh │ ├── MJRefresh-dummy.m │ ├── MJRefresh-prefix.pch │ └── MJRefresh.xcconfig │ ├── Masonry │ ├── Masonry-dummy.m │ ├── Masonry-prefix.pch │ └── Masonry.xcconfig │ ├── 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 ├── README.md └── pics ├── gif1.gif ├── pic1.png ├── pic2.png ├── pic3.png └── pic4.png /HKPTimeLine.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /HKPTimeLine.xcodeproj/xcuserdata/YHIOS002.xcuserdatad/xcschemes/HKPTimeLine.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /HKPTimeLine.xcodeproj/xcuserdata/YHIOS002.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | HKPTimeLine.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | ACCC0B761D8FDBCF00ACFEBD 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /HKPTimeLine.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /HKPTimeLine.xcworkspace/xcuserdata/YHIOS002.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samuelandkevin/HKPTimeLine/3b5a87b4f1667bd743e75baa58976c30bb887d3b/HKPTimeLine.xcworkspace/xcuserdata/YHIOS002.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /HKPTimeLine.xcworkspace/xcuserdata/YHIOS002.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 14 | 15 | 17 | 19 | 20 | 21 | 22 | 23 | 24 | 26 | 32 | 33 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /HKPTimeLine/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // HKPTimeLine 仿赤兔、微博动态 4 | // CSDN: http://blog.csdn.net/samuelandkevin 5 | // Created by samuelandkevin on 16/9/19. 6 | // Copyright © 2016年 HKP. 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 | -------------------------------------------------------------------------------- /HKPTimeLine/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // HKPTimeLine 仿赤兔、微博动态 4 | // CSDN: http://blog.csdn.net/samuelandkevin 5 | // Created by samuelandkevin on 16/9/19. 6 | // Copyright © 2016年 HKP. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /HKPTimeLine/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | } 88 | ], 89 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } -------------------------------------------------------------------------------- /HKPTimeLine/Assets.xcassets/common_avatar_120px.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "common_img_defaultAvtar@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "common_img_defaultAvtar@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /HKPTimeLine/Assets.xcassets/common_avatar_120px.imageset/common_img_defaultAvtar@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samuelandkevin/HKPTimeLine/3b5a87b4f1667bd743e75baa58976c30bb887d3b/HKPTimeLine/Assets.xcassets/common_avatar_120px.imageset/common_img_defaultAvtar@2x.png -------------------------------------------------------------------------------- /HKPTimeLine/Assets.xcassets/common_avatar_120px.imageset/common_img_defaultAvtar@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samuelandkevin/HKPTimeLine/3b5a87b4f1667bd743e75baa58976c30bb887d3b/HKPTimeLine/Assets.xcassets/common_avatar_120px.imageset/common_img_defaultAvtar@3x.png -------------------------------------------------------------------------------- /HKPTimeLine/Assets.xcassets/workgroup_img_comment.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "workgroup_img_comment@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "workgroup_img_comment@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /HKPTimeLine/Assets.xcassets/workgroup_img_comment.imageset/workgroup_img_comment@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samuelandkevin/HKPTimeLine/3b5a87b4f1667bd743e75baa58976c30bb887d3b/HKPTimeLine/Assets.xcassets/workgroup_img_comment.imageset/workgroup_img_comment@2x.png -------------------------------------------------------------------------------- /HKPTimeLine/Assets.xcassets/workgroup_img_comment.imageset/workgroup_img_comment@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samuelandkevin/HKPTimeLine/3b5a87b4f1667bd743e75baa58976c30bb887d3b/HKPTimeLine/Assets.xcassets/workgroup_img_comment.imageset/workgroup_img_comment@3x.png -------------------------------------------------------------------------------- /HKPTimeLine/Assets.xcassets/workgroup_img_defaultPhoto.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "workgroup_img_defaultPhoto@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "workgroup_img_defaultPhoto@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /HKPTimeLine/Assets.xcassets/workgroup_img_defaultPhoto.imageset/workgroup_img_defaultPhoto@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samuelandkevin/HKPTimeLine/3b5a87b4f1667bd743e75baa58976c30bb887d3b/HKPTimeLine/Assets.xcassets/workgroup_img_defaultPhoto.imageset/workgroup_img_defaultPhoto@2x.png -------------------------------------------------------------------------------- /HKPTimeLine/Assets.xcassets/workgroup_img_defaultPhoto.imageset/workgroup_img_defaultPhoto@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samuelandkevin/HKPTimeLine/3b5a87b4f1667bd743e75baa58976c30bb887d3b/HKPTimeLine/Assets.xcassets/workgroup_img_defaultPhoto.imageset/workgroup_img_defaultPhoto@3x.png -------------------------------------------------------------------------------- /HKPTimeLine/Assets.xcassets/workgroup_img_like.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "workgroup_img_like@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "workgroup_img_like@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /HKPTimeLine/Assets.xcassets/workgroup_img_like.imageset/workgroup_img_like@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samuelandkevin/HKPTimeLine/3b5a87b4f1667bd743e75baa58976c30bb887d3b/HKPTimeLine/Assets.xcassets/workgroup_img_like.imageset/workgroup_img_like@2x.png -------------------------------------------------------------------------------- /HKPTimeLine/Assets.xcassets/workgroup_img_like.imageset/workgroup_img_like@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samuelandkevin/HKPTimeLine/3b5a87b4f1667bd743e75baa58976c30bb887d3b/HKPTimeLine/Assets.xcassets/workgroup_img_like.imageset/workgroup_img_like@3x.png -------------------------------------------------------------------------------- /HKPTimeLine/Assets.xcassets/workgroup_img_like_sel.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "workgroup_img_like_sel@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "workgroup_img_like_sel@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /HKPTimeLine/Assets.xcassets/workgroup_img_like_sel.imageset/workgroup_img_like_sel@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samuelandkevin/HKPTimeLine/3b5a87b4f1667bd743e75baa58976c30bb887d3b/HKPTimeLine/Assets.xcassets/workgroup_img_like_sel.imageset/workgroup_img_like_sel@2x.png -------------------------------------------------------------------------------- /HKPTimeLine/Assets.xcassets/workgroup_img_like_sel.imageset/workgroup_img_like_sel@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samuelandkevin/HKPTimeLine/3b5a87b4f1667bd743e75baa58976c30bb887d3b/HKPTimeLine/Assets.xcassets/workgroup_img_like_sel.imageset/workgroup_img_like_sel@3x.png -------------------------------------------------------------------------------- /HKPTimeLine/Assets.xcassets/workgroup_img_more.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "workgroup_img_more@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "workgroup_img_more@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /HKPTimeLine/Assets.xcassets/workgroup_img_more.imageset/workgroup_img_more@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samuelandkevin/HKPTimeLine/3b5a87b4f1667bd743e75baa58976c30bb887d3b/HKPTimeLine/Assets.xcassets/workgroup_img_more.imageset/workgroup_img_more@2x.png -------------------------------------------------------------------------------- /HKPTimeLine/Assets.xcassets/workgroup_img_more.imageset/workgroup_img_more@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samuelandkevin/HKPTimeLine/3b5a87b4f1667bd743e75baa58976c30bb887d3b/HKPTimeLine/Assets.xcassets/workgroup_img_more.imageset/workgroup_img_more@3x.png -------------------------------------------------------------------------------- /HKPTimeLine/Assets.xcassets/workgroup_img_share.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "workgroup_img_share@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "workgroup_img_share@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /HKPTimeLine/Assets.xcassets/workgroup_img_share.imageset/workgroup_img_share@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samuelandkevin/HKPTimeLine/3b5a87b4f1667bd743e75baa58976c30bb887d3b/HKPTimeLine/Assets.xcassets/workgroup_img_share.imageset/workgroup_img_share@2x.png -------------------------------------------------------------------------------- /HKPTimeLine/Assets.xcassets/workgroup_img_share.imageset/workgroup_img_share@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samuelandkevin/HKPTimeLine/3b5a87b4f1667bd743e75baa58976c30bb887d3b/HKPTimeLine/Assets.xcassets/workgroup_img_share.imageset/workgroup_img_share@3x.png -------------------------------------------------------------------------------- /HKPTimeLine/Assets.xcassets/workgroup_sharetopikewaydynamic.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "workgroup_sharetopikewaydynamic@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "workgroup_sharetopikewaydynamic@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /HKPTimeLine/Assets.xcassets/workgroup_sharetopikewaydynamic.imageset/workgroup_sharetopikewaydynamic@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samuelandkevin/HKPTimeLine/3b5a87b4f1667bd743e75baa58976c30bb887d3b/HKPTimeLine/Assets.xcassets/workgroup_sharetopikewaydynamic.imageset/workgroup_sharetopikewaydynamic@2x.png -------------------------------------------------------------------------------- /HKPTimeLine/Assets.xcassets/workgroup_sharetopikewaydynamic.imageset/workgroup_sharetopikewaydynamic@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samuelandkevin/HKPTimeLine/3b5a87b4f1667bd743e75baa58976c30bb887d3b/HKPTimeLine/Assets.xcassets/workgroup_sharetopikewaydynamic.imageset/workgroup_sharetopikewaydynamic@3x.png -------------------------------------------------------------------------------- /HKPTimeLine/Assets.xcassets/workgroup_sharetopikewayfriend.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "workgroup_sharetopikewayfriend@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "workgroup_sharetopikewayfriend@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /HKPTimeLine/Assets.xcassets/workgroup_sharetopikewayfriend.imageset/workgroup_sharetopikewayfriend@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samuelandkevin/HKPTimeLine/3b5a87b4f1667bd743e75baa58976c30bb887d3b/HKPTimeLine/Assets.xcassets/workgroup_sharetopikewayfriend.imageset/workgroup_sharetopikewayfriend@2x.png -------------------------------------------------------------------------------- /HKPTimeLine/Assets.xcassets/workgroup_sharetopikewayfriend.imageset/workgroup_sharetopikewayfriend@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samuelandkevin/HKPTimeLine/3b5a87b4f1667bd743e75baa58976c30bb887d3b/HKPTimeLine/Assets.xcassets/workgroup_sharetopikewayfriend.imageset/workgroup_sharetopikewayfriend@3x.png -------------------------------------------------------------------------------- /HKPTimeLine/Assets.xcassets/workgroup_sharetowechatfriend.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "workgroup_sharetowechatfriend@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "workgroup_sharetowechatfriend@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /HKPTimeLine/Assets.xcassets/workgroup_sharetowechatfriend.imageset/workgroup_sharetowechatfriend@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samuelandkevin/HKPTimeLine/3b5a87b4f1667bd743e75baa58976c30bb887d3b/HKPTimeLine/Assets.xcassets/workgroup_sharetowechatfriend.imageset/workgroup_sharetowechatfriend@2x.png -------------------------------------------------------------------------------- /HKPTimeLine/Assets.xcassets/workgroup_sharetowechatfriend.imageset/workgroup_sharetowechatfriend@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samuelandkevin/HKPTimeLine/3b5a87b4f1667bd743e75baa58976c30bb887d3b/HKPTimeLine/Assets.xcassets/workgroup_sharetowechatfriend.imageset/workgroup_sharetowechatfriend@3x.png -------------------------------------------------------------------------------- /HKPTimeLine/Assets.xcassets/workgroup_sharetowechatfriendcircle.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "workgroup_sharetowechatfriendcircle@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "workgroup_sharetowechatfriendcircle@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /HKPTimeLine/Assets.xcassets/workgroup_sharetowechatfriendcircle.imageset/workgroup_sharetowechatfriendcircle@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samuelandkevin/HKPTimeLine/3b5a87b4f1667bd743e75baa58976c30bb887d3b/HKPTimeLine/Assets.xcassets/workgroup_sharetowechatfriendcircle.imageset/workgroup_sharetowechatfriendcircle@2x.png -------------------------------------------------------------------------------- /HKPTimeLine/Assets.xcassets/workgroup_sharetowechatfriendcircle.imageset/workgroup_sharetowechatfriendcircle@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samuelandkevin/HKPTimeLine/3b5a87b4f1667bd743e75baa58976c30bb887d3b/HKPTimeLine/Assets.xcassets/workgroup_sharetowechatfriendcircle.imageset/workgroup_sharetowechatfriendcircle@3x.png -------------------------------------------------------------------------------- /HKPTimeLine/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 | -------------------------------------------------------------------------------- /HKPTimeLine/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /HKPTimeLine/HKPTimeLine.pch: -------------------------------------------------------------------------------- 1 | // 2 | // HKPTimeLine 仿赤兔、微博动态.pch 3 | // HKPTimeLine 仿赤兔、微博动态 4 | // 5 | // Created by samuelandkevin on 16/9/19. 6 | // Copyright © 2016年 HKP. All rights reserved. 7 | // 8 | 9 | #ifndef HKPTimeLine_pch 10 | #define HKPTimeLine_pch 11 | 12 | // Include any system framework and library headers here that should be included in all compilation units. 13 | // You will also need to set the Prefix Header build setting of one or more of your targets to reference this file. 14 | #import 15 | #import 16 | 17 | #define RGB16(rgbValue)\ 18 | \ 19 | [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \ 20 | green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \ 21 | blue:((float)(rgbValue & 0xFF))/255.0 \ 22 | alpha:1.0] 23 | 24 | #define RGB16(rgbValue)\ 25 | \ 26 | [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \ 27 | green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \ 28 | blue:((float)(rgbValue & 0xFF))/255.0 \ 29 | alpha:1.0] 30 | #define kGrayColor RGBCOLOR(196, 197, 198) 31 | #define kGreenColor RGBCOLOR(0, 201, 144) 32 | #define RGBCOLOR(r,g,b) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:1] 33 | #define SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width 34 | #define SCREEN_HEIGHT [UIScreen mainScreen].bounds.size.height 35 | #define KEYWINDOW [UIApplication sharedApplication].keyWindow 36 | 37 | #define DDLog(FORMAT, ...) fprintf(stderr, "\n[%s] function:%s line:%d content:%s\n", __TIME__, __FUNCTION__, __LINE__, [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]); 38 | 39 | #define WeakSelf __weak __typeof(&*self)weakSelf = self; 40 | #endif /* HKPTimeLine_pch */ 41 | -------------------------------------------------------------------------------- /HKPTimeLine/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 | CFBundlePackageType 14 | APPL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | NSAppTransportSecurity 24 | 25 | NSAllowsArbitraryLoads 26 | 27 | 28 | UILaunchStoryboardName 29 | LaunchScreen 30 | UIMainStoryboardFile 31 | Main 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 | -------------------------------------------------------------------------------- /HKPTimeLine/Manager/YHUserInfoManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // YHUserInfoManager.h 3 | // github: https://github.com/samuelandkevin 4 | // 5 | // Created by kun on 16/4/25. 6 | // Copyright © 2016年 HKP. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "YHUserInfo.h" 11 | 12 | @interface YHUserInfoManager : NSObject 13 | 14 | /** 15 | * 当前登录的用户信息(单例) 16 | */ 17 | @property (nonatomic, strong)YHUserInfo *userInfo; 18 | 19 | + (instancetype)sharedInstance; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /HKPTimeLine/Manager/YHUserInfoManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // YHUserInfoManager.m 3 | // github: https://github.com/samuelandkevin 4 | // CSDN: http://blog.csdn.net/samuelandkevin 5 | // Created by kun on 16/4/25. 6 | // Copyright © 2016年 HKP. All rights reserved. 7 | // 用户信息管理 8 | 9 | #import "YHUserInfoManager.h" 10 | 11 | @interface YHUserInfoManager () 12 | 13 | @end 14 | 15 | @implementation YHUserInfoManager 16 | 17 | - (instancetype)init 18 | { 19 | self = [super init]; 20 | 21 | if (!self) 22 | { 23 | return nil; 24 | } 25 | 26 | return self; 27 | } 28 | 29 | + (instancetype)sharedInstance 30 | { 31 | static YHUserInfoManager *g_ins = nil; 32 | static dispatch_once_t onceToken; 33 | 34 | dispatch_once(&onceToken, ^{ 35 | g_ins = [YHUserInfoManager new]; 36 | }); 37 | return g_ins; 38 | } 39 | 40 | #pragma mark - Getter 41 | - (YHUserInfo *)userInfo 42 | { 43 | if (!_userInfo) 44 | { 45 | _userInfo = [YHUserInfo new]; 46 | } 47 | _userInfo.isSelfModel = YES; 48 | return _userInfo; 49 | } 50 | 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /HKPTimeLine/Model/YHEducationExperienceModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // YHEducationExperienceModel.h 3 | // github: https://github.com/samuelandkevin 4 | // 5 | // Created by samuelandkevin on 16/5/17. 6 | // Copyright © 2016年 HKP. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface YHEducationExperienceModel : NSObject 12 | 13 | @property(nonatomic,copy) NSString * eduExpId; 14 | @property(nonatomic,strong) NSString * school; 15 | @property(nonatomic,strong) NSString * major; 16 | @property(nonatomic,strong) NSString * educationBackground; 17 | @property(nonatomic,strong) NSString * beginTime; 18 | @property(nonatomic,strong) NSString * endTime; 19 | @property(nonatomic,strong) NSString * moreDescription; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /HKPTimeLine/Model/YHEducationExperienceModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // YHEducationExperienceModel.m 3 | // github: https://github.com/samuelandkevin 4 | // 5 | // Created by samuelandkevin on 16/5/17. 6 | // Copyright © 2016年 HKP. All rights reserved. 7 | // 8 | 9 | #import "YHEducationExperienceModel.h" 10 | 11 | 12 | 13 | @implementation YHEducationExperienceModel 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /HKPTimeLine/Model/YHUserSetting.h: -------------------------------------------------------------------------------- 1 | // 2 | // YHUserSetting.h 3 | // github: https://github.com/samuelandkevin 4 | // 5 | // Created by kun on 16/5/2. 6 | // Copyright © 2016年 HKP. All rights reserved. 7 | // 用户隐私设置 8 | 9 | #import 10 | 11 | 12 | typedef NS_ENUM(NSInteger,Person){ 13 | Person_All =0,//所有人 14 | Person_MyFrinds //好友 15 | }; 16 | 17 | @interface YHUserSetting : NSObject 18 | 19 | @property (nonatomic, assign)Person whoCanReadMyInfo;//谁可以查看我的资料 20 | @property (nonatomic, assign)Person whoCanAddMetoFriend; //谁可以把我添加为好友 21 | @property (nonatomic, copy)NSArray * whoCannotReadMyDynamic; //不让他看我的动态 22 | @property (nonatomic, copy)NSArray * whoseDynamicIdonotRead; //不看他的动态 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /HKPTimeLine/Model/YHUserSetting.m: -------------------------------------------------------------------------------- 1 | // 2 | // YHUserSetting.m 3 | // github: https://github.com/samuelandkevin 4 | // CSDN: http://blog.csdn.net/samuelandkevin 5 | // Created by kun on 16/5/2. 6 | // Copyright © 2016年 HKP. All rights reserved. 7 | // 8 | 9 | #import "YHUserSetting.h" 10 | 11 | @implementation YHUserSetting 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /HKPTimeLine/Model/YHWorkExperienceModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // YHWorkExperienceModel.h 3 | // github: https://github.com/samuelandkevin 4 | // CSDN: http://blog.csdn.net/samuelandkevin 5 | // Created by samuelandkevin on 16/5/17. 6 | // Copyright © 2016年 HKP. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface YHWorkExperienceModel : NSObject 12 | 13 | @property(nonatomic,copy) NSString * workExpId; 14 | @property(nonatomic,strong) NSString * company; 15 | @property(nonatomic,strong) NSString * position; 16 | @property(nonatomic,strong) NSString * beginTime; 17 | @property(nonatomic,strong) NSString * endTime; 18 | @property(nonatomic,strong) NSString * moreDescription; 19 | @end 20 | -------------------------------------------------------------------------------- /HKPTimeLine/Model/YHWorkExperienceModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // YHWorkExperienceModel.m 3 | // github: https://github.com/samuelandkevin 4 | // CSDN: http://blog.csdn.net/samuelandkevin 5 | // Created by samuelandkevin on 16/5/17. 6 | // Copyright © 2016年 HKP. All rights reserved. 7 | // 8 | 9 | #import "YHWorkExperienceModel.h" 10 | 11 | @implementation YHWorkExperienceModel 12 | 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /HKPTimeLine/Model/YHWorkGroup.h: -------------------------------------------------------------------------------- 1 | // 2 | // YHWorkGroup.h 3 | // github: https://github.com/samuelandkevin 4 | // 5 | // Created by samuelandkevin on 16/5/5. 6 | // Copyright © 2016年 HKP. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "YHUserInfo.h" 11 | 12 | //动态类型 13 | typedef NS_ENUM(int,DynType){ 14 | DynType_Original = 0, //原创 15 | DynType_Forward //转发 16 | }; 17 | 18 | //可见性 19 | typedef NS_ENUM(int,VisibleType){ 20 | Visible_AllPeople = 0,//所有人可见 21 | Visible_OnlyFriend //仅好友可见 22 | }; 23 | 24 | 25 | @interface YHWorkGroup : NSObject 26 | 27 | @property (nonatomic, copy) NSString *dynamicId; //动态Id 28 | @property (nonatomic, strong) YHUserInfo *userInfo; //发布动态用户 29 | @property (nonatomic, assign) DynType type; //动态类型 30 | @property (nonatomic, copy) NSString *publishTime;//发布时间 31 | @property (nonatomic, copy) NSString *msgContent; //动态文本内容 32 | @property (nonatomic, assign) int commentCount; //评论数 33 | @property (nonatomic, assign) int likeCount; //点赞数 34 | @property (nonatomic, assign) BOOL isLike; //是否喜欢 35 | @property (nonatomic, assign) VisibleType visible; //可见性 36 | @property (nonatomic, strong) NSArray *originalPicUrls; //原图像Url 37 | @property (nonatomic, strong) NSArray *thumbnailPicUrls;//缩略图Url 38 | @property (nonatomic, strong) YHWorkGroup *forwardModel;//上一条动态 39 | 40 | @property (nonatomic, assign) BOOL isRepost;//转发 41 | @property (nonatomic, assign) BOOL isOpening; 42 | @property (nonatomic, assign, readonly) BOOL shouldShowMoreButton; 43 | @property (nonatomic, assign) BOOL showDeleteButton; 44 | @property (nonatomic, assign) BOOL hiddenBotLine;//隐藏底部高度15的分隔线 45 | 46 | @end 47 | 48 | -------------------------------------------------------------------------------- /HKPTimeLine/Model/YHWorkGroup.m: -------------------------------------------------------------------------------- 1 | // 2 | // YHWorkGroup.m 3 | // github: https://github.com/samuelandkevin 4 | // CSDN: http://blog.csdn.net/samuelandkevin 5 | // Created by samuelandkevin on 16/5/5. 6 | // Copyright © 2016年 HKP. All rights reserved. 7 | // 8 | 9 | #import "YHWorkGroup.h" 10 | #import 11 | 12 | 13 | extern const CGFloat contentLabelFontSize; 14 | extern CGFloat maxContentLabelHeight; 15 | extern CGFloat maxContentRepostLabelHeight; 16 | extern const CGFloat kMarginContentLeft; 17 | extern const CGFloat kMarginContentRight; 18 | 19 | @implementation YHWorkGroup 20 | { 21 | CGFloat _lastContentWidth; 22 | } 23 | 24 | 25 | 26 | @synthesize msgContent = _msgContent; 27 | 28 | - (void)setMsgContent:(NSString *)msgContent 29 | { 30 | _msgContent = msgContent; 31 | } 32 | 33 | - (NSString *)msgContent 34 | { 35 | CGFloat contentW = SCREEN_WIDTH - kMarginContentLeft - kMarginContentRight ; 36 | if (contentW != _lastContentWidth) { 37 | _lastContentWidth = contentW; 38 | CGRect textRect = [_msgContent boundingRectWithSize:CGSizeMake(contentW, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:contentLabelFontSize]} context:nil]; 39 | if (!_isRepost) 40 | { 41 | 42 | if (textRect.size.height > maxContentLabelHeight+contentLabelFontSize) { 43 | _shouldShowMoreButton = YES; 44 | } else { 45 | _shouldShowMoreButton = NO; 46 | } 47 | } 48 | else{ 49 | 50 | if (textRect.size.height > maxContentRepostLabelHeight+contentLabelFontSize) 51 | { 52 | _shouldShowMoreButton = YES; 53 | } else { 54 | _shouldShowMoreButton = NO; 55 | } 56 | } 57 | 58 | } 59 | 60 | return _msgContent; 61 | } 62 | 63 | - (void)setIsOpening:(BOOL)isOpening 64 | { 65 | if (!_shouldShowMoreButton) { 66 | _isOpening = NO; 67 | } else { 68 | _isOpening = isOpening; 69 | } 70 | } 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /HKPTimeLine/Others/ThirdParty/HYBMasonryAutoCellHeight/UITableView+HYBCacheHeight.h: -------------------------------------------------------------------------------- 1 | // 2 | // UITableView+HYBCacheHeight.h 3 | // CellAutoHeightDemo 4 | // 5 | // Created by huangyibiao on 16/1/22. 6 | // Copyright © 2016年 huangyibiao. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | * 基于Masonry自动布局实现的自动计算cell的行高扩展 13 | * 14 | * @author huangyibiao 15 | * @email huangyibiao520@163.com 16 | * @github https://github.com/CoderJackyHuang 17 | * @blog http://www.henishuo.com/masonry-cell-height-auto-calculate/ 18 | * 19 | * @note Make friends with me: 20 | * QQ:(632840804) 21 | * Please tell me your real name when you send message to me.3Q. 22 | */ 23 | @interface UITableView (HYBCacheHeight) 24 | 25 | /** 26 | * @author 黄仪标, 16-01-22 20:01:09 27 | * 28 | * 用于缓存cell的行高 29 | */ 30 | @property (nonatomic, strong, readonly) NSMutableDictionary *hyb_cacheCellHeightDict; 31 | 32 | /** 33 | * @author 黄仪标, 16-03-01 21:03:19 34 | * 35 | * 用于获取或者添加计算行高的cell,因为理论上只有一个cell用来计算行高,以降低消耗 36 | */ 37 | @property (nonatomic, strong, readonly) NSMutableDictionary *hyb_reuseCells; 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /HKPTimeLine/Others/ThirdParty/HYBMasonryAutoCellHeight/UITableView+HYBCacheHeight.m: -------------------------------------------------------------------------------- 1 | // 2 | // UITableView+HYBCacheHeight.m 3 | // CellAutoHeightDemo 4 | // 5 | // Created by huangyibiao on 16/1/22. 6 | // Copyright © 2016年 huangyibiao. All rights reserved. 7 | // 8 | 9 | #import "UITableView+HYBCacheHeight.h" 10 | #import 11 | 12 | static const void *__hyb_tableview_cacheCellHeightKey = "__hyb_tableview_cacheCellHeightKey"; 13 | static const void *__hyb_tableview_reuse_cells_key = "__hyb_tableview_reuse_cells_key"; 14 | 15 | @implementation UITableView (HYBCacheHeight) 16 | 17 | - (NSMutableDictionary *)hyb_cacheCellHeightDict { 18 | NSMutableDictionary *dict = objc_getAssociatedObject(self, __hyb_tableview_cacheCellHeightKey); 19 | 20 | if (dict == nil) { 21 | dict = [[NSMutableDictionary alloc] init]; 22 | 23 | objc_setAssociatedObject(self, 24 | __hyb_tableview_cacheCellHeightKey, 25 | dict, 26 | OBJC_ASSOCIATION_RETAIN_NONATOMIC); 27 | } 28 | 29 | return dict; 30 | } 31 | 32 | - (NSMutableDictionary *)hyb_reuseCells { 33 | NSMutableDictionary *cells = objc_getAssociatedObject(self, __hyb_tableview_reuse_cells_key); 34 | 35 | if (cells == nil) { 36 | cells = [[NSMutableDictionary alloc] init]; 37 | 38 | objc_setAssociatedObject(self, 39 | __hyb_tableview_reuse_cells_key, 40 | cells, 41 | OBJC_ASSOCIATION_RETAIN); 42 | } 43 | 44 | return cells; 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /HKPTimeLine/Others/ThirdParty/HYBMasonryAutoCellHeight/UITableViewCell+HYBMasonryAutoCellHeight.h: -------------------------------------------------------------------------------- 1 | // 2 | // UITableViewCell+HYBMasonryAutoCellHeight.h 3 | // CellAutoHeightDemo 4 | // 5 | // Created by huangyibiao on 15/9/1. 6 | // Copyright © 2015年 huangyibiao. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "UITableView+HYBCacheHeight.h" 11 | 12 | /** 13 | * 获取高度前会回调,需要在此BLOCK中配置数据,才能正确地获取高度 14 | */ 15 | typedef void(^HYBCellBlock)(UITableViewCell *sourceCell); 16 | 17 | typedef NSDictionary *(^HYBCacheHeight)(); 18 | 19 | /** 20 | * @author 黄仪标, 16-01-22 21:01:09 21 | * 22 | * 唯一键,通常是数据模型的id,保证唯一 23 | */ 24 | FOUNDATION_EXTERN NSString *const kHYBCacheUniqueKey; 25 | 26 | /** 27 | * @author 黄仪标, 16-01-22 21:01:57 28 | * 29 | * 对于同一个model,如果有不同状态,而且不同状态下高度不一样,那么也需要指定 30 | */ 31 | FOUNDATION_EXTERN NSString *const kHYBCacheStateKey; 32 | 33 | /** 34 | * @author 黄仪标, 16-01-22 21:01:47 35 | * 36 | * 用于指定更新某种状态的缓存,比如当评论时,增加了一条评论,此时该状态的高度若已经缓存过,则需要指定来更新缓存 37 | */ 38 | FOUNDATION_EXTERN NSString *const kHYBRecalculateForStateKey; 39 | 40 | /** 41 | * 基于Masonry自动布局实现的自动计算cell的行高扩展 42 | * 43 | * @author huangyibiao 44 | * @email huangyibiao520@163.com 45 | * @github https://github.com/CoderJackyHuang 46 | * @blog http://www.henishuo.com/masonry-cell-height-auto-calculate/ 47 | * 48 | * @note Make friends with me: 49 | * QQ:(632840804) 50 | * Please tell me your real name when you send message to me.3Q. 51 | */ 52 | @interface UITableViewCell (HYBMasonryAutoCellHeight) 53 | 54 | 55 | /************************************************************************ 56 | * 57 | * @note UI布局必须放在UITableViewCell的初始化方法中: 58 | * 59 | * - initWithStyle:reuseIdentifier: 60 | * 61 | * 且必须指定hyb_lastViewInCell才能生效 62 | ************************************************************************/ 63 | 64 | /** 65 | * 必传设置的属性,也就是在cell中的contentView内最后一个视图,用于计算行高 66 | * 例如,创建了一个按钮button作为在cell中放到最后一个位置,则设置为:self.hyb_lastVieInCell = button; 67 | * 即可。 68 | * 默认为nil,如果在计算时,值为nil,会crash (弃用) 69 | */ 70 | @property (nonatomic, strong) UIView *hyb_lastViewInCell; 71 | 72 | /** 73 | * 当距离分割线的视图不确定时,可以将可能的所有视图放在这个数组里面,优先级低于上面的属性,也就是当`hyb_lastViewInCell`有值时,`hyb_lastViewsInCell`不起作用。(弃用) 74 | */ 75 | @property (nonatomic, strong) NSArray *hyb_lastViewsInCell; 76 | 77 | /** 78 | * 可选设置的属性,默认为0,表示指定的hyb_lastViewInCell到cell的bottom的距离 79 | * 默认为0.0 80 | */ 81 | @property (nonatomic, assign) CGFloat hyb_bottomOffsetToCell; 82 | 83 | /** 84 | * 通过此方法来计算行高,需要在config中调用配置数据的API 85 | * 86 | * @param tableView 必传,为哪个tableView缓存行高 87 | * @param config 必须要实现,且需要调用配置数据的API 88 | * 89 | * @return 计算的行高 90 | */ 91 | + (CGFloat)hyb_heightForTableView:(UITableView *)tableView config:(HYBCellBlock)config; 92 | 93 | /** 94 | * @author 黄仪标, 16-01-22 23:01:56 95 | * 96 | * 此API会缓存行高 97 | * 98 | * @param tableView 必传,为哪个tableView缓存行高 99 | * @param config 必须要实现,且需要调用配置数据的API 100 | * @param cache 返回相关key 101 | * 102 | * @return 行高 103 | */ 104 | + (CGFloat)hyb_heightForTableView:(UITableView *)tableView 105 | config:(HYBCellBlock)config 106 | cache:(HYBCacheHeight)cache; 107 | 108 | @end 109 | -------------------------------------------------------------------------------- /HKPTimeLine/Others/ThirdParty/SDPhotoBrowser/SDBrowserImageView.h: -------------------------------------------------------------------------------- 1 | // 2 | // SDBrowserImageView.h 3 | // SDPhotoBrowser 4 | // 5 | // Created by aier on 15-2-6. 6 | // Copyright (c) 2015年 GSD. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "SDWaitingView.h" 11 | 12 | 13 | @interface SDBrowserImageView : UIImageView 14 | 15 | @property (nonatomic, assign) CGFloat progress; 16 | @property (nonatomic, assign, readonly) BOOL isScaled; 17 | @property (nonatomic, assign) BOOL hasLoadedImage; 18 | 19 | - (void)eliminateScale; // 清除缩放 20 | 21 | - (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder; 22 | 23 | - (void)doubleTapToZommWithScale:(CGFloat)scale; 24 | 25 | - (void)clear; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /HKPTimeLine/Others/ThirdParty/SDPhotoBrowser/SDPhotoBrowser.h: -------------------------------------------------------------------------------- 1 | // 2 | // SDPhotoBrowser.h 3 | // photobrowser 4 | // 5 | // Created by aier on 15-2-3. 6 | // Copyright (c) 2015年 aier. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @class SDButton, SDPhotoBrowser; 13 | 14 | @protocol SDPhotoBrowserDelegate 15 | 16 | @required 17 | 18 | - (UIImage *)photoBrowser:(SDPhotoBrowser *)browser placeholderImageForIndex:(NSInteger)index; 19 | 20 | @optional 21 | 22 | - (NSURL *)photoBrowser:(SDPhotoBrowser *)browser highQualityImageURLForIndex:(NSInteger)index; 23 | 24 | @end 25 | 26 | 27 | @interface SDPhotoBrowser : UIView 28 | 29 | @property (nonatomic, weak) UIView *sourceImagesContainerView; 30 | @property (nonatomic, assign) NSInteger currentImageIndex; 31 | @property (nonatomic, assign) NSInteger imageCount; 32 | 33 | @property (nonatomic, weak) id delegate; 34 | 35 | - (void)show; 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /HKPTimeLine/Others/ThirdParty/SDPhotoBrowser/SDPhotoBrowserConfig.h: -------------------------------------------------------------------------------- 1 | // 2 | // SDPhotoBrowserConfig.h 3 | // SDPhotoBrowser 4 | // 5 | // Created by aier on 15-2-9. 6 | // Copyright (c) 2015年 GSD. All rights reserved. 7 | // 8 | 9 | 10 | typedef enum { 11 | SDWaitingViewModeLoopDiagram, // 环形 12 | SDWaitingViewModePieDiagram // 饼型 13 | } SDWaitingViewMode; 14 | 15 | // 图片保存成功提示文字 16 | #define SDPhotoBrowserSaveImageSuccessText @" 保存成功 "; 17 | 18 | // 图片保存失败提示文字 19 | #define SDPhotoBrowserSaveImageFailText @" 保存失败 "; 20 | 21 | // browser背景颜色 22 | #define SDPhotoBrowserBackgrounColor [UIColor colorWithRed:0 green:0 blue:0 alpha:0.95] 23 | 24 | // browser中图片间的margin 25 | #define SDPhotoBrowserImageViewMargin 10 26 | 27 | // browser中显示图片动画时长 28 | #define SDPhotoBrowserShowImageAnimationDuration 0.4f 29 | 30 | // browser中显示图片动画时长 31 | #define SDPhotoBrowserHideImageAnimationDuration 0.4f 32 | 33 | // 图片下载进度指示进度显示样式(SDWaitingViewModeLoopDiagram 环形,SDWaitingViewModePieDiagram 饼型) 34 | #define SDWaitingViewProgressMode SDWaitingViewModeLoopDiagram 35 | 36 | // 图片下载进度指示器背景色 37 | #define SDWaitingViewBackgroundColor [UIColor colorWithRed:0 green:0 blue:0 alpha:0.7] 38 | 39 | // 图片下载进度指示器内部控件间的间距 40 | #define SDWaitingViewItemMargin 10 41 | 42 | 43 | -------------------------------------------------------------------------------- /HKPTimeLine/Others/ThirdParty/SDPhotoBrowser/SDWaitingView.h: -------------------------------------------------------------------------------- 1 | // 2 | // SDWaitingView.h 3 | // SDPhotoBrowser 4 | // 5 | // Created by aier on 15-2-6. 6 | // Copyright (c) 2015年 GSD. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "SDPhotoBrowserConfig.h" 11 | 12 | @interface SDWaitingView : UIView 13 | 14 | @property (nonatomic, assign) CGFloat progress; 15 | @property (nonatomic, assign) int mode; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /HKPTimeLine/Others/ThirdParty/SDPhotoBrowser/SDWaitingView.m: -------------------------------------------------------------------------------- 1 | // 2 | // SDWaitingView.m 3 | // SDPhotoBrowser 4 | // 5 | // Created by aier on 15-2-6. 6 | // Copyright (c) 2015年 GSD. All rights reserved. 7 | // 8 | 9 | #import "SDWaitingView.h" 10 | 11 | //// 图片下载进度指示器背景色 12 | //#define SDWaitingViewBackgroundColor [UIColor colorWithRed:0 green:0 blue:0 alpha:0.7] 13 | // 14 | //// 图片下载进度指示器内部控件间的间距 15 | // 16 | //#define SDWaitingViewItemMargin 10 17 | 18 | 19 | @implementation SDWaitingView 20 | 21 | 22 | - (id)initWithFrame:(CGRect)frame 23 | { 24 | self = [super initWithFrame:frame]; 25 | if (self) { 26 | self.backgroundColor = SDWaitingViewBackgroundColor; 27 | self.layer.cornerRadius = 5; 28 | self.clipsToBounds = YES; 29 | self.mode = SDWaitingViewModeLoopDiagram; 30 | } 31 | return self; 32 | } 33 | 34 | - (void)setProgress:(CGFloat)progress 35 | { 36 | _progress = progress; 37 | [self setNeedsDisplay]; 38 | if (progress >= 1) { 39 | [self removeFromSuperview]; 40 | } 41 | } 42 | 43 | - (void)drawRect:(CGRect)rect 44 | { 45 | CGContextRef ctx = UIGraphicsGetCurrentContext(); 46 | 47 | CGFloat xCenter = rect.size.width * 0.5; 48 | CGFloat yCenter = rect.size.height * 0.5; 49 | [[UIColor whiteColor] set]; 50 | 51 | switch (self.mode) { 52 | case SDWaitingViewModePieDiagram: 53 | { 54 | CGFloat radius = MIN(rect.size.width * 0.5, rect.size.height * 0.5) - SDWaitingViewItemMargin; 55 | 56 | 57 | CGFloat w = radius * 2 + SDWaitingViewItemMargin; 58 | CGFloat h = w; 59 | CGFloat x = (rect.size.width - w) * 0.5; 60 | CGFloat y = (rect.size.height - h) * 0.5; 61 | CGContextAddEllipseInRect(ctx, CGRectMake(x, y, w, h)); 62 | CGContextFillPath(ctx); 63 | 64 | [SDWaitingViewBackgroundColor set]; 65 | CGContextMoveToPoint(ctx, xCenter, yCenter); 66 | CGContextAddLineToPoint(ctx, xCenter, 0); 67 | CGFloat to = - M_PI * 0.5 + self.progress * M_PI * 2 + 0.001; // 初始值 68 | CGContextAddArc(ctx, xCenter, yCenter, radius, - M_PI * 0.5, to, 1); 69 | CGContextClosePath(ctx); 70 | 71 | CGContextFillPath(ctx); 72 | } 73 | break; 74 | 75 | default: 76 | { 77 | CGContextSetLineWidth(ctx, 10); 78 | CGContextSetLineCap(ctx, kCGLineCapRound); 79 | CGFloat to = - M_PI * 0.5 + self.progress * M_PI * 2 + 0.05; // 初始值0.05 80 | CGFloat radius = MIN(rect.size.width, rect.size.height) * 0.5 - SDWaitingViewItemMargin; 81 | CGContextAddArc(ctx, xCenter, yCenter, radius, - M_PI * 0.5, to, 0); 82 | CGContextStrokePath(ctx); 83 | } 84 | break; 85 | } 86 | } 87 | 88 | @end 89 | -------------------------------------------------------------------------------- /HKPTimeLine/Tools/HKPCommon.h: -------------------------------------------------------------------------------- 1 | // 2 | // HKPCommon.h 3 | // HKPTimeLine 仿赤兔、微博动态 4 | // CSDN: http://blog.csdn.net/samuelandkevin 5 | // Created by samuelandkevin on 16/9/20. 6 | // Copyright © 2016年 HKP. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface HKPCommon : NSObject 13 | 14 | 15 | 16 | @end 17 | 18 | #ifdef __cplusplus 19 | 20 | extern "C" { 21 | #endif 22 | 23 | 24 | NSString *showDateString(NSString *dateString); 25 | NSDate *dateFromString(NSString *dateString); 26 | NSString *getNormalShowDateString(NSDate *date); 27 | 28 | NSString *toStringByformat(NSString *dateFormat,NSDate *date); 29 | 30 | 31 | #ifdef __cplusplus 32 | }; // extern 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /HKPTimeLine/Tools/HKPCommon.m: -------------------------------------------------------------------------------- 1 | // 2 | // HKPCommon.m 3 | // HKPTimeLine 仿赤兔、微博动态 4 | // CSDN: http://blog.csdn.net/samuelandkevin 5 | // Created by samuelandkevin on 16/9/20. 6 | // Copyright © 2016年 HKP. All rights reserved. 7 | // 8 | 9 | #import "HKPCommon.h" 10 | #import "NSDate+LYXCategory.h" 11 | 12 | 13 | @implementation HKPCommon 14 | 15 | 16 | @end 17 | 18 | 19 | NSString *showDateString(NSString *dateString){ 20 | if (!dateString) { 21 | return @""; 22 | } 23 | NSDate *date = dateFromString(dateString); 24 | return getNormalShowDateString(date); 25 | } 26 | 27 | /** 28 | * 格式化日期 29 | * @param dateFormat 日期格式,etg:@"yyyy-MM-dd HH:mm:ss" 30 | 31 | */ 32 | NSString *toStringByformat(NSString *dateFormat,NSDate *date) 33 | { 34 | NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; 35 | [formatter setDateFormat:dateFormat]; 36 | NSString *returnString = [formatter stringFromDate:date]; 37 | return returnString; 38 | } 39 | 40 | NSDate *dateFromString(NSString *dateString){ 41 | NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; 42 | [dateFormatter setDateFormat: @"yyyy-MM-dd HH:mm:ss"]; 43 | NSDate *destDate= [dateFormatter dateFromString:dateString]; 44 | return destDate; 45 | 46 | } 47 | 48 | NSString *getNormalShowDateString(NSDate *date) 49 | { 50 | NSDate *nowDate = [NSDate date]; 51 | NSString *dateStr = toStringByformat(@"yyyy-MM-dd", date); 52 | NSString *curDateStr = toStringByformat(@"yyyy-MM-dd", nowDate); 53 | 54 | if ([dateStr isEqualToString:curDateStr]) 55 | { 56 | //当天信息 57 | NSInteger hour = [toStringByformat(@"HH", date) integerValue]; 58 | NSString *strMonment = @""; 59 | if(hour < 6){ 60 | strMonment = @"凌晨"; 61 | } 62 | else if (hour < 12){ 63 | strMonment = @"上午"; 64 | } 65 | else if (hour < 18){ 66 | strMonment = @"下午"; 67 | } 68 | else{ 69 | strMonment = @"晚上"; 70 | } 71 | return toStringByformat([NSString stringWithFormat:@"%@ HH:mm",strMonment],date); 72 | } 73 | else 74 | { 75 | NSDate *yesterday = [NSDate dateWithTimeIntervalSince1970:[nowDate timeIntervalSince1970]-(24*60*60)]; 76 | NSDate *dayBeforeYesterday = [NSDate dateWithTimeIntervalSince1970:[nowDate timeIntervalSince1970] - 48*60*60]; 77 | 78 | NSString *yesterdatStr = [yesterday toStringByformat:@"yyyy-MM-dd"]; 79 | NSString *dayBeYesdatStr = [dayBeforeYesterday toStringByformat:@"yyyy-MM-dd"]; 80 | if ([dateStr isEqualToString:yesterdatStr])//昨天 81 | { 82 | return toStringByformat(@"昨天 HH:mm",date); 83 | } 84 | else if ([dateStr isEqualToString:dayBeYesdatStr]) 85 | { 86 | return toStringByformat(@"前天 HH:mm", date); 87 | } 88 | else 89 | { 90 | NSString *dateStr = [date toStringByformat:@"yyyy" ]; 91 | NSString *curDateStr = [nowDate toStringByformat:@"yyyy"]; 92 | if ([dateStr isEqualToString:curDateStr])//当年 93 | { 94 | NSString *toString = toStringByformat(@"M月d日",date); 95 | return toString; 96 | 97 | } 98 | else//超过一年 99 | { 100 | return toStringByformat(@"yyyy年MM月dd日",date); 101 | } 102 | } 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /HKPTimeLine/Tools/NSDate+LYXCategory.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSDate+LYXCategory.h 3 | // OA 4 | // CSDN: http://blog.csdn.net/samuelandkevin 5 | // Created by liuyx on 15/7/23. 6 | // Copyright (c) 2015年 com.tgnet. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSDate (LYXCategory) 12 | 13 | /** 14 | * 格式化日期 15 | * 16 | * @param dateFormat 日期格式,etg:@"yyyy-MM-dd HH:mm:ss" 17 | * 18 | * @return 字符串 19 | */ 20 | - (NSString *)toStringByformat:(NSString *)dateFormat; 21 | 22 | //获取固定的时间格式的当前时间 @"yyyy-MM-dd'T'HH:mm:ss" 23 | - (NSString *)getNowDate; 24 | 25 | //根据字符串格式转换字符串为日期 26 | +(NSDate *)dateByStringFormat:(NSString *)format dateString:(NSString *)dateString; 27 | 28 | //根据年月日返回日期 29 | +(NSDate *)dateByYear:(NSInteger)year month:(NSInteger)month date:(NSInteger)date hour:(NSInteger)hour minute:(NSInteger)minute second:(NSInteger)second; 30 | 31 | //返回指定时间和当前时间相比后的时间描述 32 | +(NSString *) compareCurrentTime:(NSDate*) compareDate; 33 | 34 | //获取NSDate的年份部分 35 | +(NSInteger)getFullYear:(NSDate *)date; 36 | //获取NSDate的月份部分 37 | +(NSInteger)getMonth:(NSDate *)date; 38 | //获取NSDate的日期部分 39 | +(NSInteger)getDate:(NSDate *)date; 40 | //获取NSDate的小时部分 41 | +(NSInteger)getHour:(NSDate *)date; 42 | //获取NSDate的分钟部分 43 | +(NSInteger)getMinute:(NSDate *)date; 44 | //获取NSDate的秒部分 45 | +(NSInteger)getSecond:(NSDate *)date; 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /HKPTimeLine/Tools/YHUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // HHUtils.h 3 | // HipHopBattle 4 | // CSDN: http://blog.csdn.net/samuelandkevin 5 | // Created by samuelandkevin on 14-6-26. 6 | // Copyright (c) 2014年 Dope Beats Co.,Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #include 11 | #include 12 | 13 | typedef void(^HHAlertCallback)(BOOL resultYes ); 14 | 15 | @interface YHUtils : NSObject 16 | 17 | /** 18 | * 获取文件MD5值 19 | */ 20 | + (NSString *)getFileMD5WithPath:(NSString*)path; 21 | + (NSString *)getFileMD5WithData:(NSData *)data; 22 | + (UIView *)rotate360DegreeWithView:(UIView *)imageView; 23 | 24 | #pragma mark - 弹窗页面 25 | + (void)showSingleButtonAlertWithTitle:(NSString *)title message:(NSString *)msg okTitle:(NSString *)okString dismiss:(HHAlertCallback)callback; 26 | + (void)showAlertWithTitle:(NSString *)title message:(NSString *)msg dismiss:(HHAlertCallback)callback; 27 | + (void)showAlertWithTitle:(NSString *)title message:(NSString *)msg okTitle:(NSString *)okString cancelTitle:(NSString *)cancelString inViewController:(UIViewController *)vc dismiss:(HHAlertCallback)callback; 28 | + (void)showAlertWithTitle:(NSString *)title message:(NSString *)msg okTitle:(NSString *)okString cancelTitle:(NSString *)cancelString dismiss:(HHAlertCallback)callback; 29 | + (NSDictionary *)parseUrlParameters:(NSURL *)url; 30 | 31 | + (void)postTip:(NSString *)tipsTitle RGB16:(int)hexColor complete:(void(^)())completeCallback; 32 | + (void)postTip:(NSString *)tipsTitle RGB16:(int)rgbValue keepTime:(NSTimeInterval)interval complete:(void(^)())completeCallback; 33 | + (void)postTip:(NSString *)tipsTitle RGBcolorRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue keepTime:(NSTimeInterval)time complete:(void(^)())completeCallback; 34 | + (void)dismissAlertWithClickedButtonIndex:(NSInteger)buttonIndex 35 | animated:(BOOL)animated; 36 | 37 | + (long long)freeDiskSpaceInBytes; 38 | 39 | /** 40 | * MD5加密字符串 41 | * 42 | * @param input 字符串 43 | * 44 | * @return 加密后的字符串 45 | */ 46 | + (NSString *)md5HexDigest:(NSString*)input; 47 | 48 | /** 49 | * 获取iPhone机型 50 | * 51 | * @return 52 | */ 53 | + (NSString*)phoneType; 54 | 55 | /** 56 | * 获取iPhone系统 57 | * 58 | * @return eg:iOS8.1 59 | */ 60 | + (NSString *)phoneSystem; 61 | 62 | /** 63 | * appStore上的版本号 64 | * 65 | * @return 66 | */ 67 | + (NSString *)appStoreNumber; 68 | /** 69 | * app开发环境版本号 70 | * 71 | * @return 72 | */ 73 | + (NSString *)appBulidNumber; 74 | 75 | + (BOOL)compareWithBeginDateString:(NSString *)beginDateString andEndDateString:(NSString *)endDateString; 76 | 77 | + (NSDate *)dateFromString:(NSString *)dateString; 78 | + (NSString *)getNormalShowDateString:(NSString *)dateString; 79 | @end 80 | 81 | #ifdef __cplusplus 82 | extern "C" { 83 | #endif 84 | 85 | 86 | /** 87 | 返回文件长度,以字节为单位 88 | */ 89 | int getFileSize(NSString *path); 90 | 91 | NSString * getDeviceVersion(); 92 | NSString * platformString (); 93 | 94 | /** 95 | 比较不同数组中不同的ID(与上一次的缓存对比) 96 | @return 返回与是一次是否有变化 97 | */ 98 | BOOL compareStringIdsDiff( NSArray *allphones, NSString *phonesCacheFilePath, NSArray **addlist, NSArray **removelist ); 99 | 100 | #ifdef __cplusplus 101 | } 102 | #endif 103 | -------------------------------------------------------------------------------- /HKPTimeLine/View/CellForWorkGroup.h: -------------------------------------------------------------------------------- 1 | // 2 | // CellForQAList.h 3 | // github: https://github.com/samuelandkevin 4 | // 5 | // Created by samuelandkevin on 16/8/29. 6 | // Copyright © 2016年 HKP. All rights reserved. 7 | // 原创视图 8 | 9 | #import 10 | #import "YHWorkGroup.h" 11 | #import "HKPBotView.h" 12 | 13 | @class CellForWorkGroup; 14 | @protocol CellForWorkGroupDelegate 15 | 16 | - (void)onAvatarInCell:(CellForWorkGroup *)cell; 17 | - (void)onMoreInCell:(CellForWorkGroup *)cell; 18 | - (void)onCommentInCell:(CellForWorkGroup *)cell; 19 | - (void)onLikeInCell:(CellForWorkGroup *)cell; 20 | - (void)onShareInCell:(CellForWorkGroup *)cell; 21 | 22 | @optional 23 | - (void)onDeleteInCell:(CellForWorkGroup *)cell; 24 | 25 | @end 26 | 27 | @interface CellForWorkGroup : UITableViewCell 28 | 29 | @property (nonatomic,strong) YHWorkGroup *model; 30 | @property (nonatomic) NSIndexPath *indexPath; 31 | @property (nonatomic, weak) id delegate; 32 | @property (nonatomic,strong)HKPBotView *viewBottom; 33 | @end 34 | -------------------------------------------------------------------------------- /HKPTimeLine/View/CellForWorkGroupRepost.h: -------------------------------------------------------------------------------- 1 | // 2 | // CellForWorkGroupRepost.h 3 | // HKPTimeLine 仿赤兔、微博动态 4 | // CSDN: http://blog.csdn.net/samuelandkevin 5 | // Created by samuelandkevin on 16/9/20. 6 | // Copyright © 2016年 HKP. All rights reserved. 7 | // 转发视图 8 | 9 | #import 10 | #import "YHWorkGroup.h" 11 | #import "HKPBotView.h" 12 | 13 | @class CellForWorkGroupRepost; 14 | @protocol CellForWorkGroupRepostDelegate 15 | 16 | - (void)onAvatarInRepostCell:(CellForWorkGroupRepost *)cell; 17 | - (void)onTapRepostViewInCell:(CellForWorkGroupRepost *)cell; 18 | - (void)onCommentInRepostCell:(CellForWorkGroupRepost *)cell; 19 | - (void)onLikeInRepostCell:(CellForWorkGroupRepost *)cell; 20 | - (void)onShareInRepostCell:(CellForWorkGroupRepost *)cell; 21 | - (void)onDeleteInRepostCell:(CellForWorkGroupRepost *)cell; 22 | - (void)onMoreInRespostCell:(CellForWorkGroupRepost *)cell; 23 | @end 24 | 25 | @interface CellForWorkGroupRepost : UITableViewCell 26 | 27 | @property (nonatomic) NSIndexPath *indexPath; 28 | @property (weak,nonatomic) iddelegate; 29 | @property (nonatomic,strong) YHWorkGroup *model; 30 | @property (nonatomic,strong) HKPBotView *viewBottom; 31 | @end 32 | -------------------------------------------------------------------------------- /HKPTimeLine/View/HKPBotView.h: -------------------------------------------------------------------------------- 1 | // 2 | // HKPBotView.h 3 | // HKPTimeLine 仿赤兔、微博动态 4 | // CSDN: http://blog.csdn.net/samuelandkevin 5 | // Created by samuelandkevin on 16/9/20. 6 | // Copyright © 2016年 HKP. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "YHWorkGroupButton.h" 11 | @class HKPBotView; 12 | 13 | @protocol HKPBotViewDelegate 14 | 15 | - (void)onComment; 16 | - (void)onLike; 17 | - (void)onShare; 18 | 19 | @end 20 | 21 | @interface HKPBotView : UIView 22 | 23 | @property (nonatomic,strong)YHWorkGroupButton *btnComment; 24 | @property (nonatomic,strong)YHWorkGroupButton *btnLike; 25 | @property (nonatomic,strong)YHWorkGroupButton *btnShare; 26 | @property (nonatomic,weak)iddelegate; 27 | @end 28 | -------------------------------------------------------------------------------- /HKPTimeLine/View/YHActionSheet.h: -------------------------------------------------------------------------------- 1 | // 2 | // YHActionSheet.h 3 | // github: https://github.com/samuelandkevin 4 | // 5 | // Created by samuelandkevin on 16/4/28. 6 | // Copyright © 2016年 HKP. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | * 操作回调,如果用户点击空白处,不选中任何button,则 clickedIndex = NSNotFound, isCancel = YES 13 | * clickedIndex 从0开始, cancelButton是最后一个, titleButton不能点击 14 | */ 15 | typedef void(^YHSheetCompletionHanlde)(NSInteger clickedIndex, BOOL isCancel); 16 | 17 | @interface YHActionSheet : UIView 18 | @property (nullable, nonatomic, copy) NSString *cancelTitle;// 19 | @property (nullable, nonatomic, copy) NSArray *otherTitles; 20 | @property (copy,nonatomic,nonnull)YHSheetCompletionHanlde handle; 21 | 22 | - (nonnull instancetype)initWithCancelTitle:(nonnull NSString*)cancelTitle otherTitles:(nonnull NSArray *)otherTitles; 23 | - (void)show; 24 | - (void)dismissForCompletionHandle:(nullable YHSheetCompletionHanlde)handle; 25 | 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /HKPTimeLine/View/YHRefreshTableView.h: -------------------------------------------------------------------------------- 1 | // 2 | // YHSuperTableView.h 3 | // github: https://github.com/samuelandkevin 4 | // 5 | // Created by samuelandkevin on 16/5/31. 6 | // Copyright © 2016年 HKP. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //刷新类型 12 | typedef NS_ENUM(int,YHRefreshType){ 13 | YHRefreshType_LoadNew = 1, //下拉刷新 14 | YHRefreshType_LoadMore //上拉加载 15 | }; 16 | 17 | @class YHRefreshTableView; 18 | 19 | @protocol YHRefreshTableViewDelegate 20 | 21 | - (void)refreshTableViewLoadNew:(YHRefreshTableView*)view; 22 | - (void)refreshTableViewLoadmore:(YHRefreshTableView*)view; 23 | 24 | @end 25 | 26 | 27 | @interface YHRefreshTableView : UITableView 28 | 29 | @property (nonatomic,assign ) IBInspectable BOOL enableLoadNew; 30 | @property (nonatomic, assign) IBInspectable BOOL enableLoadMore; 31 | @property (nonatomic, assign) BOOL noData; //无数据 32 | @property (nonatomic, assign) BOOL noMoreData;//上拉加载无更多数据 33 | 34 | //开始加载 35 | - (void)loadBegin:(YHRefreshType)type; 36 | //结束加载 37 | - (void)loadFinish:(YHRefreshType)type; 38 | 39 | //无数据 40 | - (void)setNoData:(BOOL)noData withText:(NSString *)tips; 41 | 42 | - (void)setNoDataInAllSections:(BOOL)showNoDataInAllSections noData:(BOOL)noData withText:(NSString *)tips; 43 | /** 44 | 显示Loading 45 | 与setLoadFailed互斥,不会同时显示 46 | 且当table中有内容时也不显示 47 | */ 48 | - (void)showLoadingView:(BOOL)isShow; 49 | 50 | /** 51 | 显示加载失败 52 | 与showLoadingView互斥,不会同时显示 53 | */ 54 | - (void)setLoadFailed:(BOOL)isFailed; 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /HKPTimeLine/View/YHSharePresentView.h: -------------------------------------------------------------------------------- 1 | // 2 | // YHSharePresentView.h 3 | // PikeWay 4 | // 5 | // Created by YHIOS002 on 16/10/27. 6 | // Copyright © 2016年 YHSoft. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef NS_ENUM(NSInteger,ShareType){ 12 | ShareType_WorkGroup,//工作圈 13 | ShareType_Card,//名片 14 | ShareType_News//咨讯 15 | }; 16 | 17 | typedef void(^DismissBlock)(BOOL isCanceled,NSInteger index); 18 | @interface YHSharePresentView : UIView 19 | 20 | //config arguments 21 | @property (nonatomic,copy) NSArray *iconNameArray; 22 | @property (nonatomic,copy) NSArray *itemNameArray; 23 | @property (nonatomic,assign) CGFloat fontSize; //字体大小 24 | @property (nonatomic,assign) CGFloat cancelBtnH;//取消按钮高度 25 | @property (nonatomic,strong) UIColor *textColor;//字体颜色 26 | @property (nonatomic,strong) UIColor *maskColor;//遮罩颜色 27 | @property (nonatomic,strong) UIColor *popViewBGColor;//弹出视图背景颜色 28 | @property (nonatomic,strong) UIColor *cancelBtnColor;//取消按钮颜色 29 | 30 | @property (nonatomic,assign)ShareType shareType;//分享的类型。设置此属性就不用再设置 iconNameArray itemNameArray (可选属性) 31 | 32 | - (void)show; 33 | - (void)hide; 34 | 35 | - (void)dismissHandler:(DismissBlock)handler; 36 | @end 37 | -------------------------------------------------------------------------------- /HKPTimeLine/View/YHWorkGroupButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // YHWorkGroupButton.h 3 | // HKP 4 | // 5 | // Created by kun on 16/5/14. 6 | // Copyright © 2016年 HKP. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface YHWorkGroupButton : UIButton 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /HKPTimeLine/View/YHWorkGroupButton.m: -------------------------------------------------------------------------------- 1 | // 2 | // YHWorkGroupButton.m 3 | // HKP 4 | // CSDN: http://blog.csdn.net/samuelandkevin 5 | // Created by kun on 16/5/14. 6 | // Copyright © 2016年 HKP. All rights reserved. 7 | // 8 | 9 | #import "YHWorkGroupButton.h" 10 | 11 | static CGFloat const imgW = 13; 12 | static CGFloat const imgH = 13; 13 | static CGFloat const margin = 5; //图片与文字的间距 14 | static CGFloat const labelH = 13; 15 | 16 | @interface YHWorkGroupButton() 17 | 18 | 19 | @end 20 | 21 | @implementation YHWorkGroupButton 22 | 23 | /* 24 | // Only override drawRect: if you perform custom drawing. 25 | // An empty implementation adversely affects performance during animation. 26 | - (void)drawRect:(CGRect)rect { 27 | // Drawing code 28 | } 29 | */ 30 | 31 | - (instancetype)initWithFrame:(CGRect)frame 32 | { 33 | self = [super initWithFrame:frame]; 34 | if (self) 35 | { 36 | CGFloat font = 12.0f; 37 | 38 | self.imageView.contentMode = UIViewContentModeScaleAspectFit; 39 | self.titleLabel.textAlignment = NSTextAlignmentLeft; 40 | 41 | [self setTitleColor:RGBCOLOR(151, 161, 173) forState:UIControlStateNormal]; 42 | [self setTitleColor:RGBCOLOR(0, 191, 143) forState:UIControlStateSelected]; 43 | 44 | [self.titleLabel setTintColor:[UIColor colorWithRed:122/255.0 green:122/255.0 blue:122/255.0 alpha:1.0]]; 45 | [self.titleLabel setFont:[UIFont boldSystemFontOfSize:font]]; 46 | self.titleLabel.lineBreakMode = NSLineBreakByTruncatingTail; 47 | } 48 | return self; 49 | } 50 | 51 | //1.重写方法,改变图片的位置,在titleRect..方法后执行 52 | - (CGRect)imageRectForContentRect:(CGRect)contentRect 53 | { 54 | 55 | CGFloat imageX = self.bounds.size.width*0.4; 56 | CGFloat imageY = self.center.y - imgH/2; 57 | CGFloat width = imgW; 58 | CGFloat height = imgH; 59 | return CGRectMake(imageX, imageY, width, height); 60 | 61 | } 62 | 63 | //2.改变title文字的位置,构造title的矩形即可 64 | - (CGRect)titleRectForContentRect:(CGRect)contentRect 65 | { 66 | 67 | CGFloat titleX = CGRectGetMaxX(self.imageView.frame) + margin; 68 | CGFloat titleY = self.center.y - labelH/2; 69 | CGFloat width = self.frame.size.width - titleX; 70 | CGFloat height = labelH; 71 | return CGRectMake(titleX, titleY, width, height); 72 | 73 | } 74 | 75 | - (void)setHighlighted:(BOOL)highlighted{ 76 | 77 | } 78 | 79 | 80 | 81 | @end 82 | -------------------------------------------------------------------------------- /HKPTimeLine/View/YHWorkGroupPhotoContainer.h: -------------------------------------------------------------------------------- 1 | // 2 | // YHWorkGroupPhotoContainer.h 3 | // HKPTimeLine 仿赤兔、微博动态 4 | // CSDN: http://blog.csdn.net/samuelandkevin 5 | // Created by samuelandkevin on 16/9/20. 6 | // Copyright © 2016年 HKP. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface YHWorkGroupPhotoContainer : UIView 12 | 13 | @property (nonatomic, strong) NSArray *picUrlArray;//缩略图URL 14 | @property (nonatomic, strong) NSArray *picOriArray;//原图url 15 | 16 | - (instancetype)initWithWidth:(CGFloat)width; 17 | 18 | - (CGFloat)setupPicUrlArray:(NSArray *)picUrlArray; 19 | @end 20 | -------------------------------------------------------------------------------- /HKPTimeLine/ViewController/YHTimeLineListController.h: -------------------------------------------------------------------------------- 1 | // 2 | // YHQAListController.h 3 | // github: https://github.com/samuelandkevin 4 | // 5 | // Created by samuelandkevin on 16/8/29. 6 | // Copyright © 2016年 HKP. All rights reserved. 7 | // 问答列表 8 | 9 | #import 10 | 11 | 12 | @interface YHTimeLineListController : UIViewController 13 | @property (nonatomic,assign) NSInteger curPageIndex; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /HKPTimeLine/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // HKPTimeLine 仿赤兔、微博动态 4 | // CSDN: http://blog.csdn.net/samuelandkevin 5 | // Created by samuelandkevin on 16/9/19. 6 | // Copyright © 2016年 HKP. 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 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | pod 'Masonry', '~> 1.0.0' 2 | pod 'SDWebImage', '~>3.7' 3 | pod 'MJRefresh', '~> 3.1.0' -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Masonry (1.0.2) 3 | - MJRefresh (3.1.12) 4 | - SDWebImage (3.8.2): 5 | - SDWebImage/Core (= 3.8.2) 6 | - SDWebImage/Core (3.8.2) 7 | 8 | DEPENDENCIES: 9 | - Masonry (~> 1.0.0) 10 | - MJRefresh (~> 3.1.0) 11 | - SDWebImage (~> 3.7) 12 | 13 | SPEC CHECKSUMS: 14 | Masonry: 7c429b56da9d4ee0bbb3ed77a5ea710d6a5df39e 15 | MJRefresh: b96cdb21c4aa75a7b07654311ab2f315c497e806 16 | SDWebImage: '098e97e6176540799c27e804c96653ee0833d13c' 17 | 18 | COCOAPODS: 0.39.0 19 | -------------------------------------------------------------------------------- /Pods/Headers/Private/MJRefresh/MJRefresh.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/MJRefresh.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJRefresh/MJRefreshAutoFooter.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Base/MJRefreshAutoFooter.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJRefresh/MJRefreshAutoGifFooter.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Custom/Footer/Auto/MJRefreshAutoGifFooter.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJRefresh/MJRefreshAutoNormalFooter.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Custom/Footer/Auto/MJRefreshAutoNormalFooter.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJRefresh/MJRefreshAutoStateFooter.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Custom/Footer/Auto/MJRefreshAutoStateFooter.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJRefresh/MJRefreshBackFooter.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Base/MJRefreshBackFooter.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJRefresh/MJRefreshBackGifFooter.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Custom/Footer/Back/MJRefreshBackGifFooter.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJRefresh/MJRefreshBackNormalFooter.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Custom/Footer/Back/MJRefreshBackNormalFooter.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJRefresh/MJRefreshBackStateFooter.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Custom/Footer/Back/MJRefreshBackStateFooter.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJRefresh/MJRefreshComponent.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Base/MJRefreshComponent.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJRefresh/MJRefreshConst.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/MJRefreshConst.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJRefresh/MJRefreshFooter.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Base/MJRefreshFooter.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJRefresh/MJRefreshGifHeader.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Custom/Header/MJRefreshGifHeader.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJRefresh/MJRefreshHeader.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Base/MJRefreshHeader.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJRefresh/MJRefreshNormalHeader.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Custom/Header/MJRefreshNormalHeader.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJRefresh/MJRefreshStateHeader.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Custom/Header/MJRefreshStateHeader.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJRefresh/NSBundle+MJRefresh.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/NSBundle+MJRefresh.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJRefresh/UIScrollView+MJExtension.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/UIScrollView+MJExtension.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJRefresh/UIScrollView+MJRefresh.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/UIScrollView+MJRefresh.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJRefresh/UIView+MJExtension.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/UIView+MJExtension.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASCompositeConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASCompositeConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASConstraint+Private.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraint+Private.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASConstraintMaker.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraintMaker.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASLayoutConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASLayoutConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASUtilities.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASUtilities.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASViewAttribute.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASViewAttribute.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASViewConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASViewConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/Masonry.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/Masonry.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/NSArray+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSArray+MASAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/NSArray+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSArray+MASShorthandAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/NSLayoutConstraint+MASDebugAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/View+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/View+MASAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/View+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/View+MASShorthandAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/ViewController+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/ViewController+MASAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/NSData+ImageContentType.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/NSData+ImageContentType.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDImageCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDImageCache.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDWebImageCompat.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageCompat.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDWebImageDecoder.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageDecoder.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDWebImageDownloader.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageDownloader.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDWebImageDownloaderOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageDownloaderOperation.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDWebImageManager.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageManager.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDWebImageOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageOperation.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDWebImagePrefetcher.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImagePrefetcher.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/UIButton+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIButton+WebCache.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/UIImage+GIF.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImage+GIF.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/UIImage+MultiFormat.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImage+MultiFormat.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/UIImageView+HighlightedWebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/UIImageView+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImageView+WebCache.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/UIView+WebCacheOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIView+WebCacheOperation.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJRefresh/MJRefresh.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/MJRefresh.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJRefresh/MJRefreshAutoFooter.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Base/MJRefreshAutoFooter.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJRefresh/MJRefreshAutoGifFooter.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Custom/Footer/Auto/MJRefreshAutoGifFooter.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJRefresh/MJRefreshAutoNormalFooter.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Custom/Footer/Auto/MJRefreshAutoNormalFooter.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJRefresh/MJRefreshAutoStateFooter.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Custom/Footer/Auto/MJRefreshAutoStateFooter.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJRefresh/MJRefreshBackFooter.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Base/MJRefreshBackFooter.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJRefresh/MJRefreshBackGifFooter.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Custom/Footer/Back/MJRefreshBackGifFooter.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJRefresh/MJRefreshBackNormalFooter.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Custom/Footer/Back/MJRefreshBackNormalFooter.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJRefresh/MJRefreshBackStateFooter.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Custom/Footer/Back/MJRefreshBackStateFooter.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJRefresh/MJRefreshComponent.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Base/MJRefreshComponent.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJRefresh/MJRefreshConst.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/MJRefreshConst.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJRefresh/MJRefreshFooter.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Base/MJRefreshFooter.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJRefresh/MJRefreshGifHeader.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Custom/Header/MJRefreshGifHeader.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJRefresh/MJRefreshHeader.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Base/MJRefreshHeader.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJRefresh/MJRefreshNormalHeader.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Custom/Header/MJRefreshNormalHeader.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJRefresh/MJRefreshStateHeader.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/Custom/Header/MJRefreshStateHeader.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJRefresh/NSBundle+MJRefresh.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/NSBundle+MJRefresh.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJRefresh/UIScrollView+MJExtension.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/UIScrollView+MJExtension.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJRefresh/UIScrollView+MJRefresh.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/UIScrollView+MJRefresh.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJRefresh/UIView+MJExtension.h: -------------------------------------------------------------------------------- 1 | ../../../MJRefresh/MJRefresh/UIView+MJExtension.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASCompositeConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASCompositeConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASConstraint+Private.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraint+Private.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASConstraintMaker.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraintMaker.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASLayoutConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASLayoutConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASUtilities.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASUtilities.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASViewAttribute.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASViewAttribute.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASViewConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASViewConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/Masonry.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/Masonry.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/NSArray+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSArray+MASAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/NSArray+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSArray+MASShorthandAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/NSLayoutConstraint+MASDebugAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/View+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/View+MASAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/View+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/View+MASShorthandAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/ViewController+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/ViewController+MASAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/NSData+ImageContentType.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/NSData+ImageContentType.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDImageCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDImageCache.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDWebImageCompat.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageCompat.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDWebImageDecoder.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageDecoder.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDWebImageDownloader.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageDownloader.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDWebImageDownloaderOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageDownloaderOperation.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDWebImageManager.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageManager.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDWebImageOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageOperation.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDWebImagePrefetcher.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImagePrefetcher.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/UIButton+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIButton+WebCache.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/UIImage+GIF.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImage+GIF.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/UIImage+MultiFormat.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImage+MultiFormat.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/UIImageView+HighlightedWebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/UIImageView+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImageView+WebCache.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/UIView+WebCacheOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIView+WebCacheOperation.h -------------------------------------------------------------------------------- /Pods/MJRefresh/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2015 MJRefresh (https://github.com/CoderMJLee/MJRefresh) 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 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all 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 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Base/MJRefreshAutoFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshAutoFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshFooter.h" 10 | 11 | @interface MJRefreshAutoFooter : MJRefreshFooter 12 | /** 是否自动刷新(默认为YES) */ 13 | @property (assign, nonatomic, getter=isAutomaticallyRefresh) BOOL automaticallyRefresh; 14 | 15 | /** 当底部控件出现多少时就自动刷新(默认为1.0,也就是底部控件完全出现时,才会自动刷新) */ 16 | @property (assign, nonatomic) CGFloat appearencePercentTriggerAutoRefresh MJRefreshDeprecated("请使用triggerAutomaticallyRefreshPercent属性"); 17 | 18 | /** 当底部控件出现多少时就自动刷新(默认为1.0,也就是底部控件完全出现时,才会自动刷新) */ 19 | @property (assign, nonatomic) CGFloat triggerAutomaticallyRefreshPercent; 20 | @end 21 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Base/MJRefreshBackFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshBackFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshFooter.h" 10 | 11 | @interface MJRefreshBackFooter : MJRefreshFooter 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Base/MJRefreshComponent.h: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // MJRefreshComponent.h 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 15/3/4. 7 | // Copyright (c) 2015年 小码哥. All rights reserved. 8 | // 刷新控件的基类 9 | 10 | #import 11 | #import "MJRefreshConst.h" 12 | #import "UIView+MJExtension.h" 13 | #import "UIScrollView+MJExtension.h" 14 | #import "UIScrollView+MJRefresh.h" 15 | #import "NSBundle+MJRefresh.h" 16 | 17 | /** 刷新控件的状态 */ 18 | typedef NS_ENUM(NSInteger, MJRefreshState) { 19 | /** 普通闲置状态 */ 20 | MJRefreshStateIdle = 1, 21 | /** 松开就可以进行刷新的状态 */ 22 | MJRefreshStatePulling, 23 | /** 正在刷新中的状态 */ 24 | MJRefreshStateRefreshing, 25 | /** 即将刷新的状态 */ 26 | MJRefreshStateWillRefresh, 27 | /** 所有数据加载完毕,没有更多的数据了 */ 28 | MJRefreshStateNoMoreData 29 | }; 30 | 31 | /** 进入刷新状态的回调 */ 32 | typedef void (^MJRefreshComponentRefreshingBlock)(); 33 | /** 开始刷新后的回调(进入刷新状态后的回调) */ 34 | typedef void (^MJRefreshComponentbeginRefreshingCompletionBlock)(); 35 | /** 结束刷新后的回调 */ 36 | typedef void (^MJRefreshComponentEndRefreshingCompletionBlock)(); 37 | 38 | /** 刷新控件的基类 */ 39 | @interface MJRefreshComponent : UIView 40 | { 41 | /** 记录scrollView刚开始的inset */ 42 | UIEdgeInsets _scrollViewOriginalInset; 43 | /** 父控件 */ 44 | __weak UIScrollView *_scrollView; 45 | } 46 | #pragma mark - 刷新回调 47 | /** 正在刷新的回调 */ 48 | @property (copy, nonatomic) MJRefreshComponentRefreshingBlock refreshingBlock; 49 | /** 设置回调对象和回调方法 */ 50 | - (void)setRefreshingTarget:(id)target refreshingAction:(SEL)action; 51 | 52 | /** 回调对象 */ 53 | @property (weak, nonatomic) id refreshingTarget; 54 | /** 回调方法 */ 55 | @property (assign, nonatomic) SEL refreshingAction; 56 | /** 触发回调(交给子类去调用) */ 57 | - (void)executeRefreshingCallback; 58 | 59 | #pragma mark - 刷新状态控制 60 | /** 进入刷新状态 */ 61 | - (void)beginRefreshing; 62 | - (void)beginRefreshingWithCompletionBlock:(void (^)())completionBlock; 63 | /** 开始刷新后的回调(进入刷新状态后的回调) */ 64 | @property (copy, nonatomic) MJRefreshComponentbeginRefreshingCompletionBlock beginRefreshingCompletionBlock; 65 | /** 结束刷新的回调 */ 66 | @property (copy, nonatomic) MJRefreshComponentEndRefreshingCompletionBlock endRefreshingCompletionBlock; 67 | /** 结束刷新状态 */ 68 | - (void)endRefreshing; 69 | - (void)endRefreshingWithCompletionBlock:(void (^)())completionBlock; 70 | /** 是否正在刷新 */ 71 | - (BOOL)isRefreshing; 72 | /** 刷新状态 一般交给子类内部实现 */ 73 | @property (assign, nonatomic) MJRefreshState state; 74 | 75 | #pragma mark - 交给子类去访问 76 | /** 记录scrollView刚开始的inset */ 77 | @property (assign, nonatomic, readonly) UIEdgeInsets scrollViewOriginalInset; 78 | /** 父控件 */ 79 | @property (weak, nonatomic, readonly) UIScrollView *scrollView; 80 | 81 | #pragma mark - 交给子类们去实现 82 | /** 初始化 */ 83 | - (void)prepare NS_REQUIRES_SUPER; 84 | /** 摆放子控件frame */ 85 | - (void)placeSubviews NS_REQUIRES_SUPER; 86 | /** 当scrollView的contentOffset发生改变的时候调用 */ 87 | - (void)scrollViewContentOffsetDidChange:(NSDictionary *)change NS_REQUIRES_SUPER; 88 | /** 当scrollView的contentSize发生改变的时候调用 */ 89 | - (void)scrollViewContentSizeDidChange:(NSDictionary *)change NS_REQUIRES_SUPER; 90 | /** 当scrollView的拖拽状态发生改变的时候调用 */ 91 | - (void)scrollViewPanStateDidChange:(NSDictionary *)change NS_REQUIRES_SUPER; 92 | 93 | 94 | #pragma mark - 其他 95 | /** 拉拽的百分比(交给子类重写) */ 96 | @property (assign, nonatomic) CGFloat pullingPercent; 97 | /** 根据拖拽比例自动切换透明度 */ 98 | @property (assign, nonatomic, getter=isAutoChangeAlpha) BOOL autoChangeAlpha MJRefreshDeprecated("请使用automaticallyChangeAlpha属性"); 99 | /** 根据拖拽比例自动切换透明度 */ 100 | @property (assign, nonatomic, getter=isAutomaticallyChangeAlpha) BOOL automaticallyChangeAlpha; 101 | @end 102 | 103 | @interface UILabel(MJRefresh) 104 | + (instancetype)mj_label; 105 | - (CGFloat)mj_textWith; 106 | @end 107 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Base/MJRefreshFooter.h: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // MJRefreshFooter.h 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 15/3/5. 7 | // Copyright (c) 2015年 小码哥. All rights reserved. 8 | // 上拉刷新控件 9 | 10 | #import "MJRefreshComponent.h" 11 | 12 | @interface MJRefreshFooter : MJRefreshComponent 13 | /** 创建footer */ 14 | + (instancetype)footerWithRefreshingBlock:(MJRefreshComponentRefreshingBlock)refreshingBlock; 15 | /** 创建footer */ 16 | + (instancetype)footerWithRefreshingTarget:(id)target refreshingAction:(SEL)action; 17 | 18 | /** 提示没有更多的数据 */ 19 | - (void)endRefreshingWithNoMoreData; 20 | - (void)noticeNoMoreData MJRefreshDeprecated("使用endRefreshingWithNoMoreData"); 21 | 22 | /** 重置没有更多的数据(消除没有更多数据的状态) */ 23 | - (void)resetNoMoreData; 24 | 25 | /** 忽略多少scrollView的contentInset的bottom */ 26 | @property (assign, nonatomic) CGFloat ignoredScrollViewContentInsetBottom; 27 | 28 | /** 自动根据有无数据来显示和隐藏(有数据就显示,没有数据隐藏。默认是NO) */ 29 | @property (assign, nonatomic, getter=isAutomaticallyHidden) BOOL automaticallyHidden; 30 | @end 31 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Base/MJRefreshFooter.m: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // MJRefreshFooter.m 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 15/3/5. 7 | // Copyright (c) 2015年 小码哥. All rights reserved. 8 | // 9 | 10 | #import "MJRefreshFooter.h" 11 | 12 | @interface MJRefreshFooter() 13 | 14 | @end 15 | 16 | @implementation MJRefreshFooter 17 | #pragma mark - 构造方法 18 | + (instancetype)footerWithRefreshingBlock:(MJRefreshComponentRefreshingBlock)refreshingBlock 19 | { 20 | MJRefreshFooter *cmp = [[self alloc] init]; 21 | cmp.refreshingBlock = refreshingBlock; 22 | return cmp; 23 | } 24 | + (instancetype)footerWithRefreshingTarget:(id)target refreshingAction:(SEL)action 25 | { 26 | MJRefreshFooter *cmp = [[self alloc] init]; 27 | [cmp setRefreshingTarget:target refreshingAction:action]; 28 | return cmp; 29 | } 30 | 31 | #pragma mark - 重写父类的方法 32 | - (void)prepare 33 | { 34 | [super prepare]; 35 | 36 | // 设置自己的高度 37 | self.mj_h = MJRefreshFooterHeight; 38 | 39 | // 默认不会自动隐藏 40 | self.automaticallyHidden = NO; 41 | } 42 | 43 | - (void)willMoveToSuperview:(UIView *)newSuperview 44 | { 45 | [super willMoveToSuperview:newSuperview]; 46 | 47 | if (newSuperview) { 48 | // 监听scrollView数据的变化 49 | if ([self.scrollView isKindOfClass:[UITableView class]] || [self.scrollView isKindOfClass:[UICollectionView class]]) { 50 | [self.scrollView setMj_reloadDataBlock:^(NSInteger totalDataCount) { 51 | if (self.isAutomaticallyHidden) { 52 | self.hidden = (totalDataCount == 0); 53 | } 54 | }]; 55 | } 56 | } 57 | } 58 | 59 | #pragma mark - 公共方法 60 | - (void)endRefreshingWithNoMoreData 61 | { 62 | self.state = MJRefreshStateNoMoreData; 63 | } 64 | 65 | - (void)noticeNoMoreData 66 | { 67 | [self endRefreshingWithNoMoreData]; 68 | } 69 | 70 | - (void)resetNoMoreData 71 | { 72 | self.state = MJRefreshStateIdle; 73 | } 74 | @end 75 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Base/MJRefreshHeader.h: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // MJRefreshHeader.h 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 15/3/4. 7 | // Copyright (c) 2015年 小码哥. All rights reserved. 8 | // 下拉刷新控件:负责监控用户下拉的状态 9 | 10 | #import "MJRefreshComponent.h" 11 | 12 | @interface MJRefreshHeader : MJRefreshComponent 13 | /** 创建header */ 14 | + (instancetype)headerWithRefreshingBlock:(MJRefreshComponentRefreshingBlock)refreshingBlock; 15 | /** 创建header */ 16 | + (instancetype)headerWithRefreshingTarget:(id)target refreshingAction:(SEL)action; 17 | 18 | /** 这个key用来存储上一次下拉刷新成功的时间 */ 19 | @property (copy, nonatomic) NSString *lastUpdatedTimeKey; 20 | /** 上一次下拉刷新成功的时间 */ 21 | @property (strong, nonatomic, readonly) NSDate *lastUpdatedTime; 22 | 23 | /** 忽略多少scrollView的contentInset的top */ 24 | @property (assign, nonatomic) CGFloat ignoredScrollViewContentInsetTop; 25 | @end 26 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Custom/Footer/Auto/MJRefreshAutoGifFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshAutoGifFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshAutoStateFooter.h" 10 | 11 | @interface MJRefreshAutoGifFooter : MJRefreshAutoStateFooter 12 | @property (weak, nonatomic, readonly) UIImageView *gifView; 13 | 14 | /** 设置state状态下的动画图片images 动画持续时间duration*/ 15 | - (void)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state; 16 | - (void)setImages:(NSArray *)images forState:(MJRefreshState)state; 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Custom/Footer/Auto/MJRefreshAutoGifFooter.m: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshAutoGifFooter.m 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshAutoGifFooter.h" 10 | 11 | @interface MJRefreshAutoGifFooter() 12 | { 13 | __unsafe_unretained UIImageView *_gifView; 14 | } 15 | /** 所有状态对应的动画图片 */ 16 | @property (strong, nonatomic) NSMutableDictionary *stateImages; 17 | /** 所有状态对应的动画时间 */ 18 | @property (strong, nonatomic) NSMutableDictionary *stateDurations; 19 | @end 20 | 21 | @implementation MJRefreshAutoGifFooter 22 | #pragma mark - 懒加载 23 | - (UIImageView *)gifView 24 | { 25 | if (!_gifView) { 26 | UIImageView *gifView = [[UIImageView alloc] init]; 27 | [self addSubview:_gifView = gifView]; 28 | } 29 | return _gifView; 30 | } 31 | 32 | - (NSMutableDictionary *)stateImages 33 | { 34 | if (!_stateImages) { 35 | self.stateImages = [NSMutableDictionary dictionary]; 36 | } 37 | return _stateImages; 38 | } 39 | 40 | - (NSMutableDictionary *)stateDurations 41 | { 42 | if (!_stateDurations) { 43 | self.stateDurations = [NSMutableDictionary dictionary]; 44 | } 45 | return _stateDurations; 46 | } 47 | 48 | #pragma mark - 公共方法 49 | - (void)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state 50 | { 51 | if (images == nil) return; 52 | 53 | self.stateImages[@(state)] = images; 54 | self.stateDurations[@(state)] = @(duration); 55 | 56 | /* 根据图片设置控件的高度 */ 57 | UIImage *image = [images firstObject]; 58 | if (image.size.height > self.mj_h) { 59 | self.mj_h = image.size.height; 60 | } 61 | } 62 | 63 | - (void)setImages:(NSArray *)images forState:(MJRefreshState)state 64 | { 65 | [self setImages:images duration:images.count * 0.1 forState:state]; 66 | } 67 | 68 | #pragma mark - 实现父类的方法 69 | - (void)prepare 70 | { 71 | [super prepare]; 72 | 73 | // 初始化间距 74 | self.labelLeftInset = 20; 75 | } 76 | 77 | - (void)placeSubviews 78 | { 79 | [super placeSubviews]; 80 | 81 | if (self.gifView.constraints.count) return; 82 | 83 | self.gifView.frame = self.bounds; 84 | if (self.isRefreshingTitleHidden) { 85 | self.gifView.contentMode = UIViewContentModeCenter; 86 | } else { 87 | self.gifView.contentMode = UIViewContentModeRight; 88 | self.gifView.mj_w = self.mj_w * 0.5 - self.labelLeftInset - self.stateLabel.mj_textWith * 0.5; 89 | } 90 | } 91 | 92 | - (void)setState:(MJRefreshState)state 93 | { 94 | MJRefreshCheckState 95 | 96 | // 根据状态做事情 97 | if (state == MJRefreshStateRefreshing) { 98 | NSArray *images = self.stateImages[@(state)]; 99 | if (images.count == 0) return; 100 | [self.gifView stopAnimating]; 101 | 102 | self.gifView.hidden = NO; 103 | if (images.count == 1) { // 单张图片 104 | self.gifView.image = [images lastObject]; 105 | } else { // 多张图片 106 | self.gifView.animationImages = images; 107 | self.gifView.animationDuration = [self.stateDurations[@(state)] doubleValue]; 108 | [self.gifView startAnimating]; 109 | } 110 | } else if (state == MJRefreshStateNoMoreData || state == MJRefreshStateIdle) { 111 | [self.gifView stopAnimating]; 112 | self.gifView.hidden = YES; 113 | } 114 | } 115 | @end 116 | 117 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Custom/Footer/Auto/MJRefreshAutoNormalFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshAutoNormalFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshAutoStateFooter.h" 10 | 11 | @interface MJRefreshAutoNormalFooter : MJRefreshAutoStateFooter 12 | /** 菊花的样式 */ 13 | @property (assign, nonatomic) UIActivityIndicatorViewStyle activityIndicatorViewStyle; 14 | @end 15 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Custom/Footer/Auto/MJRefreshAutoNormalFooter.m: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshAutoNormalFooter.m 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshAutoNormalFooter.h" 10 | 11 | @interface MJRefreshAutoNormalFooter() 12 | @property (weak, nonatomic) UIActivityIndicatorView *loadingView; 13 | @end 14 | 15 | @implementation MJRefreshAutoNormalFooter 16 | #pragma mark - 懒加载子控件 17 | - (UIActivityIndicatorView *)loadingView 18 | { 19 | if (!_loadingView) { 20 | UIActivityIndicatorView *loadingView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:self.activityIndicatorViewStyle]; 21 | loadingView.hidesWhenStopped = YES; 22 | [self addSubview:_loadingView = loadingView]; 23 | } 24 | return _loadingView; 25 | } 26 | 27 | - (void)setActivityIndicatorViewStyle:(UIActivityIndicatorViewStyle)activityIndicatorViewStyle 28 | { 29 | _activityIndicatorViewStyle = activityIndicatorViewStyle; 30 | 31 | self.loadingView = nil; 32 | [self setNeedsLayout]; 33 | } 34 | #pragma mark - 重写父类的方法 35 | - (void)prepare 36 | { 37 | [super prepare]; 38 | 39 | self.activityIndicatorViewStyle = UIActivityIndicatorViewStyleGray; 40 | } 41 | 42 | - (void)placeSubviews 43 | { 44 | [super placeSubviews]; 45 | 46 | if (self.loadingView.constraints.count) return; 47 | 48 | // 圈圈 49 | CGFloat loadingCenterX = self.mj_w * 0.5; 50 | if (!self.isRefreshingTitleHidden) { 51 | loadingCenterX -= self.stateLabel.mj_textWith * 0.5 + self.labelLeftInset; 52 | } 53 | CGFloat loadingCenterY = self.mj_h * 0.5; 54 | self.loadingView.center = CGPointMake(loadingCenterX, loadingCenterY); 55 | } 56 | 57 | - (void)setState:(MJRefreshState)state 58 | { 59 | MJRefreshCheckState 60 | 61 | // 根据状态做事情 62 | if (state == MJRefreshStateNoMoreData || state == MJRefreshStateIdle) { 63 | [self.loadingView stopAnimating]; 64 | } else if (state == MJRefreshStateRefreshing) { 65 | [self.loadingView startAnimating]; 66 | } 67 | } 68 | 69 | @end 70 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Custom/Footer/Auto/MJRefreshAutoStateFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshAutoStateFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/6/13. 6 | // Copyright © 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshAutoFooter.h" 10 | 11 | @interface MJRefreshAutoStateFooter : MJRefreshAutoFooter 12 | /** 文字距离圈圈、箭头的距离 */ 13 | @property (assign, nonatomic) CGFloat labelLeftInset; 14 | /** 显示刷新状态的label */ 15 | @property (weak, nonatomic, readonly) UILabel *stateLabel; 16 | 17 | /** 设置state状态下的文字 */ 18 | - (void)setTitle:(NSString *)title forState:(MJRefreshState)state; 19 | 20 | /** 隐藏刷新状态的文字 */ 21 | @property (assign, nonatomic, getter=isRefreshingTitleHidden) BOOL refreshingTitleHidden; 22 | @end 23 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Custom/Footer/Auto/MJRefreshAutoStateFooter.m: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshAutoStateFooter.m 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/6/13. 6 | // Copyright © 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshAutoStateFooter.h" 10 | 11 | @interface MJRefreshAutoStateFooter() 12 | { 13 | /** 显示刷新状态的label */ 14 | __unsafe_unretained UILabel *_stateLabel; 15 | } 16 | /** 所有状态对应的文字 */ 17 | @property (strong, nonatomic) NSMutableDictionary *stateTitles; 18 | @end 19 | 20 | @implementation MJRefreshAutoStateFooter 21 | #pragma mark - 懒加载 22 | - (NSMutableDictionary *)stateTitles 23 | { 24 | if (!_stateTitles) { 25 | self.stateTitles = [NSMutableDictionary dictionary]; 26 | } 27 | return _stateTitles; 28 | } 29 | 30 | - (UILabel *)stateLabel 31 | { 32 | if (!_stateLabel) { 33 | [self addSubview:_stateLabel = [UILabel mj_label]]; 34 | } 35 | return _stateLabel; 36 | } 37 | 38 | #pragma mark - 公共方法 39 | - (void)setTitle:(NSString *)title forState:(MJRefreshState)state 40 | { 41 | if (title == nil) return; 42 | self.stateTitles[@(state)] = title; 43 | self.stateLabel.text = self.stateTitles[@(self.state)]; 44 | } 45 | 46 | #pragma mark - 私有方法 47 | - (void)stateLabelClick 48 | { 49 | if (self.state == MJRefreshStateIdle) { 50 | [self beginRefreshing]; 51 | } 52 | } 53 | 54 | #pragma mark - 重写父类的方法 55 | - (void)prepare 56 | { 57 | [super prepare]; 58 | 59 | // 初始化间距 60 | self.labelLeftInset = MJRefreshLabelLeftInset; 61 | 62 | // 初始化文字 63 | [self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshAutoFooterIdleText] forState:MJRefreshStateIdle]; 64 | [self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshAutoFooterRefreshingText] forState:MJRefreshStateRefreshing]; 65 | [self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshAutoFooterNoMoreDataText] forState:MJRefreshStateNoMoreData]; 66 | 67 | // 监听label 68 | self.stateLabel.userInteractionEnabled = YES; 69 | [self.stateLabel addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(stateLabelClick)]]; 70 | } 71 | 72 | - (void)placeSubviews 73 | { 74 | [super placeSubviews]; 75 | 76 | if (self.stateLabel.constraints.count) return; 77 | 78 | // 状态标签 79 | self.stateLabel.frame = self.bounds; 80 | } 81 | 82 | - (void)setState:(MJRefreshState)state 83 | { 84 | MJRefreshCheckState 85 | 86 | if (self.isRefreshingTitleHidden && state == MJRefreshStateRefreshing) { 87 | self.stateLabel.text = nil; 88 | } else { 89 | self.stateLabel.text = self.stateTitles[@(state)]; 90 | } 91 | } 92 | @end -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Custom/Footer/Back/MJRefreshBackGifFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshBackGifFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshBackStateFooter.h" 10 | 11 | @interface MJRefreshBackGifFooter : MJRefreshBackStateFooter 12 | @property (weak, nonatomic, readonly) UIImageView *gifView; 13 | 14 | /** 设置state状态下的动画图片images 动画持续时间duration*/ 15 | - (void)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state; 16 | - (void)setImages:(NSArray *)images forState:(MJRefreshState)state; 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Custom/Footer/Back/MJRefreshBackGifFooter.m: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshBackGifFooter.m 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshBackGifFooter.h" 10 | 11 | @interface MJRefreshBackGifFooter() 12 | { 13 | __unsafe_unretained UIImageView *_gifView; 14 | } 15 | /** 所有状态对应的动画图片 */ 16 | @property (strong, nonatomic) NSMutableDictionary *stateImages; 17 | /** 所有状态对应的动画时间 */ 18 | @property (strong, nonatomic) NSMutableDictionary *stateDurations; 19 | @end 20 | 21 | @implementation MJRefreshBackGifFooter 22 | #pragma mark - 懒加载 23 | - (UIImageView *)gifView 24 | { 25 | if (!_gifView) { 26 | UIImageView *gifView = [[UIImageView alloc] init]; 27 | [self addSubview:_gifView = gifView]; 28 | } 29 | return _gifView; 30 | } 31 | 32 | - (NSMutableDictionary *)stateImages 33 | { 34 | if (!_stateImages) { 35 | self.stateImages = [NSMutableDictionary dictionary]; 36 | } 37 | return _stateImages; 38 | } 39 | 40 | - (NSMutableDictionary *)stateDurations 41 | { 42 | if (!_stateDurations) { 43 | self.stateDurations = [NSMutableDictionary dictionary]; 44 | } 45 | return _stateDurations; 46 | } 47 | 48 | #pragma mark - 公共方法 49 | - (void)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state 50 | { 51 | if (images == nil) return; 52 | 53 | self.stateImages[@(state)] = images; 54 | self.stateDurations[@(state)] = @(duration); 55 | 56 | /* 根据图片设置控件的高度 */ 57 | UIImage *image = [images firstObject]; 58 | if (image.size.height > self.mj_h) { 59 | self.mj_h = image.size.height; 60 | } 61 | } 62 | 63 | - (void)setImages:(NSArray *)images forState:(MJRefreshState)state 64 | { 65 | [self setImages:images duration:images.count * 0.1 forState:state]; 66 | } 67 | 68 | #pragma mark - 实现父类的方法 69 | - (void)prepare 70 | { 71 | [super prepare]; 72 | 73 | // 初始化间距 74 | self.labelLeftInset = 20; 75 | } 76 | 77 | - (void)setPullingPercent:(CGFloat)pullingPercent 78 | { 79 | [super setPullingPercent:pullingPercent]; 80 | NSArray *images = self.stateImages[@(MJRefreshStateIdle)]; 81 | if (self.state != MJRefreshStateIdle || images.count == 0) return; 82 | [self.gifView stopAnimating]; 83 | NSUInteger index = images.count * pullingPercent; 84 | if (index >= images.count) index = images.count - 1; 85 | self.gifView.image = images[index]; 86 | } 87 | 88 | - (void)placeSubviews 89 | { 90 | [super placeSubviews]; 91 | 92 | if (self.gifView.constraints.count) return; 93 | 94 | self.gifView.frame = self.bounds; 95 | if (self.stateLabel.hidden) { 96 | self.gifView.contentMode = UIViewContentModeCenter; 97 | } else { 98 | self.gifView.contentMode = UIViewContentModeRight; 99 | self.gifView.mj_w = self.mj_w * 0.5 - self.labelLeftInset - self.stateLabel.mj_textWith * 0.5; 100 | } 101 | } 102 | 103 | - (void)setState:(MJRefreshState)state 104 | { 105 | MJRefreshCheckState 106 | 107 | // 根据状态做事情 108 | if (state == MJRefreshStatePulling || state == MJRefreshStateRefreshing) { 109 | NSArray *images = self.stateImages[@(state)]; 110 | if (images.count == 0) return; 111 | 112 | self.gifView.hidden = NO; 113 | [self.gifView stopAnimating]; 114 | if (images.count == 1) { // 单张图片 115 | self.gifView.image = [images lastObject]; 116 | } else { // 多张图片 117 | self.gifView.animationImages = images; 118 | self.gifView.animationDuration = [self.stateDurations[@(state)] doubleValue]; 119 | [self.gifView startAnimating]; 120 | } 121 | } else if (state == MJRefreshStateIdle) { 122 | self.gifView.hidden = NO; 123 | } else if (state == MJRefreshStateNoMoreData) { 124 | self.gifView.hidden = YES; 125 | } 126 | } 127 | @end 128 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Custom/Footer/Back/MJRefreshBackNormalFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshBackNormalFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshBackStateFooter.h" 10 | 11 | @interface MJRefreshBackNormalFooter : MJRefreshBackStateFooter 12 | @property (weak, nonatomic, readonly) UIImageView *arrowView; 13 | /** 菊花的样式 */ 14 | @property (assign, nonatomic) UIActivityIndicatorViewStyle activityIndicatorViewStyle; 15 | @end 16 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Custom/Footer/Back/MJRefreshBackStateFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshBackStateFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/6/13. 6 | // Copyright © 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshBackFooter.h" 10 | 11 | @interface MJRefreshBackStateFooter : MJRefreshBackFooter 12 | /** 文字距离圈圈、箭头的距离 */ 13 | @property (assign, nonatomic) CGFloat labelLeftInset; 14 | /** 显示刷新状态的label */ 15 | @property (weak, nonatomic, readonly) UILabel *stateLabel; 16 | /** 设置state状态下的文字 */ 17 | - (void)setTitle:(NSString *)title forState:(MJRefreshState)state; 18 | 19 | /** 获取state状态下的title */ 20 | - (NSString *)titleForState:(MJRefreshState)state; 21 | @end 22 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Custom/Footer/Back/MJRefreshBackStateFooter.m: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshBackStateFooter.m 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/6/13. 6 | // Copyright © 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshBackStateFooter.h" 10 | 11 | @interface MJRefreshBackStateFooter() 12 | { 13 | /** 显示刷新状态的label */ 14 | __unsafe_unretained UILabel *_stateLabel; 15 | } 16 | /** 所有状态对应的文字 */ 17 | @property (strong, nonatomic) NSMutableDictionary *stateTitles; 18 | @end 19 | 20 | @implementation MJRefreshBackStateFooter 21 | #pragma mark - 懒加载 22 | - (NSMutableDictionary *)stateTitles 23 | { 24 | if (!_stateTitles) { 25 | self.stateTitles = [NSMutableDictionary dictionary]; 26 | } 27 | return _stateTitles; 28 | } 29 | 30 | - (UILabel *)stateLabel 31 | { 32 | if (!_stateLabel) { 33 | [self addSubview:_stateLabel = [UILabel mj_label]]; 34 | } 35 | return _stateLabel; 36 | } 37 | 38 | #pragma mark - 公共方法 39 | - (void)setTitle:(NSString *)title forState:(MJRefreshState)state 40 | { 41 | if (title == nil) return; 42 | self.stateTitles[@(state)] = title; 43 | self.stateLabel.text = self.stateTitles[@(self.state)]; 44 | } 45 | 46 | - (NSString *)titleForState:(MJRefreshState)state { 47 | return self.stateTitles[@(state)]; 48 | } 49 | 50 | #pragma mark - 重写父类的方法 51 | - (void)prepare 52 | { 53 | [super prepare]; 54 | 55 | // 初始化间距 56 | self.labelLeftInset = MJRefreshLabelLeftInset; 57 | 58 | // 初始化文字 59 | [self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshBackFooterIdleText] forState:MJRefreshStateIdle]; 60 | [self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshBackFooterPullingText] forState:MJRefreshStatePulling]; 61 | [self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshBackFooterRefreshingText] forState:MJRefreshStateRefreshing]; 62 | [self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshBackFooterNoMoreDataText] forState:MJRefreshStateNoMoreData]; 63 | } 64 | 65 | - (void)placeSubviews 66 | { 67 | [super placeSubviews]; 68 | 69 | if (self.stateLabel.constraints.count) return; 70 | 71 | // 状态标签 72 | self.stateLabel.frame = self.bounds; 73 | } 74 | 75 | - (void)setState:(MJRefreshState)state 76 | { 77 | MJRefreshCheckState 78 | 79 | // 设置状态文字 80 | self.stateLabel.text = self.stateTitles[@(state)]; 81 | } 82 | @end 83 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Custom/Header/MJRefreshGifHeader.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshGifHeader.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshStateHeader.h" 10 | 11 | @interface MJRefreshGifHeader : MJRefreshStateHeader 12 | @property (weak, nonatomic, readonly) UIImageView *gifView; 13 | 14 | /** 设置state状态下的动画图片images 动画持续时间duration*/ 15 | - (void)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state; 16 | - (void)setImages:(NSArray *)images forState:(MJRefreshState)state; 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Custom/Header/MJRefreshNormalHeader.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshNormalHeader.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshStateHeader.h" 10 | 11 | @interface MJRefreshNormalHeader : MJRefreshStateHeader 12 | @property (weak, nonatomic, readonly) UIImageView *arrowView; 13 | /** 菊花的样式 */ 14 | @property (assign, nonatomic) UIActivityIndicatorViewStyle activityIndicatorViewStyle; 15 | @end 16 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Custom/Header/MJRefreshStateHeader.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshStateHeader.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshHeader.h" 10 | 11 | @interface MJRefreshStateHeader : MJRefreshHeader 12 | #pragma mark - 刷新时间相关 13 | /** 利用这个block来决定显示的更新时间文字 */ 14 | @property (copy, nonatomic) NSString *(^lastUpdatedTimeText)(NSDate *lastUpdatedTime); 15 | /** 显示上一次刷新时间的label */ 16 | @property (weak, nonatomic, readonly) UILabel *lastUpdatedTimeLabel; 17 | 18 | #pragma mark - 状态相关 19 | /** 文字距离圈圈、箭头的距离 */ 20 | @property (assign, nonatomic) CGFloat labelLeftInset; 21 | /** 显示刷新状态的label */ 22 | @property (weak, nonatomic, readonly) UILabel *stateLabel; 23 | /** 设置state状态下的文字 */ 24 | - (void)setTitle:(NSString *)title forState:(MJRefreshState)state; 25 | @end 26 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/MJRefresh.bundle/arrow@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samuelandkevin/HKPTimeLine/3b5a87b4f1667bd743e75baa58976c30bb887d3b/Pods/MJRefresh/MJRefresh/MJRefresh.bundle/arrow@2x.png -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/MJRefresh.bundle/en.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samuelandkevin/HKPTimeLine/3b5a87b4f1667bd743e75baa58976c30bb887d3b/Pods/MJRefresh/MJRefresh/MJRefresh.bundle/en.lproj/Localizable.strings -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/MJRefresh.bundle/zh-Hans.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samuelandkevin/HKPTimeLine/3b5a87b4f1667bd743e75baa58976c30bb887d3b/Pods/MJRefresh/MJRefresh/MJRefresh.bundle/zh-Hans.lproj/Localizable.strings -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/MJRefresh.bundle/zh-Hant.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | "MJRefreshHeaderIdleText" = "下拉可以刷新"; 2 | "MJRefreshHeaderPullingText" = "鬆開立即刷新"; 3 | "MJRefreshHeaderRefreshingText" = "正在刷新數據中..."; 4 | 5 | "MJRefreshAutoFooterIdleText" = "點擊或上拉加載更多"; 6 | "MJRefreshAutoFooterRefreshingText" = "正在加載更多的數據..."; 7 | "MJRefreshAutoFooterNoMoreDataText" = "已經全部加載完畢"; 8 | 9 | "MJRefreshBackFooterIdleText" = "上拉可以加載更多"; 10 | "MJRefreshBackFooterPullingText" = "鬆開立即加載更多"; 11 | "MJRefreshBackFooterRefreshingText" = "正在加載更多的數據..."; 12 | "MJRefreshBackFooterNoMoreDataText" = "已經全部加載完畢"; 13 | 14 | "MJRefreshHeaderLastTimeText" = "最後更新:"; 15 | "MJRefreshHeaderDateTodayText" = "今天"; 16 | "MJRefreshHeaderNoneLastDateText" = "無記錄"; 17 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/MJRefresh.h: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | 4 | #import "UIScrollView+MJRefresh.h" 5 | #import "UIScrollView+MJExtension.h" 6 | #import "UIView+MJExtension.h" 7 | 8 | #import "MJRefreshNormalHeader.h" 9 | #import "MJRefreshGifHeader.h" 10 | 11 | #import "MJRefreshBackNormalFooter.h" 12 | #import "MJRefreshBackGifFooter.h" 13 | #import "MJRefreshAutoNormalFooter.h" 14 | #import "MJRefreshAutoGifFooter.h" -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/MJRefreshConst.h: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | #import 4 | #import 5 | 6 | // 弱引用 7 | #define MJWeakSelf __weak typeof(self) weakSelf = self; 8 | 9 | // 日志输出 10 | #ifdef DEBUG 11 | #define MJRefreshLog(...) NSLog(__VA_ARGS__) 12 | #else 13 | #define MJRefreshLog(...) 14 | #endif 15 | 16 | // 过期提醒 17 | #define MJRefreshDeprecated(instead) NS_DEPRECATED(2_0, 2_0, 2_0, 2_0, instead) 18 | 19 | // 运行时objc_msgSend 20 | #define MJRefreshMsgSend(...) ((void (*)(void *, SEL, UIView *))objc_msgSend)(__VA_ARGS__) 21 | #define MJRefreshMsgTarget(target) (__bridge void *)(target) 22 | 23 | // RGB颜色 24 | #define MJRefreshColor(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0] 25 | 26 | // 文字颜色 27 | #define MJRefreshLabelTextColor MJRefreshColor(90, 90, 90) 28 | 29 | // 字体大小 30 | #define MJRefreshLabelFont [UIFont boldSystemFontOfSize:14] 31 | 32 | // 常量 33 | UIKIT_EXTERN const CGFloat MJRefreshLabelLeftInset; 34 | UIKIT_EXTERN const CGFloat MJRefreshHeaderHeight; 35 | UIKIT_EXTERN const CGFloat MJRefreshFooterHeight; 36 | UIKIT_EXTERN const CGFloat MJRefreshFastAnimationDuration; 37 | UIKIT_EXTERN const CGFloat MJRefreshSlowAnimationDuration; 38 | 39 | UIKIT_EXTERN NSString *const MJRefreshKeyPathContentOffset; 40 | UIKIT_EXTERN NSString *const MJRefreshKeyPathContentSize; 41 | UIKIT_EXTERN NSString *const MJRefreshKeyPathContentInset; 42 | UIKIT_EXTERN NSString *const MJRefreshKeyPathPanState; 43 | 44 | UIKIT_EXTERN NSString *const MJRefreshHeaderLastUpdatedTimeKey; 45 | 46 | UIKIT_EXTERN NSString *const MJRefreshHeaderIdleText; 47 | UIKIT_EXTERN NSString *const MJRefreshHeaderPullingText; 48 | UIKIT_EXTERN NSString *const MJRefreshHeaderRefreshingText; 49 | 50 | UIKIT_EXTERN NSString *const MJRefreshAutoFooterIdleText; 51 | UIKIT_EXTERN NSString *const MJRefreshAutoFooterRefreshingText; 52 | UIKIT_EXTERN NSString *const MJRefreshAutoFooterNoMoreDataText; 53 | 54 | UIKIT_EXTERN NSString *const MJRefreshBackFooterIdleText; 55 | UIKIT_EXTERN NSString *const MJRefreshBackFooterPullingText; 56 | UIKIT_EXTERN NSString *const MJRefreshBackFooterRefreshingText; 57 | UIKIT_EXTERN NSString *const MJRefreshBackFooterNoMoreDataText; 58 | 59 | UIKIT_EXTERN NSString *const MJRefreshHeaderLastTimeText; 60 | UIKIT_EXTERN NSString *const MJRefreshHeaderDateTodayText; 61 | UIKIT_EXTERN NSString *const MJRefreshHeaderNoneLastDateText; 62 | 63 | // 状态检查 64 | #define MJRefreshCheckState \ 65 | MJRefreshState oldState = self.state; \ 66 | if (state == oldState) return; \ 67 | [super setState:state]; 68 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/MJRefreshConst.m: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | #import 4 | 5 | const CGFloat MJRefreshLabelLeftInset = 25; 6 | const CGFloat MJRefreshHeaderHeight = 54.0; 7 | const CGFloat MJRefreshFooterHeight = 44.0; 8 | const CGFloat MJRefreshFastAnimationDuration = 0.25; 9 | const CGFloat MJRefreshSlowAnimationDuration = 0.4; 10 | 11 | NSString *const MJRefreshKeyPathContentOffset = @"contentOffset"; 12 | NSString *const MJRefreshKeyPathContentInset = @"contentInset"; 13 | NSString *const MJRefreshKeyPathContentSize = @"contentSize"; 14 | NSString *const MJRefreshKeyPathPanState = @"state"; 15 | 16 | NSString *const MJRefreshHeaderLastUpdatedTimeKey = @"MJRefreshHeaderLastUpdatedTimeKey"; 17 | 18 | NSString *const MJRefreshHeaderIdleText = @"MJRefreshHeaderIdleText"; 19 | NSString *const MJRefreshHeaderPullingText = @"MJRefreshHeaderPullingText"; 20 | NSString *const MJRefreshHeaderRefreshingText = @"MJRefreshHeaderRefreshingText"; 21 | 22 | NSString *const MJRefreshAutoFooterIdleText = @"MJRefreshAutoFooterIdleText"; 23 | NSString *const MJRefreshAutoFooterRefreshingText = @"MJRefreshAutoFooterRefreshingText"; 24 | NSString *const MJRefreshAutoFooterNoMoreDataText = @"MJRefreshAutoFooterNoMoreDataText"; 25 | 26 | NSString *const MJRefreshBackFooterIdleText = @"MJRefreshBackFooterIdleText"; 27 | NSString *const MJRefreshBackFooterPullingText = @"MJRefreshBackFooterPullingText"; 28 | NSString *const MJRefreshBackFooterRefreshingText = @"MJRefreshBackFooterRefreshingText"; 29 | NSString *const MJRefreshBackFooterNoMoreDataText = @"MJRefreshBackFooterNoMoreDataText"; 30 | 31 | NSString *const MJRefreshHeaderLastTimeText = @"MJRefreshHeaderLastTimeText"; 32 | NSString *const MJRefreshHeaderDateTodayText = @"MJRefreshHeaderDateTodayText"; 33 | NSString *const MJRefreshHeaderNoneLastDateText = @"MJRefreshHeaderNoneLastDateText"; -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/NSBundle+MJRefresh.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSBundle+MJRefresh.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 16/6/13. 6 | // Copyright © 2016年 小码哥. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSBundle (MJRefresh) 12 | + (instancetype)mj_refreshBundle; 13 | + (UIImage *)mj_arrowImage; 14 | + (NSString *)mj_localizedStringForKey:(NSString *)key value:(NSString *)value; 15 | + (NSString *)mj_localizedStringForKey:(NSString *)key; 16 | @end 17 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/NSBundle+MJRefresh.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSBundle+MJRefresh.m 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 16/6/13. 6 | // Copyright © 2016年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "NSBundle+MJRefresh.h" 10 | #import "MJRefreshComponent.h" 11 | 12 | @implementation NSBundle (MJRefresh) 13 | + (instancetype)mj_refreshBundle 14 | { 15 | static NSBundle *refreshBundle = nil; 16 | if (refreshBundle == nil) { 17 | // 这里不使用mainBundle是为了适配pod 1.x和0.x 18 | refreshBundle = [NSBundle bundleWithPath:[[NSBundle bundleForClass:[MJRefreshComponent class]] pathForResource:@"MJRefresh" ofType:@"bundle"]]; 19 | } 20 | return refreshBundle; 21 | } 22 | 23 | + (UIImage *)mj_arrowImage 24 | { 25 | static UIImage *arrowImage = nil; 26 | if (arrowImage == nil) { 27 | arrowImage = [[UIImage imageWithContentsOfFile:[[self mj_refreshBundle] pathForResource:@"arrow@2x" ofType:@"png"]] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; 28 | } 29 | return arrowImage; 30 | } 31 | 32 | + (NSString *)mj_localizedStringForKey:(NSString *)key 33 | { 34 | return [self mj_localizedStringForKey:key value:nil]; 35 | } 36 | 37 | + (NSString *)mj_localizedStringForKey:(NSString *)key value:(NSString *)value 38 | { 39 | static NSBundle *bundle = nil; 40 | if (bundle == nil) { 41 | // (iOS获取的语言字符串比较不稳定)目前框架只处理en、zh-Hans、zh-Hant三种情况,其他按照系统默认处理 42 | NSString *language = [NSLocale preferredLanguages].firstObject; 43 | if ([language hasPrefix:@"en"]) { 44 | language = @"en"; 45 | } else if ([language hasPrefix:@"zh"]) { 46 | if ([language rangeOfString:@"Hans"].location != NSNotFound) { 47 | language = @"zh-Hans"; // 简体中文 48 | } else { // zh-Hant\zh-HK\zh-TW 49 | language = @"zh-Hant"; // 繁體中文 50 | } 51 | } else { 52 | language = @"en"; 53 | } 54 | 55 | // 从MJRefresh.bundle中查找资源 56 | bundle = [NSBundle bundleWithPath:[[NSBundle mj_refreshBundle] pathForResource:language ofType:@"lproj"]]; 57 | } 58 | value = [bundle localizedStringForKey:key value:value table:nil]; 59 | return [[NSBundle mainBundle] localizedStringForKey:key value:value table:nil]; 60 | } 61 | @end 62 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/UIScrollView+MJExtension.h: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // UIScrollView+Extension.h 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 14-5-28. 7 | // Copyright (c) 2014年 小码哥. All rights reserved. 8 | // 9 | 10 | #import 11 | 12 | @interface UIScrollView (MJExtension) 13 | @property (assign, nonatomic) CGFloat mj_insetT; 14 | @property (assign, nonatomic) CGFloat mj_insetB; 15 | @property (assign, nonatomic) CGFloat mj_insetL; 16 | @property (assign, nonatomic) CGFloat mj_insetR; 17 | 18 | @property (assign, nonatomic) CGFloat mj_offsetX; 19 | @property (assign, nonatomic) CGFloat mj_offsetY; 20 | 21 | @property (assign, nonatomic) CGFloat mj_contentW; 22 | @property (assign, nonatomic) CGFloat mj_contentH; 23 | @end 24 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/UIScrollView+MJExtension.m: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // UIScrollView+Extension.m 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 14-5-28. 7 | // Copyright (c) 2014年 小码哥. All rights reserved. 8 | // 9 | 10 | #import "UIScrollView+MJExtension.h" 11 | #import 12 | 13 | @implementation UIScrollView (MJExtension) 14 | 15 | - (void)setMj_insetT:(CGFloat)mj_insetT 16 | { 17 | UIEdgeInsets inset = self.contentInset; 18 | inset.top = mj_insetT; 19 | self.contentInset = inset; 20 | } 21 | 22 | - (CGFloat)mj_insetT 23 | { 24 | return self.contentInset.top; 25 | } 26 | 27 | - (void)setMj_insetB:(CGFloat)mj_insetB 28 | { 29 | UIEdgeInsets inset = self.contentInset; 30 | inset.bottom = mj_insetB; 31 | self.contentInset = inset; 32 | } 33 | 34 | - (CGFloat)mj_insetB 35 | { 36 | return self.contentInset.bottom; 37 | } 38 | 39 | - (void)setMj_insetL:(CGFloat)mj_insetL 40 | { 41 | UIEdgeInsets inset = self.contentInset; 42 | inset.left = mj_insetL; 43 | self.contentInset = inset; 44 | } 45 | 46 | - (CGFloat)mj_insetL 47 | { 48 | return self.contentInset.left; 49 | } 50 | 51 | - (void)setMj_insetR:(CGFloat)mj_insetR 52 | { 53 | UIEdgeInsets inset = self.contentInset; 54 | inset.right = mj_insetR; 55 | self.contentInset = inset; 56 | } 57 | 58 | - (CGFloat)mj_insetR 59 | { 60 | return self.contentInset.right; 61 | } 62 | 63 | - (void)setMj_offsetX:(CGFloat)mj_offsetX 64 | { 65 | CGPoint offset = self.contentOffset; 66 | offset.x = mj_offsetX; 67 | self.contentOffset = offset; 68 | } 69 | 70 | - (CGFloat)mj_offsetX 71 | { 72 | return self.contentOffset.x; 73 | } 74 | 75 | - (void)setMj_offsetY:(CGFloat)mj_offsetY 76 | { 77 | CGPoint offset = self.contentOffset; 78 | offset.y = mj_offsetY; 79 | self.contentOffset = offset; 80 | } 81 | 82 | - (CGFloat)mj_offsetY 83 | { 84 | return self.contentOffset.y; 85 | } 86 | 87 | - (void)setMj_contentW:(CGFloat)mj_contentW 88 | { 89 | CGSize size = self.contentSize; 90 | size.width = mj_contentW; 91 | self.contentSize = size; 92 | } 93 | 94 | - (CGFloat)mj_contentW 95 | { 96 | return self.contentSize.width; 97 | } 98 | 99 | - (void)setMj_contentH:(CGFloat)mj_contentH 100 | { 101 | CGSize size = self.contentSize; 102 | size.height = mj_contentH; 103 | self.contentSize = size; 104 | } 105 | 106 | - (CGFloat)mj_contentH 107 | { 108 | return self.contentSize.height; 109 | } 110 | @end 111 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/UIScrollView+MJRefresh.h: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // UIScrollView+MJRefresh.h 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 15/3/4. 7 | // Copyright (c) 2015年 小码哥. All rights reserved. 8 | // 给ScrollView增加下拉刷新、上拉刷新的功能 9 | 10 | #import 11 | #import "MJRefreshConst.h" 12 | 13 | @class MJRefreshHeader, MJRefreshFooter; 14 | 15 | @interface UIScrollView (MJRefresh) 16 | /** 下拉刷新控件 */ 17 | @property (strong, nonatomic) MJRefreshHeader *mj_header; 18 | @property (strong, nonatomic) MJRefreshHeader *header MJRefreshDeprecated("使用mj_header"); 19 | /** 上拉刷新控件 */ 20 | @property (strong, nonatomic) MJRefreshFooter *mj_footer; 21 | @property (strong, nonatomic) MJRefreshFooter *footer MJRefreshDeprecated("使用mj_footer"); 22 | 23 | #pragma mark - other 24 | - (NSInteger)mj_totalDataCount; 25 | @property (copy, nonatomic) void (^mj_reloadDataBlock)(NSInteger totalDataCount); 26 | @end 27 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/UIView+MJExtension.h: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // UIView+Extension.h 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 14-5-28. 7 | // Copyright (c) 2014年 小码哥. All rights reserved. 8 | // 9 | 10 | #import 11 | 12 | @interface UIView (MJExtension) 13 | @property (assign, nonatomic) CGFloat mj_x; 14 | @property (assign, nonatomic) CGFloat mj_y; 15 | @property (assign, nonatomic) CGFloat mj_w; 16 | @property (assign, nonatomic) CGFloat mj_h; 17 | @property (assign, nonatomic) CGSize mj_size; 18 | @property (assign, nonatomic) CGPoint mj_origin; 19 | @end 20 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/UIView+MJExtension.m: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // UIView+Extension.m 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 14-5-28. 7 | // Copyright (c) 2014年 小码哥. All rights reserved. 8 | // 9 | 10 | #import "UIView+MJExtension.h" 11 | 12 | @implementation UIView (MJExtension) 13 | - (void)setMj_x:(CGFloat)mj_x 14 | { 15 | CGRect frame = self.frame; 16 | frame.origin.x = mj_x; 17 | self.frame = frame; 18 | } 19 | 20 | - (CGFloat)mj_x 21 | { 22 | return self.frame.origin.x; 23 | } 24 | 25 | - (void)setMj_y:(CGFloat)mj_y 26 | { 27 | CGRect frame = self.frame; 28 | frame.origin.y = mj_y; 29 | self.frame = frame; 30 | } 31 | 32 | - (CGFloat)mj_y 33 | { 34 | return self.frame.origin.y; 35 | } 36 | 37 | - (void)setMj_w:(CGFloat)mj_w 38 | { 39 | CGRect frame = self.frame; 40 | frame.size.width = mj_w; 41 | self.frame = frame; 42 | } 43 | 44 | - (CGFloat)mj_w 45 | { 46 | return self.frame.size.width; 47 | } 48 | 49 | - (void)setMj_h:(CGFloat)mj_h 50 | { 51 | CGRect frame = self.frame; 52 | frame.size.height = mj_h; 53 | self.frame = frame; 54 | } 55 | 56 | - (CGFloat)mj_h 57 | { 58 | return self.frame.size.height; 59 | } 60 | 61 | - (void)setMj_size:(CGSize)mj_size 62 | { 63 | CGRect frame = self.frame; 64 | frame.size = mj_size; 65 | self.frame = frame; 66 | } 67 | 68 | - (CGSize)mj_size 69 | { 70 | return self.frame.size; 71 | } 72 | 73 | - (void)setMj_origin:(CGPoint)mj_origin 74 | { 75 | CGRect frame = self.frame; 76 | frame.origin = mj_origin; 77 | self.frame = frame; 78 | } 79 | 80 | - (CGPoint)mj_origin 81 | { 82 | return self.frame.origin; 83 | } 84 | @end 85 | -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Masonry (1.0.2) 3 | - MJRefresh (3.1.12) 4 | - SDWebImage (3.8.2): 5 | - SDWebImage/Core (= 3.8.2) 6 | - SDWebImage/Core (3.8.2) 7 | 8 | DEPENDENCIES: 9 | - Masonry (~> 1.0.0) 10 | - MJRefresh (~> 3.1.0) 11 | - SDWebImage (~> 3.7) 12 | 13 | SPEC CHECKSUMS: 14 | Masonry: 7c429b56da9d4ee0bbb3ed77a5ea710d6a5df39e 15 | MJRefresh: b96cdb21c4aa75a7b07654311ab2f315c497e806 16 | SDWebImage: '098e97e6176540799c27e804c96653ee0833d13c' 17 | 18 | COCOAPODS: 0.39.0 19 | -------------------------------------------------------------------------------- /Pods/Masonry/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-2012 Masonry Team - https://github.com/Masonry 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 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all 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. -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/MASCompositeConstraint.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASCompositeConstraint.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 21/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASConstraint.h" 10 | #import "MASUtilities.h" 11 | 12 | /** 13 | * A group of MASConstraint objects 14 | */ 15 | @interface MASCompositeConstraint : MASConstraint 16 | 17 | /** 18 | * Creates a composite with a predefined array of children 19 | * 20 | * @param children child MASConstraints 21 | * 22 | * @return a composite constraint 23 | */ 24 | - (id)initWithChildren:(NSArray *)children; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/MASConstraint+Private.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASConstraint+Private.h 3 | // Masonry 4 | // 5 | // Created by Nick Tymchenko on 29/04/14. 6 | // Copyright (c) 2014 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASConstraint.h" 10 | 11 | @protocol MASConstraintDelegate; 12 | 13 | 14 | @interface MASConstraint () 15 | 16 | /** 17 | * Whether or not to check for an existing constraint instead of adding constraint 18 | */ 19 | @property (nonatomic, assign) BOOL updateExisting; 20 | 21 | /** 22 | * Usually MASConstraintMaker but could be a parent MASConstraint 23 | */ 24 | @property (nonatomic, weak) id delegate; 25 | 26 | /** 27 | * Based on a provided value type, is equal to calling: 28 | * NSNumber - setOffset: 29 | * NSValue with CGPoint - setPointOffset: 30 | * NSValue with CGSize - setSizeOffset: 31 | * NSValue with MASEdgeInsets - setInsets: 32 | */ 33 | - (void)setLayoutConstantWithValue:(NSValue *)value; 34 | 35 | @end 36 | 37 | 38 | @interface MASConstraint (Abstract) 39 | 40 | /** 41 | * Sets the constraint relation to given NSLayoutRelation 42 | * returns a block which accepts one of the following: 43 | * MASViewAttribute, UIView, NSValue, NSArray 44 | * see readme for more details. 45 | */ 46 | - (MASConstraint * (^)(id, NSLayoutRelation))equalToWithRelation; 47 | 48 | /** 49 | * Override to set a custom chaining behaviour 50 | */ 51 | - (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute; 52 | 53 | @end 54 | 55 | 56 | @protocol MASConstraintDelegate 57 | 58 | /** 59 | * Notifies the delegate when the constraint needs to be replaced with another constraint. For example 60 | * A MASViewConstraint may turn into a MASCompositeConstraint when an array is passed to one of the equality blocks 61 | */ 62 | - (void)constraint:(MASConstraint *)constraint shouldBeReplacedWithConstraint:(MASConstraint *)replacementConstraint; 63 | 64 | - (MASConstraint *)constraint:(MASConstraint *)constraint addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute; 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/MASLayoutConstraint.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASLayoutConstraint.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 3/08/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "MASUtilities.h" 10 | 11 | /** 12 | * When you are debugging or printing the constraints attached to a view this subclass 13 | * makes it easier to identify which constraints have been created via Masonry 14 | */ 15 | @interface MASLayoutConstraint : NSLayoutConstraint 16 | 17 | /** 18 | * a key to associate with this constraint 19 | */ 20 | @property (nonatomic, strong) id mas_key; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/MASLayoutConstraint.m: -------------------------------------------------------------------------------- 1 | // 2 | // MASLayoutConstraint.m 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 3/08/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "MASLayoutConstraint.h" 10 | 11 | @implementation MASLayoutConstraint 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/MASViewAttribute.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASAttribute.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 21/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASUtilities.h" 10 | 11 | /** 12 | * An immutable tuple which stores the view and the related NSLayoutAttribute. 13 | * Describes part of either the left or right hand side of a constraint equation 14 | */ 15 | @interface MASViewAttribute : NSObject 16 | 17 | /** 18 | * The view which the reciever relates to. Can be nil if item is not a view. 19 | */ 20 | @property (nonatomic, weak, readonly) MAS_VIEW *view; 21 | 22 | /** 23 | * The item which the reciever relates to. 24 | */ 25 | @property (nonatomic, weak, readonly) id item; 26 | 27 | /** 28 | * The attribute which the reciever relates to 29 | */ 30 | @property (nonatomic, assign, readonly) NSLayoutAttribute layoutAttribute; 31 | 32 | /** 33 | * Convenience initializer. 34 | */ 35 | - (id)initWithView:(MAS_VIEW *)view layoutAttribute:(NSLayoutAttribute)layoutAttribute; 36 | 37 | /** 38 | * The designated initializer. 39 | */ 40 | - (id)initWithView:(MAS_VIEW *)view item:(id)item layoutAttribute:(NSLayoutAttribute)layoutAttribute; 41 | 42 | /** 43 | * Determine whether the layoutAttribute is a size attribute 44 | * 45 | * @return YES if layoutAttribute is equal to NSLayoutAttributeWidth or NSLayoutAttributeHeight 46 | */ 47 | - (BOOL)isSizeAttribute; 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/MASViewAttribute.m: -------------------------------------------------------------------------------- 1 | // 2 | // MASAttribute.m 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 21/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASViewAttribute.h" 10 | 11 | @implementation MASViewAttribute 12 | 13 | - (id)initWithView:(MAS_VIEW *)view layoutAttribute:(NSLayoutAttribute)layoutAttribute { 14 | self = [self initWithView:view item:view layoutAttribute:layoutAttribute]; 15 | return self; 16 | } 17 | 18 | - (id)initWithView:(MAS_VIEW *)view item:(id)item layoutAttribute:(NSLayoutAttribute)layoutAttribute { 19 | self = [super init]; 20 | if (!self) return nil; 21 | 22 | _view = view; 23 | _item = item; 24 | _layoutAttribute = layoutAttribute; 25 | 26 | return self; 27 | } 28 | 29 | - (BOOL)isSizeAttribute { 30 | return self.layoutAttribute == NSLayoutAttributeWidth 31 | || self.layoutAttribute == NSLayoutAttributeHeight; 32 | } 33 | 34 | - (BOOL)isEqual:(MASViewAttribute *)viewAttribute { 35 | if ([viewAttribute isKindOfClass:self.class]) { 36 | return self.view == viewAttribute.view 37 | && self.layoutAttribute == viewAttribute.layoutAttribute; 38 | } 39 | return [super isEqual:viewAttribute]; 40 | } 41 | 42 | - (NSUInteger)hash { 43 | return MAS_NSUINTROTATE([self.view hash], MAS_NSUINT_BIT / 2) ^ self.layoutAttribute; 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/MASViewConstraint.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASConstraint.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 20/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASViewAttribute.h" 10 | #import "MASConstraint.h" 11 | #import "MASLayoutConstraint.h" 12 | #import "MASUtilities.h" 13 | 14 | /** 15 | * A single constraint. 16 | * Contains the attributes neccessary for creating a NSLayoutConstraint and adding it to the appropriate view 17 | */ 18 | @interface MASViewConstraint : MASConstraint 19 | 20 | /** 21 | * First item/view and first attribute of the NSLayoutConstraint 22 | */ 23 | @property (nonatomic, strong, readonly) MASViewAttribute *firstViewAttribute; 24 | 25 | /** 26 | * Second item/view and second attribute of the NSLayoutConstraint 27 | */ 28 | @property (nonatomic, strong, readonly) MASViewAttribute *secondViewAttribute; 29 | 30 | /** 31 | * initialises the MASViewConstraint with the first part of the equation 32 | * 33 | * @param firstViewAttribute view.mas_left, view.mas_width etc. 34 | * 35 | * @return a new view constraint 36 | */ 37 | - (id)initWithFirstViewAttribute:(MASViewAttribute *)firstViewAttribute; 38 | 39 | /** 40 | * Returns all MASViewConstraints installed with this view as a first item. 41 | * 42 | * @param view A view to retrieve constraints for. 43 | * 44 | * @return An array of MASViewConstraints. 45 | */ 46 | + (NSArray *)installedConstraintsForView:(MAS_VIEW *)view; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/Masonry.h: -------------------------------------------------------------------------------- 1 | // 2 | // Masonry.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 20/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for Masonry. 12 | FOUNDATION_EXPORT double MasonryVersionNumber; 13 | 14 | //! Project version string for Masonry. 15 | FOUNDATION_EXPORT const unsigned char MasonryVersionString[]; 16 | 17 | #import "MASUtilities.h" 18 | #import "View+MASAdditions.h" 19 | #import "View+MASShorthandAdditions.h" 20 | #import "ViewController+MASAdditions.h" 21 | #import "NSArray+MASAdditions.h" 22 | #import "NSArray+MASShorthandAdditions.h" 23 | #import "MASConstraint.h" 24 | #import "MASCompositeConstraint.h" 25 | #import "MASViewAttribute.h" 26 | #import "MASViewConstraint.h" 27 | #import "MASConstraintMaker.h" 28 | #import "MASLayoutConstraint.h" 29 | #import "NSLayoutConstraint+MASDebugAdditions.h" 30 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/NSArray+MASAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+MASAdditions.h 3 | // 4 | // 5 | // Created by Daniel Hammond on 11/26/13. 6 | // 7 | // 8 | 9 | #import "MASUtilities.h" 10 | #import "MASConstraintMaker.h" 11 | #import "MASViewAttribute.h" 12 | 13 | typedef NS_ENUM(NSUInteger, MASAxisType) { 14 | MASAxisTypeHorizontal, 15 | MASAxisTypeVertical 16 | }; 17 | 18 | @interface NSArray (MASAdditions) 19 | 20 | /** 21 | * Creates a MASConstraintMaker with each view in the callee. 22 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing on each view 23 | * 24 | * @param block scope within which you can build up the constraints which you wish to apply to each view. 25 | * 26 | * @return Array of created MASConstraints 27 | */ 28 | - (NSArray *)mas_makeConstraints:(void (^)(MASConstraintMaker *make))block; 29 | 30 | /** 31 | * Creates a MASConstraintMaker with each view in the callee. 32 | * Any constraints defined are added to each view or the appropriate superview once the block has finished executing on each view. 33 | * If an existing constraint exists then it will be updated instead. 34 | * 35 | * @param block scope within which you can build up the constraints which you wish to apply to each view. 36 | * 37 | * @return Array of created/updated MASConstraints 38 | */ 39 | - (NSArray *)mas_updateConstraints:(void (^)(MASConstraintMaker *make))block; 40 | 41 | /** 42 | * Creates a MASConstraintMaker with each view in the callee. 43 | * Any constraints defined are added to each view or the appropriate superview once the block has finished executing on each view. 44 | * All constraints previously installed for the views will be removed. 45 | * 46 | * @param block scope within which you can build up the constraints which you wish to apply to each view. 47 | * 48 | * @return Array of created/updated MASConstraints 49 | */ 50 | - (NSArray *)mas_remakeConstraints:(void (^)(MASConstraintMaker *make))block; 51 | 52 | /** 53 | * distribute with fixed spacing 54 | * 55 | * @param axisType which axis to distribute items along 56 | * @param fixedSpacing the spacing between each item 57 | * @param leadSpacing the spacing before the first item and the container 58 | * @param tailSpacing the spacing after the last item and the container 59 | */ 60 | - (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedSpacing:(CGFloat)fixedSpacing leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing; 61 | 62 | /** 63 | * distribute with fixed item size 64 | * 65 | * @param axisType which axis to distribute items along 66 | * @param fixedItemLength the fixed length of each item 67 | * @param leadSpacing the spacing before the first item and the container 68 | * @param tailSpacing the spacing after the last item and the container 69 | */ 70 | - (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedItemLength:(CGFloat)fixedItemLength leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing; 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/NSArray+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+MASShorthandAdditions.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 22/07/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "NSArray+MASAdditions.h" 10 | 11 | #ifdef MAS_SHORTHAND 12 | 13 | /** 14 | * Shorthand array additions without the 'mas_' prefixes, 15 | * only enabled if MAS_SHORTHAND is defined 16 | */ 17 | @interface NSArray (MASShorthandAdditions) 18 | 19 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *make))block; 20 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *make))block; 21 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *make))block; 22 | 23 | @end 24 | 25 | @implementation NSArray (MASShorthandAdditions) 26 | 27 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *))block { 28 | return [self mas_makeConstraints:block]; 29 | } 30 | 31 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *))block { 32 | return [self mas_updateConstraints:block]; 33 | } 34 | 35 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *))block { 36 | return [self mas_remakeConstraints:block]; 37 | } 38 | 39 | @end 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSLayoutConstraint+MASDebugAdditions.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 3/08/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "MASUtilities.h" 10 | 11 | /** 12 | * makes debug and log output of NSLayoutConstraints more readable 13 | */ 14 | @interface NSLayoutConstraint (MASDebugAdditions) 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/ViewController+MASAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+MASAdditions.h 3 | // Masonry 4 | // 5 | // Created by Craig Siemens on 2015-06-23. 6 | // 7 | // 8 | 9 | #import "MASUtilities.h" 10 | #import "MASConstraintMaker.h" 11 | #import "MASViewAttribute.h" 12 | 13 | #ifdef MAS_VIEW_CONTROLLER 14 | 15 | @interface MAS_VIEW_CONTROLLER (MASAdditions) 16 | 17 | /** 18 | * following properties return a new MASViewAttribute with appropriate UILayoutGuide and NSLayoutAttribute 19 | */ 20 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuide; 21 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuide; 22 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuideTop; 23 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuideBottom; 24 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuideTop; 25 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuideBottom; 26 | 27 | 28 | @end 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/ViewController+MASAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+MASAdditions.m 3 | // Masonry 4 | // 5 | // Created by Craig Siemens on 2015-06-23. 6 | // 7 | // 8 | 9 | #import "ViewController+MASAdditions.h" 10 | 11 | #ifdef MAS_VIEW_CONTROLLER 12 | 13 | @implementation MAS_VIEW_CONTROLLER (MASAdditions) 14 | 15 | - (MASViewAttribute *)mas_topLayoutGuide { 16 | return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; 17 | } 18 | - (MASViewAttribute *)mas_topLayoutGuideTop { 19 | return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeTop]; 20 | } 21 | - (MASViewAttribute *)mas_topLayoutGuideBottom { 22 | return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; 23 | } 24 | 25 | - (MASViewAttribute *)mas_bottomLayoutGuide { 26 | return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeTop]; 27 | } 28 | - (MASViewAttribute *)mas_bottomLayoutGuideTop { 29 | return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeTop]; 30 | } 31 | - (MASViewAttribute *)mas_bottomLayoutGuideBottom { 32 | return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; 33 | } 34 | 35 | 36 | 37 | @end 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/YHIOS002.xcuserdatad/xcschemes/MJRefresh.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 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/YHIOS002.xcuserdatad/xcschemes/Masonry.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 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/YHIOS002.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 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/YHIOS002.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 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/YHIOS002.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | MJRefresh.xcscheme 8 | 9 | isShown 10 | 11 | 12 | Masonry.xcscheme 13 | 14 | isShown 15 | 16 | 17 | Pods.xcscheme 18 | 19 | isShown 20 | 21 | 22 | SDWebImage.xcscheme 23 | 24 | isShown 25 | 26 | 27 | 28 | SuppressBuildableAutocreation 29 | 30 | 2C8CD97C8271F3A1097A150E0549A738 31 | 32 | primary 33 | 34 | 35 | 53480ED0BE09FF49E34B1702D485CAAB 36 | 37 | primary 38 | 39 | 40 | 70BC44266C6FFE30D2C57129458E070B 41 | 42 | primary 43 | 44 | 45 | D3851938B380A023DB527F0E473AAA85 46 | 47 | primary 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /Pods/SDWebImage/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 Olivier Poitrey rs@dailymotion.com 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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 = 1; 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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Pods/Target Support Files/MJRefresh/MJRefresh-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_MJRefresh : NSObject 3 | @end 4 | @implementation PodsDummy_MJRefresh 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/MJRefresh/MJRefresh-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/MJRefresh/MJRefresh.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/MJRefresh" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/SDWebImage" 3 | PODS_ROOT = ${SRCROOT} 4 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Pods/Target Support Files/Masonry/Masonry-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Masonry : NSObject 3 | @end 4 | @implementation PodsDummy_Masonry 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Masonry/Masonry-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Masonry/Masonry.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/Masonry" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/SDWebImage" 3 | OTHER_LDFLAGS = -framework "Foundation" -framework "UIKit" 4 | PODS_ROOT = ${SRCROOT} 5 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## MJRefresh 5 | 6 | Copyright (c) 2013-2015 MJRefresh (https://github.com/CoderMJLee/MJRefresh) 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 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all 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 | ## Masonry 28 | 29 | Copyright (c) 2011-2012 Masonry Team - https://github.com/Masonry 30 | 31 | Permission is hereby granted, free of charge, to any person obtaining a copy 32 | of this software and associated documentation files (the "Software"), to deal 33 | in the Software without restriction, including without limitation the rights 34 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 35 | copies of the Software, and to permit persons to whom the Software is 36 | furnished to do so, subject to the following conditions: 37 | 38 | The above copyright notice and this permission notice shall be included in 39 | all copies or substantial portions of the Software. 40 | 41 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 42 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 43 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 44 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 45 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 46 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 47 | THE SOFTWARE. 48 | 49 | ## SDWebImage 50 | 51 | Copyright (c) 2016 Olivier Poitrey rs@dailymotion.com 52 | 53 | Permission is hereby granted, free of charge, to any person obtaining a copy 54 | of this software and associated documentation files (the "Software"), to deal 55 | in the Software without restriction, including without limitation the rights 56 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 57 | copies of the Software, and to permit persons to whom the Software is furnished 58 | to do so, subject to the following conditions: 59 | 60 | The above copyright notice and this permission notice shall be included in all 61 | copies or substantial portions of the Software. 62 | 63 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 64 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 65 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 66 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 67 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 68 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 69 | THE SOFTWARE. 70 | 71 | 72 | Generated by CocoaPods - http://cocoapods.org 73 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods : NSObject 3 | @end 4 | @implementation PodsDummy_Pods 5 | @end 6 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/MJRefresh" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/SDWebImage" 3 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/MJRefresh" -isystem "${PODS_ROOT}/Headers/Public/Masonry" -isystem "${PODS_ROOT}/Headers/Public/SDWebImage" 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"MJRefresh" -l"Masonry" -l"SDWebImage" -framework "Foundation" -framework "ImageIO" -framework "UIKit" 5 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /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/MJRefresh" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/SDWebImage" 3 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/MJRefresh" -isystem "${PODS_ROOT}/Headers/Public/Masonry" -isystem "${PODS_ROOT}/Headers/Public/SDWebImage" 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"MJRefresh" -l"Masonry" -l"SDWebImage" -framework "Foundation" -framework "ImageIO" -framework "UIKit" 5 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Pods/Target Support Files/SDWebImage/SDWebImage-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_SDWebImage : NSObject 3 | @end 4 | @implementation PodsDummy_SDWebImage 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SDWebImage/SDWebImage-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /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/MJRefresh" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/SDWebImage" 3 | OTHER_LDFLAGS = -framework "ImageIO" 4 | PODS_ROOT = ${SRCROOT} 5 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # HKPTimeLine 2 | ## description 3 | [MyCSDN: iOS-仿赤兔、新浪微博动态列表(带评论、点赞、转发和分享,自动计算行高功能)](http://blog.csdn.net/samuelandkevin/article/details/53186368)
4 | 项目中使用到的第三方框架有:Masonry,HYBMasonryAutoCellHeight,SDWebImage
5 | #### 文件结构: 6 | pic1
8 | #### 数据源: 9 | 项目中的数据来源不是来自公司服务器,是通过函数随机产生。以下这部分代码大家可以在实际开发中通过后台服务器获取的数据代替。
10 | ``` 11 | - (void)randomModel:(YHWorkGroup *)model totalCount:(int)totalCount{ 12 | model.type = arc4random()%totalCount %2? DynType_Forward:DynType_Original; 13 | if (model.type == DynType_Forward) { 14 | model.forwardModel = [YHWorkGroup new]; 15 | [self creatOriModel:model.forwardModel totalCount:totalCount]; 16 | } 17 | [self creatOriModel:model totalCount:totalCount]; 18 | } 19 | ``` 20 |
21 | 22 | 使用Masorny布局时要打开符号断点:
23 | pic3
25 | #### 行高计算: 26 | 取缓存高度,若为0,则计算高度。 27 | ``` 28 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ 29 | 30 | if (indexPath.row < self.dataArray.count) { 31 | CGFloat height = 0.0; 32 | //原创cell 33 | Class currentClass = [CellForWorkGroup class]; 34 | YHWorkGroup *model = self.dataArray[indexPath.row]; 35 | 36 | //取缓存高度 37 | NSDictionary *dict = self.heightDict[model.dynamicId]; 38 | if (dict) { 39 | if (model.isOpening) { 40 | height = [dict[@"open"] floatValue]; 41 | }else{ 42 | height = [dict[@"normal"] floatValue]; 43 | } 44 | if (height) { 45 | return height; 46 | } 47 | } 48 | 49 | //转发cell 50 | if (model.type == DynType_Forward) { 51 | currentClass = [CellForWorkGroupRepost class];//第一版没有转发,因此这样稍该一下 52 | 53 | height = [CellForWorkGroupRepost hyb_heightForTableView:tableView config:^(UITableViewCell *sourceCell) { 54 | CellForWorkGroupRepost *cell = (CellForWorkGroupRepost *)sourceCell; 55 | cell.model = model; 56 | }]; 57 | 58 | } 59 | else{ 60 | height = [CellForWorkGroup hyb_heightForTableView:tableView config:^(UITableViewCell *sourceCell) { 61 | CellForWorkGroup *cell = (CellForWorkGroup *)sourceCell; 62 | cell.model = model; 63 | }]; 64 | } 65 | 66 | //缓存高度 67 | if (model.dynamicId) { 68 | NSMutableDictionary *aDict = [NSMutableDictionary new]; 69 | if (model.isOpening) { 70 | [aDict setObject:@(height) forKey:@"open"]; 71 | }else{ 72 | [aDict setObject:@(height) forKey:@"normal"]; 73 | } 74 | [self.heightDict setObject:aDict forKey:model.dynamicId]; 75 | } 76 | return height; 77 | } 78 | else{ 79 | return 44.0f; 80 | } 81 | } 82 | 83 | ``` 84 | #### 效果图: 85 | pic5 pic7 pic8 pic9
90 | 91 | 你的支持,我的动力! 92 | -------------------------------------------------------------------------------- /pics/gif1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samuelandkevin/HKPTimeLine/3b5a87b4f1667bd743e75baa58976c30bb887d3b/pics/gif1.gif -------------------------------------------------------------------------------- /pics/pic1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samuelandkevin/HKPTimeLine/3b5a87b4f1667bd743e75baa58976c30bb887d3b/pics/pic1.png -------------------------------------------------------------------------------- /pics/pic2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samuelandkevin/HKPTimeLine/3b5a87b4f1667bd743e75baa58976c30bb887d3b/pics/pic2.png -------------------------------------------------------------------------------- /pics/pic3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samuelandkevin/HKPTimeLine/3b5a87b4f1667bd743e75baa58976c30bb887d3b/pics/pic3.png -------------------------------------------------------------------------------- /pics/pic4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samuelandkevin/HKPTimeLine/3b5a87b4f1667bd743e75baa58976c30bb887d3b/pics/pic4.png --------------------------------------------------------------------------------