├── .gitignore ├── LICENSE ├── Project ├── XHNewsFrameworkExample.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── XHNewsFrameworkExample │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Controllers │ │ ├── XHExampleLeftSideDrawerViewController.h │ │ ├── XHExampleLeftSideDrawerViewController.m │ │ ├── XHExampleRightSideDrawerViewController.h │ │ ├── XHExampleRightSideDrawerViewController.m │ │ ├── XHExampleSideDrawerViewController.h │ │ ├── XHExampleSideDrawerViewController.m │ │ ├── XHNeteaseNewsViewController.h │ │ └── XHNeteaseNewsViewController.m │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── LaunchImage.launchimage │ │ │ └── Contents.json │ ├── Models │ │ ├── XHDataStoreManager.h │ │ ├── XHDataStoreManager.m │ │ ├── XHNewsModel.h │ │ └── XHNewsModel.m │ ├── Resources │ │ ├── MenuBackground@2x.png │ │ ├── info_offline_flash.png │ │ ├── info_offline_flash@2x.png │ │ ├── leftShadow@2x.png │ │ ├── logo@2x.png │ │ ├── managerMenuButton@2x.png │ │ ├── order_back.png │ │ ├── page_state_highlight@2x.png │ │ ├── page_state_normal@2x.png │ │ ├── refresh.png │ │ ├── refresh@2x.png │ │ ├── rightShadow@2x.png │ │ ├── statusbar_close.png │ │ ├── statusbar_close@2x.png │ │ ├── 列表图片@2x.jpg │ │ └── 图片@2x.jpg │ ├── Vendor │ │ ├── RESideMenu │ │ │ ├── RECommonFunctions.h │ │ │ ├── RECommonFunctions.m │ │ │ ├── RESideMenu.h │ │ │ ├── RESideMenu.m │ │ │ ├── UIViewController+RESideMenu.h │ │ │ └── UIViewController+RESideMenu.m │ │ └── XHNewsFramework.framework │ │ │ ├── Headers │ │ │ ├── Resources │ │ │ ├── Versions │ │ │ ├── A │ │ │ │ ├── Headers │ │ │ │ │ ├── NSTimer+Addition.h │ │ │ │ │ ├── UIScrollView+XHVisibleCenterScroll.h │ │ │ │ │ ├── XHBaseViewController.h │ │ │ │ │ ├── XHColumnItemManagerViewController.h │ │ │ │ │ ├── XHColumnItemView.h │ │ │ │ │ ├── XHContentView.h │ │ │ │ │ ├── XHEdittingScrollView.h │ │ │ │ │ ├── XHFountionCommon.h │ │ │ │ │ ├── XHFriendlyLoadingView.h │ │ │ │ │ ├── XHHTTPClient.h │ │ │ │ │ ├── XHIndicatorView.h │ │ │ │ │ ├── XHMenu.h │ │ │ │ │ ├── XHMenuButton.h │ │ │ │ │ ├── XHNewsCommentsViewController.h │ │ │ │ │ ├── XHNewsContainerViewController.h │ │ │ │ │ ├── XHNewsDetail.h │ │ │ │ │ ├── XHNewsDetailViewController.h │ │ │ │ │ ├── XHOperationNetworkKit.h │ │ │ │ │ ├── XHPageControl.h │ │ │ │ │ ├── XHPageIndexPath.h │ │ │ │ │ ├── XHParallaxNavigationController.h │ │ │ │ │ ├── XHProgressStatusBar.h │ │ │ │ │ ├── XHScrollBannerView.h │ │ │ │ │ └── XHScrollMenu.h │ │ │ │ ├── Resources │ │ │ │ │ ├── Info.plist │ │ │ │ │ └── en.lproj │ │ │ │ │ │ └── InfoPlist.strings │ │ │ │ └── XHNewsFramework │ │ │ └── Current │ │ │ └── XHNewsFramework │ ├── Views │ │ ├── HUAJIEBannerView.h │ │ ├── HUAJIEBannerView.m │ │ ├── HUAJIENewsCell.h │ │ ├── HUAJIENewsCell.m │ │ ├── XHNetNewsCell.h │ │ └── XHNetNewsCell.m │ ├── XHNewsFrameworkExample-Info.plist │ ├── XHNewsFrameworkExample-Prefix.pch │ ├── en.lproj │ │ └── InfoPlist.strings │ └── main.m └── XHNewsFrameworkExampleTests │ ├── XHNewsFrameworkExampleTests-Info.plist │ ├── XHNewsFrameworkExampleTests.m │ └── en.lproj │ └── InfoPlist.strings ├── README.md ├── Screenshots ├── XHNewsFrameworkPulDownUpRefresh.gif └── XHNewsFramewrokPanGestureRecognizer.gif └── fixTheHeadError.gif /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | .DS_Store 3 | */build/* 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | profile 14 | *.moved-aside 15 | DerivedData 16 | .idea/ 17 | *.hmap 18 | *.xccheckout 19 | 20 | #CocoaPods 21 | Pods 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 JackTeam 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 74180D5D190F9C5600A35C82 /* XHDataStoreManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 74180D5C190F9C5600A35C82 /* XHDataStoreManager.m */; }; 11 | 74180D60190F9C6700A35C82 /* XHNewsModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 74180D5F190F9C6700A35C82 /* XHNewsModel.m */; }; 12 | 74180D67190FA6B700A35C82 /* XHNetNewsCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 74180D66190FA6B700A35C82 /* XHNetNewsCell.m */; }; 13 | 74B7F40118F2EEBD004EE42A /* RECommonFunctions.m in Sources */ = {isa = PBXBuildFile; fileRef = 74B7F3FC18F2EEBD004EE42A /* RECommonFunctions.m */; }; 14 | 74B7F40218F2EEBD004EE42A /* RESideMenu.m in Sources */ = {isa = PBXBuildFile; fileRef = 74B7F3FE18F2EEBD004EE42A /* RESideMenu.m */; }; 15 | 74B7F40318F2EEBD004EE42A /* UIViewController+RESideMenu.m in Sources */ = {isa = PBXBuildFile; fileRef = 74B7F40018F2EEBD004EE42A /* UIViewController+RESideMenu.m */; }; 16 | 74E272F318EE535900AC103D /* page_state_highlight@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 74E272F118EE535900AC103D /* page_state_highlight@2x.png */; }; 17 | 74E272F418EE535900AC103D /* page_state_normal@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 74E272F218EE535900AC103D /* page_state_normal@2x.png */; }; 18 | AB4D0A5118DD248600C7858F /* XHExampleLeftSideDrawerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AB4D0A3F18DD248600C7858F /* XHExampleLeftSideDrawerViewController.m */; }; 19 | AB4D0A5218DD248600C7858F /* XHExampleSideDrawerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AB4D0A4118DD248600C7858F /* XHExampleSideDrawerViewController.m */; }; 20 | AB4D0A5318DD248600C7858F /* XHNeteaseNewsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AB4D0A4318DD248600C7858F /* XHNeteaseNewsViewController.m */; }; 21 | AB4D0A5718DD248600C7858F /* HUAJIEBannerView.m in Sources */ = {isa = PBXBuildFile; fileRef = AB4D0A4E18DD248600C7858F /* HUAJIEBannerView.m */; }; 22 | AB4D0A5818DD248600C7858F /* HUAJIENewsCell.m in Sources */ = {isa = PBXBuildFile; fileRef = AB4D0A5018DD248600C7858F /* HUAJIENewsCell.m */; }; 23 | AB4D0A6818DD249900C7858F /* info_offline_flash.png in Resources */ = {isa = PBXBuildFile; fileRef = AB4D0A5A18DD249900C7858F /* info_offline_flash.png */; }; 24 | AB4D0A6918DD249900C7858F /* info_offline_flash@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = AB4D0A5B18DD249900C7858F /* info_offline_flash@2x.png */; }; 25 | AB4D0A6A18DD249900C7858F /* leftShadow@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = AB4D0A5C18DD249900C7858F /* leftShadow@2x.png */; }; 26 | AB4D0A6B18DD249900C7858F /* logo@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = AB4D0A5D18DD249900C7858F /* logo@2x.png */; }; 27 | AB4D0A6C18DD249900C7858F /* managerMenuButton@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = AB4D0A5E18DD249900C7858F /* managerMenuButton@2x.png */; }; 28 | AB4D0A6D18DD249900C7858F /* MenuBackground@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = AB4D0A5F18DD249900C7858F /* MenuBackground@2x.png */; }; 29 | AB4D0A6E18DD249900C7858F /* order_back.png in Resources */ = {isa = PBXBuildFile; fileRef = AB4D0A6018DD249900C7858F /* order_back.png */; }; 30 | AB4D0A6F18DD249900C7858F /* refresh.png in Resources */ = {isa = PBXBuildFile; fileRef = AB4D0A6118DD249900C7858F /* refresh.png */; }; 31 | AB4D0A7018DD249900C7858F /* refresh@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = AB4D0A6218DD249900C7858F /* refresh@2x.png */; }; 32 | AB4D0A7118DD249900C7858F /* rightShadow@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = AB4D0A6318DD249900C7858F /* rightShadow@2x.png */; }; 33 | AB4D0A7218DD249900C7858F /* statusbar_close.png in Resources */ = {isa = PBXBuildFile; fileRef = AB4D0A6418DD249900C7858F /* statusbar_close.png */; }; 34 | AB4D0A7318DD249900C7858F /* statusbar_close@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = AB4D0A6518DD249900C7858F /* statusbar_close@2x.png */; }; 35 | AB4D0A7418DD249900C7858F /* 列表图片@2x.jpg in Resources */ = {isa = PBXBuildFile; fileRef = AB4D0A6618DD249900C7858F /* 列表图片@2x.jpg */; }; 36 | AB4D0A7518DD249900C7858F /* 图片@2x.jpg in Resources */ = {isa = PBXBuildFile; fileRef = AB4D0A6718DD249900C7858F /* 图片@2x.jpg */; }; 37 | AB4D0A7818DD255C00C7858F /* XHExampleRightSideDrawerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AB4D0A7718DD255C00C7858F /* XHExampleRightSideDrawerViewController.m */; }; 38 | AB8682FE18942CFE00765392 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB8682FD18942CFE00765392 /* Foundation.framework */; }; 39 | AB86830018942CFE00765392 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB8682FF18942CFE00765392 /* CoreGraphics.framework */; }; 40 | AB86830218942CFE00765392 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB86830118942CFE00765392 /* UIKit.framework */; }; 41 | AB86830818942CFE00765392 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = AB86830618942CFE00765392 /* InfoPlist.strings */; }; 42 | AB86830A18942CFE00765392 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = AB86830918942CFE00765392 /* main.m */; }; 43 | AB86830E18942CFE00765392 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = AB86830D18942CFE00765392 /* AppDelegate.m */; }; 44 | AB86831018942CFE00765392 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = AB86830F18942CFE00765392 /* Images.xcassets */; }; 45 | AB86831718942CFF00765392 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB86831618942CFF00765392 /* XCTest.framework */; }; 46 | AB86831818942CFF00765392 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB8682FD18942CFE00765392 /* Foundation.framework */; }; 47 | AB86831918942CFF00765392 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB86830118942CFE00765392 /* UIKit.framework */; }; 48 | AB86832118942CFF00765392 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = AB86831F18942CFF00765392 /* InfoPlist.strings */; }; 49 | AB86832318942CFF00765392 /* XHNewsFrameworkExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = AB86832218942CFF00765392 /* XHNewsFrameworkExampleTests.m */; }; 50 | ABE77C551899CFFA0006EF4A /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ABE77C541899CFFA0006EF4A /* Accelerate.framework */; }; 51 | ABEE1151191477CB0048BD57 /* XHNewsFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ABEE1150191477CB0048BD57 /* XHNewsFramework.framework */; }; 52 | /* End PBXBuildFile section */ 53 | 54 | /* Begin PBXContainerItemProxy section */ 55 | AB86831A18942CFF00765392 /* PBXContainerItemProxy */ = { 56 | isa = PBXContainerItemProxy; 57 | containerPortal = AB8682F218942CFE00765392 /* Project object */; 58 | proxyType = 1; 59 | remoteGlobalIDString = AB8682F918942CFE00765392; 60 | remoteInfo = XHNewsFrameworkExample; 61 | }; 62 | /* End PBXContainerItemProxy section */ 63 | 64 | /* Begin PBXFileReference section */ 65 | 74180D5B190F9C5600A35C82 /* XHDataStoreManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XHDataStoreManager.h; sourceTree = ""; }; 66 | 74180D5C190F9C5600A35C82 /* XHDataStoreManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XHDataStoreManager.m; sourceTree = ""; }; 67 | 74180D5E190F9C6700A35C82 /* XHNewsModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XHNewsModel.h; sourceTree = ""; }; 68 | 74180D5F190F9C6700A35C82 /* XHNewsModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XHNewsModel.m; sourceTree = ""; }; 69 | 74180D65190FA6B700A35C82 /* XHNetNewsCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XHNetNewsCell.h; sourceTree = ""; }; 70 | 74180D66190FA6B700A35C82 /* XHNetNewsCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XHNetNewsCell.m; sourceTree = ""; }; 71 | 74B7F3FB18F2EEBD004EE42A /* RECommonFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RECommonFunctions.h; sourceTree = ""; }; 72 | 74B7F3FC18F2EEBD004EE42A /* RECommonFunctions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RECommonFunctions.m; sourceTree = ""; }; 73 | 74B7F3FD18F2EEBD004EE42A /* RESideMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RESideMenu.h; sourceTree = ""; }; 74 | 74B7F3FE18F2EEBD004EE42A /* RESideMenu.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RESideMenu.m; sourceTree = ""; }; 75 | 74B7F3FF18F2EEBD004EE42A /* UIViewController+RESideMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIViewController+RESideMenu.h"; sourceTree = ""; }; 76 | 74B7F40018F2EEBD004EE42A /* UIViewController+RESideMenu.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIViewController+RESideMenu.m"; sourceTree = ""; }; 77 | 74E272F118EE535900AC103D /* page_state_highlight@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "page_state_highlight@2x.png"; sourceTree = ""; }; 78 | 74E272F218EE535900AC103D /* page_state_normal@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "page_state_normal@2x.png"; sourceTree = ""; }; 79 | AB4D0A3E18DD248600C7858F /* XHExampleLeftSideDrawerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XHExampleLeftSideDrawerViewController.h; sourceTree = ""; }; 80 | AB4D0A3F18DD248600C7858F /* XHExampleLeftSideDrawerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XHExampleLeftSideDrawerViewController.m; sourceTree = ""; }; 81 | AB4D0A4018DD248600C7858F /* XHExampleSideDrawerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XHExampleSideDrawerViewController.h; sourceTree = ""; }; 82 | AB4D0A4118DD248600C7858F /* XHExampleSideDrawerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XHExampleSideDrawerViewController.m; sourceTree = ""; }; 83 | AB4D0A4218DD248600C7858F /* XHNeteaseNewsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XHNeteaseNewsViewController.h; sourceTree = ""; }; 84 | AB4D0A4318DD248600C7858F /* XHNeteaseNewsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XHNeteaseNewsViewController.m; sourceTree = ""; }; 85 | AB4D0A4D18DD248600C7858F /* HUAJIEBannerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HUAJIEBannerView.h; sourceTree = ""; }; 86 | AB4D0A4E18DD248600C7858F /* HUAJIEBannerView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HUAJIEBannerView.m; sourceTree = ""; }; 87 | AB4D0A4F18DD248600C7858F /* HUAJIENewsCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HUAJIENewsCell.h; sourceTree = ""; }; 88 | AB4D0A5018DD248600C7858F /* HUAJIENewsCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HUAJIENewsCell.m; sourceTree = ""; }; 89 | AB4D0A5A18DD249900C7858F /* info_offline_flash.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = info_offline_flash.png; sourceTree = ""; }; 90 | AB4D0A5B18DD249900C7858F /* info_offline_flash@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "info_offline_flash@2x.png"; sourceTree = ""; }; 91 | AB4D0A5C18DD249900C7858F /* leftShadow@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "leftShadow@2x.png"; sourceTree = ""; }; 92 | AB4D0A5D18DD249900C7858F /* logo@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "logo@2x.png"; sourceTree = ""; }; 93 | AB4D0A5E18DD249900C7858F /* managerMenuButton@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "managerMenuButton@2x.png"; sourceTree = ""; }; 94 | AB4D0A5F18DD249900C7858F /* MenuBackground@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "MenuBackground@2x.png"; sourceTree = ""; }; 95 | AB4D0A6018DD249900C7858F /* order_back.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = order_back.png; sourceTree = ""; }; 96 | AB4D0A6118DD249900C7858F /* refresh.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = refresh.png; sourceTree = ""; }; 97 | AB4D0A6218DD249900C7858F /* refresh@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "refresh@2x.png"; sourceTree = ""; }; 98 | AB4D0A6318DD249900C7858F /* rightShadow@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "rightShadow@2x.png"; sourceTree = ""; }; 99 | AB4D0A6418DD249900C7858F /* statusbar_close.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = statusbar_close.png; sourceTree = ""; }; 100 | AB4D0A6518DD249900C7858F /* statusbar_close@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "statusbar_close@2x.png"; sourceTree = ""; }; 101 | AB4D0A6618DD249900C7858F /* 列表图片@2x.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "列表图片@2x.jpg"; sourceTree = ""; }; 102 | AB4D0A6718DD249900C7858F /* 图片@2x.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "图片@2x.jpg"; sourceTree = ""; }; 103 | AB4D0A7618DD255C00C7858F /* XHExampleRightSideDrawerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XHExampleRightSideDrawerViewController.h; sourceTree = ""; }; 104 | AB4D0A7718DD255C00C7858F /* XHExampleRightSideDrawerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XHExampleRightSideDrawerViewController.m; sourceTree = ""; }; 105 | AB8682FA18942CFE00765392 /* XHNewsFrameworkExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = XHNewsFrameworkExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 106 | AB8682FD18942CFE00765392 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 107 | AB8682FF18942CFE00765392 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 108 | AB86830118942CFE00765392 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 109 | AB86830518942CFE00765392 /* XHNewsFrameworkExample-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "XHNewsFrameworkExample-Info.plist"; sourceTree = ""; }; 110 | AB86830718942CFE00765392 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 111 | AB86830918942CFE00765392 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 112 | AB86830B18942CFE00765392 /* XHNewsFrameworkExample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "XHNewsFrameworkExample-Prefix.pch"; sourceTree = ""; }; 113 | AB86830C18942CFE00765392 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 114 | AB86830D18942CFE00765392 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 115 | AB86830F18942CFE00765392 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 116 | AB86831518942CFF00765392 /* XHNewsFrameworkExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = XHNewsFrameworkExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 117 | AB86831618942CFF00765392 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 118 | AB86831E18942CFF00765392 /* XHNewsFrameworkExampleTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "XHNewsFrameworkExampleTests-Info.plist"; sourceTree = ""; }; 119 | AB86832018942CFF00765392 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 120 | AB86832218942CFF00765392 /* XHNewsFrameworkExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XHNewsFrameworkExampleTests.m; sourceTree = ""; }; 121 | ABE77C541899CFFA0006EF4A /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; }; 122 | ABEE1150191477CB0048BD57 /* XHNewsFramework.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = XHNewsFramework.framework; sourceTree = ""; }; 123 | /* End PBXFileReference section */ 124 | 125 | /* Begin PBXFrameworksBuildPhase section */ 126 | AB8682F718942CFE00765392 /* Frameworks */ = { 127 | isa = PBXFrameworksBuildPhase; 128 | buildActionMask = 2147483647; 129 | files = ( 130 | ABE77C551899CFFA0006EF4A /* Accelerate.framework in Frameworks */, 131 | ABEE1151191477CB0048BD57 /* XHNewsFramework.framework in Frameworks */, 132 | AB86830018942CFE00765392 /* CoreGraphics.framework in Frameworks */, 133 | AB86830218942CFE00765392 /* UIKit.framework in Frameworks */, 134 | AB8682FE18942CFE00765392 /* Foundation.framework in Frameworks */, 135 | ); 136 | runOnlyForDeploymentPostprocessing = 0; 137 | }; 138 | AB86831218942CFF00765392 /* Frameworks */ = { 139 | isa = PBXFrameworksBuildPhase; 140 | buildActionMask = 2147483647; 141 | files = ( 142 | AB86831718942CFF00765392 /* XCTest.framework in Frameworks */, 143 | AB86831918942CFF00765392 /* UIKit.framework in Frameworks */, 144 | AB86831818942CFF00765392 /* Foundation.framework in Frameworks */, 145 | ); 146 | runOnlyForDeploymentPostprocessing = 0; 147 | }; 148 | /* End PBXFrameworksBuildPhase section */ 149 | 150 | /* Begin PBXGroup section */ 151 | 74180D5A190F9C3600A35C82 /* Models */ = { 152 | isa = PBXGroup; 153 | children = ( 154 | 74180D5B190F9C5600A35C82 /* XHDataStoreManager.h */, 155 | 74180D5C190F9C5600A35C82 /* XHDataStoreManager.m */, 156 | 74180D5E190F9C6700A35C82 /* XHNewsModel.h */, 157 | 74180D5F190F9C6700A35C82 /* XHNewsModel.m */, 158 | ); 159 | path = Models; 160 | sourceTree = ""; 161 | }; 162 | 74B7F3FA18F2EEBD004EE42A /* RESideMenu */ = { 163 | isa = PBXGroup; 164 | children = ( 165 | 74B7F3FB18F2EEBD004EE42A /* RECommonFunctions.h */, 166 | 74B7F3FC18F2EEBD004EE42A /* RECommonFunctions.m */, 167 | 74B7F3FD18F2EEBD004EE42A /* RESideMenu.h */, 168 | 74B7F3FE18F2EEBD004EE42A /* RESideMenu.m */, 169 | 74B7F3FF18F2EEBD004EE42A /* UIViewController+RESideMenu.h */, 170 | 74B7F40018F2EEBD004EE42A /* UIViewController+RESideMenu.m */, 171 | ); 172 | path = RESideMenu; 173 | sourceTree = ""; 174 | }; 175 | AB4D0A3D18DD248600C7858F /* Controllers */ = { 176 | isa = PBXGroup; 177 | children = ( 178 | AB4D0A4218DD248600C7858F /* XHNeteaseNewsViewController.h */, 179 | AB4D0A4318DD248600C7858F /* XHNeteaseNewsViewController.m */, 180 | AB4D0A3E18DD248600C7858F /* XHExampleLeftSideDrawerViewController.h */, 181 | AB4D0A3F18DD248600C7858F /* XHExampleLeftSideDrawerViewController.m */, 182 | AB4D0A4018DD248600C7858F /* XHExampleSideDrawerViewController.h */, 183 | AB4D0A4118DD248600C7858F /* XHExampleSideDrawerViewController.m */, 184 | AB4D0A7618DD255C00C7858F /* XHExampleRightSideDrawerViewController.h */, 185 | AB4D0A7718DD255C00C7858F /* XHExampleRightSideDrawerViewController.m */, 186 | ); 187 | path = Controllers; 188 | sourceTree = ""; 189 | }; 190 | AB4D0A4418DD248600C7858F /* Vendor */ = { 191 | isa = PBXGroup; 192 | children = ( 193 | ABEE1150191477CB0048BD57 /* XHNewsFramework.framework */, 194 | 74B7F3FA18F2EEBD004EE42A /* RESideMenu */, 195 | ); 196 | path = Vendor; 197 | sourceTree = ""; 198 | }; 199 | AB4D0A4C18DD248600C7858F /* Views */ = { 200 | isa = PBXGroup; 201 | children = ( 202 | AB4D0A4D18DD248600C7858F /* HUAJIEBannerView.h */, 203 | AB4D0A4E18DD248600C7858F /* HUAJIEBannerView.m */, 204 | AB4D0A4F18DD248600C7858F /* HUAJIENewsCell.h */, 205 | AB4D0A5018DD248600C7858F /* HUAJIENewsCell.m */, 206 | 74180D65190FA6B700A35C82 /* XHNetNewsCell.h */, 207 | 74180D66190FA6B700A35C82 /* XHNetNewsCell.m */, 208 | ); 209 | path = Views; 210 | sourceTree = ""; 211 | }; 212 | AB4D0A5918DD249900C7858F /* Resources */ = { 213 | isa = PBXGroup; 214 | children = ( 215 | 74E272F118EE535900AC103D /* page_state_highlight@2x.png */, 216 | 74E272F218EE535900AC103D /* page_state_normal@2x.png */, 217 | AB4D0A5A18DD249900C7858F /* info_offline_flash.png */, 218 | AB4D0A5B18DD249900C7858F /* info_offline_flash@2x.png */, 219 | AB4D0A5C18DD249900C7858F /* leftShadow@2x.png */, 220 | AB4D0A5D18DD249900C7858F /* logo@2x.png */, 221 | AB4D0A5E18DD249900C7858F /* managerMenuButton@2x.png */, 222 | AB4D0A5F18DD249900C7858F /* MenuBackground@2x.png */, 223 | AB4D0A6018DD249900C7858F /* order_back.png */, 224 | AB4D0A6118DD249900C7858F /* refresh.png */, 225 | AB4D0A6218DD249900C7858F /* refresh@2x.png */, 226 | AB4D0A6318DD249900C7858F /* rightShadow@2x.png */, 227 | AB4D0A6418DD249900C7858F /* statusbar_close.png */, 228 | AB4D0A6518DD249900C7858F /* statusbar_close@2x.png */, 229 | AB4D0A6618DD249900C7858F /* 列表图片@2x.jpg */, 230 | AB4D0A6718DD249900C7858F /* 图片@2x.jpg */, 231 | ); 232 | path = Resources; 233 | sourceTree = ""; 234 | }; 235 | AB8682F118942CFE00765392 = { 236 | isa = PBXGroup; 237 | children = ( 238 | AB86830318942CFE00765392 /* XHNewsFrameworkExample */, 239 | AB86831C18942CFF00765392 /* XHNewsFrameworkExampleTests */, 240 | AB8682FC18942CFE00765392 /* Frameworks */, 241 | AB8682FB18942CFE00765392 /* Products */, 242 | ); 243 | sourceTree = ""; 244 | }; 245 | AB8682FB18942CFE00765392 /* Products */ = { 246 | isa = PBXGroup; 247 | children = ( 248 | AB8682FA18942CFE00765392 /* XHNewsFrameworkExample.app */, 249 | AB86831518942CFF00765392 /* XHNewsFrameworkExampleTests.xctest */, 250 | ); 251 | name = Products; 252 | sourceTree = ""; 253 | }; 254 | AB8682FC18942CFE00765392 /* Frameworks */ = { 255 | isa = PBXGroup; 256 | children = ( 257 | ABE77C541899CFFA0006EF4A /* Accelerate.framework */, 258 | AB8682FD18942CFE00765392 /* Foundation.framework */, 259 | AB8682FF18942CFE00765392 /* CoreGraphics.framework */, 260 | AB86830118942CFE00765392 /* UIKit.framework */, 261 | AB86831618942CFF00765392 /* XCTest.framework */, 262 | ); 263 | name = Frameworks; 264 | sourceTree = ""; 265 | }; 266 | AB86830318942CFE00765392 /* XHNewsFrameworkExample */ = { 267 | isa = PBXGroup; 268 | children = ( 269 | AB86830C18942CFE00765392 /* AppDelegate.h */, 270 | AB86830D18942CFE00765392 /* AppDelegate.m */, 271 | 74180D5A190F9C3600A35C82 /* Models */, 272 | AB4D0A3D18DD248600C7858F /* Controllers */, 273 | AB4D0A4418DD248600C7858F /* Vendor */, 274 | AB4D0A4C18DD248600C7858F /* Views */, 275 | AB86830F18942CFE00765392 /* Images.xcassets */, 276 | AB86830418942CFE00765392 /* Supporting Files */, 277 | ); 278 | path = XHNewsFrameworkExample; 279 | sourceTree = ""; 280 | }; 281 | AB86830418942CFE00765392 /* Supporting Files */ = { 282 | isa = PBXGroup; 283 | children = ( 284 | AB4D0A5918DD249900C7858F /* Resources */, 285 | AB86830518942CFE00765392 /* XHNewsFrameworkExample-Info.plist */, 286 | AB86830618942CFE00765392 /* InfoPlist.strings */, 287 | AB86830918942CFE00765392 /* main.m */, 288 | AB86830B18942CFE00765392 /* XHNewsFrameworkExample-Prefix.pch */, 289 | ); 290 | name = "Supporting Files"; 291 | sourceTree = ""; 292 | }; 293 | AB86831C18942CFF00765392 /* XHNewsFrameworkExampleTests */ = { 294 | isa = PBXGroup; 295 | children = ( 296 | AB86832218942CFF00765392 /* XHNewsFrameworkExampleTests.m */, 297 | AB86831D18942CFF00765392 /* Supporting Files */, 298 | ); 299 | path = XHNewsFrameworkExampleTests; 300 | sourceTree = ""; 301 | }; 302 | AB86831D18942CFF00765392 /* Supporting Files */ = { 303 | isa = PBXGroup; 304 | children = ( 305 | AB86831E18942CFF00765392 /* XHNewsFrameworkExampleTests-Info.plist */, 306 | AB86831F18942CFF00765392 /* InfoPlist.strings */, 307 | ); 308 | name = "Supporting Files"; 309 | sourceTree = ""; 310 | }; 311 | /* End PBXGroup section */ 312 | 313 | /* Begin PBXNativeTarget section */ 314 | AB8682F918942CFE00765392 /* XHNewsFrameworkExample */ = { 315 | isa = PBXNativeTarget; 316 | buildConfigurationList = AB86832618942CFF00765392 /* Build configuration list for PBXNativeTarget "XHNewsFrameworkExample" */; 317 | buildPhases = ( 318 | AB8682F618942CFE00765392 /* Sources */, 319 | AB8682F718942CFE00765392 /* Frameworks */, 320 | AB8682F818942CFE00765392 /* Resources */, 321 | ); 322 | buildRules = ( 323 | ); 324 | dependencies = ( 325 | ); 326 | name = XHNewsFrameworkExample; 327 | productName = XHNewsFrameworkExample; 328 | productReference = AB8682FA18942CFE00765392 /* XHNewsFrameworkExample.app */; 329 | productType = "com.apple.product-type.application"; 330 | }; 331 | AB86831418942CFF00765392 /* XHNewsFrameworkExampleTests */ = { 332 | isa = PBXNativeTarget; 333 | buildConfigurationList = AB86832918942CFF00765392 /* Build configuration list for PBXNativeTarget "XHNewsFrameworkExampleTests" */; 334 | buildPhases = ( 335 | AB86831118942CFF00765392 /* Sources */, 336 | AB86831218942CFF00765392 /* Frameworks */, 337 | AB86831318942CFF00765392 /* Resources */, 338 | ); 339 | buildRules = ( 340 | ); 341 | dependencies = ( 342 | AB86831B18942CFF00765392 /* PBXTargetDependency */, 343 | ); 344 | name = XHNewsFrameworkExampleTests; 345 | productName = XHNewsFrameworkExampleTests; 346 | productReference = AB86831518942CFF00765392 /* XHNewsFrameworkExampleTests.xctest */; 347 | productType = "com.apple.product-type.bundle.unit-test"; 348 | }; 349 | /* End PBXNativeTarget section */ 350 | 351 | /* Begin PBXProject section */ 352 | AB8682F218942CFE00765392 /* Project object */ = { 353 | isa = PBXProject; 354 | attributes = { 355 | LastUpgradeCheck = 0500; 356 | ORGANIZATIONNAME = "曾宪华 开发团队(http://iyilunba.com ) 本人QQ:543413507 本人QQ群(142557668)"; 357 | TargetAttributes = { 358 | AB86831418942CFF00765392 = { 359 | TestTargetID = AB8682F918942CFE00765392; 360 | }; 361 | }; 362 | }; 363 | buildConfigurationList = AB8682F518942CFE00765392 /* Build configuration list for PBXProject "XHNewsFrameworkExample" */; 364 | compatibilityVersion = "Xcode 3.2"; 365 | developmentRegion = English; 366 | hasScannedForEncodings = 0; 367 | knownRegions = ( 368 | en, 369 | ); 370 | mainGroup = AB8682F118942CFE00765392; 371 | productRefGroup = AB8682FB18942CFE00765392 /* Products */; 372 | projectDirPath = ""; 373 | projectRoot = ""; 374 | targets = ( 375 | AB8682F918942CFE00765392 /* XHNewsFrameworkExample */, 376 | AB86831418942CFF00765392 /* XHNewsFrameworkExampleTests */, 377 | ); 378 | }; 379 | /* End PBXProject section */ 380 | 381 | /* Begin PBXResourcesBuildPhase section */ 382 | AB8682F818942CFE00765392 /* Resources */ = { 383 | isa = PBXResourcesBuildPhase; 384 | buildActionMask = 2147483647; 385 | files = ( 386 | AB4D0A6C18DD249900C7858F /* managerMenuButton@2x.png in Resources */, 387 | AB4D0A6E18DD249900C7858F /* order_back.png in Resources */, 388 | AB4D0A7218DD249900C7858F /* statusbar_close.png in Resources */, 389 | AB86830818942CFE00765392 /* InfoPlist.strings in Resources */, 390 | 74E272F418EE535900AC103D /* page_state_normal@2x.png in Resources */, 391 | AB4D0A7118DD249900C7858F /* rightShadow@2x.png in Resources */, 392 | 74E272F318EE535900AC103D /* page_state_highlight@2x.png in Resources */, 393 | AB4D0A6B18DD249900C7858F /* logo@2x.png in Resources */, 394 | AB4D0A7018DD249900C7858F /* refresh@2x.png in Resources */, 395 | AB4D0A7518DD249900C7858F /* 图片@2x.jpg in Resources */, 396 | AB4D0A6918DD249900C7858F /* info_offline_flash@2x.png in Resources */, 397 | AB86831018942CFE00765392 /* Images.xcassets in Resources */, 398 | AB4D0A6818DD249900C7858F /* info_offline_flash.png in Resources */, 399 | AB4D0A6A18DD249900C7858F /* leftShadow@2x.png in Resources */, 400 | AB4D0A6D18DD249900C7858F /* MenuBackground@2x.png in Resources */, 401 | AB4D0A6F18DD249900C7858F /* refresh.png in Resources */, 402 | AB4D0A7318DD249900C7858F /* statusbar_close@2x.png in Resources */, 403 | AB4D0A7418DD249900C7858F /* 列表图片@2x.jpg in Resources */, 404 | ); 405 | runOnlyForDeploymentPostprocessing = 0; 406 | }; 407 | AB86831318942CFF00765392 /* Resources */ = { 408 | isa = PBXResourcesBuildPhase; 409 | buildActionMask = 2147483647; 410 | files = ( 411 | AB86832118942CFF00765392 /* InfoPlist.strings in Resources */, 412 | ); 413 | runOnlyForDeploymentPostprocessing = 0; 414 | }; 415 | /* End PBXResourcesBuildPhase section */ 416 | 417 | /* Begin PBXSourcesBuildPhase section */ 418 | AB8682F618942CFE00765392 /* Sources */ = { 419 | isa = PBXSourcesBuildPhase; 420 | buildActionMask = 2147483647; 421 | files = ( 422 | 74180D67190FA6B700A35C82 /* XHNetNewsCell.m in Sources */, 423 | AB4D0A5118DD248600C7858F /* XHExampleLeftSideDrawerViewController.m in Sources */, 424 | AB4D0A5818DD248600C7858F /* HUAJIENewsCell.m in Sources */, 425 | AB4D0A5318DD248600C7858F /* XHNeteaseNewsViewController.m in Sources */, 426 | 74B7F40218F2EEBD004EE42A /* RESideMenu.m in Sources */, 427 | AB86830E18942CFE00765392 /* AppDelegate.m in Sources */, 428 | AB4D0A5718DD248600C7858F /* HUAJIEBannerView.m in Sources */, 429 | AB86830A18942CFE00765392 /* main.m in Sources */, 430 | AB4D0A7818DD255C00C7858F /* XHExampleRightSideDrawerViewController.m in Sources */, 431 | 74B7F40118F2EEBD004EE42A /* RECommonFunctions.m in Sources */, 432 | 74180D5D190F9C5600A35C82 /* XHDataStoreManager.m in Sources */, 433 | AB4D0A5218DD248600C7858F /* XHExampleSideDrawerViewController.m in Sources */, 434 | 74180D60190F9C6700A35C82 /* XHNewsModel.m in Sources */, 435 | 74B7F40318F2EEBD004EE42A /* UIViewController+RESideMenu.m in Sources */, 436 | ); 437 | runOnlyForDeploymentPostprocessing = 0; 438 | }; 439 | AB86831118942CFF00765392 /* Sources */ = { 440 | isa = PBXSourcesBuildPhase; 441 | buildActionMask = 2147483647; 442 | files = ( 443 | AB86832318942CFF00765392 /* XHNewsFrameworkExampleTests.m in Sources */, 444 | ); 445 | runOnlyForDeploymentPostprocessing = 0; 446 | }; 447 | /* End PBXSourcesBuildPhase section */ 448 | 449 | /* Begin PBXTargetDependency section */ 450 | AB86831B18942CFF00765392 /* PBXTargetDependency */ = { 451 | isa = PBXTargetDependency; 452 | target = AB8682F918942CFE00765392 /* XHNewsFrameworkExample */; 453 | targetProxy = AB86831A18942CFF00765392 /* PBXContainerItemProxy */; 454 | }; 455 | /* End PBXTargetDependency section */ 456 | 457 | /* Begin PBXVariantGroup section */ 458 | AB86830618942CFE00765392 /* InfoPlist.strings */ = { 459 | isa = PBXVariantGroup; 460 | children = ( 461 | AB86830718942CFE00765392 /* en */, 462 | ); 463 | name = InfoPlist.strings; 464 | sourceTree = ""; 465 | }; 466 | AB86831F18942CFF00765392 /* InfoPlist.strings */ = { 467 | isa = PBXVariantGroup; 468 | children = ( 469 | AB86832018942CFF00765392 /* en */, 470 | ); 471 | name = InfoPlist.strings; 472 | sourceTree = ""; 473 | }; 474 | /* End PBXVariantGroup section */ 475 | 476 | /* Begin XCBuildConfiguration section */ 477 | AB86832418942CFF00765392 /* Debug */ = { 478 | isa = XCBuildConfiguration; 479 | buildSettings = { 480 | ALWAYS_SEARCH_USER_PATHS = NO; 481 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 482 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 483 | CLANG_CXX_LIBRARY = "libc++"; 484 | CLANG_ENABLE_MODULES = YES; 485 | CLANG_ENABLE_OBJC_ARC = YES; 486 | CLANG_WARN_BOOL_CONVERSION = YES; 487 | CLANG_WARN_CONSTANT_CONVERSION = YES; 488 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 489 | CLANG_WARN_EMPTY_BODY = YES; 490 | CLANG_WARN_ENUM_CONVERSION = YES; 491 | CLANG_WARN_INT_CONVERSION = YES; 492 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 493 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 494 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 495 | COPY_PHASE_STRIP = NO; 496 | GCC_C_LANGUAGE_STANDARD = gnu99; 497 | GCC_DYNAMIC_NO_PIC = NO; 498 | GCC_OPTIMIZATION_LEVEL = 0; 499 | GCC_PREPROCESSOR_DEFINITIONS = ( 500 | "DEBUG=1", 501 | "$(inherited)", 502 | ); 503 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 504 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 505 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 506 | GCC_WARN_UNDECLARED_SELECTOR = YES; 507 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 508 | GCC_WARN_UNUSED_FUNCTION = YES; 509 | GCC_WARN_UNUSED_VARIABLE = YES; 510 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 511 | ONLY_ACTIVE_ARCH = YES; 512 | SDKROOT = iphoneos; 513 | TARGETED_DEVICE_FAMILY = "1,2"; 514 | }; 515 | name = Debug; 516 | }; 517 | AB86832518942CFF00765392 /* Release */ = { 518 | isa = XCBuildConfiguration; 519 | buildSettings = { 520 | ALWAYS_SEARCH_USER_PATHS = NO; 521 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 522 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 523 | CLANG_CXX_LIBRARY = "libc++"; 524 | CLANG_ENABLE_MODULES = YES; 525 | CLANG_ENABLE_OBJC_ARC = YES; 526 | CLANG_WARN_BOOL_CONVERSION = YES; 527 | CLANG_WARN_CONSTANT_CONVERSION = YES; 528 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 529 | CLANG_WARN_EMPTY_BODY = YES; 530 | CLANG_WARN_ENUM_CONVERSION = YES; 531 | CLANG_WARN_INT_CONVERSION = YES; 532 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 533 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 534 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 535 | COPY_PHASE_STRIP = YES; 536 | ENABLE_NS_ASSERTIONS = NO; 537 | GCC_C_LANGUAGE_STANDARD = gnu99; 538 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 539 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 540 | GCC_WARN_UNDECLARED_SELECTOR = YES; 541 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 542 | GCC_WARN_UNUSED_FUNCTION = YES; 543 | GCC_WARN_UNUSED_VARIABLE = YES; 544 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 545 | SDKROOT = iphoneos; 546 | TARGETED_DEVICE_FAMILY = "1,2"; 547 | VALIDATE_PRODUCT = YES; 548 | }; 549 | name = Release; 550 | }; 551 | AB86832718942CFF00765392 /* Debug */ = { 552 | isa = XCBuildConfiguration; 553 | buildSettings = { 554 | ARCHS = "$(ARCHS_STANDARD)"; 555 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 556 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 557 | FRAMEWORK_SEARCH_PATHS = ( 558 | "$(inherited)", 559 | /Users/JackMacbook/JackTeamDeveloper/JackTeamGithub/XHNewsFrameworkExample/Project/XHNewsFrameworkExample, 560 | /Users/JackMacbook/JackTeamDeveloper/JackTeamGithub/XHNewsFrameworkExample/Project/XHNewsFrameworkExample/Vendor, 561 | "$(PROJECT_DIR)/XHNewsFrameworkExample/Vendor", 562 | ); 563 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 564 | GCC_PREFIX_HEADER = "XHNewsFrameworkExample/XHNewsFrameworkExample-Prefix.pch"; 565 | INFOPLIST_FILE = "XHNewsFrameworkExample/XHNewsFrameworkExample-Info.plist"; 566 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 567 | PRODUCT_NAME = "$(TARGET_NAME)"; 568 | PROVISIONING_PROFILE = "D46261E9-258D-44B7-AF19-26A173308B7C"; 569 | WRAPPER_EXTENSION = app; 570 | }; 571 | name = Debug; 572 | }; 573 | AB86832818942CFF00765392 /* Release */ = { 574 | isa = XCBuildConfiguration; 575 | buildSettings = { 576 | ARCHS = "$(ARCHS_STANDARD)"; 577 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 578 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 579 | FRAMEWORK_SEARCH_PATHS = ( 580 | "$(inherited)", 581 | /Users/JackMacbook/JackTeamDeveloper/JackTeamGithub/XHNewsFrameworkExample/Project/XHNewsFrameworkExample, 582 | /Users/JackMacbook/JackTeamDeveloper/JackTeamGithub/XHNewsFrameworkExample/Project/XHNewsFrameworkExample/Vendor, 583 | "$(PROJECT_DIR)/XHNewsFrameworkExample/Vendor", 584 | ); 585 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 586 | GCC_PREFIX_HEADER = "XHNewsFrameworkExample/XHNewsFrameworkExample-Prefix.pch"; 587 | INFOPLIST_FILE = "XHNewsFrameworkExample/XHNewsFrameworkExample-Info.plist"; 588 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 589 | PRODUCT_NAME = "$(TARGET_NAME)"; 590 | PROVISIONING_PROFILE = "D46261E9-258D-44B7-AF19-26A173308B7C"; 591 | WRAPPER_EXTENSION = app; 592 | }; 593 | name = Release; 594 | }; 595 | AB86832A18942CFF00765392 /* Debug */ = { 596 | isa = XCBuildConfiguration; 597 | buildSettings = { 598 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 599 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/XHNewsFrameworkExample.app/XHNewsFrameworkExample"; 600 | FRAMEWORK_SEARCH_PATHS = ( 601 | "$(SDKROOT)/Developer/Library/Frameworks", 602 | "$(inherited)", 603 | "$(DEVELOPER_FRAMEWORKS_DIR)", 604 | ); 605 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 606 | GCC_PREFIX_HEADER = "XHNewsFrameworkExample/XHNewsFrameworkExample-Prefix.pch"; 607 | GCC_PREPROCESSOR_DEFINITIONS = ( 608 | "DEBUG=1", 609 | "$(inherited)", 610 | ); 611 | INFOPLIST_FILE = "XHNewsFrameworkExampleTests/XHNewsFrameworkExampleTests-Info.plist"; 612 | PRODUCT_NAME = "$(TARGET_NAME)"; 613 | TEST_HOST = "$(BUNDLE_LOADER)"; 614 | WRAPPER_EXTENSION = xctest; 615 | }; 616 | name = Debug; 617 | }; 618 | AB86832B18942CFF00765392 /* Release */ = { 619 | isa = XCBuildConfiguration; 620 | buildSettings = { 621 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 622 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/XHNewsFrameworkExample.app/XHNewsFrameworkExample"; 623 | FRAMEWORK_SEARCH_PATHS = ( 624 | "$(SDKROOT)/Developer/Library/Frameworks", 625 | "$(inherited)", 626 | "$(DEVELOPER_FRAMEWORKS_DIR)", 627 | ); 628 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 629 | GCC_PREFIX_HEADER = "XHNewsFrameworkExample/XHNewsFrameworkExample-Prefix.pch"; 630 | INFOPLIST_FILE = "XHNewsFrameworkExampleTests/XHNewsFrameworkExampleTests-Info.plist"; 631 | PRODUCT_NAME = "$(TARGET_NAME)"; 632 | TEST_HOST = "$(BUNDLE_LOADER)"; 633 | WRAPPER_EXTENSION = xctest; 634 | }; 635 | name = Release; 636 | }; 637 | /* End XCBuildConfiguration section */ 638 | 639 | /* Begin XCConfigurationList section */ 640 | AB8682F518942CFE00765392 /* Build configuration list for PBXProject "XHNewsFrameworkExample" */ = { 641 | isa = XCConfigurationList; 642 | buildConfigurations = ( 643 | AB86832418942CFF00765392 /* Debug */, 644 | AB86832518942CFF00765392 /* Release */, 645 | ); 646 | defaultConfigurationIsVisible = 0; 647 | defaultConfigurationName = Release; 648 | }; 649 | AB86832618942CFF00765392 /* Build configuration list for PBXNativeTarget "XHNewsFrameworkExample" */ = { 650 | isa = XCConfigurationList; 651 | buildConfigurations = ( 652 | AB86832718942CFF00765392 /* Debug */, 653 | AB86832818942CFF00765392 /* Release */, 654 | ); 655 | defaultConfigurationIsVisible = 0; 656 | defaultConfigurationName = Release; 657 | }; 658 | AB86832918942CFF00765392 /* Build configuration list for PBXNativeTarget "XHNewsFrameworkExampleTests" */ = { 659 | isa = XCConfigurationList; 660 | buildConfigurations = ( 661 | AB86832A18942CFF00765392 /* Debug */, 662 | AB86832B18942CFF00765392 /* Release */, 663 | ); 664 | defaultConfigurationIsVisible = 0; 665 | defaultConfigurationName = Release; 666 | }; 667 | /* End XCConfigurationList section */ 668 | }; 669 | rootObject = AB8682F218942CFE00765392 /* Project object */; 670 | } 671 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // XHNewsFrameworkExample 4 | // 5 | // Created by 曾 宪华 on 14-1-25. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // XHNewsFrameworkExample 4 | // 5 | // Created by 曾 宪华 on 14-1-25. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "XHNeteaseNewsViewController.h" 11 | #import "XHExampleLeftSideDrawerViewController.h" 12 | #import "XHExampleRightSideDrawerViewController.h" 13 | 14 | #import 15 | 16 | @interface AppDelegate () 17 | 18 | @end 19 | 20 | @implementation AppDelegate 21 | 22 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 23 | { 24 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 25 | // Override point for customization after application launch. 26 | self.window.backgroundColor = [UIColor whiteColor]; 27 | 28 | if ([[[UIDevice currentDevice] systemVersion] integerValue] >= 7.0) { 29 | [[UINavigationBar appearance] setTintColor:[UIColor whiteColor]]; 30 | [[UINavigationBar appearance] setTitleTextAttributes:@{UITextAttributeTextColor : [UIColor whiteColor], UITextAttributeFont : [UIFont systemFontOfSize:22.0f]}]; 31 | } 32 | 33 | XHExampleLeftSideDrawerViewController *leftSideDrawerViewController = [[XHExampleLeftSideDrawerViewController alloc] init]; 34 | 35 | XHExampleRightSideDrawerViewController *rightSideDrawerViewController = [[XHExampleRightSideDrawerViewController alloc] init]; 36 | 37 | XHParallaxNavigationController *parallaxNavigationController = [[XHParallaxNavigationController alloc] initWithRootViewController:[[XHNeteaseNewsViewController alloc] init]]; 38 | 39 | RESideMenu *sideMenuViewController = [[RESideMenu alloc] initWithContentViewController:parallaxNavigationController menuViewController:leftSideDrawerViewController]; 40 | sideMenuViewController.backgroundImage = [UIImage imageNamed:@"MenuBackground"]; 41 | sideMenuViewController.contentViewInPortraitOffsetCenterX = 40; 42 | sideMenuViewController.menuPreferredStatusBarStyle = 1; // UIStatusBarStyleLightContent 43 | sideMenuViewController.tempViewController = rightSideDrawerViewController; 44 | sideMenuViewController.delegate = self; 45 | 46 | self.window.rootViewController = sideMenuViewController; 47 | 48 | // 主页原本框架 49 | // self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:[[XHNeteaseNewsViewController alloc] init]]; 50 | [self.window makeKeyAndVisible]; 51 | return YES; 52 | } 53 | 54 | - (void)applicationWillResignActive:(UIApplication *)application 55 | { 56 | // 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. 57 | // 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. 58 | } 59 | 60 | - (void)applicationDidEnterBackground:(UIApplication *)application 61 | { 62 | // 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. 63 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 64 | } 65 | 66 | - (void)applicationWillEnterForeground:(UIApplication *)application 67 | { 68 | // 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. 69 | } 70 | 71 | - (void)applicationDidBecomeActive:(UIApplication *)application 72 | { 73 | // 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. 74 | } 75 | 76 | - (void)applicationWillTerminate:(UIApplication *)application 77 | { 78 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 79 | } 80 | 81 | @end 82 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Controllers/XHExampleLeftSideDrawerViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHExampleLeftSideDrawerViewController.h 3 | // XHDrawerController 4 | // 5 | // Created by 曾 宪华 on 13-12-27. 6 | // Copyright (c) 2013年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHExampleSideDrawerViewController.h" 10 | 11 | @interface XHExampleLeftSideDrawerViewController : XHExampleSideDrawerViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Controllers/XHExampleLeftSideDrawerViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // XHExampleLeftSideDrawerViewController.m 3 | // XHDrawerController 4 | // 5 | // Created by 曾 宪华 on 13-12-27. 6 | // Copyright (c) 2013年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHExampleLeftSideDrawerViewController.h" 10 | 11 | @interface XHExampleLeftSideDrawerViewController () 12 | 13 | @end 14 | 15 | @implementation XHExampleLeftSideDrawerViewController 16 | 17 | - (void)viewDidLoad 18 | { 19 | [super viewDidLoad]; 20 | // Do any additional setup after loading the view. 21 | CGRect tableViewFrame = self.tableView.frame; 22 | tableViewFrame.origin.y = 95; 23 | tableViewFrame.origin.x = 40; 24 | tableViewFrame.size.height = 377; 25 | self.tableView.frame = tableViewFrame; 26 | [self.view addSubview:self.tableView]; 27 | // test github 28 | } 29 | 30 | - (void)didReceiveMemoryWarning 31 | { 32 | [super didReceiveMemoryWarning]; 33 | // Dispose of any resources that can be recreated. 34 | } 35 | 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Controllers/XHExampleRightSideDrawerViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHExampleRightSideDrawerViewController.h 3 | // XHDrawerController 4 | // 5 | // Created by 曾 宪华 on 13-12-27. 6 | // Copyright (c) 2013年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHExampleSideDrawerViewController.h" 10 | 11 | @interface XHExampleRightSideDrawerViewController : XHExampleSideDrawerViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Controllers/XHExampleRightSideDrawerViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // XHExampleRightSideDrawerViewController.m 3 | // XHDrawerController 4 | // 5 | // Created by 曾 宪华 on 13-12-27. 6 | // Copyright (c) 2013年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHExampleRightSideDrawerViewController.h" 10 | 11 | @interface XHExampleRightSideDrawerViewController () 12 | 13 | @end 14 | 15 | @implementation XHExampleRightSideDrawerViewController 16 | 17 | - (void)viewDidLoad 18 | { 19 | [super viewDidLoad]; 20 | // Do any additional setup after loading the view. 21 | CGRect tableViewFrame = self.tableView.frame; 22 | tableViewFrame.origin.y = 95; 23 | tableViewFrame.origin.x = 80; 24 | tableViewFrame.size.height = 377; 25 | self.tableView.frame = tableViewFrame; 26 | [self.view addSubview:self.tableView]; 27 | } 28 | 29 | - (void)didReceiveMemoryWarning 30 | { 31 | [super didReceiveMemoryWarning]; 32 | // Dispose of any resources that can be recreated. 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Controllers/XHExampleSideDrawerViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHExampleSideDrawerViewController.h 3 | // XHDrawerController 4 | // 5 | // Created by 曾 宪华 on 13-12-27. 6 | // Copyright (c) 2013年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface XHExampleSideDrawerViewController : UIViewController 12 | @property (nonatomic, strong) UITableView *tableView; 13 | @property (nonatomic,strong) NSArray *dataSource; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Controllers/XHExampleSideDrawerViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // XHExampleSideDrawerViewController.m 3 | // XHDrawerController 4 | // 5 | // Created by 曾 宪华 on 13-12-27. 6 | // Copyright (c) 2013年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHExampleSideDrawerViewController.h" 10 | 11 | @interface XHExampleSideDrawerViewController () 12 | 13 | @end 14 | 15 | @implementation XHExampleSideDrawerViewController 16 | 17 | - (UITableView *)tableView { 18 | if (!_tableView) { 19 | _tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain]; 20 | _tableView.backgroundColor = [UIColor clearColor]; 21 | _tableView.delegate = self; 22 | _tableView.dataSource = self; 23 | _tableView.separatorColor = [UIColor clearColor]; 24 | _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; 25 | } 26 | return _tableView; 27 | } 28 | 29 | - (void)viewDidLoad 30 | { 31 | [super viewDidLoad]; 32 | // Do any additional setup after loading the view. 33 | } 34 | 35 | - (id)init { 36 | self = [super init]; 37 | if (self) { 38 | [self setDataSource:@[@"Option One", @"Option Two", @"Option Three", @"Option Four", @"Option Five"]]; 39 | } 40 | return self; 41 | } 42 | 43 | - (void)didReceiveMemoryWarning 44 | { 45 | [super didReceiveMemoryWarning]; 46 | // Dispose of any resources that can be recreated. 47 | } 48 | 49 | #pragma mark - UITableViewDatasource Methods 50 | 51 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 52 | { 53 | return 1; 54 | } 55 | 56 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 57 | { 58 | return [[self dataSource] count]; 59 | } 60 | 61 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 62 | static NSString *cellIdentifier = @"cellIdentifier"; 63 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; 64 | if (!cell) { 65 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier]; 66 | } 67 | [cell setBackgroundColor:[UIColor clearColor]]; 68 | [[cell textLabel] setTextColor:[UIColor whiteColor]]; 69 | [[cell textLabel] setText:[self dataSource][[indexPath row]]]; 70 | [cell setSelectedBackgroundView:[UIView new]]; 71 | [[cell textLabel] setHighlightedTextColor:[UIColor purpleColor]]; 72 | return cell; 73 | } 74 | 75 | #pragma mark - UITableViewDelegate Methods 76 | 77 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 78 | { 79 | [tableView deselectRowAtIndexPath:indexPath animated:YES]; 80 | [self.sideMenuViewController hideMenuViewController]; 81 | } 82 | 83 | @end 84 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Controllers/XHNeteaseNewsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHNeteaseNewsViewController.h 3 | // XHNewsFrameworkExample 4 | // 5 | // Created by 曾 宪华 on 14-1-24. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | // 当编译的时候,如果出现报错,提示头文件找不到的时候,把XHNewsFramework.framework拖出工程,然后再拖进来,这样就不会报错了,因为github上传后所引起的,具体操作可以看fixTheHeadError.gif文件,会教你怎么做。 10 | #import 11 | 12 | @interface XHNeteaseNewsViewController : XHNewsContainerViewController 13 | @end 14 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Controllers/XHNeteaseNewsViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // XHNeteaseNewsViewController.m 3 | // XHNewsFrameworkExample 4 | // 5 | // Created by 曾 宪华 on 14-1-24. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHNeteaseNewsViewController.h" 10 | #import 11 | #import 12 | #import 13 | 14 | #import "XHNetNewsCell.h" 15 | #import "HUAJIEBannerView.h" 16 | 17 | #import "XHDataStoreManager.h" 18 | 19 | @interface XHNeteaseNewsViewController () 20 | 21 | @property (nonatomic, strong) NSMutableArray *bannerViews; 22 | @property (nonatomic, strong) XHScrollBannerView *scrollBannerView; 23 | 24 | @end 25 | 26 | @implementation XHNeteaseNewsViewController 27 | 28 | #pragma mark - Action 29 | 30 | - (void)rightOpened { 31 | [self.sideMenuViewController presentRightViewController]; 32 | } 33 | 34 | - (void)leftOpened { 35 | [self.sideMenuViewController presentMenuViewController]; 36 | } 37 | 38 | - (void)receiveScrollViewPanGestureRecognizerHandle:(UIPanGestureRecognizer *)scrollViewPanGestureRecognizer { 39 | [self.sideMenuViewController panGestureRecognized:scrollViewPanGestureRecognizer]; 40 | } 41 | 42 | #pragma mark - Perprotys 43 | 44 | - (NSMutableArray *)bannerViews { 45 | if (!_bannerViews) { 46 | _bannerViews = [[NSMutableArray alloc] init]; 47 | [_bannerViews addObject:[[HUAJIEBannerView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.scrollBannerView.bounds), CGRectGetHeight(self.scrollBannerView.bounds))]]; 48 | [_bannerViews addObject:[[HUAJIEBannerView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.scrollBannerView.bounds), CGRectGetHeight(self.scrollBannerView.bounds))]]; 49 | [_bannerViews addObject:[[HUAJIEBannerView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.scrollBannerView.bounds), CGRectGetHeight(self.scrollBannerView.bounds))]]; 50 | [_bannerViews addObject:[[HUAJIEBannerView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.scrollBannerView.bounds), CGRectGetHeight(self.scrollBannerView.bounds))]]; 51 | [_bannerViews addObject:[[HUAJIEBannerView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.scrollBannerView.bounds), CGRectGetHeight(self.scrollBannerView.bounds))]]; 52 | [_bannerViews addObject:[[HUAJIEBannerView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.scrollBannerView.bounds), CGRectGetHeight(self.scrollBannerView.bounds))]]; 53 | } 54 | return _bannerViews; 55 | } 56 | 57 | - (XHScrollBannerView *)scrollBannerView { 58 | if (!_scrollBannerView) { 59 | __weak typeof(self) weakSelf = self; 60 | _scrollBannerView = [[XHScrollBannerView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.view.bounds), 200) animationDuration:3.0f]; 61 | self.scrollBannerView.totalPagesCount = ^NSUInteger(void){ 62 | return weakSelf.bannerViews.count; 63 | }; 64 | self.scrollBannerView.fetchContentViewAtIndex = ^UIView *(NSUInteger pageIndex){ 65 | return weakSelf.bannerViews[pageIndex]; 66 | }; 67 | self.scrollBannerView.fetchFocusTitle = ^NSString *(NSUInteger pageIndex) { 68 | if (pageIndex == 0) { 69 | return @"我是皇上,你想怎样?"; 70 | } else if (pageIndex == 1) { 71 | return @"我是王子,那你又想怎样?"; 72 | } else if (pageIndex == 2) { 73 | return @"我是Jack,那你还想怎样?"; 74 | } else { 75 | return @"我管你是谁,我就是仿网易新闻"; 76 | } 77 | }; 78 | _scrollBannerView.didSelectCompled = ^(NSUInteger selectIndex) { 79 | NSLog(@"selectIndex : %d", selectIndex); 80 | }; 81 | } 82 | return _scrollBannerView; 83 | } 84 | #pragma mark - Life cycle 85 | 86 | - (id)init { 87 | self = [super init]; 88 | if (self) { 89 | self.isShowTopScrollToolBar = YES; 90 | // custom UI 91 | /* 92 | self.topScrollViewToolBarBackgroundColor = [UIColor colorWithRed:0.362 green:0.555 blue:0.902 alpha:1.000]; 93 | self.leftShadowImage = [UIImage imageNamed:@"leftShadow"]; 94 | self.rightShadowImage = [UIImage imageNamed:@"rightShadow"]; 95 | self.indicatorColor = [UIColor colorWithRed:0.219 green:0.752 blue:0.002 alpha:1.000]; 96 | self.managerButtonBackgroundImage = [UIImage imageNamed:@"managerMenuButton"]; 97 | 98 | self.midContentLogoImage = [UIImage imageNamed:@"logo"]; 99 | self.contentScrollViewBackgroundColor = [UIColor colorWithRed:1.000 green:0.724 blue:0.640 alpha:1.000]; 100 | */ 101 | } 102 | return self; 103 | } 104 | 105 | - (void)viewDidAppear:(BOOL)animated { 106 | [super viewDidAppear:animated]; 107 | } 108 | 109 | - (void)loadNetWorkDataSource:(void (^)())compled { 110 | __weak typeof(self) weakSelf = self; 111 | [[XHDataStoreManager shareDataStoreManager] loadNetDataSourceWithPagesize:100 pageNumber:1 compledBlock:^(NSMutableArray *datas) { 112 | 113 | NSMutableArray *items = [NSMutableArray array]; 114 | for (NSInteger i = 0; i < 10; i ++) { 115 | XHMenu *item = [[XHMenu alloc] init]; 116 | NSString *title = @"头条"; 117 | item.title = title; 118 | item.titleNormalColor = [UIColor colorWithWhite:0.141 alpha:1.000]; 119 | item.titleFont = [UIFont boldSystemFontOfSize:16]; 120 | 121 | item.dataSources = [NSMutableArray arrayWithArray:datas]; 122 | 123 | [items addObject:item]; 124 | } 125 | 126 | 127 | dispatch_async(dispatch_get_main_queue(), ^{ 128 | weakSelf.items = items; 129 | [weakSelf reloadDataSource]; 130 | if (compled) { 131 | compled(); 132 | } 133 | }); 134 | }]; 135 | } 136 | 137 | - (void)viewDidLoad 138 | { 139 | [super viewDidLoad]; 140 | // Do any additional setup after loading the view. 141 | if ([self.navigationController.navigationBar respondsToSelector:@selector(setBarTintColor:)]) 142 | [self.navigationController.navigationBar setBarTintColor:[UIColor redColor]]; 143 | 144 | if ([self respondsToSelector:@selector(automaticallyAdjustsScrollViewInsets)]) 145 | self.automaticallyAdjustsScrollViewInsets = NO; 146 | self.title = @"网易新闻"; 147 | 148 | self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Left" style:UIBarButtonItemStyleBordered target:self action:@selector(leftOpened)]; 149 | self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Right" style:UIBarButtonItemStyleBordered target:self action:@selector(rightOpened)]; 150 | 151 | [self loadNetWorkDataSource:NULL]; 152 | } 153 | 154 | - (void)didReceiveMemoryWarning 155 | { 156 | [super didReceiveMemoryWarning]; 157 | // Dispose of any resources that can be recreated. 158 | } 159 | 160 | #pragma mark - contentView refreshControl delegate 161 | 162 | - (void)pullDownRefreshingAction:(XHContentView *)contentView { 163 | [self loadNetWorkDataSource:^{ 164 | [contentView endPullDownRefreshing]; 165 | }]; 166 | } 167 | 168 | - (void)pullUpRefreshingAction:(XHContentView *)contentView { 169 | [contentView performSelector:@selector(endPullUpRefreshing) withObject:nil afterDelay:3]; 170 | } 171 | 172 | #pragma mark contentViews delegate/datasource 173 | 174 | - (NSInteger)numberOfContentViews { 175 | int numberOfPanels = [self.items count]; 176 | return numberOfPanels; 177 | } 178 | 179 | - (NSInteger)contentView:(XHContentView *)contentView numberOfRowsInPage:(NSInteger)page section:(NSInteger)section { 180 | XHMenu *item = [self.items objectAtIndex:page]; 181 | return [item.dataSources count]; 182 | } 183 | 184 | - (UITableViewCell *)contentView:(XHContentView *)contentView cellForRowAtIndexPath:(XHPageIndexPath *)indexPath { 185 | static NSString *cellIdentifier = @"cellIdentifier"; 186 | XHNetNewsCell *cell = [contentView.tableView dequeueReusableCellWithIdentifier:cellIdentifier]; 187 | if (!cell) { 188 | cell = [[XHNetNewsCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier]; 189 | } 190 | XHMenu *menu = [self.items lastObject]; 191 | XHNewsModel *newsModel = [menu.dataSources objectAtIndex:indexPath.row]; 192 | 193 | cell.newsModel = newsModel; 194 | 195 | 196 | return cell; 197 | } 198 | 199 | - (void)contentView:(XHContentView *)contentView didSelectRowAtIndexPath:(XHPageIndexPath *)indexPath { 200 | NSLog(@"row : %d section : %d page : %d", indexPath.row, indexPath.section, indexPath.page); 201 | [super contentView:contentView didSelectRowAtIndexPath:indexPath]; 202 | } 203 | 204 | - (XHContentView *)contentViewForPage:(NSInteger)page { 205 | static NSString *identifier = @"XHContentView"; 206 | XHContentView *contentView = (XHContentView *)[self dequeueReusablePageWithIdentifier:identifier]; 207 | if (contentView == nil) { 208 | contentView = [[XHContentView alloc] initWithIdentifier:identifier]; 209 | contentView.pullDownRefreshed = YES; 210 | contentView.refreshControlDelegate = self; 211 | } 212 | if (!page) 213 | contentView.tableView.tableHeaderView = self.scrollBannerView; 214 | else 215 | contentView.tableView.tableHeaderView = nil; 216 | return contentView; 217 | } 218 | 219 | #pragma mark - UITableView delegate 220 | 221 | - (CGFloat)contentView:(XHContentView *)contentView heightForRowAtIndexPath:(XHPageIndexPath *)indexPath { 222 | return 100; 223 | } 224 | 225 | @end 226 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "ipad", 20 | "size" : "29x29", 21 | "scale" : "1x" 22 | }, 23 | { 24 | "idiom" : "ipad", 25 | "size" : "29x29", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "ipad", 30 | "size" : "40x40", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "40x40", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "76x76", 41 | "scale" : "1x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "76x76", 46 | "scale" : "2x" 47 | } 48 | ], 49 | "info" : { 50 | "version" : 1, 51 | "author" : "xcode" 52 | } 53 | } -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "orientation" : "portrait", 20 | "idiom" : "ipad", 21 | "extent" : "full-screen", 22 | "minimum-system-version" : "7.0", 23 | "scale" : "1x" 24 | }, 25 | { 26 | "orientation" : "landscape", 27 | "idiom" : "ipad", 28 | "extent" : "full-screen", 29 | "minimum-system-version" : "7.0", 30 | "scale" : "1x" 31 | }, 32 | { 33 | "orientation" : "portrait", 34 | "idiom" : "ipad", 35 | "extent" : "full-screen", 36 | "minimum-system-version" : "7.0", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "orientation" : "landscape", 41 | "idiom" : "ipad", 42 | "extent" : "full-screen", 43 | "minimum-system-version" : "7.0", 44 | "scale" : "2x" 45 | } 46 | ], 47 | "info" : { 48 | "version" : 1, 49 | "author" : "xcode" 50 | } 51 | } -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Models/XHDataStoreManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHDataStoreManager.h 3 | // XHNewsFrameworkExample 4 | // 5 | // Created by qtone-1 on 14-4-29. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import 10 | #import "XHNewsModel.h" 11 | 12 | @interface XHDataStoreManager : NSObject 13 | 14 | + (instancetype)shareDataStoreManager; 15 | 16 | - (void)loadNetDataSourceWithPagesize:(NSInteger)pagesize pageNumber:(NSInteger)pageNumber compledBlock:(void (^)(NSMutableArray *datas))compled; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Models/XHDataStoreManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // XHDataStoreManager.m 3 | // XHNewsFrameworkExample 4 | // 5 | // Created by qtone-1 on 14-4-29. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHDataStoreManager.h" 10 | #import 11 | 12 | @interface XHDataStoreManager () 13 | 14 | @property (nonatomic) dispatch_queue_t dueJSONDataQueue; 15 | 16 | @end 17 | 18 | @implementation XHDataStoreManager 19 | @synthesize dueJSONDataQueue = _dueJSONDataQueue; 20 | 21 | - (dispatch_queue_t)dueJSONDataQueue { 22 | if (!_dueJSONDataQueue) { 23 | _dueJSONDataQueue = dispatch_queue_create("dueJSONDataQueue", NULL); 24 | } 25 | return _dueJSONDataQueue; 26 | } 27 | 28 | + (instancetype)shareDataStoreManager { 29 | static XHDataStoreManager *dataStoreManager; 30 | static dispatch_once_t onceToken; 31 | dispatch_once(&onceToken, ^{ 32 | dataStoreManager = [[XHDataStoreManager alloc] init]; 33 | }); 34 | return dataStoreManager; 35 | } 36 | 37 | - (void)exDueJSONDataQueue:(void (^)())queue { 38 | dispatch_async(self.dueJSONDataQueue, queue); 39 | } 40 | 41 | - (void)exMainQueue:(void (^)())queue { 42 | dispatch_async(dispatch_get_main_queue(), queue); 43 | } 44 | 45 | - (void)loadNetDataSourceWithPagesize:(NSInteger)pagesize pageNumber:(NSInteger)pageNumber compledBlock:(void (^)(NSMutableArray *datas))compled { 46 | NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://bbs.suizhou.com/suizhoudzapi/topiclist.php?type=tops&pageno=1&pagesize=20"]]; 47 | XHOperationNetworkKit *operation = [[XHOperationNetworkKit alloc] initWithRequest:request jsonSuccessHandler:^(id json) { 48 | if ([[json valueForKey:@"code"] integerValue] == 200) { 49 | [self exDueJSONDataQueue:^{ 50 | NSArray *dataDictionarys = [json valueForKey:@"datas"]; 51 | NSLog(@"dataDictionarys : %@", dataDictionarys); 52 | 53 | if ([dataDictionarys isKindOfClass:[NSArray class]]) { 54 | NSMutableArray *datas = [NSMutableArray arrayWithCapacity:dataDictionarys.count]; 55 | for (NSDictionary *dictionary in dataDictionarys) { 56 | XHNewsModel *newsModel = [[XHNewsModel alloc] initWithDictionary:dictionary]; 57 | [datas addObject:newsModel]; 58 | } 59 | compled(datas); 60 | } 61 | }]; 62 | } 63 | } failureHandler:^(NSData *responseData, NSURLResponse *response, NSError *error) { 64 | NSLog(@"error : %@", error); 65 | }]; 66 | [[XHOperationNetworkKit queue] addOperation:operation]; 67 | } 68 | 69 | @end 70 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Models/XHNewsModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHNewsModel.h 3 | // XHNewsFrameworkExample 4 | // 5 | // Created by qtone-1 on 14-4-29. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface XHNewsModel : NSObject 12 | 13 | @property (nonatomic, copy) NSString *title; 14 | @property (nonatomic, copy) NSString *summary; 15 | @property (nonatomic, copy) NSString *pic; 16 | 17 | - (instancetype)initWithDictionary:(NSDictionary *)dictionary; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Models/XHNewsModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // XHNewsModel.m 3 | // XHNewsFrameworkExample 4 | // 5 | // Created by qtone-1 on 14-4-29. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHNewsModel.h" 10 | 11 | @implementation XHNewsModel 12 | 13 | - (instancetype)initWithDictionary:(NSDictionary *)dictionary { 14 | self = [super init]; 15 | if (self) { 16 | self.title = [dictionary valueForKey:@"title"]; 17 | self.summary = [dictionary valueForKey:@"summary"]; 18 | self.pic = [dictionary valueForKey:@"pic"]; 19 | } 20 | return self; 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Resources/MenuBackground@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHNewsFrameworkExample/9056655237a111856b481a9392946583a617d484/Project/XHNewsFrameworkExample/Resources/MenuBackground@2x.png -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Resources/info_offline_flash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHNewsFrameworkExample/9056655237a111856b481a9392946583a617d484/Project/XHNewsFrameworkExample/Resources/info_offline_flash.png -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Resources/info_offline_flash@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHNewsFrameworkExample/9056655237a111856b481a9392946583a617d484/Project/XHNewsFrameworkExample/Resources/info_offline_flash@2x.png -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Resources/leftShadow@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHNewsFrameworkExample/9056655237a111856b481a9392946583a617d484/Project/XHNewsFrameworkExample/Resources/leftShadow@2x.png -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Resources/logo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHNewsFrameworkExample/9056655237a111856b481a9392946583a617d484/Project/XHNewsFrameworkExample/Resources/logo@2x.png -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Resources/managerMenuButton@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHNewsFrameworkExample/9056655237a111856b481a9392946583a617d484/Project/XHNewsFrameworkExample/Resources/managerMenuButton@2x.png -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Resources/order_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHNewsFrameworkExample/9056655237a111856b481a9392946583a617d484/Project/XHNewsFrameworkExample/Resources/order_back.png -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Resources/page_state_highlight@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHNewsFrameworkExample/9056655237a111856b481a9392946583a617d484/Project/XHNewsFrameworkExample/Resources/page_state_highlight@2x.png -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Resources/page_state_normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHNewsFrameworkExample/9056655237a111856b481a9392946583a617d484/Project/XHNewsFrameworkExample/Resources/page_state_normal@2x.png -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Resources/refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHNewsFrameworkExample/9056655237a111856b481a9392946583a617d484/Project/XHNewsFrameworkExample/Resources/refresh.png -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Resources/refresh@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHNewsFrameworkExample/9056655237a111856b481a9392946583a617d484/Project/XHNewsFrameworkExample/Resources/refresh@2x.png -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Resources/rightShadow@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHNewsFrameworkExample/9056655237a111856b481a9392946583a617d484/Project/XHNewsFrameworkExample/Resources/rightShadow@2x.png -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Resources/statusbar_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHNewsFrameworkExample/9056655237a111856b481a9392946583a617d484/Project/XHNewsFrameworkExample/Resources/statusbar_close.png -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Resources/statusbar_close@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHNewsFrameworkExample/9056655237a111856b481a9392946583a617d484/Project/XHNewsFrameworkExample/Resources/statusbar_close@2x.png -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Resources/列表图片@2x.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHNewsFrameworkExample/9056655237a111856b481a9392946583a617d484/Project/XHNewsFrameworkExample/Resources/列表图片@2x.jpg -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Resources/图片@2x.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHNewsFrameworkExample/9056655237a111856b481a9392946583a617d484/Project/XHNewsFrameworkExample/Resources/图片@2x.jpg -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Vendor/RESideMenu/RECommonFunctions.h: -------------------------------------------------------------------------------- 1 | // 2 | // RECommonFunctions.h 3 | // RESideMenu 4 | // 5 | // Copyright (c) 2013 Roman Efimov (https://github.com/romaonthego) 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | // 25 | 26 | #import 27 | 28 | 29 | #ifndef REUIKitIsFlatMode 30 | #define REUIKitIsFlatMode() RESideMenuUIKitIsFlatMode() 31 | #endif 32 | 33 | #ifndef kCFCoreFoundationVersionNumber_iOS_6_1 34 | #define kCFCoreFoundationVersionNumber_iOS_6_1 793.00 35 | #endif 36 | 37 | #if __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_6_1 38 | #define IF_IOS7_OR_GREATER(...) \ 39 | if (kCFCoreFoundationVersionNumber > kCFCoreFoundationVersionNumber_iOS_6_1) \ 40 | { \ 41 | __VA_ARGS__ \ 42 | } 43 | #else 44 | #define IF_IOS7_OR_GREATER(...) 45 | #endif 46 | 47 | BOOL RESideMenuUIKitIsFlatMode(); -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Vendor/RESideMenu/RECommonFunctions.m: -------------------------------------------------------------------------------- 1 | // 2 | // RECommonFunctions.m 3 | // RESideMenu 4 | // 5 | // Copyright (c) 2013 Roman Efimov (https://github.com/romaonthego) 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | // 25 | 26 | #import "RECommonFunctions.h" 27 | 28 | BOOL RESideMenuUIKitIsFlatMode() 29 | { 30 | static BOOL isUIKitFlatMode = NO; 31 | static dispatch_once_t onceToken; 32 | dispatch_once(&onceToken, ^{ 33 | if (floor(NSFoundationVersionNumber) > 993.0) { 34 | // If your app is running in legacy mode, tintColor will be nil - else it must be set to some color. 35 | if (UIApplication.sharedApplication.keyWindow) { 36 | isUIKitFlatMode = [UIApplication.sharedApplication.delegate.window performSelector:@selector(tintColor)] != nil; 37 | } else { 38 | // Possible that we're called early on (e.g. when used in a Storyboard). Adapt and use a temporary window. 39 | isUIKitFlatMode = [[UIWindow new] performSelector:@selector(tintColor)] != nil; 40 | } 41 | } 42 | }); 43 | return isUIKitFlatMode; 44 | } -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Vendor/RESideMenu/RESideMenu.h: -------------------------------------------------------------------------------- 1 | // 2 | // REFrostedViewController.h 3 | // RESideMenu 4 | // 5 | // Copyright (c) 2013 Roman Efimov (https://github.com/romaonthego) 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | // 25 | 26 | #import 27 | #import "UIViewController+RESideMenu.h" 28 | 29 | @protocol RESideMenuDelegate; 30 | 31 | @interface RESideMenu : UIViewController 32 | 33 | @property (weak, readwrite, nonatomic) id delegate; 34 | 35 | @property (assign, readwrite, nonatomic) NSTimeInterval animationDuration; 36 | @property (strong, readwrite, nonatomic) UIImage *backgroundImage; 37 | @property (assign, readwrite, nonatomic) BOOL panGestureEnabled; 38 | @property (assign, readwrite, nonatomic) BOOL panFromEdge; 39 | @property (assign, readwrite, nonatomic) BOOL interactivePopGestureRecognizerEnabled; 40 | @property (assign, readwrite, nonatomic) BOOL scaleContentView; 41 | @property (assign, readwrite, nonatomic) BOOL scaleBackgroundImageView; 42 | @property (assign, readwrite, nonatomic) BOOL scaleMenuViewContainer; 43 | @property (assign, readwrite, nonatomic) CGFloat contentViewScaleValue; 44 | @property (assign, readwrite, nonatomic) CGFloat contentViewInLandscapeOffsetCenterX; 45 | @property (assign, readwrite, nonatomic) CGFloat contentViewInPortraitOffsetCenterX; 46 | @property (assign, readwrite, nonatomic) CGFloat parallaxMenuMinimumRelativeValue; 47 | @property (assign, readwrite, nonatomic) CGFloat parallaxMenuMaximumRelativeValue; 48 | @property (assign, readwrite, nonatomic) CGFloat parallaxContentMinimumRelativeValue; 49 | @property (assign, readwrite, nonatomic) CGFloat parallaxContentMaximumRelativeValue; 50 | @property (assign, readwrite, nonatomic) BOOL parallaxEnabled; 51 | @property (assign, readwrite, nonatomic) BOOL bouncesHorizontally; 52 | @property (assign, readwrite, nonatomic) UIStatusBarStyle menuPreferredStatusBarStyle; 53 | @property (assign, readwrite, nonatomic) BOOL menuPrefersStatusBarHidden; 54 | 55 | @property (strong, readwrite, nonatomic) UIViewController *contentViewController; 56 | @property (strong, readwrite, nonatomic) UIViewController *menuViewController; 57 | @property (strong, readwrite, nonatomic) UIViewController *tempViewController; 58 | 59 | - (id)initWithContentViewController:(UIViewController *)contentViewController menuViewController:(UIViewController *)menuViewController; 60 | - (void)setContentViewController:(UIViewController *)contentViewController animated:(BOOL)animated; 61 | - (void)presentMenuViewController; 62 | - (void)hideMenuViewController; 63 | - (void)presentRightViewController; 64 | 65 | - (void)panGestureRecognized:(UIPanGestureRecognizer *)recognizer; 66 | @end 67 | 68 | @protocol RESideMenuDelegate 69 | 70 | @optional 71 | - (void)sideMenu:(RESideMenu *)sideMenu didRecognizePanGesture:(UIPanGestureRecognizer *)recognizer; 72 | - (void)sideMenu:(RESideMenu *)sideMenu willShowMenuViewController:(UIViewController *)menuViewController; 73 | - (void)sideMenu:(RESideMenu *)sideMenu didShowMenuViewController:(UIViewController *)menuViewController; 74 | - (void)sideMenu:(RESideMenu *)sideMenu willHideMenuViewController:(UIViewController *)menuViewController; 75 | - (void)sideMenu:(RESideMenu *)sideMenu didHideMenuViewController:(UIViewController *)menuViewController; 76 | 77 | @end -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Vendor/RESideMenu/RESideMenu.m: -------------------------------------------------------------------------------- 1 | // 2 | // REFrostedViewController.m 3 | // RESideMenu 4 | // 5 | // Copyright (c) 2013 Roman Efimov (https://github.com/romaonthego) 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | // 25 | 26 | #import "RESideMenu.h" 27 | #import "UIViewController+RESideMenu.h" 28 | #import "RECommonFunctions.h" 29 | 30 | @interface RESideMenu () 31 | 32 | @property (strong, readwrite, nonatomic) UIImageView *backgroundImageView; 33 | @property (assign, readwrite, nonatomic) BOOL visible; 34 | @property (assign, readwrite, nonatomic) BOOL leftMenuVisible; 35 | @property (assign, readwrite, nonatomic) BOOL rightMenuVisible; 36 | @property (assign, readwrite, nonatomic) CGPoint originalPoint; 37 | @property (strong, readwrite, nonatomic) UIButton *contentButton; 38 | @property (strong, readwrite, nonatomic) UIView *menuViewContainer; 39 | 40 | @end 41 | 42 | @implementation RESideMenu 43 | 44 | - (id)init 45 | { 46 | self = [super init]; 47 | if (self) { 48 | [self commonInit]; 49 | } 50 | return self; 51 | } 52 | 53 | - (id)initWithCoder:(NSCoder *)decoder 54 | { 55 | self = [super initWithCoder:decoder]; 56 | if (self) { 57 | [self commonInit]; 58 | } 59 | return self; 60 | } 61 | 62 | - (void)commonInit 63 | { 64 | _animationDuration = 0.3f; 65 | _panGestureEnabled = YES; 66 | _interactivePopGestureRecognizerEnabled = YES; 67 | 68 | _scaleContentView = YES; 69 | _contentViewScaleValue = 0.7f; 70 | 71 | _scaleBackgroundImageView = YES; 72 | _scaleMenuViewContainer = YES; 73 | 74 | _parallaxEnabled = YES; 75 | _parallaxMenuMinimumRelativeValue = -15; 76 | _parallaxMenuMaximumRelativeValue = 15; 77 | 78 | _parallaxContentMinimumRelativeValue = -25; 79 | _parallaxContentMaximumRelativeValue = 25; 80 | 81 | _contentViewInLandscapeOffsetCenterX = 30.f; 82 | _contentViewInPortraitOffsetCenterX = 30.f; 83 | 84 | _bouncesHorizontally = YES; 85 | 86 | _menuViewContainer = [[UIView alloc] init]; 87 | } 88 | 89 | - (id)initWithContentViewController:(UIViewController *)contentViewController menuViewController:(UIViewController *)menuViewController 90 | { 91 | self = [self init]; 92 | if (self) { 93 | _contentViewController = contentViewController; 94 | _menuViewController = menuViewController; 95 | } 96 | return self; 97 | } 98 | 99 | - (void)viewDidLoad 100 | { 101 | [super viewDidLoad]; 102 | 103 | self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 104 | self.backgroundImageView = ({ 105 | UIImageView *imageView = [[UIImageView alloc] initWithFrame:self.view.bounds]; 106 | imageView.image = self.backgroundImage; 107 | imageView.contentMode = UIViewContentModeScaleAspectFill; 108 | imageView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 109 | imageView; 110 | }); 111 | self.contentButton = ({ 112 | UIButton *button = [[UIButton alloc] initWithFrame:CGRectNull]; 113 | [button addTarget:self action:@selector(hideMenuViewController) forControlEvents:UIControlEventTouchUpInside]; 114 | button; 115 | }); 116 | 117 | [self.view addSubview:self.backgroundImageView]; 118 | [self.view addSubview:self.menuViewContainer]; 119 | 120 | self.menuViewContainer.frame = self.view.bounds; 121 | self.menuViewContainer.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 122 | 123 | if (self.menuViewController) { 124 | [self addChildViewController:self.menuViewController]; 125 | self.menuViewController.view.frame = self.view.bounds; 126 | self.menuViewController.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 127 | [self.menuViewContainer addSubview:self.menuViewController.view]; 128 | [self.menuViewController didMoveToParentViewController:self]; 129 | } 130 | 131 | if (self.tempViewController) { 132 | [self addChildViewController:self.tempViewController]; 133 | self.tempViewController.view.frame = self.view.bounds; 134 | self.tempViewController.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 135 | [self.menuViewContainer addSubview:self.tempViewController.view]; 136 | [self.tempViewController didMoveToParentViewController:self]; 137 | } 138 | 139 | [self re_displayController:self.contentViewController frame:self.view.bounds]; 140 | 141 | self.menuViewContainer.alpha = 1.0; 142 | if (self.scaleBackgroundImageView) 143 | self.backgroundImageView.transform = CGAffineTransformMakeScale(1.7f, 1.7f); 144 | 145 | [self addMenuViewControllerMotionEffects]; 146 | 147 | if (self.panGestureEnabled) { 148 | self.view.multipleTouchEnabled = NO; 149 | UIPanGestureRecognizer *panGestureRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panGestureRecognized:)]; 150 | panGestureRecognizer.delegate = self; 151 | [self.view addGestureRecognizer:panGestureRecognizer]; 152 | } 153 | } 154 | 155 | - (void)viewWillAppear:(BOOL)animated 156 | { 157 | [super viewWillAppear:animated]; 158 | } 159 | 160 | - (void)viewDidAppear:(BOOL)animated 161 | { 162 | [super viewDidAppear:animated]; 163 | } 164 | 165 | - (void)viewWillDisappear:(BOOL)animated 166 | { 167 | [super viewWillDisappear:animated]; 168 | } 169 | 170 | - (void)viewDidDisappear:(BOOL)animated 171 | { 172 | [super viewDidDisappear:animated]; 173 | } 174 | 175 | #pragma mark - 176 | 177 | - (void)resetMenuViewContainer { 178 | self.menuViewContainer.transform = CGAffineTransformIdentity; 179 | if (self.scaleBackgroundImageView) { 180 | self.backgroundImageView.transform = CGAffineTransformIdentity; 181 | self.backgroundImageView.frame = self.view.bounds; 182 | } 183 | if (self.scaleMenuViewContainer) { 184 | self.menuViewContainer.frame = self.view.bounds; 185 | self.menuViewContainer.transform = CGAffineTransformMakeScale(1.5f, 1.5f); 186 | self.menuViewContainer.alpha = 0; 187 | } 188 | if (self.scaleBackgroundImageView) 189 | self.backgroundImageView.transform = CGAffineTransformMakeScale(1.7f, 1.7f); 190 | 191 | if ([self.delegate conformsToProtocol:@protocol(RESideMenuDelegate)] && [self.delegate respondsToSelector:@selector(sideMenu:willShowMenuViewController:)]) { 192 | [self.delegate sideMenu:self willShowMenuViewController:self.menuViewController]; 193 | } 194 | 195 | } 196 | 197 | - (void)presentRightViewController { 198 | [self resetMenuViewContainer]; 199 | 200 | [self showRightMenuViewController]; 201 | } 202 | 203 | - (void)presentMenuViewController 204 | { 205 | [self resetMenuViewContainer]; 206 | 207 | [self showMenuViewController]; 208 | } 209 | 210 | - (void)showMenuViewController 211 | { 212 | if (!self.menuViewController) { 213 | return; 214 | } 215 | self.menuViewController.view.hidden = NO; 216 | self.tempViewController.view.hidden = YES; 217 | [self.view.window endEditing:YES]; 218 | [self addContentButton]; 219 | 220 | 221 | void (^animation)(void) = ^{ 222 | if (self.scaleContentView) { 223 | self.contentViewController.view.transform = CGAffineTransformMakeScale(self.contentViewScaleValue, self.contentViewScaleValue); 224 | } else { 225 | self.contentViewController.view.transform = CGAffineTransformIdentity; 226 | } 227 | self.contentViewController.view.center = CGPointMake((UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation]) ? self.contentViewInLandscapeOffsetCenterX + CGRectGetHeight(self.view.frame) : self.contentViewInPortraitOffsetCenterX + CGRectGetWidth(self.view.frame)), self.contentViewController.view.center.y); 228 | 229 | if (self.scaleMenuViewContainer) { 230 | self.menuViewContainer.alpha = 1.0f; 231 | self.menuViewContainer.transform = CGAffineTransformIdentity; 232 | } 233 | if (self.scaleBackgroundImageView) 234 | self.backgroundImageView.transform = CGAffineTransformIdentity; 235 | }; 236 | 237 | void (^completion)(BOOL finished) = ^(BOOL finished) { 238 | [self addContentViewControllerMotionEffects]; 239 | 240 | if (!self.visible && [self.delegate conformsToProtocol:@protocol(RESideMenuDelegate)] && [self.delegate respondsToSelector:@selector(sideMenu:didShowMenuViewController:)]) { 241 | [self.delegate sideMenu:self didShowMenuViewController:self.menuViewController]; 242 | } 243 | 244 | self.visible = YES; 245 | self.leftMenuVisible = YES; 246 | }; 247 | 248 | 249 | [UIView animateWithDuration:self.animationDuration animations:animation completion:completion]; 250 | 251 | [self updateStatusBar]; 252 | } 253 | 254 | - (void)showRightMenuViewController 255 | { 256 | if (!self.tempViewController) { 257 | return; 258 | } 259 | self.menuViewController.view.hidden = YES; 260 | self.tempViewController.view.hidden = NO; 261 | [self.view.window endEditing:YES]; 262 | [self addContentButton]; 263 | 264 | [[UIApplication sharedApplication] beginIgnoringInteractionEvents]; 265 | [UIView animateWithDuration:self.animationDuration animations:^{ 266 | if (self.scaleContentView) { 267 | self.contentViewController.view.transform = CGAffineTransformMakeScale(self.contentViewScaleValue, self.contentViewScaleValue); 268 | } else { 269 | self.contentViewController.view.transform = CGAffineTransformIdentity; 270 | } 271 | self.contentViewController.view.center = CGPointMake((UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation]) ? -self.contentViewInLandscapeOffsetCenterX : -self.contentViewInPortraitOffsetCenterX), self.contentViewController.view.center.y); 272 | 273 | if (self.scaleMenuViewContainer) { 274 | self.menuViewContainer.alpha = 1.0f; 275 | self.menuViewContainer.transform = CGAffineTransformIdentity; 276 | } 277 | if (self.scaleBackgroundImageView) 278 | self.backgroundImageView.transform = CGAffineTransformIdentity; 279 | 280 | } completion:^(BOOL finished) { 281 | self.visible = !(self.contentViewController.view.frame.size.width == self.view.bounds.size.width && self.contentViewController.view.frame.size.height == self.view.bounds.size.height && self.contentViewController.view.frame.origin.x == 0 && self.contentViewController.view.frame.origin.y == 0); 282 | self.rightMenuVisible = self.visible; 283 | [[UIApplication sharedApplication] endIgnoringInteractionEvents]; 284 | [self addContentViewControllerMotionEffects]; 285 | 286 | if ([self.delegate conformsToProtocol:@protocol(RESideMenuDelegate)] && [self.delegate respondsToSelector:@selector(sideMenu:didShowMenuViewController:)]) { 287 | [self.delegate sideMenu:self didShowMenuViewController:self.menuViewController]; 288 | } 289 | }]; 290 | 291 | [self updateStatusBar]; 292 | } 293 | 294 | - (void)hideMenuViewController 295 | { 296 | if ([self.delegate conformsToProtocol:@protocol(RESideMenuDelegate)] && [self.delegate respondsToSelector:@selector(sideMenu:willHideMenuViewController:)]) { 297 | [self.delegate sideMenu:self willHideMenuViewController:self.menuViewController]; 298 | } 299 | 300 | self.visible = NO; 301 | self.leftMenuVisible = NO; 302 | self.rightMenuVisible = NO; 303 | [self.contentButton removeFromSuperview]; 304 | 305 | [[UIApplication sharedApplication] beginIgnoringInteractionEvents]; 306 | [UIView animateWithDuration:self.animationDuration animations:^{ 307 | self.contentViewController.view.transform = CGAffineTransformIdentity; 308 | self.contentViewController.view.frame = self.view.bounds; 309 | 310 | if (self.scaleMenuViewContainer) { 311 | self.menuViewContainer.transform = CGAffineTransformMakeScale(1.5f, 1.5f); 312 | self.menuViewContainer.alpha = 0; 313 | } 314 | if (self.scaleBackgroundImageView) { 315 | self.backgroundImageView.transform = CGAffineTransformMakeScale(1.7f, 1.7f); 316 | } 317 | if (self.parallaxEnabled) { 318 | IF_IOS7_OR_GREATER( 319 | for (UIMotionEffect *effect in self.contentViewController.view.motionEffects) { 320 | [self.contentViewController.view removeMotionEffect:effect]; 321 | } 322 | ); 323 | } 324 | } completion:^(BOOL finished) { 325 | [[UIApplication sharedApplication] endIgnoringInteractionEvents]; 326 | 327 | if (!self.visible && [self.delegate conformsToProtocol:@protocol(RESideMenuDelegate)] && [self.delegate respondsToSelector:@selector(sideMenu:didHideMenuViewController:)]) { 328 | [self.delegate sideMenu:self didHideMenuViewController:self.menuViewController]; 329 | } 330 | }]; 331 | [self updateStatusBar]; 332 | } 333 | 334 | - (void)addContentButton 335 | { 336 | if (self.contentButton.superview) 337 | return; 338 | 339 | self.contentButton.autoresizingMask = UIViewAutoresizingNone; 340 | self.contentButton.frame = self.contentViewController.view.bounds; 341 | self.contentButton.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 342 | [self.contentViewController.view addSubview:self.contentButton]; 343 | } 344 | 345 | #pragma mark - 346 | #pragma mark Motion effects 347 | 348 | - (void)addMenuViewControllerMotionEffects 349 | { 350 | if (self.parallaxEnabled) { 351 | IF_IOS7_OR_GREATER( 352 | for (UIMotionEffect *effect in self.menuViewContainer.motionEffects) { 353 | [self.menuViewContainer removeMotionEffect:effect]; 354 | } 355 | UIInterpolatingMotionEffect *interpolationHorizontal = [[UIInterpolatingMotionEffect alloc]initWithKeyPath:@"center.x" type:UIInterpolatingMotionEffectTypeTiltAlongHorizontalAxis]; 356 | interpolationHorizontal.minimumRelativeValue = @(self.parallaxMenuMinimumRelativeValue); 357 | interpolationHorizontal.maximumRelativeValue = @(self.parallaxMenuMaximumRelativeValue); 358 | 359 | UIInterpolatingMotionEffect *interpolationVertical = [[UIInterpolatingMotionEffect alloc]initWithKeyPath:@"center.y" type:UIInterpolatingMotionEffectTypeTiltAlongVerticalAxis]; 360 | interpolationVertical.minimumRelativeValue = @(self.parallaxMenuMinimumRelativeValue); 361 | interpolationVertical.maximumRelativeValue = @(self.parallaxMenuMaximumRelativeValue); 362 | 363 | [self.menuViewContainer addMotionEffect:interpolationHorizontal]; 364 | [self.menuViewContainer addMotionEffect:interpolationVertical]; 365 | ); 366 | } 367 | } 368 | 369 | - (void)addContentViewControllerMotionEffects 370 | { 371 | if (self.parallaxEnabled) { 372 | IF_IOS7_OR_GREATER( 373 | for (UIMotionEffect *effect in self.contentViewController.view.motionEffects) { 374 | [self.contentViewController.view removeMotionEffect:effect]; 375 | } 376 | [UIView animateWithDuration:0.2 animations:^{ 377 | UIInterpolatingMotionEffect *interpolationHorizontal = [[UIInterpolatingMotionEffect alloc] initWithKeyPath:@"center.x" type:UIInterpolatingMotionEffectTypeTiltAlongHorizontalAxis]; 378 | interpolationHorizontal.minimumRelativeValue = @(self.parallaxContentMinimumRelativeValue); 379 | interpolationHorizontal.maximumRelativeValue = @(self.parallaxContentMaximumRelativeValue); 380 | 381 | UIInterpolatingMotionEffect *interpolationVertical = [[UIInterpolatingMotionEffect alloc] initWithKeyPath:@"center.y" type:UIInterpolatingMotionEffectTypeTiltAlongVerticalAxis]; 382 | interpolationVertical.minimumRelativeValue = @(self.parallaxContentMinimumRelativeValue); 383 | interpolationVertical.maximumRelativeValue = @(self.parallaxContentMaximumRelativeValue); 384 | 385 | [self.contentViewController.view addMotionEffect:interpolationHorizontal]; 386 | [self.contentViewController.view addMotionEffect:interpolationVertical]; 387 | }]; 388 | ); 389 | } 390 | } 391 | 392 | #pragma mark - 393 | #pragma mark Gesture recognizer 394 | 395 | - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch 396 | { 397 | IF_IOS7_OR_GREATER( 398 | if (self.interactivePopGestureRecognizerEnabled && [self.contentViewController isKindOfClass:[UINavigationController class]]) { 399 | UINavigationController *navigationController = (UINavigationController *)self.contentViewController; 400 | if (navigationController.viewControllers.count > 1 && navigationController.interactivePopGestureRecognizer.enabled) { 401 | return NO; 402 | } 403 | } 404 | ); 405 | 406 | if (self.panFromEdge && [gestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]] && !self.visible) { 407 | CGPoint point = [touch locationInView:gestureRecognizer.view]; 408 | if (point.x < 20.0 || point.x > self.view.frame.size.width - 20.0) { 409 | return YES; 410 | } else { 411 | return NO; 412 | } 413 | } 414 | 415 | return YES; 416 | } 417 | 418 | - (void)panGestureRecognized:(UIPanGestureRecognizer *)recognizer 419 | { 420 | if ([self.delegate conformsToProtocol:@protocol(RESideMenuDelegate)] && [self.delegate respondsToSelector:@selector(sideMenu:didRecognizePanGesture:)]) 421 | [self.delegate sideMenu:self didRecognizePanGesture:recognizer]; 422 | 423 | if (!self.panGestureEnabled) { 424 | return; 425 | } 426 | 427 | CGPoint point = [recognizer translationInView:self.view]; 428 | 429 | if (recognizer.state == UIGestureRecognizerStateBegan) { 430 | 431 | if (!self.visible && [self.delegate conformsToProtocol:@protocol(RESideMenuDelegate)] && [self.delegate respondsToSelector:@selector(sideMenu:willShowMenuViewController:)]) { 432 | [self.delegate sideMenu:self willShowMenuViewController:self.menuViewController]; 433 | } 434 | 435 | self.originalPoint = CGPointMake(self.contentViewController.view.center.x - CGRectGetWidth(self.contentViewController.view.bounds) / 2.0, 436 | self.contentViewController.view.center.y - CGRectGetHeight(self.contentViewController.view.bounds) / 2.0); 437 | self.menuViewContainer.transform = CGAffineTransformIdentity; 438 | if (self.scaleBackgroundImageView) { 439 | self.backgroundImageView.transform = CGAffineTransformIdentity; 440 | self.backgroundImageView.frame = self.view.bounds; 441 | } 442 | self.menuViewContainer.frame = self.view.bounds; 443 | [self addContentButton]; 444 | [self.view.window endEditing:YES]; 445 | } 446 | 447 | if (recognizer.state == UIGestureRecognizerStateChanged) { 448 | CGFloat delta = 0; 449 | if (self.visible) { 450 | delta = self.originalPoint.x != 0 ? (point.x + self.originalPoint.x) / self.originalPoint.x : 0; 451 | } else { 452 | delta = point.x / self.view.frame.size.width; 453 | } 454 | delta = MIN(fabs(delta), 1.6); 455 | 456 | CGFloat contentViewScale = self.scaleContentView ? 1 - ((1 - self.contentViewScaleValue) * delta) : 1; 457 | 458 | CGFloat backgroundViewScale = 1.7f - (0.7f * delta); 459 | CGFloat menuViewScale = 1.5f - (0.5f * delta); 460 | 461 | if (!self.bouncesHorizontally) { 462 | contentViewScale = MAX(contentViewScale, self.contentViewScaleValue); 463 | backgroundViewScale = MAX(backgroundViewScale, 1.0); 464 | menuViewScale = MAX(menuViewScale, 1.0); 465 | } 466 | 467 | 468 | if (self.scaleBackgroundImageView) { 469 | self.backgroundImageView.transform = CGAffineTransformMakeScale(backgroundViewScale, backgroundViewScale); 470 | } 471 | 472 | if (self.scaleMenuViewContainer) { 473 | self.menuViewContainer.alpha = delta; 474 | self.menuViewContainer.transform = CGAffineTransformMakeScale(menuViewScale, menuViewScale); 475 | } 476 | 477 | if (self.scaleBackgroundImageView) { 478 | if (backgroundViewScale < 1) { 479 | self.backgroundImageView.transform = CGAffineTransformIdentity; 480 | } 481 | } 482 | 483 | if (!self.bouncesHorizontally && self.visible) { 484 | if (self.contentViewController.view.frame.origin.x > self.contentViewController.view.frame.size.width / 2.0) 485 | point.x = MIN(0.0, point.x); 486 | 487 | if (self.contentViewController.view.frame.origin.x < -(self.contentViewController.view.frame.size.width / 2.0)) 488 | point.x = MAX(0.0, point.x); 489 | } 490 | 491 | // Limit size 492 | // 493 | if (point.x < 0) { 494 | point.x = MAX(point.x, -[UIScreen mainScreen].bounds.size.height); 495 | } else { 496 | point.x = MIN(point.x, [UIScreen mainScreen].bounds.size.height); 497 | } 498 | [recognizer setTranslation:point inView:self.view]; 499 | 500 | if (contentViewScale > 1) { 501 | CGFloat oppositeScale = (1 - (contentViewScale - 1)); 502 | self.contentViewController.view.transform = CGAffineTransformMakeScale(oppositeScale, oppositeScale); 503 | self.contentViewController.view.transform = CGAffineTransformTranslate(self.contentViewController.view.transform, point.x, 0); 504 | } else { 505 | self.contentViewController.view.transform = CGAffineTransformMakeScale(contentViewScale, contentViewScale); 506 | self.contentViewController.view.transform = CGAffineTransformTranslate(self.contentViewController.view.transform, point.x, 0); 507 | } 508 | 509 | self.menuViewController.view.hidden = self.contentViewController.view.frame.origin.x < 0; 510 | self.tempViewController.view.hidden = self.contentViewController.view.frame.origin.x > 0; 511 | 512 | if (!self.menuViewController && self.contentViewController.view.frame.origin.x > 0) { 513 | self.contentViewController.view.transform = CGAffineTransformIdentity; 514 | self.contentViewController.view.frame = self.view.bounds; 515 | self.visible = NO; 516 | self.leftMenuVisible = NO; 517 | } else if (!self.tempViewController && self.contentViewController.view.frame.origin.x < 0) { 518 | self.contentViewController.view.transform = CGAffineTransformIdentity; 519 | self.contentViewController.view.frame = self.view.bounds; 520 | self.visible = NO; 521 | self.rightMenuVisible = NO; 522 | } 523 | 524 | [self updateStatusBar]; 525 | } 526 | 527 | if (recognizer.state == UIGestureRecognizerStateEnded) { 528 | if ([recognizer velocityInView:self.view].x > 0) { 529 | if (self.contentViewController.view.frame.origin.x < 0) { 530 | [self hideMenuViewController]; 531 | } else { 532 | if (self.menuViewController) { 533 | [self showMenuViewController]; 534 | } 535 | } 536 | } else { 537 | if (self.contentViewController.view.frame.origin.x < 0) { 538 | if (self.tempViewController) { 539 | [self showRightMenuViewController]; 540 | } 541 | } else { 542 | [self hideMenuViewController]; 543 | } 544 | } 545 | } 546 | } 547 | 548 | #pragma mark - 549 | #pragma mark Setters 550 | 551 | - (void)setBackgroundImage:(UIImage *)backgroundImage 552 | { 553 | _backgroundImage = backgroundImage; 554 | if (self.backgroundImageView) 555 | self.backgroundImageView.image = backgroundImage; 556 | } 557 | 558 | - (void)setContentViewController:(UIViewController *)contentViewController 559 | { 560 | if (!_contentViewController) { 561 | _contentViewController = contentViewController; 562 | return; 563 | } 564 | CGRect frame = _contentViewController.view.frame; 565 | CGAffineTransform transform = _contentViewController.view.transform; 566 | [self re_hideController:_contentViewController]; 567 | _contentViewController = contentViewController; 568 | [self re_displayController:contentViewController frame:self.view.bounds]; 569 | contentViewController.view.transform = transform; 570 | contentViewController.view.frame = frame; 571 | 572 | [self addContentViewControllerMotionEffects]; 573 | } 574 | 575 | - (void)setContentViewController:(UIViewController *)contentViewController animated:(BOOL)animated 576 | { 577 | if (!animated) { 578 | [self setContentViewController:contentViewController]; 579 | } else { 580 | contentViewController.view.alpha = 0; 581 | contentViewController.view.frame = self.contentViewController.view.bounds; 582 | [self.contentViewController.view addSubview:contentViewController.view]; 583 | [UIView animateWithDuration:self.animationDuration animations:^{ 584 | contentViewController.view.alpha = 1; 585 | } completion:^(BOOL finished) { 586 | [contentViewController.view removeFromSuperview]; 587 | [self setContentViewController:contentViewController]; 588 | }]; 589 | } 590 | } 591 | 592 | - (void)setMenuViewController:(UIViewController *)menuViewController 593 | { 594 | if (!_menuViewController) { 595 | _menuViewController = menuViewController; 596 | return; 597 | } 598 | [self re_hideController:_menuViewController]; 599 | _menuViewController = menuViewController; 600 | 601 | [self addChildViewController:self.menuViewController]; 602 | self.menuViewController.view.frame = self.view.bounds; 603 | self.menuViewController.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 604 | [self.menuViewContainer addSubview:self.menuViewController.view]; 605 | [self.menuViewController didMoveToParentViewController:self]; 606 | 607 | [self addMenuViewControllerMotionEffects]; 608 | [self.view bringSubviewToFront:self.contentViewController.view]; 609 | } 610 | 611 | - (void)setTempViewController:(UIViewController *)tempViewController 612 | { 613 | if (!_tempViewController) { 614 | _tempViewController = tempViewController; 615 | return; 616 | } 617 | [self re_hideController:_tempViewController]; 618 | _tempViewController = tempViewController; 619 | 620 | [self addChildViewController:self.tempViewController]; 621 | self.tempViewController.view.frame = self.view.bounds; 622 | self.tempViewController.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 623 | [self.menuViewContainer addSubview:self.tempViewController.view]; 624 | [self.tempViewController didMoveToParentViewController:self]; 625 | 626 | /*[self addChildViewController:self.menuViewController]; 627 | self.menuViewController.view.frame = self.view.bounds; 628 | self.menuViewController.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 629 | [self.menuViewContainer addSubview:self.menuViewController.view]; 630 | [self.menuViewController didMoveToParentViewController:self];*/ 631 | 632 | [self addMenuViewControllerMotionEffects]; 633 | [self.view bringSubviewToFront:self.contentViewController.view]; 634 | } 635 | 636 | #pragma mark - 637 | #pragma mark Rotation handler 638 | 639 | - (BOOL)shouldAutorotate 640 | { 641 | return self.contentViewController.shouldAutorotate; 642 | } 643 | 644 | - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration 645 | { 646 | if (self.visible) { 647 | self.menuViewContainer.bounds = self.view.bounds; 648 | self.contentViewController.view.transform = CGAffineTransformIdentity; 649 | self.contentViewController.view.frame = self.view.bounds; 650 | 651 | if (self.scaleContentView) { 652 | self.contentViewController.view.transform = CGAffineTransformMakeScale(self.contentViewScaleValue, self.contentViewScaleValue); 653 | } else { 654 | self.contentViewController.view.transform = CGAffineTransformIdentity; 655 | } 656 | 657 | CGPoint center; 658 | if (self.leftMenuVisible) { 659 | center = CGPointMake((UIDeviceOrientationIsLandscape([UIDevice currentDevice].orientation) ? self.contentViewInLandscapeOffsetCenterX + CGRectGetHeight(self.view.frame) : self.contentViewInPortraitOffsetCenterX + CGRectGetWidth(self.view.frame)), self.contentViewController.view.center.y); 660 | } else { 661 | center = CGPointMake((UIDeviceOrientationIsLandscape([UIDevice currentDevice].orientation) ? -self.contentViewInLandscapeOffsetCenterX : -self.contentViewInPortraitOffsetCenterX), self.contentViewController.view.center.y); 662 | } 663 | 664 | self.contentViewController.view.center = center; 665 | } 666 | } 667 | 668 | #pragma mark - 669 | #pragma mark Status bar appearance management 670 | 671 | - (void)updateStatusBar 672 | { 673 | if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) { 674 | [UIView animateWithDuration:0.3f animations:^{ 675 | [self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)]; 676 | }]; 677 | } 678 | } 679 | 680 | - (UIStatusBarStyle)preferredStatusBarStyle 681 | { 682 | UIStatusBarStyle statusBarStyle = UIStatusBarStyleDefault; 683 | IF_IOS7_OR_GREATER( 684 | statusBarStyle = self.visible ? self.menuPreferredStatusBarStyle : self.contentViewController.preferredStatusBarStyle; 685 | if (self.contentViewController.view.frame.origin.y > 10) { 686 | statusBarStyle = self.menuPreferredStatusBarStyle; 687 | } else { 688 | statusBarStyle = self.contentViewController.preferredStatusBarStyle; 689 | } 690 | ); 691 | return statusBarStyle; 692 | } 693 | 694 | - (BOOL)prefersStatusBarHidden 695 | { 696 | BOOL statusBarHidden = NO; 697 | IF_IOS7_OR_GREATER( 698 | statusBarHidden = self.visible ? self.menuPrefersStatusBarHidden : self.contentViewController.prefersStatusBarHidden; 699 | if (self.contentViewController.view.frame.origin.y > 10) { 700 | statusBarHidden = self.menuPrefersStatusBarHidden; 701 | } else { 702 | statusBarHidden = self.contentViewController.prefersStatusBarHidden; 703 | } 704 | ); 705 | return statusBarHidden; 706 | } 707 | 708 | - (UIStatusBarAnimation)preferredStatusBarUpdateAnimation 709 | { 710 | UIStatusBarAnimation statusBarAnimation = UIStatusBarAnimationNone; 711 | IF_IOS7_OR_GREATER( 712 | statusBarAnimation = self.visible ? self.menuViewController.preferredStatusBarUpdateAnimation : self.contentViewController.preferredStatusBarUpdateAnimation; 713 | if (self.contentViewController.view.frame.origin.y > 10) { 714 | statusBarAnimation = self.menuViewController.preferredStatusBarUpdateAnimation; 715 | } else { 716 | statusBarAnimation = self.contentViewController.preferredStatusBarUpdateAnimation; 717 | } 718 | ); 719 | return statusBarAnimation; 720 | } 721 | 722 | @end 723 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Vendor/RESideMenu/UIViewController+RESideMenu.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+RESideMenu.h 3 | // RESideMenu 4 | // 5 | // Copyright (c) 2013 Roman Efimov (https://github.com/romaonthego) 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | // 25 | 26 | #import 27 | 28 | @class RESideMenu; 29 | 30 | @interface UIViewController (RESideMenu) 31 | 32 | @property (strong, readonly, nonatomic) RESideMenu *sideMenuViewController; 33 | 34 | - (void)re_displayController:(UIViewController *)controller frame:(CGRect)frame; 35 | - (void)re_hideController:(UIViewController *)controller; 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Vendor/RESideMenu/UIViewController+RESideMenu.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+RESideMenu.m 3 | // RESideMenu 4 | // 5 | // Copyright (c) 2013 Roman Efimov (https://github.com/romaonthego) 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | // 25 | 26 | #import "UIViewController+RESideMenu.h" 27 | #import "RESideMenu.h" 28 | 29 | @implementation UIViewController (RESideMenu) 30 | 31 | - (void)re_displayController:(UIViewController *)controller frame:(CGRect)frame 32 | { 33 | [self addChildViewController:controller]; 34 | controller.view.frame = frame; 35 | [self.view addSubview:controller.view]; 36 | [controller didMoveToParentViewController:self]; 37 | } 38 | 39 | - (void)re_hideController:(UIViewController *)controller 40 | { 41 | [controller willMoveToParentViewController:nil]; 42 | [controller.view removeFromSuperview]; 43 | [controller removeFromParentViewController]; 44 | } 45 | 46 | - (RESideMenu *)sideMenuViewController 47 | { 48 | UIViewController *iter = self.parentViewController; 49 | while (iter) { 50 | if ([iter isKindOfClass:[RESideMenu class]]) { 51 | return (RESideMenu *)iter; 52 | } else if (iter.parentViewController && iter.parentViewController != iter) { 53 | iter = iter.parentViewController; 54 | } else { 55 | iter = nil; 56 | } 57 | } 58 | return nil; 59 | } 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Vendor/XHNewsFramework.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Vendor/XHNewsFramework.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Vendor/XHNewsFramework.framework/Versions/A/Headers/NSTimer+Addition.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSTimer+Addition.h 3 | // HUAJIENewsiPhoneSDK 4 | // 5 | // Created by 曾 宪华 on 14-3-16. 6 | // Copyright (c) 2014年 曾宪华 QQ群: (142557668) QQ:543413507 Gmail:xhzengAIB@gmail.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSTimer (Addition) 12 | 13 | - (void)pauseTimer; 14 | - (void)resumeTimer; 15 | - (void)resumeTimerAfterTimeInterval:(NSTimeInterval)interval; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Vendor/XHNewsFramework.framework/Versions/A/Headers/UIScrollView+XHVisibleCenterScroll.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIScrollView+XHVisibleCenterScroll.h 3 | // XHScrollMenu 4 | // 5 | // Created by 曾 宪华 on 14-3-9. 6 | // Copyright (c) 2014年 曾宪华 QQ群: (142557668) QQ:543413507 Gmail:xhzengAIB@gmail.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIScrollView (XHVisibleCenterScroll) 12 | 13 | - (void)scrollRectToVisibleCenteredOn:(CGRect)visibleRect 14 | animated:(BOOL)animated; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Vendor/XHNewsFramework.framework/Versions/A/Headers/XHBaseViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHBaseViewController.h 3 | // XHNewsFramework 4 | // 5 | // Created by 曾 宪华 on 14-1-30. 6 | // Copyright (c) 2014年 曾宪华 开发团队(http://iyilunba.com ) 本人QQ:543413507 本人QQ群(142557668). All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface XHBaseViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Vendor/XHNewsFramework.framework/Versions/A/Headers/XHColumnItemManagerViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHColumnItemManagerViewController.h 3 | // XHNewsFramework 4 | // 5 | // Created by 曾 宪华 on 14-1-26. 6 | // Copyright (c) 2014年 曾宪华 开发团队(http://iyilunba.com ) 本人QQ:543413507 本人QQ群(142557668). All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class XHColumnItemManagerViewController; 12 | @protocol XHColumnItemManagerViewControllerDelegate 13 | 14 | - (void)managerDidFinish:(XHColumnItemManagerViewController *)columnItemManagerViewController; 15 | 16 | @end 17 | 18 | @interface XHColumnItemManagerViewController : UIViewController 19 | @property (nonatomic, assign) id delegate; 20 | @property (nonatomic, strong) NSArray *subscribed; // 已经订阅分类 21 | @property (nonatomic, strong) NSArray *unSubscribed; // 在本地或者网络搜索回来的未订阅分类 22 | @end 23 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Vendor/XHNewsFramework.framework/Versions/A/Headers/XHColumnItemView.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHColumnItemView.h 3 | // XHNewsFramework 4 | // 5 | // Created by 曾 宪华 on 14-1-27. 6 | // Copyright (c) 2014年 曾宪华 开发团队(http://iyilunba.com ) 本人QQ:543413507 本人QQ群(142557668). All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class XHColumnItemView; 12 | @protocol XHColumnItemViewDelegate 13 | 14 | - (void)didSelected:(XHColumnItemView *)columnItemView; 15 | 16 | @end 17 | 18 | @class XHMenu; 19 | @interface XHColumnItemView : UIView 20 | @property (nonatomic, strong) XHMenu *item; 21 | @property (nonatomic, assign) id delegate; 22 | - (id)initWithFrame:(CGRect)frame target:(id)target action:(SEL)action isTapHandle:(BOOL)isTap; 23 | @end 24 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Vendor/XHNewsFramework.framework/Versions/A/Headers/XHContentView.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHContentView.h 3 | // XHNewsFramework 4 | // 5 | // Created by 曾 宪华 on 14-1-24. 6 | // Copyright (c) 2014年 曾宪华 开发团队(http://iyilunba.com ) 本人QQ:543413507 本人QQ群(142557668). All rights reserved. 7 | // 8 | 9 | #import 10 | #import "XHPageIndexPath.h" 11 | 12 | @class XHContentView; 13 | @protocol XHContentViewDelegate 14 | - (NSInteger)contentView:(XHContentView *)contentView numberOfRowsInPage:(NSInteger)page section:(NSInteger)section; 15 | - (UITableViewCell *)contentView:(XHContentView *)contentView cellForRowAtIndexPath:(XHPageIndexPath *)indexPath; 16 | @optional 17 | - (void)contentView:(XHContentView *)contentView didSelectRowAtIndexPath:(XHPageIndexPath *)indexPath; 18 | - (CGFloat)contentView:(XHContentView *)contentView heightForRowAtIndexPath:(XHPageIndexPath *)indexPath; 19 | - (NSInteger)contentView:(XHContentView *)contentView numberOfSectionsInPage:(NSInteger)pageNumber; 20 | - (NSString*)contentView:(XHContentView *)contentView titleForHeaderInPage:(NSInteger)pageNumber section:(NSInteger)section; 21 | - (UIView *)contentView:(XHContentView *)contentView viewForHeaderInPage:(NSInteger)pageNumber section:(NSInteger)section; 22 | - (void)contentView:(XHContentView *)contentView didScroll:(UIScrollView *)scrollView; 23 | - (CGFloat)contentView:(XHContentView *)contentView heightForHeaderInSection:(NSInteger)section; 24 | @end 25 | 26 | @protocol XHContentViewRefreshingDelegate 27 | 28 | - (void)pullDownRefreshingAction:(XHContentView *)contentView; 29 | - (void)pullUpRefreshingAction:(XHContentView *)contentView; 30 | 31 | @end 32 | 33 | @interface XHContentView : UIView 34 | 35 | @property (nonatomic, assign) CGFloat transitionDuration; // default is 0.4 36 | @property (nonatomic, assign) CGFloat tableViewContentInsetTop; 37 | @property (nonatomic, assign) NSInteger pageNumber; 38 | @property (nonatomic, strong) UITableView *tableView; 39 | @property (nonatomic, unsafe_unretained) id delegate; 40 | @property (nonatomic, unsafe_unretained) id refreshControlDelegate; 41 | @property (nonatomic, copy) NSString *identifier; 42 | 43 | @property (nonatomic, assign) BOOL isShowTopScrollToolBar; 44 | @property (nonatomic, assign) BOOL pullDownRefreshed; // default is NO 45 | @property (nonatomic, assign) BOOL pullUpRefreshed; // default is NO 46 | 47 | #pragma mark init 48 | - (id)initWithIdentifier:(NSString *)identifier; 49 | 50 | #pragma mark reset 51 | - (void)reset; 52 | 53 | #pragma mark view state 54 | - (void)pageWillAppear; 55 | - (void)pageDidAppear; 56 | - (void)pageWillDisappear; 57 | 58 | #pragma mark animation 59 | - (CGAffineTransform)transformForOrientation; 60 | - (void)showContentView:(BOOL)show animated:(BOOL)animated; 61 | - (void)shouldWiggle:(BOOL)wiggle; 62 | 63 | #pragma mark offset save/restore 64 | @property (nonatomic, assign) BOOL restored; // default is NO 65 | - (void)saveTableviewOffset; 66 | - (void)restoreTableviewOffset; 67 | - (void)removeTableviewOffset; 68 | 69 | #pragma mark add and remove panels 70 | - (void)addContentViewWithAnimation:(BOOL)animate; 71 | - (void)removeContentViewWithAnimation:(BOOL)animate; 72 | 73 | #pragma mark page controll 74 | - (void)showNextContentView; 75 | - (void)showPreviousContentView; 76 | 77 | #pragma mark - 刷新的 78 | - (void)endPullDownRefreshing; 79 | - (void)endPullUpRefreshing; 80 | 81 | @end 82 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Vendor/XHNewsFramework.framework/Versions/A/Headers/XHEdittingScrollView.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHEdittingScrollView.h 3 | // XHNewsFramework 4 | // 5 | // Created by 曾 宪华 on 14-1-24. 6 | // Copyright (c) 2014年 曾宪华 开发团队(http://iyilunba.com ) 本人QQ:543413507 本人QQ群(142557668). All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface XHEdittingScrollView : UIScrollView 12 | @property (nonatomic, assign) BOOL isEditing; 13 | @end 14 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Vendor/XHNewsFramework.framework/Versions/A/Headers/XHFountionCommon.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHFountionCommon.h 3 | // XHNewsFramework 4 | // 5 | // Created by 曾 宪华 on 14-1-24. 6 | // Copyright (c) 2014年 曾宪华 开发团队(http://iyilunba.com ) 本人QQ:543413507 本人QQ群(142557668). All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | #define BUNDLE_IMAGE(_file) [UIImage imageWithContentsOfFile:[[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"XHNewsFramework.bundle"] stringByAppendingPathComponent:[NSString stringWithFormat:@"%@%@.png", _file, ((int)[[UIScreen mainScreen] scale]-1) ? @"@2x" : @""]]] 13 | 14 | #ifdef __IPHONE_6_0 // iOS6 and later 15 | # define UITextAlignmentCenter NSTextAlignmentCenter 16 | # define UITextAlignmentLeft NSTextAlignmentLeft 17 | # define UITextAlignmentRight NSTextAlignmentRight 18 | # define UILineBreakModeTailTruncation NSLineBreakByTruncatingTail 19 | # define UILineBreakModeMiddleTruncation NSLineBreakByTruncatingMiddle 20 | # define UILineBreakModeCharacterWrap NSLineBreakByWordWrapping 21 | #endif 22 | 23 | #if __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_6_1 24 | #define IF_IOS7_OR_GREATER(...) \ 25 | if (kCFCoreFoundationVersionNumber > kCFCoreFoundationVersionNumber_iOS_6_1) \ 26 | { \ 27 | __VA_ARGS__ \ 28 | } 29 | #else 30 | #define IF_IOS7_OR_GREATER(...) 31 | #endif 32 | 33 | @interface XHFountionCommon : NSObject 34 | 35 | + (BOOL)iOS7; 36 | 37 | + (CGFloat)getAdapterHeight; 38 | 39 | + (void)setOfflineProgress:(CGFloat)progress; 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Vendor/XHNewsFramework.framework/Versions/A/Headers/XHFriendlyLoadingView.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHFriendlyLoadingView.h 3 | // XHFriendlyLoadingView 4 | // 5 | // Created by 曾 宪华 on 13-12-31. 6 | // Copyright (c) 2013年 曾宪华 开发团队(http://iyilunba.com ) 本人QQ:543413507. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef void(^ReloadButtonClickedCompleted)(UIButton *sender); 12 | 13 | @interface XHFriendlyLoadingView : UIView 14 | @property (nonatomic, copy) ReloadButtonClickedCompleted reloadButtonClickedCompleted; 15 | 16 | + (instancetype)shareFriendlyLoadingView; 17 | 18 | - (void)showFriendlyLoadingViewWithText:(NSString *)text loadingAnimated:(BOOL)animated; 19 | 20 | /** 21 | * 隐藏页面加载动画及信息提示 22 | */ 23 | - (void)hideLoadingView; 24 | 25 | /** 26 | * 重新加载提示 27 | * @param reloadString 要显示的提示字符串 28 | */ 29 | - (void)showReloadViewWithText:(NSString *)reloadString; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Vendor/XHNewsFramework.framework/Versions/A/Headers/XHHTTPClient.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHHTTPClient.h 3 | // XHOperationNetworkKit 4 | // 5 | // Created by 曾 宪华 on 14-1-4. 6 | // Copyright (c) 2014年 曾宪华 开发团队(http://iyilunba.com ) 本人QQ:543413507. All rights reserved. 7 | // 8 | 9 | #import "XHOperationNetworkKit.h" 10 | 11 | #define XHHTTPClientTimeoutInterval 30 12 | 13 | static NSString *const pailixiuHomeURL = @"http://www.pailixiu.com"; 14 | 15 | @interface XHHTTPClient : XHOperationNetworkKit 16 | 17 | + (void)GETPath:(NSString *)urlString parameters:(NSDictionary *)parameters jsonSuccessHandler:(XHJSONSuccessHandler)jsonSuccessHandler 18 | failureHandler:(XHHTTPFailureHandler)failureHandler; 19 | 20 | + (void)POSTPath:(NSString *)urlString parameters:(NSDictionary *)parameters jsonSuccessHandler:(XHJSONSuccessHandler)jsonSuccessHandler 21 | failureHandler:(XHHTTPFailureHandler)failureHandler; 22 | 23 | + (void)DELETEPath:(NSString *)urlString parameters:(NSDictionary *)parameters jsonSuccessHandler:(XHJSONSuccessHandler)jsonSuccessHandler 24 | failureHandler:(XHHTTPFailureHandler)failureHandler; 25 | 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Vendor/XHNewsFramework.framework/Versions/A/Headers/XHIndicatorView.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHIndicatorView.h 3 | // XHScrollMenu 4 | // 5 | // Created by 曾 宪华 on 14-3-8. 6 | // Copyright (c) 2014年 曾宪华 QQ群: (142557668) QQ:543413507 Gmail:xhzengAIB@gmail.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #define kXHIndicatorViewHeight 3 12 | 13 | @interface XHIndicatorView : UIView 14 | 15 | + (instancetype)initIndicatorView; 16 | 17 | @property (nonatomic, assign) CGFloat indicatorWidth; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Vendor/XHNewsFramework.framework/Versions/A/Headers/XHMenu.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHMenu.h 3 | // XHScrollMenu 4 | // 5 | // Created by 曾 宪华 on 14-3-8. 6 | // Copyright (c) 2014年 曾宪华 QQ群: (142557668) QQ:543413507 Gmail:xhzengAIB@gmail.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface XHMenu : NSObject 12 | 13 | @property (nonatomic, copy) NSString *title; 14 | @property (nonatomic, strong) UIFont *titleFont; 15 | @property (nonatomic, strong) UIColor *titleNormalColor; 16 | @property (nonatomic, strong) UIColor *titleSelectedColor; 17 | @property (nonatomic, strong) UIColor *titleHighlightedColor; 18 | 19 | @property (nonatomic, strong) UIImage *normalImage; 20 | @property (nonatomic, strong) UIImage *hightlightedImage; 21 | @property (nonatomic, strong) UIImage *selectedImage; 22 | 23 | @property (nonatomic, copy) NSString *dataSourcesStringUrl; 24 | @property (nonatomic, strong) NSMutableArray *dataSources; 25 | 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Vendor/XHNewsFramework.framework/Versions/A/Headers/XHMenuButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHMenuButton.h 3 | // XHScrollMenu 4 | // 5 | // Created by 曾 宪华 on 14-3-9. 6 | // Copyright (c) 2014年 曾宪华 QQ群: (142557668) QQ:543413507 Gmail:xhzengAIB@gmail.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface XHMenuButton : UIButton 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Vendor/XHNewsFramework.framework/Versions/A/Headers/XHNewsCommentsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHNewsCommentsViewController.h 3 | // XHNewsFramework 4 | // 5 | // Created by 曾 宪华 on 14-1-29. 6 | // Copyright (c) 2014年 曾宪华 开发团队(http://iyilunba.com ) 本人QQ:543413507 本人QQ群(142557668). All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface XHNewsCommentsViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Vendor/XHNewsFramework.framework/Versions/A/Headers/XHNewsContainerViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHNewsContainerViewController.h 3 | // XHNewsFramework 4 | // 5 | // Created by 曾 宪华 on 14-1-24. 6 | // Copyright (c) 2014年 曾宪华 开发团队(http://iyilunba.com ) 本人QQ:543413507 本人QQ群(142557668). All rights reserved. 7 | // 8 | 9 | #import 10 | #import "XHBaseViewController.h" 11 | #import "XHEdittingScrollView.h" 12 | #import "XHContentView.h" 13 | 14 | @interface XHNewsContainerViewController : XHBaseViewController 15 | 16 | 17 | #pragma mark - Custom UI 18 | // top 19 | @property (nonatomic, assign) BOOL isShowTopScrollToolBar; // default is YES 20 | @property (nonatomic, strong) UIImage *topScrollViewToolBarBackgroundImage; // default is nil 21 | @property (nonatomic, strong) UIColor *topScrollViewToolBarBackgroundColor; // default is [UIColor colorWithWhite:0.902 alpha:1.000] 22 | @property (nonatomic, strong) UIImage *managerButtonBackgroundImage; // default is arrow image 23 | @property (nonatomic, strong) UIColor *indicatorColor; // default is redColor 24 | @property (nonatomic, assign) CGFloat topScrollViewToolBarHieght; // default is 36 25 | @property (nonatomic, strong) UIImage *leftShadowImage; 26 | @property (nonatomic, strong) UIImage *rightShadowImage; 27 | @property (nonatomic, assign) BOOL isShowManagerButton; // default is NO 28 | 29 | // mid 30 | @property (nonatomic, strong) UIImage *midContentLogoImage; // default is netEase logo 31 | // contentScrollView 32 | @property (nonatomic, strong) UIColor *contentScrollViewBackgroundColor; // default is [UIColor whiteColor] 33 | @property (nonatomic, assign) CGFloat contentViewPaddingX; // default is 0 34 | @property (nonatomic, assign) CGFloat contentViewContentInsetTop; // default is 0 35 | #pragma mark frame and sizes 36 | - (CGRect)scrollViewFrame; 37 | - (CGSize)contentViewSize; 38 | #pragma mark - scroll the contentView 39 | - (void)goToContentView:(NSInteger)index; 40 | 41 | 42 | #pragma mark - DataSource 43 | @property (nonatomic, assign) int currentPage; 44 | @property (nonatomic, assign) int lastDisplayedPage; 45 | @property (nonatomic, strong) NSArray *items; 46 | @property (nonatomic, strong) NSArray *unItems; 47 | - (NSInteger)numberOfVisibleContentViews; 48 | - (NSInteger)numberOfContentViews; 49 | - (void)reloadDataSource; 50 | 51 | 52 | #pragma mark - Reuse 53 | - (XHContentView *)dequeueReusablePageWithIdentifier:(NSString*)identifier; 54 | /** 55 | * 这个方法用于重载的,这个方法类似TableView的用法 56 | * 57 | * @param page 配置的页码 58 | * 59 | * @return 返回初始化或者重用的contentView 60 | */ 61 | - (XHContentView *)contentViewForPage:(NSInteger)page; 62 | 63 | /** 64 | * 用于直接调用的方法,获取某个页码的contentView 65 | * 66 | * @param page 目标页码 67 | * 68 | * @return 返回某个页码对于的contentView 69 | */ 70 | - (XHContentView *)contentViewAtPage:(NSInteger)page; 71 | 72 | #pragma mark - Custom Action 73 | // 管理menu item的按钮事件,由你自己发挥 74 | - (void)didOpenManagerItems; 75 | // 新需求,当滚动视图停止后,告之最终显示页面的Index 76 | - (void)didDisplayContentViewAtCurrentPageIndex:(NSInteger)currentPageIndex; 77 | 78 | #pragma mark - 手势冲突解决 79 | @property (nonatomic, assign) BOOL enableSideMenu; // default is YES 80 | // 用于解决手势冲突的问题,内部已经解决细节的问题,只需要直接传递就可以,因为内部判断好了向左还是向右, 81 | - (void)receiveScrollViewPanGestureRecognizerHandle:(UIPanGestureRecognizer *)scrollViewPanGestureRecognizer; 82 | 83 | @end 84 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Vendor/XHNewsFramework.framework/Versions/A/Headers/XHNewsDetail.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHNewsDetail.h 3 | // XHNewsFramework 4 | // 5 | // Created by 曾 宪华 on 14-1-29. 6 | // Copyright (c) 2014年 曾宪华 开发团队(http://iyilunba.com ) 本人QQ:543413507 本人QQ群(142557668). All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface XHNewsDetail : NSObject 12 | @property (nonatomic, copy) NSString *newsTitle; 13 | @property (nonatomic, copy) NSString *newsContent; 14 | @end 15 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Vendor/XHNewsFramework.framework/Versions/A/Headers/XHNewsDetailViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHNewsDetailViewController.h 3 | // XHNewsFramework 4 | // 5 | // Created by 曾 宪华 on 14-1-29. 6 | // Copyright (c) 2014年 曾宪华 开发团队(http://iyilunba.com ) 本人QQ:543413507 本人QQ群(142557668). All rights reserved. 7 | // 8 | 9 | #import 10 | #import "XHNewsDetail.h" 11 | 12 | @interface XHNewsDetailViewController : UIViewController 13 | @property (nonatomic, strong) XHNewsDetail *newsDetail; 14 | @end 15 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Vendor/XHNewsFramework.framework/Versions/A/Headers/XHOperationNetworkKit.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHOperationNetworkKit.h 3 | // XHOperationNetworkKit 4 | // 5 | // Created by 曾 宪华 on 14-1-2. 6 | // Copyright (c) 2014年 曾宪华 开发团队(http://iyilunba.com ) 本人QQ:543413507. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef void (^XHHTTPProgressHandler)(CGFloat progress, unsigned long long total); 12 | typedef void (^XHJSONSuccessHandler)(id json); 13 | typedef void (^XHHTTPSuccessHandler)(NSData *responseData, NSURLResponse *response); 14 | typedef void (^XHHTTPFailureHandler)(NSData *responseData, NSURLResponse *response, NSError *error); 15 | 16 | @interface XHOperationNetworkKit : NSOperation 17 | 18 | + (NSOperationQueue *)queue; 19 | 20 | - (id)initWithRequest:(NSURLRequest *)request; 21 | - (id)initWithRequest:(NSURLRequest *)request 22 | jsonSuccessHandler:(XHJSONSuccessHandler)jsonSuccessHandler 23 | failureHandler:(XHHTTPFailureHandler)failureHandler; 24 | - (id)initWithRequest:(NSURLRequest *)request 25 | successHandler:(XHHTTPSuccessHandler)successHandler 26 | failureHandler:(XHHTTPFailureHandler)failureHandler; 27 | 28 | 29 | - (void)setSuccessHandler:(XHHTTPSuccessHandler)successHandler; 30 | - (void)setFailureHandler:(XHHTTPFailureHandler)failureHandler; 31 | - (void)setProgressHandler:(XHHTTPProgressHandler)progressHandler; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Vendor/XHNewsFramework.framework/Versions/A/Headers/XHPageControl.h: -------------------------------------------------------------------------------- 1 | // 2 | // HUAJIEPageControl.h 3 | // HUAJIENewsiPhoneSDK 4 | // 5 | // Created by 曾 宪华 on 14-3-16. 6 | // Copyright (c) 2014年 曾宪华 QQ群: (142557668) QQ:543413507 Gmail:xhzengAIB@gmail.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef void(^DidSelectDotAtIndex)(NSUInteger dotIndex); 12 | 13 | @interface XHPageControl : UIView 14 | 15 | @property (nonatomic, copy) DidSelectDotAtIndex didSelectDotAtIndex; 16 | @property (nonatomic, strong) UIImage *normalDotImage; 17 | @property (nonatomic, strong) UIImage *highlightedDotImage; 18 | @property (nonatomic, assign) NSUInteger pageNumbers; // degault is 3 19 | @property (nonatomic, assign) NSInteger currentSelectedIndex; // default is 0 20 | @property (nonatomic, assign) CGSize dotSize; // default is 6 21 | @property (nonatomic, assign) CGFloat dotPadding; // default is 6 22 | @property (nonatomic, assign) NSTimeInterval animationDuration; // default is 0 23 | 24 | - (void)reloadData; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Vendor/XHNewsFramework.framework/Versions/A/Headers/XHPageIndexPath.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHPageIndexPath.h 3 | // XHNewsFramework 4 | // 5 | // Created by 曾 宪华 on 14-1-24. 6 | // Copyright (c) 2014年 曾宪华 开发团队(http://iyilunba.com ) 本人QQ:543413507 本人QQ群(142557668). All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface XHPageIndexPath : NSObject 13 | @property (nonatomic, assign) NSInteger page; 14 | @property (nonatomic, assign) NSInteger row; 15 | @property (nonatomic, assign) NSInteger section; 16 | 17 | - (instancetype)initWithPage:(NSInteger)page row:(NSInteger)row section:(NSInteger)section; 18 | + (instancetype)panelIndexPathForPage:(NSInteger)page row:(NSInteger)row section:(NSInteger)section ; 19 | + (id)panelIndexPathForPage:(NSInteger)page indexPath:(NSIndexPath*)indexPath; 20 | @end 21 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Vendor/XHNewsFramework.framework/Versions/A/Headers/XHParallaxNavigationController.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHParallaxNavigationController.h 3 | // iyilunba 4 | // 5 | // Created by 曾 宪华 on 13-12-4. 6 | // Copyright (c) 2013年 曾 宪华 开发团队(http://iyilunba.com ). All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | // 背景视图起始frame.x 12 | #define startX -200; 13 | @class XHParallaxNavigationController; 14 | typedef void(^ParallaxNavigationControllerMovieBegin)(XHParallaxNavigationController *parallaxNavigationController); 15 | typedef void(^ParallaxNavigationControllerMovieEnd)(XHParallaxNavigationController *parallaxNavigationController); 16 | typedef void(^ParallaxNavigationControllerMovieCancel)(XHParallaxNavigationController *parallaxNavigationController); 17 | 18 | @interface XHParallaxNavigationController : UINavigationController 19 | // 静态栏 默认是显示的 20 | @property (nonatomic, assign) BOOL hideStatusBar; 21 | // 默认为特效开启 22 | @property (nonatomic, assign) BOOL canDragBack; 23 | // 默认为毛玻璃不开启 24 | @property (nonatomic, assign) BOOL isBlurry; 25 | // 默认为有背景阴影 26 | @property (nonatomic, assign) BOOL shadowEffect; 27 | 28 | @property (nonatomic, copy) ParallaxNavigationControllerMovieBegin parallaxNavigationControllerMovieBegin; 29 | @property (nonatomic, copy) ParallaxNavigationControllerMovieEnd parallaxNavigationControllerMovieEnd; 30 | @property (nonatomic, copy) ParallaxNavigationControllerMovieCancel parallaxNavigationControllerMovieCancel; 31 | @end 32 | 33 | @interface UIViewController (XHParallaxNavigationController) 34 | - (void)addParallaxNavigationControllerMovieBegin:(ParallaxNavigationControllerMovieBegin)parallaxNavigationControllerMovieBegin; 35 | - (void)addParallaxNavigationControllerMovieEnd:(ParallaxNavigationControllerMovieEnd)parallaxNavigationControllerMovieEnd; 36 | - (void)addParallaxNavigationControllerMovieCancel:(ParallaxNavigationControllerMovieCancel)parallaxNavigationControllerMovieCancel; 37 | - (XHParallaxNavigationController *)xh_parallaxNavigationController; 38 | @end -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Vendor/XHNewsFramework.framework/Versions/A/Headers/XHProgressStatusBar.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHProgressStatusBar.h 3 | // XHNewsFramework 4 | // 5 | // Created by 曾 宪华 on 14-1-26. 6 | // Copyright (c) 2014年 曾宪华 开发团队(http://iyilunba.com ) 本人QQ:543413507 本人QQ群(142557668). All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef void(^ProgressStatusBarCloseBlock)(void); 12 | @interface XHProgressStatusBar : UIWindow { 13 | 14 | } 15 | 16 | @property (nonatomic, strong) UILabel *loadingLabel; 17 | @property (nonatomic, strong) UIView *loadingView; 18 | @property (nonatomic, strong) UIImageView *flashView; 19 | @property (nonatomic, strong) UIButton *closeButton; 20 | @property (nonatomic, strong) NSTimer *timer; 21 | @property (nonatomic, copy) ProgressStatusBarCloseBlock progressStatusBarCloseCompled; 22 | 23 | @property (nonatomic, assign) CGFloat progress; 24 | 25 | /* 26 | * progress: [0, 1] 27 | */ 28 | - (void)setProgress:(CGFloat)progress; 29 | - (void)setLoadingMsg:(NSString *)msg; 30 | - (void)show; 31 | - (void)hide; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Vendor/XHNewsFramework.framework/Versions/A/Headers/XHScrollBannerView.h: -------------------------------------------------------------------------------- 1 | // 2 | // HUAJIEScrollBannerView.h 3 | // HUAJIENewsiPhoneSDK 4 | // 5 | // Created by 曾 宪华 on 14-3-16. 6 | // Copyright (c) 2014年 曾宪华 QQ群: (142557668) QQ:543413507 Gmail:xhzengAIB@gmail.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #define kHUAJIEFocusLabelWidth 240 12 | #define kHUAJIEFocusLabelHeight 35 13 | 14 | typedef NSUInteger(^TotalPagesCount)(void); 15 | typedef UIView *(^FetchContentViewAtIndex)(NSUInteger pageIndex); 16 | typedef void(^DidSelectCompled)(NSUInteger selectIndex); 17 | typedef NSString *(^FetchFocusTitle)(NSUInteger pageIndex); 18 | 19 | @interface XHScrollBannerView : UIView 20 | 21 | @property (nonatomic , readonly) UIScrollView *scrollView; 22 | 23 | // 数据源:获取总的page个数 24 | @property (nonatomic , copy) TotalPagesCount totalPagesCount; 25 | 26 | // 数据源:获取第pageIndex个位置的contentView 27 | @property (nonatomic , copy) FetchContentViewAtIndex fetchContentViewAtIndex; 28 | 29 | // 数据源:获取第pageIndex个位置的焦点标题 30 | @property (nonatomic, copy) FetchFocusTitle fetchFocusTitle; 31 | 32 | // 当点击的时候,执行的block 33 | @property (nonatomic , copy) DidSelectCompled didSelectCompled; 34 | 35 | @property (nonatomic, assign) NSTimeInterval animationDuration; 36 | 37 | - (id)initWithFrame:(CGRect)frame; 38 | - (id)initWithFrame:(CGRect)frame animationDuration:(NSTimeInterval)animationDuration; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Vendor/XHNewsFramework.framework/Versions/A/Headers/XHScrollMenu.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHScrollMenu.h 3 | // XHScrollMenu 4 | // 5 | // Created by 曾 宪华 on 14-3-8. 6 | // Copyright (c) 2014年 曾宪华 QQ群: (142557668) QQ:543413507 Gmail:xhzengAIB@gmail.com. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "XHIndicatorView.h" 11 | #import "XHMenu.h" 12 | #import "XHMenuButton.h" 13 | 14 | #define kXHMenuButtonPaddingX 30 15 | #define kXHMenuButtonStarX 8 16 | 17 | #define kXHScrollMenuHeight 36 18 | 19 | @class XHScrollMenu; 20 | 21 | @protocol XHScrollMenuDelegate 22 | 23 | - (void)scrollMenuDidSelected:(XHScrollMenu *)scrollMenu menuIndex:(NSUInteger)selectIndex; 24 | - (void)scrollMenuDidManagerSelected:(XHScrollMenu *)scrollMenu; 25 | 26 | @end 27 | 28 | @interface XHScrollMenu : UIView 29 | 30 | @property (nonatomic, assign) id delegate; 31 | 32 | // UI 33 | @property (nonatomic, strong) UIScrollView *scrollView; 34 | @property (nonatomic, strong) XHIndicatorView *indicatorView; 35 | @property (nonatomic, strong) UIImage *leftShadowImage; 36 | @property (nonatomic, strong) UIImage *rightShadowImage; 37 | 38 | - (void)setBackgroundImage:(UIImage *)backgroundImage; 39 | - (void)setContainerBackgroundColor:(UIColor *)backgroundColor; 40 | - (void)setManagerButtonImage:(UIImage *)managerButtonImage; 41 | - (void)setIndicatorColor:(UIColor *)indicatorColor; 42 | 43 | // DataSource 44 | @property (nonatomic, strong) NSArray *menus; 45 | 46 | // select 47 | @property (nonatomic, assign) NSUInteger selectedIndex; // default is 0 48 | 49 | - (void)setSelectedIndex:(NSUInteger)selectedIndex animated:(BOOL)aniamted calledDelegate:(BOOL)calledDelgate; 50 | 51 | - (CGRect)rectForSelectedItemAtIndex:(NSUInteger)index; 52 | 53 | - (XHMenuButton *)menuButtonAtIndex:(NSUInteger)index; 54 | 55 | // reload dataSource 56 | - (void)reloadData; 57 | 58 | - (id)initWithFrame:(CGRect)frame showedManagerButton:(BOOL)showed; 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Vendor/XHNewsFramework.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHNewsFrameworkExample/9056655237a111856b481a9392946583a617d484/Project/XHNewsFrameworkExample/Vendor/XHNewsFramework.framework/Versions/A/Resources/Info.plist -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Vendor/XHNewsFramework.framework/Versions/A/Resources/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHNewsFrameworkExample/9056655237a111856b481a9392946583a617d484/Project/XHNewsFrameworkExample/Vendor/XHNewsFramework.framework/Versions/A/Resources/en.lproj/InfoPlist.strings -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Vendor/XHNewsFramework.framework/Versions/A/XHNewsFramework: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHNewsFrameworkExample/9056655237a111856b481a9392946583a617d484/Project/XHNewsFrameworkExample/Vendor/XHNewsFramework.framework/Versions/A/XHNewsFramework -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Vendor/XHNewsFramework.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Vendor/XHNewsFramework.framework/XHNewsFramework: -------------------------------------------------------------------------------- 1 | Versions/Current/XHNewsFramework -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Views/HUAJIEBannerView.h: -------------------------------------------------------------------------------- 1 | // 2 | // HUAJIEBannerView.h 3 | // HUAJIENewsiPhoneSDK 4 | // 5 | // Created by 曾 宪华 on 14-3-16. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HUAJIEBannerView : UIView 12 | 13 | @property (nonatomic, strong) UIImageView *focusImageView; 14 | 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Views/HUAJIEBannerView.m: -------------------------------------------------------------------------------- 1 | // 2 | // HUAJIEBannerView.m 3 | // HUAJIENewsiPhoneSDK 4 | // 5 | // Created by 曾 宪华 on 14-3-16. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "HUAJIEBannerView.h" 10 | 11 | @implementation HUAJIEBannerView 12 | 13 | - (UIImageView *)focusImageView { 14 | if (!_focusImageView) { 15 | _focusImageView = [[UIImageView alloc] initWithFrame:self.bounds]; 16 | _focusImageView.contentMode = UIViewContentModeScaleToFill; 17 | _focusImageView.image = [UIImage imageNamed:@"图片@2x.jpg"]; 18 | } 19 | return _focusImageView; 20 | } 21 | 22 | - (id)initWithFrame:(CGRect)frame { 23 | self = [super initWithFrame:frame]; 24 | if (self) { 25 | // Initialization code 26 | [self addSubview:self.focusImageView]; 27 | } 28 | return self; 29 | } 30 | 31 | /* 32 | // Only override drawRect: if you perform custom drawing. 33 | // An empty implementation adversely affects performance during animation. 34 | - (void)drawRect:(CGRect)rect 35 | { 36 | // Drawing code 37 | } 38 | */ 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Views/HUAJIENewsCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // HUAJIENewsCell.h 3 | // HUAJIENewsiPhoneSDK 4 | // 5 | // Created by 曾 宪华 on 14-3-7. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #define lightGreyColor [UIColor colorWithRed:80.0f/255.0f green:80.0f/255.0f blue:80.0f/255.0f alpha:1.0f] 12 | 13 | #define cccColor [UIColor colorWithRed:236.0/255.0f green:238.0/255.0f blue:239.0/255.0f alpha:1.0f] 14 | 15 | 16 | @interface HUAJIENewsCell : UITableViewCell 17 | 18 | //新闻缩略图 19 | @property (nonatomic, strong) UIImageView *newsThumb; 20 | 21 | //新闻标题 22 | @property (nonatomic, strong) UILabel *newsTitle; 23 | 24 | @property (nonatomic, strong) UILabel *newsDescriptionLabel; 25 | 26 | //新闻发表时间 27 | @property (nonatomic, strong) UILabel *newsPublishDate; 28 | 29 | // 新闻的赞 30 | @property (nonatomic, strong) UILabel *newsLike; 31 | 32 | // 新闻的评论 33 | @property (nonatomic, strong) UILabel *newsComment; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Views/HUAJIENewsCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // HUAJIENewsCell.m 3 | // HUAJIENewsiPhoneSDK 4 | // 5 | // Created by 曾 宪华 on 14-3-7. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "HUAJIENewsCell.h" 10 | 11 | @interface HUAJIENewsCell () 12 | 13 | //单元格背景 14 | @property (nonatomic, strong) UIImageView *centerImageView; 15 | 16 | @end 17 | 18 | @implementation HUAJIENewsCell 19 | 20 | - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier 21 | { 22 | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; 23 | if (self) { 24 | // Initialization code 25 | //设置cell的长度和位置,注意,这个方法覆盖了默认方法 26 | [self setFrame:self.bounds]; 27 | 28 | //设置背景 29 | UIImage *centerImage = [UIImage imageNamed:@"feed_cell_bg@2x.png"]; 30 | //拉伸图片背景,原来如此 31 | centerImage = [centerImage stretchableImageWithLeftCapWidth:15 topCapHeight:9]; 32 | self.centerImageView = [[UIImageView alloc] initWithImage:centerImage]; 33 | self.backgroundView = self.centerImageView; 34 | 35 | //设置高亮状态 36 | UIImage *centerImage2 = [UIImage imageNamed:@"feed_cell_bg_hl@2x.png"]; 37 | //拉伸图片背景,原来如此 38 | centerImage2 = [centerImage2 stretchableImageWithLeftCapWidth:15 topCapHeight:9]; 39 | UIImageView *imageView2 = [[UIImageView alloc] initWithImage:centerImage2]; 40 | self.selectedBackgroundView = imageView2; 41 | 42 | //缩略图 43 | self.newsThumb = [UIImageView new]; 44 | self.newsThumb.frame = CGRectMake(8, 5, 110, 90); 45 | self.newsThumb.image = [UIImage imageNamed:@"列表图片@2x.jpg"]; 46 | [self.contentView addSubview:self.newsThumb]; 47 | 48 | //新闻标题 49 | self.newsTitle = [UILabel new]; 50 | self.newsTitle.frame = CGRectMake(self.newsThumb.frame.origin.x + self.newsThumb.frame.size.width + 10, 10, 183, 25); 51 | self.newsTitle.numberOfLines = 0; 52 | self.newsTitle.text = @"北京天文馆朱金表示,神十将在明晚7时左右过境北京,天文爱好者可以观看"; 53 | self.newsTitle.textColor = lightGreyColor; 54 | self.newsTitle.lineBreakMode = NSLineBreakByTruncatingTail; 55 | self.newsTitle.font = [UIFont fontWithName:@"Helvetica-Bold" size:18]; 56 | self.newsTitle.backgroundColor = [UIColor clearColor]; 57 | [self.contentView addSubview:self.newsTitle]; 58 | 59 | self.newsDescriptionLabel = [UILabel new]; 60 | self.newsDescriptionLabel.frame = CGRectMake(self.newsTitle.frame.origin.x, CGRectGetMaxY(self.newsTitle.frame), 183, 40); 61 | self.newsDescriptionLabel.numberOfLines = 0; 62 | self.newsDescriptionLabel.text = @"天文爱好者可以观看啊实打实的疯狂哪凉快天文爱好者可以观看啊实打实的疯狂哪凉快天文爱好者可以观看啊实打实的疯狂哪凉快"; 63 | self.newsDescriptionLabel.textColor = lightGreyColor; 64 | self.newsDescriptionLabel.lineBreakMode = NSLineBreakByTruncatingTail; 65 | self.newsDescriptionLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:12]; 66 | self.newsDescriptionLabel.backgroundColor = [UIColor clearColor]; 67 | [self.contentView addSubview:self.newsDescriptionLabel]; 68 | 69 | // 新闻的赞 70 | self.newsLike = [UILabel new]; 71 | self.newsLike.frame = CGRectMake(130, 80, 33, 14); 72 | self.newsLike.font = [UIFont fontWithName:@"Arial" size:10]; 73 | self.newsLike.text = @"33赞"; 74 | self.newsLike.textColor = [UIColor grayColor]; 75 | self.newsLike.backgroundColor = [UIColor clearColor]; 76 | [self.contentView addSubview:self.newsLike]; 77 | 78 | // 新闻的评论 79 | self.newsComment = [UILabel new]; 80 | self.newsComment.frame = CGRectMake(180, 80, 43, 14); 81 | self.newsComment.text = @"111评论"; 82 | self.newsComment.font = [UIFont fontWithName:@"Arial" size:10]; 83 | self.newsComment.textColor = [UIColor grayColor]; 84 | self.newsComment.backgroundColor = [UIColor clearColor]; 85 | [self.contentView addSubview:self.newsComment]; 86 | 87 | //发表时间 88 | self.newsPublishDate = [UILabel new]; 89 | self.newsPublishDate.frame = CGRectMake(240, 80, 95, 14); 90 | self.newsPublishDate.font = [UIFont fontWithName:@"Arial" size:10]; 91 | self.newsPublishDate.textColor = [UIColor grayColor]; 92 | NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; 93 | [dateFormatter setDateFormat:@"YY-MM-dd HH:mm"]; 94 | self.newsPublishDate.text = [dateFormatter stringFromDate:[NSDate date]]; 95 | self.newsPublishDate.backgroundColor = [UIColor clearColor]; 96 | [self.contentView addSubview:self.newsPublishDate]; 97 | 98 | 99 | } 100 | return self; 101 | } 102 | 103 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated 104 | { 105 | 106 | if (selected) 107 | { 108 | //看过之后,新闻标题变灰 109 | self.newsTitle.textColor = [UIColor grayColor]; 110 | } 111 | 112 | [super setSelected:selected animated:animated]; 113 | } 114 | 115 | 116 | - (void)setHighlighted:(BOOL)highlighted 117 | { 118 | if (highlighted) 119 | { 120 | 121 | } 122 | // 必须要设置这个,不然高亮背景显示不出来 123 | [super setHighlighted:highlighted]; 124 | } 125 | 126 | @end 127 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Views/XHNetNewsCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // XHNetNewsCell.h 3 | // XHNewsFrameworkExample 4 | // 5 | // Created by qtone-1 on 14-4-29. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "HUAJIENewsCell.h" 10 | #import "XHNewsModel.h" 11 | 12 | @interface XHNetNewsCell : HUAJIENewsCell 13 | 14 | @property (nonatomic, strong) XHNewsModel *newsModel; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/Views/XHNetNewsCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // XHNetNewsCell.m 3 | // XHNewsFrameworkExample 4 | // 5 | // Created by qtone-1 on 14-4-29. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import "XHNetNewsCell.h" 10 | 11 | @implementation XHNetNewsCell 12 | 13 | - (void)setNewsModel:(XHNewsModel *)newsModel { 14 | self.newsTitle.text = newsModel.title; 15 | self.newsDescriptionLabel.text = newsModel.summary; 16 | 17 | self.newsThumb.image = [UIImage imageNamed:@"列表图片"]; 18 | NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:newsModel.pic]]; 19 | [NSURLConnection sendAsynchronousRequest:request 20 | queue:[NSOperationQueue mainQueue] 21 | completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) { 22 | self.newsThumb.image = [UIImage imageWithData:data]; 23 | }]; 24 | } 25 | 26 | - (id)initWithFrame:(CGRect)frame 27 | { 28 | self = [super initWithFrame:frame]; 29 | if (self) { 30 | // Initialization code 31 | } 32 | return self; 33 | } 34 | 35 | /* 36 | // Only override drawRect: if you perform custom drawing. 37 | // An empty implementation adversely affects performance during animation. 38 | - (void)drawRect:(CGRect)rect 39 | { 40 | // Drawing code 41 | } 42 | */ 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/XHNewsFrameworkExample-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.HUAJIE.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/XHNewsFrameworkExample-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_3_0 10 | #warning "This project uses features only available in iOS SDK 3.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | 17 | #import "RESideMenu.h" 18 | #endif 19 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // XHNewsFrameworkExample 4 | // 5 | // Created by 曾 宪华 on 14-1-25. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExampleTests/XHNewsFrameworkExampleTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.JackTeam.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExampleTests/XHNewsFrameworkExampleTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // XHNewsFrameworkExampleTests.m 3 | // XHNewsFrameworkExampleTests 4 | // 5 | // Created by 曾 宪华 on 14-1-25. 6 | // Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface XHNewsFrameworkExampleTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation XHNewsFrameworkExampleTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Project/XHNewsFrameworkExampleTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![image](https://github.com/JackTeam/XHNewsFrameworkExample/raw/master/Screenshots/XHNewsFramewrokPanGestureRecognizer.gif) 2 | ![image](https://github.com/JackTeam/XHNewsFrameworkExample/raw/master/Screenshots/XHNewsFrameworkPulDownUpRefresh.gif) 3 | 4 | ## 建议 5 | 如果您觉得这个库值得你看下去,那请不要那么急着,如看到什么不懂,或者想知道实现原理,移步看wiki的文档[XHNewsFramework文档](https://github.com/JackTeam/XHNewsFrameworkExample/wiki/XHNewsFramework%E6%A1%86%E6%9E%B6%E6%96%87%E6%A1%A3) 6 | 7 | ## 中文: 8 | XHNewsFramework是一个快速的集成和开发框架的新闻应用程序,在仿网易新闻应App的基础上完成的框架。 9 | 有以下功能: 10 | 1、支持重用嵌套在ScrollView里面的tableView. 11 | 2、支持快速水平滑动scrollView. 12 | 3、完美解决UIScrollView滚动和侧滑框架的手势冲突. 13 | 4、支持新闻分栏ScrollView控制内容scrollView,以及内容scrollView可以控制新闻分栏ScrollView. 14 | 5、支持新闻分栏目管理. 15 | 6、让业务逻辑和UI交互完全独立. 16 | 7、一套完整而又独立的新闻框架,有着革命性的UI交互体验. 17 | 18 | 后续会加入网络访问、多任务多线程管理TableView中的图片下载以及缓存 19 | 20 | ## Podfile 21 | 22 | [CocosPods](http://cocosPods.org) is the recommended method to install XHNewsFramework, just add the following line to `Podfile` 23 | 24 | ``` 25 | pod 'XHNewsFramework', '~> 0.1.0' 26 | ``` 27 | 28 | and run `pod install`, then you're all done! 29 | 30 | 如果您的项目使用静态库,可能会出现的问题,请异步到[这里](https://github.com/CocoaPods/CocoaPods/issues/1)查看解决方案。 31 | 32 | ## English: 33 | XHNewsFramework is a fast integration and development of the framework of news app, base on Netease App build. 34 | Has the following features: 35 | 1、support reuse nested inside the ScrollView tableView. 36 | 2、support rapid horizontal sliding scrollView. 37 | 3、perfect solution UIScrollView rolling and framework of sideslip gestures to conflict. 38 | 4、support the ScrollView control content ScrollView news columns, ScrollView can control the ScrollView news columns and content. 39 | 5、support, news program management. 40 | 6、make the business logic and UI interaction fully independent. 41 | 7、a complete and independent news frame, a revolutionary UI interaction experience. 42 | 43 | Subsequent will join network access, multitasking, multithreading management the TableView pictures download and cache 44 | 45 | 请移步到开源所有代码:[XHNewsFramework](https://github.com/JackTeam/XHNewsFramework) 46 | 47 | Please click to all open source code: [XHNewsFramework](https://github.com/JackTeam/XHNewsFramework) 48 | 49 | ## License 50 | 51 | 中文: XHNewsFrameworkExample 是在MIT协议下使用的,可以在LICENSE文件里面找到相关的使用协议信息. 52 | 53 | English: XHNewsFrameworkExample is acailable under the MIT license, see the LICENSE file for more information. 54 | 55 | ======================= 56 | ## 须知 57 | 中文:如果您在您的项目中使用该开源组件,请给我们发[电子邮件](mailto:xhzengAIB@gmail.com?subject=From%20GitHub%20XHScreenCaptureSDKSimple)告诉我们您的应用程序的名称。 58 | 59 | ## Instructions 60 | 61 | English:If you use the open source components in your project, please [Email us](mailto:xhzengAIB@gmail.com?subject=From%20GitHub%20XHNewsFrameworkExample) to tell us the name of your application. 62 | 63 | -------------------------------------------------------------------------------- /Screenshots/XHNewsFrameworkPulDownUpRefresh.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHNewsFrameworkExample/9056655237a111856b481a9392946583a617d484/Screenshots/XHNewsFrameworkPulDownUpRefresh.gif -------------------------------------------------------------------------------- /Screenshots/XHNewsFramewrokPanGestureRecognizer.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHNewsFrameworkExample/9056655237a111856b481a9392946583a617d484/Screenshots/XHNewsFramewrokPanGestureRecognizer.gif -------------------------------------------------------------------------------- /fixTheHeadError.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackTeam/XHNewsFrameworkExample/9056655237a111856b481a9392946583a617d484/fixTheHeadError.gif --------------------------------------------------------------------------------