├── .gitignore ├── Demo ├── FHHFPSIndicatorDemo.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── FHHFPSIndicatorDemo │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ ├── Contents.json │ │ ├── deleteButton.imageset │ │ │ ├── Contents.json │ │ │ ├── nav_delete@2x.png │ │ │ └── nav_delete@3x.png │ │ └── nav_return.imageset │ │ │ ├── Contents.json │ │ │ ├── nav_return@2x.png │ │ │ └── nav_return@3x.png │ ├── Base.lproj │ │ └── LaunchScreen.storyboard │ ├── Classes │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── HomeViewController.h │ │ ├── HomeViewController.m │ │ ├── LastHomeViewController.h │ │ ├── LastHomeViewController.m │ │ ├── SubHomeViewController.h │ │ ├── SubHomeViewController.m │ │ ├── WildernessViewController.h │ │ └── WildernessViewController.m │ ├── Commom.h │ ├── CommonColor.h │ ├── CommonFont.h │ ├── CommonPadding.h │ ├── Info.plist │ ├── PrefixHeader.pch │ ├── Utility │ │ ├── UIView+FHH.h │ │ ├── UIView+FHH.m │ │ ├── UIViewController+CustomNavigationBar.h │ │ └── UIViewController+CustomNavigationBar.m │ └── main.m └── Snapshots │ ├── snapshot1.PNG │ ├── snapshot2.PNG │ ├── snapshot3.PNG │ └── snapshot4.PNG ├── FHHFPSIndicator.podspec ├── FHHFPSIndicator ├── FHHFPSIndicator.h ├── FHHFPSIndicator.m ├── UIWindow+FHH.h └── UIWindow+FHH.m ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xcuserstate 23 | 24 | ## Obj-C/Swift specific 25 | *.hmap 26 | *.ipa 27 | *.dSYM.zip 28 | *.dSYM 29 | 30 | # CocoaPods 31 | # 32 | # We recommend against adding the Pods directory to your .gitignore. However 33 | # you should judge for yourself, the pros and cons are mentioned at: 34 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 35 | # 36 | # Pods/ 37 | 38 | # Carthage 39 | # 40 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 41 | # Carthage/Checkouts 42 | 43 | Carthage/Build 44 | 45 | # fastlane 46 | # 47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 48 | # screenshots whenever they are needed. 49 | # For more information about the recommended setup visit: 50 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 51 | 52 | fastlane/report.xml 53 | fastlane/screenshots 54 | 55 | #Code Injection 56 | # 57 | # After new code Injection tools there's a generated folder /iOSInjectionProject 58 | # https://github.com/johnno1962/injectionforxcode 59 | 60 | iOSInjectionProject/ 61 | -------------------------------------------------------------------------------- /Demo/FHHFPSIndicatorDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 25C90C9C1D227566002F1B5E /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 25C90C9B1D227566002F1B5E /* main.m */; }; 11 | 25C90CA71D227566002F1B5E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 25C90CA61D227566002F1B5E /* Assets.xcassets */; }; 12 | 25C90CAA1D227566002F1B5E /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 25C90CA81D227566002F1B5E /* LaunchScreen.storyboard */; }; 13 | 25C90CBC1D22762D002F1B5E /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 25C90CB31D22762D002F1B5E /* AppDelegate.m */; }; 14 | 25C90CBD1D22762D002F1B5E /* HomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 25C90CB51D22762D002F1B5E /* HomeViewController.m */; }; 15 | 25C90CBE1D22762D002F1B5E /* LastHomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 25C90CB71D22762D002F1B5E /* LastHomeViewController.m */; }; 16 | 25C90CBF1D22762D002F1B5E /* SubHomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 25C90CB91D22762D002F1B5E /* SubHomeViewController.m */; }; 17 | 25C90CC01D22762D002F1B5E /* WildernessViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 25C90CBB1D22762D002F1B5E /* WildernessViewController.m */; }; 18 | 25C90CC61D227636002F1B5E /* UIView+FHH.m in Sources */ = {isa = PBXBuildFile; fileRef = 25C90CC31D227636002F1B5E /* UIView+FHH.m */; }; 19 | 25C90CC71D227636002F1B5E /* UIViewController+CustomNavigationBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 25C90CC51D227636002F1B5E /* UIViewController+CustomNavigationBar.m */; }; 20 | 25C90CD41D237DF0002F1B5E /* FHHFPSIndicator.m in Sources */ = {isa = PBXBuildFile; fileRef = 25C90CD11D237DF0002F1B5E /* FHHFPSIndicator.m */; }; 21 | 25C90CD51D237DF0002F1B5E /* UIWindow+FHH.m in Sources */ = {isa = PBXBuildFile; fileRef = 25C90CD31D237DF0002F1B5E /* UIWindow+FHH.m */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXFileReference section */ 25 | 257574D81F5E9D440069680F /* Commom.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Commom.h; sourceTree = ""; }; 26 | 257574D91F5E9D510069680F /* PrefixHeader.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PrefixHeader.pch; sourceTree = ""; }; 27 | 257574DB1F5E9EF50069680F /* CommonFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommonFont.h; sourceTree = ""; }; 28 | 257574DC1F5E9F120069680F /* CommonColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommonColor.h; sourceTree = ""; }; 29 | 257574DD1F5EA0010069680F /* CommonPadding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommonPadding.h; sourceTree = ""; }; 30 | 25C90C971D227566002F1B5E /* FHHFPSIndicatorDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FHHFPSIndicatorDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 31 | 25C90C9B1D227566002F1B5E /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 32 | 25C90CA61D227566002F1B5E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 33 | 25C90CA91D227566002F1B5E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 34 | 25C90CAB1D227566002F1B5E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 35 | 25C90CB21D22762D002F1B5E /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 36 | 25C90CB31D22762D002F1B5E /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 37 | 25C90CB41D22762D002F1B5E /* HomeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HomeViewController.h; sourceTree = ""; }; 38 | 25C90CB51D22762D002F1B5E /* HomeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HomeViewController.m; sourceTree = ""; }; 39 | 25C90CB61D22762D002F1B5E /* LastHomeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LastHomeViewController.h; sourceTree = ""; }; 40 | 25C90CB71D22762D002F1B5E /* LastHomeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LastHomeViewController.m; sourceTree = ""; }; 41 | 25C90CB81D22762D002F1B5E /* SubHomeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SubHomeViewController.h; sourceTree = ""; }; 42 | 25C90CB91D22762D002F1B5E /* SubHomeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SubHomeViewController.m; sourceTree = ""; }; 43 | 25C90CBA1D22762D002F1B5E /* WildernessViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WildernessViewController.h; sourceTree = ""; }; 44 | 25C90CBB1D22762D002F1B5E /* WildernessViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WildernessViewController.m; sourceTree = ""; }; 45 | 25C90CC21D227636002F1B5E /* UIView+FHH.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+FHH.h"; sourceTree = ""; }; 46 | 25C90CC31D227636002F1B5E /* UIView+FHH.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+FHH.m"; sourceTree = ""; }; 47 | 25C90CC41D227636002F1B5E /* UIViewController+CustomNavigationBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIViewController+CustomNavigationBar.h"; sourceTree = ""; }; 48 | 25C90CC51D227636002F1B5E /* UIViewController+CustomNavigationBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIViewController+CustomNavigationBar.m"; sourceTree = ""; }; 49 | 25C90CD01D237DF0002F1B5E /* FHHFPSIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FHHFPSIndicator.h; sourceTree = ""; }; 50 | 25C90CD11D237DF0002F1B5E /* FHHFPSIndicator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FHHFPSIndicator.m; sourceTree = ""; }; 51 | 25C90CD21D237DF0002F1B5E /* UIWindow+FHH.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIWindow+FHH.h"; sourceTree = ""; }; 52 | 25C90CD31D237DF0002F1B5E /* UIWindow+FHH.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIWindow+FHH.m"; sourceTree = ""; }; 53 | /* End PBXFileReference section */ 54 | 55 | /* Begin PBXFrameworksBuildPhase section */ 56 | 25C90C941D227566002F1B5E /* Frameworks */ = { 57 | isa = PBXFrameworksBuildPhase; 58 | buildActionMask = 2147483647; 59 | files = ( 60 | ); 61 | runOnlyForDeploymentPostprocessing = 0; 62 | }; 63 | /* End PBXFrameworksBuildPhase section */ 64 | 65 | /* Begin PBXGroup section */ 66 | 25C90C8E1D227566002F1B5E = { 67 | isa = PBXGroup; 68 | children = ( 69 | 25C90C991D227566002F1B5E /* FHHFPSIndicatorDemo */, 70 | 25C90C981D227566002F1B5E /* Products */, 71 | ); 72 | sourceTree = ""; 73 | }; 74 | 25C90C981D227566002F1B5E /* Products */ = { 75 | isa = PBXGroup; 76 | children = ( 77 | 25C90C971D227566002F1B5E /* FHHFPSIndicatorDemo.app */, 78 | ); 79 | name = Products; 80 | sourceTree = ""; 81 | }; 82 | 25C90C991D227566002F1B5E /* FHHFPSIndicatorDemo */ = { 83 | isa = PBXGroup; 84 | children = ( 85 | 25C90CCF1D237DF0002F1B5E /* FHHFPSIndicator */, 86 | 25C90CC11D227636002F1B5E /* Utility */, 87 | 25C90CB11D22762D002F1B5E /* Classes */, 88 | 25C90CA61D227566002F1B5E /* Assets.xcassets */, 89 | 25C90CA81D227566002F1B5E /* LaunchScreen.storyboard */, 90 | 25C90CAB1D227566002F1B5E /* Info.plist */, 91 | 25C90C9A1D227566002F1B5E /* Supporting Files */, 92 | ); 93 | path = FHHFPSIndicatorDemo; 94 | sourceTree = ""; 95 | }; 96 | 25C90C9A1D227566002F1B5E /* Supporting Files */ = { 97 | isa = PBXGroup; 98 | children = ( 99 | 25C90C9B1D227566002F1B5E /* main.m */, 100 | 257574D81F5E9D440069680F /* Commom.h */, 101 | 257574D91F5E9D510069680F /* PrefixHeader.pch */, 102 | 257574DB1F5E9EF50069680F /* CommonFont.h */, 103 | 257574DC1F5E9F120069680F /* CommonColor.h */, 104 | 257574DD1F5EA0010069680F /* CommonPadding.h */, 105 | ); 106 | name = "Supporting Files"; 107 | sourceTree = ""; 108 | }; 109 | 25C90CB11D22762D002F1B5E /* Classes */ = { 110 | isa = PBXGroup; 111 | children = ( 112 | 25C90CB21D22762D002F1B5E /* AppDelegate.h */, 113 | 25C90CB31D22762D002F1B5E /* AppDelegate.m */, 114 | 25C90CB41D22762D002F1B5E /* HomeViewController.h */, 115 | 25C90CB51D22762D002F1B5E /* HomeViewController.m */, 116 | 25C90CB81D22762D002F1B5E /* SubHomeViewController.h */, 117 | 25C90CB91D22762D002F1B5E /* SubHomeViewController.m */, 118 | 25C90CB61D22762D002F1B5E /* LastHomeViewController.h */, 119 | 25C90CB71D22762D002F1B5E /* LastHomeViewController.m */, 120 | 25C90CBA1D22762D002F1B5E /* WildernessViewController.h */, 121 | 25C90CBB1D22762D002F1B5E /* WildernessViewController.m */, 122 | ); 123 | path = Classes; 124 | sourceTree = ""; 125 | }; 126 | 25C90CC11D227636002F1B5E /* Utility */ = { 127 | isa = PBXGroup; 128 | children = ( 129 | 25C90CC21D227636002F1B5E /* UIView+FHH.h */, 130 | 25C90CC31D227636002F1B5E /* UIView+FHH.m */, 131 | 25C90CC41D227636002F1B5E /* UIViewController+CustomNavigationBar.h */, 132 | 25C90CC51D227636002F1B5E /* UIViewController+CustomNavigationBar.m */, 133 | ); 134 | path = Utility; 135 | sourceTree = ""; 136 | }; 137 | 25C90CCF1D237DF0002F1B5E /* FHHFPSIndicator */ = { 138 | isa = PBXGroup; 139 | children = ( 140 | 25C90CD01D237DF0002F1B5E /* FHHFPSIndicator.h */, 141 | 25C90CD11D237DF0002F1B5E /* FHHFPSIndicator.m */, 142 | 25C90CD21D237DF0002F1B5E /* UIWindow+FHH.h */, 143 | 25C90CD31D237DF0002F1B5E /* UIWindow+FHH.m */, 144 | ); 145 | name = FHHFPSIndicator; 146 | path = ../../FHHFPSIndicator; 147 | sourceTree = ""; 148 | }; 149 | /* End PBXGroup section */ 150 | 151 | /* Begin PBXNativeTarget section */ 152 | 25C90C961D227566002F1B5E /* FHHFPSIndicatorDemo */ = { 153 | isa = PBXNativeTarget; 154 | buildConfigurationList = 25C90CAE1D227566002F1B5E /* Build configuration list for PBXNativeTarget "FHHFPSIndicatorDemo" */; 155 | buildPhases = ( 156 | 25C90C931D227566002F1B5E /* Sources */, 157 | 25C90C941D227566002F1B5E /* Frameworks */, 158 | 25C90C951D227566002F1B5E /* Resources */, 159 | ); 160 | buildRules = ( 161 | ); 162 | dependencies = ( 163 | ); 164 | name = FHHFPSIndicatorDemo; 165 | productName = FHHFPSIndicatorDemo; 166 | productReference = 25C90C971D227566002F1B5E /* FHHFPSIndicatorDemo.app */; 167 | productType = "com.apple.product-type.application"; 168 | }; 169 | /* End PBXNativeTarget section */ 170 | 171 | /* Begin PBXProject section */ 172 | 25C90C8F1D227566002F1B5E /* Project object */ = { 173 | isa = PBXProject; 174 | attributes = { 175 | LastUpgradeCheck = 0730; 176 | ORGANIZATIONNAME = 002; 177 | TargetAttributes = { 178 | 25C90C961D227566002F1B5E = { 179 | CreatedOnToolsVersion = 7.3; 180 | }; 181 | }; 182 | }; 183 | buildConfigurationList = 25C90C921D227566002F1B5E /* Build configuration list for PBXProject "FHHFPSIndicatorDemo" */; 184 | compatibilityVersion = "Xcode 3.2"; 185 | developmentRegion = English; 186 | hasScannedForEncodings = 0; 187 | knownRegions = ( 188 | en, 189 | Base, 190 | ); 191 | mainGroup = 25C90C8E1D227566002F1B5E; 192 | productRefGroup = 25C90C981D227566002F1B5E /* Products */; 193 | projectDirPath = ""; 194 | projectRoot = ""; 195 | targets = ( 196 | 25C90C961D227566002F1B5E /* FHHFPSIndicatorDemo */, 197 | ); 198 | }; 199 | /* End PBXProject section */ 200 | 201 | /* Begin PBXResourcesBuildPhase section */ 202 | 25C90C951D227566002F1B5E /* Resources */ = { 203 | isa = PBXResourcesBuildPhase; 204 | buildActionMask = 2147483647; 205 | files = ( 206 | 25C90CAA1D227566002F1B5E /* LaunchScreen.storyboard in Resources */, 207 | 25C90CA71D227566002F1B5E /* Assets.xcassets in Resources */, 208 | ); 209 | runOnlyForDeploymentPostprocessing = 0; 210 | }; 211 | /* End PBXResourcesBuildPhase section */ 212 | 213 | /* Begin PBXSourcesBuildPhase section */ 214 | 25C90C931D227566002F1B5E /* Sources */ = { 215 | isa = PBXSourcesBuildPhase; 216 | buildActionMask = 2147483647; 217 | files = ( 218 | 25C90CC01D22762D002F1B5E /* WildernessViewController.m in Sources */, 219 | 25C90CC71D227636002F1B5E /* UIViewController+CustomNavigationBar.m in Sources */, 220 | 25C90CD51D237DF0002F1B5E /* UIWindow+FHH.m in Sources */, 221 | 25C90CBC1D22762D002F1B5E /* AppDelegate.m in Sources */, 222 | 25C90CC61D227636002F1B5E /* UIView+FHH.m in Sources */, 223 | 25C90CBF1D22762D002F1B5E /* SubHomeViewController.m in Sources */, 224 | 25C90C9C1D227566002F1B5E /* main.m in Sources */, 225 | 25C90CBD1D22762D002F1B5E /* HomeViewController.m in Sources */, 226 | 25C90CD41D237DF0002F1B5E /* FHHFPSIndicator.m in Sources */, 227 | 25C90CBE1D22762D002F1B5E /* LastHomeViewController.m in Sources */, 228 | ); 229 | runOnlyForDeploymentPostprocessing = 0; 230 | }; 231 | /* End PBXSourcesBuildPhase section */ 232 | 233 | /* Begin PBXVariantGroup section */ 234 | 25C90CA81D227566002F1B5E /* LaunchScreen.storyboard */ = { 235 | isa = PBXVariantGroup; 236 | children = ( 237 | 25C90CA91D227566002F1B5E /* Base */, 238 | ); 239 | name = LaunchScreen.storyboard; 240 | sourceTree = ""; 241 | }; 242 | /* End PBXVariantGroup section */ 243 | 244 | /* Begin XCBuildConfiguration section */ 245 | 25C90CAC1D227566002F1B5E /* Debug */ = { 246 | isa = XCBuildConfiguration; 247 | buildSettings = { 248 | ALWAYS_SEARCH_USER_PATHS = NO; 249 | CLANG_ANALYZER_NONNULL = YES; 250 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 251 | CLANG_CXX_LIBRARY = "libc++"; 252 | CLANG_ENABLE_MODULES = YES; 253 | CLANG_ENABLE_OBJC_ARC = YES; 254 | CLANG_WARN_BOOL_CONVERSION = YES; 255 | CLANG_WARN_CONSTANT_CONVERSION = YES; 256 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 257 | CLANG_WARN_EMPTY_BODY = YES; 258 | CLANG_WARN_ENUM_CONVERSION = YES; 259 | CLANG_WARN_INT_CONVERSION = YES; 260 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 261 | CLANG_WARN_UNREACHABLE_CODE = YES; 262 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 263 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 264 | COPY_PHASE_STRIP = NO; 265 | DEBUG_INFORMATION_FORMAT = dwarf; 266 | ENABLE_STRICT_OBJC_MSGSEND = YES; 267 | ENABLE_TESTABILITY = YES; 268 | GCC_C_LANGUAGE_STANDARD = gnu99; 269 | GCC_DYNAMIC_NO_PIC = NO; 270 | GCC_NO_COMMON_BLOCKS = YES; 271 | GCC_OPTIMIZATION_LEVEL = 0; 272 | GCC_PREPROCESSOR_DEFINITIONS = ( 273 | "DEBUG=1", 274 | "$(inherited)", 275 | ); 276 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 277 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 278 | GCC_WARN_UNDECLARED_SELECTOR = YES; 279 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 280 | GCC_WARN_UNUSED_FUNCTION = YES; 281 | GCC_WARN_UNUSED_VARIABLE = YES; 282 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 283 | MTL_ENABLE_DEBUG_INFO = YES; 284 | ONLY_ACTIVE_ARCH = YES; 285 | SDKROOT = iphoneos; 286 | TARGETED_DEVICE_FAMILY = "1,2"; 287 | }; 288 | name = Debug; 289 | }; 290 | 25C90CAD1D227566002F1B5E /* Release */ = { 291 | isa = XCBuildConfiguration; 292 | buildSettings = { 293 | ALWAYS_SEARCH_USER_PATHS = NO; 294 | CLANG_ANALYZER_NONNULL = YES; 295 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 296 | CLANG_CXX_LIBRARY = "libc++"; 297 | CLANG_ENABLE_MODULES = YES; 298 | CLANG_ENABLE_OBJC_ARC = YES; 299 | CLANG_WARN_BOOL_CONVERSION = YES; 300 | CLANG_WARN_CONSTANT_CONVERSION = YES; 301 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 302 | CLANG_WARN_EMPTY_BODY = YES; 303 | CLANG_WARN_ENUM_CONVERSION = YES; 304 | CLANG_WARN_INT_CONVERSION = YES; 305 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 306 | CLANG_WARN_UNREACHABLE_CODE = YES; 307 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 308 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 309 | COPY_PHASE_STRIP = NO; 310 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 311 | ENABLE_NS_ASSERTIONS = NO; 312 | ENABLE_STRICT_OBJC_MSGSEND = YES; 313 | GCC_C_LANGUAGE_STANDARD = gnu99; 314 | GCC_NO_COMMON_BLOCKS = YES; 315 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 316 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 317 | GCC_WARN_UNDECLARED_SELECTOR = YES; 318 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 319 | GCC_WARN_UNUSED_FUNCTION = YES; 320 | GCC_WARN_UNUSED_VARIABLE = YES; 321 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 322 | MTL_ENABLE_DEBUG_INFO = NO; 323 | SDKROOT = iphoneos; 324 | TARGETED_DEVICE_FAMILY = "1,2"; 325 | VALIDATE_PRODUCT = YES; 326 | }; 327 | name = Release; 328 | }; 329 | 25C90CAF1D227566002F1B5E /* Debug */ = { 330 | isa = XCBuildConfiguration; 331 | buildSettings = { 332 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 333 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 334 | GCC_PREFIX_HEADER = FHHFPSIndicatorDemo/PrefixHeader.pch; 335 | INFOPLIST_FILE = FHHFPSIndicatorDemo/Info.plist; 336 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 337 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 338 | PRODUCT_BUNDLE_IDENTIFIER = com.fhhe.FHHFPSIndicatorDemo; 339 | PRODUCT_NAME = "$(TARGET_NAME)"; 340 | PROVISIONING_PROFILE = "21ab5b6e-3985-4566-9933-d7c4ba336123"; 341 | }; 342 | name = Debug; 343 | }; 344 | 25C90CB01D227566002F1B5E /* Release */ = { 345 | isa = XCBuildConfiguration; 346 | buildSettings = { 347 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 348 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 349 | GCC_PREFIX_HEADER = FHHFPSIndicatorDemo/PrefixHeader.pch; 350 | INFOPLIST_FILE = FHHFPSIndicatorDemo/Info.plist; 351 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 352 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 353 | PRODUCT_BUNDLE_IDENTIFIER = com.fhhe.FHHFPSIndicatorDemo; 354 | PRODUCT_NAME = "$(TARGET_NAME)"; 355 | PROVISIONING_PROFILE = "21ab5b6e-3985-4566-9933-d7c4ba336123"; 356 | }; 357 | name = Release; 358 | }; 359 | /* End XCBuildConfiguration section */ 360 | 361 | /* Begin XCConfigurationList section */ 362 | 25C90C921D227566002F1B5E /* Build configuration list for PBXProject "FHHFPSIndicatorDemo" */ = { 363 | isa = XCConfigurationList; 364 | buildConfigurations = ( 365 | 25C90CAC1D227566002F1B5E /* Debug */, 366 | 25C90CAD1D227566002F1B5E /* Release */, 367 | ); 368 | defaultConfigurationIsVisible = 0; 369 | defaultConfigurationName = Release; 370 | }; 371 | 25C90CAE1D227566002F1B5E /* Build configuration list for PBXNativeTarget "FHHFPSIndicatorDemo" */ = { 372 | isa = XCConfigurationList; 373 | buildConfigurations = ( 374 | 25C90CAF1D227566002F1B5E /* Debug */, 375 | 25C90CB01D227566002F1B5E /* Release */, 376 | ); 377 | defaultConfigurationIsVisible = 0; 378 | defaultConfigurationName = Release; 379 | }; 380 | /* End XCConfigurationList section */ 381 | }; 382 | rootObject = 25C90C8F1D227566002F1B5E /* Project object */; 383 | } 384 | -------------------------------------------------------------------------------- /Demo/FHHFPSIndicatorDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Demo/FHHFPSIndicatorDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | } 88 | ], 89 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } -------------------------------------------------------------------------------- /Demo/FHHFPSIndicatorDemo/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Demo/FHHFPSIndicatorDemo/Assets.xcassets/deleteButton.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "nav_delete@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "nav_delete@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Demo/FHHFPSIndicatorDemo/Assets.xcassets/deleteButton.imageset/nav_delete@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/002and001/FHHFPSIndicator/b6e52f91cc01ffef5f9b139d66a07ac10dc2a744/Demo/FHHFPSIndicatorDemo/Assets.xcassets/deleteButton.imageset/nav_delete@2x.png -------------------------------------------------------------------------------- /Demo/FHHFPSIndicatorDemo/Assets.xcassets/deleteButton.imageset/nav_delete@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/002and001/FHHFPSIndicator/b6e52f91cc01ffef5f9b139d66a07ac10dc2a744/Demo/FHHFPSIndicatorDemo/Assets.xcassets/deleteButton.imageset/nav_delete@3x.png -------------------------------------------------------------------------------- /Demo/FHHFPSIndicatorDemo/Assets.xcassets/nav_return.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "nav_return@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "nav_return@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Demo/FHHFPSIndicatorDemo/Assets.xcassets/nav_return.imageset/nav_return@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/002and001/FHHFPSIndicator/b6e52f91cc01ffef5f9b139d66a07ac10dc2a744/Demo/FHHFPSIndicatorDemo/Assets.xcassets/nav_return.imageset/nav_return@2x.png -------------------------------------------------------------------------------- /Demo/FHHFPSIndicatorDemo/Assets.xcassets/nav_return.imageset/nav_return@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/002and001/FHHFPSIndicator/b6e52f91cc01ffef5f9b139d66a07ac10dc2a744/Demo/FHHFPSIndicatorDemo/Assets.xcassets/nav_return.imageset/nav_return@3x.png -------------------------------------------------------------------------------- /Demo/FHHFPSIndicatorDemo/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Demo/FHHFPSIndicatorDemo/Classes/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // FHHFPSIndicatorDemo 4 | // 5 | // Created by 002 on 16/6/27. 6 | // Copyright © 2016年 002. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /Demo/FHHFPSIndicatorDemo/Classes/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // FHHFPSIndicatorDemo 4 | // 5 | // Created by 002 on 16/6/27. 6 | // Copyright © 2016年 002. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "HomeViewController.h" 11 | 12 | #if defined(DEBUG) || defined(_DEBUG) 13 | #import "FHHFPSIndicator.h" 14 | #endif 15 | 16 | 17 | @interface AppDelegate () 18 | 19 | @end 20 | 21 | @implementation AppDelegate 22 | 23 | 24 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 25 | // Override point for customization after application launch. 26 | 27 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 28 | [self.window makeKeyAndVisible]; 29 | 30 | // Add the follwing code after the window become keywindow 31 | #if defined(DEBUG) || defined(_DEBUG) 32 | [[FHHFPSIndicator sharedFPSIndicator] show]; 33 | // [FHHFPSIndicator sharedFPSIndicator].fpsLabelPosition = FPSIndicatorPositionTopRight; 34 | #endif 35 | 36 | self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:[[HomeViewController alloc] init]]; 37 | 38 | return YES; 39 | } 40 | 41 | - (void)applicationWillResignActive:(UIApplication *)application { 42 | // 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. 43 | // 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. 44 | } 45 | 46 | - (void)applicationDidEnterBackground:(UIApplication *)application { 47 | // 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. 48 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 49 | } 50 | 51 | - (void)applicationWillEnterForeground:(UIApplication *)application { 52 | // 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. 53 | } 54 | 55 | - (void)applicationDidBecomeActive:(UIApplication *)application { 56 | // 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. 57 | } 58 | 59 | - (void)applicationWillTerminate:(UIApplication *)application { 60 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 61 | } 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /Demo/FHHFPSIndicatorDemo/Classes/HomeViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // HomeViewController.h 3 | // FHHFPSIndicator 4 | // 5 | // Created by 002 on 16/6/27. 6 | // Copyright © 2016年 002. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HomeViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Demo/FHHFPSIndicatorDemo/Classes/HomeViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // HomeViewController.m 3 | // FHHFPSIndicator 4 | // 5 | // Created by 002 on 16/6/27. 6 | // Copyright © 2016年 002. All rights reserved. 7 | // 8 | 9 | #import "HomeViewController.h" 10 | #import "UIViewController+CustomNavigationBar.h" 11 | #import "SubHomeViewController.h" 12 | 13 | @implementation HomeViewController 14 | 15 | - (void)viewDidLoad { 16 | [super viewDidLoad]; 17 | 18 | self.view.backgroundColor = RGBColor(201, 201, 201); 19 | 20 | [self setNavigationBarTitle:@"Home" navLeftButtonIcon:nil navRightButtonTitle:@"next"]; 21 | [self.navRightButton addTarget:self action:@selector(p_rightButtonDidClick:) forControlEvents:UIControlEventTouchUpInside]; 22 | } 23 | 24 | - (void)p_rightButtonDidClick:(UIButton *)btn { 25 | [self.navigationController pushViewController:[[SubHomeViewController alloc] init] animated:YES]; 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Demo/FHHFPSIndicatorDemo/Classes/LastHomeViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // LastHomeViewController.h 3 | // FHHFPSIndicator 4 | // 5 | // Created by 002 on 16/6/27. 6 | // Copyright © 2016年 002. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LastHomeViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Demo/FHHFPSIndicatorDemo/Classes/LastHomeViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // LastHomeViewController.m 3 | // FHHFPSIndicator 4 | // 5 | // Created by 002 on 16/6/27. 6 | // Copyright © 2016年 002. All rights reserved. 7 | // 8 | 9 | #import "LastHomeViewController.h" 10 | #import "UIViewController+CustomNavigationBar.h" 11 | #import "WildernessViewController.h" 12 | #import "FHHFPSIndicator.h" 13 | 14 | @implementation LastHomeViewController 15 | 16 | - (void)viewDidLoad { 17 | [super viewDidLoad]; 18 | 19 | self.view.backgroundColor = kColorC4_1; 20 | 21 | [self setNavigationBarTitle:@"LastHome" navLeftButtonIcon:@"backupIcon" navRightButtonTitle:@"next"]; 22 | [self.navRightButton addTarget:self action:@selector(p_rightButtonDidClick:) forControlEvents:UIControlEventTouchUpInside]; 23 | 24 | [FHHFPSIndicator sharedFPSIndicator].fpsLabelPosition = FPSIndicatorPositionTopRight; 25 | } 26 | 27 | - (void)viewWillDisappear:(BOOL)animated { 28 | [super viewWillDisappear:YES]; 29 | [FHHFPSIndicator sharedFPSIndicator].fpsLabelPosition = FPSIndicatorPositionBottomCenter; 30 | } 31 | 32 | - (void)p_rightButtonDidClick:(UIButton *)btn { 33 | [self.navigationController pushViewController:[[WildernessViewController alloc] init] animated:YES]; 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Demo/FHHFPSIndicatorDemo/Classes/SubHomeViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SubHomeViewController.h 3 | // FHHFPSIndicator 4 | // 5 | // Created by 002 on 16/6/27. 6 | // Copyright © 2016年 002. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SubHomeViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Demo/FHHFPSIndicatorDemo/Classes/SubHomeViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // SubHomeViewController.m 3 | // FHHFPSIndicator 4 | // 5 | // Created by 002 on 16/6/27. 6 | // Copyright © 2016年 002. All rights reserved. 7 | // 8 | 9 | #import "SubHomeViewController.h" 10 | #import "UIViewController+CustomNavigationBar.h" 11 | #import "LastHomeViewController.h" 12 | #import "FHHFPSIndicator.h" 13 | 14 | @implementation SubHomeViewController 15 | 16 | - (void)viewDidLoad { 17 | [super viewDidLoad]; 18 | 19 | self.view.backgroundColor = RGBColor(160, 160, 160); 20 | 21 | [self setNavigationBarTitle:@"SubHome" navLeftButtonIcon:@"backupIcon" navRightButtonTitle:@"next"]; 22 | [self.navRightButton addTarget:self action:@selector(p_rightButtonDidClick:) forControlEvents:UIControlEventTouchUpInside]; 23 | 24 | [FHHFPSIndicator sharedFPSIndicator].fpsLabelPosition = FPSIndicatorPositionTopLeft; 25 | } 26 | 27 | - (void)p_rightButtonDidClick:(UIButton *)btn { 28 | [self.navigationController pushViewController:[[LastHomeViewController alloc] init] animated:YES]; 29 | } 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Demo/FHHFPSIndicatorDemo/Classes/WildernessViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // WildernessViewController.h 3 | // FHHFPSIndicator 4 | // 5 | // Created by 002 on 16/6/27. 6 | // Copyright © 2016年 002. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface WildernessViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Demo/FHHFPSIndicatorDemo/Classes/WildernessViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // WildernessViewController.m 3 | // FHHFPSIndicator 4 | // 5 | // Created by 002 on 16/6/27. 6 | // Copyright © 2016年 002. All rights reserved. 7 | // 8 | 9 | #import "WildernessViewController.h" 10 | #import "UIViewController+CustomNavigationBar.h" 11 | #import "UIView+FHH.h" 12 | 13 | @interface WildernessViewController () 14 | 15 | @property (nonatomic, strong) UITextView *textView; 16 | 17 | @end 18 | 19 | @implementation WildernessViewController 20 | 21 | - (void)viewDidLoad { 22 | [super viewDidLoad]; 23 | 24 | self.view.backgroundColor = RGBColor(246, 246, 246); 25 | 26 | [self setNavigationBarTitle:@"Wilderness" navLeftButtonIcon:@"deleteButton"]; 27 | [self removeNavLeftButtonDefaultEvent]; 28 | [self.navLeftButton addTarget:self action:@selector(p_leftButtonClick) forControlEvents:UIControlEventTouchUpInside]; 29 | 30 | [self p_setupUI]; 31 | } 32 | 33 | - (void)p_setupUI { 34 | [self.view addSubview:self.textView]; 35 | 36 | self.textView.width = [UIScreen mainScreen].bounds.size.width; 37 | self.textView.height = [UIScreen mainScreen].bounds.size.height - 64 - 20; 38 | self.textView.x = 0; 39 | self.textView.y = 64 + 20; 40 | } 41 | 42 | - (void)p_leftButtonClick { 43 | [self.navigationController popToRootViewControllerAnimated:YES]; 44 | } 45 | 46 | - (UITextView *)textView { 47 | if(!_textView) { 48 | _textView = [[UITextView alloc] init]; 49 | NSMutableString *strM = [NSMutableString string]; 50 | for (int i = 0; i < 500; i++) { 51 | [strM appendString:@"O(∩_∩)!%>_<% 😙😙😐😣😡😚😱(‧_‧?)😱🌮🍩🏝💖🍫🍦🏦🍦(*^__^*)(ˉ▽ ̄~) 😚😚😚😣😡😱(→_→)😱😚🌮😚🗽🍻🍯🗽🚋🎊🎂💗💛🍫🎂🍜🍜🍜(¯^¯ )"]; 52 | } 53 | _textView.text = strM; 54 | } 55 | return _textView; 56 | } 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /Demo/FHHFPSIndicatorDemo/Commom.h: -------------------------------------------------------------------------------- 1 | // 2 | // Commom.h 3 | // FHHFPSIndicatorDemo 4 | // 5 | // Created by hefanghui on 2017/9/5. 6 | // Copyright © 2017年 002. All rights reserved. 7 | // 8 | 9 | // 通用间距 10 | #define MARGIN_COMMON 15.0 11 | 12 | -------------------------------------------------------------------------------- /Demo/FHHFPSIndicatorDemo/CommonColor.h: -------------------------------------------------------------------------------- 1 | // 2 | // CommonColor.h 3 | // FHHFPSIndicatorDemo 4 | // 5 | // Created by hefanghui on 2017/9/5. 6 | // Copyright © 2017年 002. All rights reserved. 7 | // 8 | 9 | #ifndef CommonColor_h 10 | #define CommonColor_h 11 | 12 | #define RandomColor [UIColor colorWithRed:arc4random_uniform(255)/255.0 green:arc4random_uniform(255)/255.0 blue:arc4random_uniform(255)/255.0 alpha:1.0] 13 | #define RGBColor(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0] 14 | #define HQColor(RED, GREEN, BLUE, ALPHA) [UIColor colorWithRed:RED green:GREEN blue:BLUE alpha:ALPHA] 15 | #define kColorAlpha(color, alpha) [color colorWithAlphaComponent:alpha] 16 | 17 | #define kColorBackGround RGBColor(246,246,246) 18 | #define kColorLine RGBColor(237,237,237) 19 | 20 | #define kColorC1_1 RGBColor(255,128,35) 21 | #define kColorC1_2 RGBColor(240,118,29) 22 | 23 | #define kColorC2_1 RGBColor(250,151,39) 24 | #define kColorC2_2 RGBColor(250,201,71) 25 | #define kColorC2_3 RGBColor(197,144,105) 26 | #define kColorC2_4 RGBColor(255,133,133) 27 | #define kColorC2_5 RGBColor(124,219,90) 28 | 29 | #define kColorC3_1 RGBColor(40,40,40) 30 | #define kColorC3_2 RGBColor(58,58,58) 31 | #define kColorC3_3 RGBColor(80,80,80) 32 | #define kColorC3_4 RGBColor(119,119,119) 33 | #define kColorC3_5 RGBColor(156,156,156) 34 | #define kColorC3_6 RGBColor(187,187,187) 35 | #define kColorC3_7 RGBColor(204,204,204) 36 | 37 | #define kColorC4_1 RGBColor(255,255,255) 38 | #define kColorC4_2 RGBColor(245,246,247) 39 | #define kColorC4_3 RGBColor(250,250,250) 40 | #define kColorC4_4 RGBColor(237,237,237) 41 | #define kColorC4_5 RGBColor(220,220,220) 42 | #define kColorC4_6 RGBColor(240,240,240) 43 | 44 | #endif /* CommonColor_h */ 45 | -------------------------------------------------------------------------------- /Demo/FHHFPSIndicatorDemo/CommonFont.h: -------------------------------------------------------------------------------- 1 | // 2 | // CommonFont.h 3 | // FHHFPSIndicatorDemo 4 | // 5 | // Created by hefanghui on 2017/9/5. 6 | // Copyright © 2017年 002. All rights reserved. 7 | // 8 | 9 | #define T10_20PX 10.0 10 | #define T9_22PX 11.0 11 | #define T8_24PX 12.0 12 | #define T7_26PX 13.0 13 | #define T6_28PX 14.0 14 | #define T5_30PX 15.0 15 | #define T4_32PX 16.0 16 | #define T3_34PX 17.0 17 | #define T2_36PX 18.0 18 | #define T1_38PX 19.0 19 | 20 | #define S1_PAGE_PADDING_10PX 5.0 21 | #define S2_PAGE_PADDING_20PX 10.0 22 | #define S3_PAGE_PADDING_30PX 15.0 23 | #define S4_PAGE_PADDING_40PX 20.0 24 | 25 | -------------------------------------------------------------------------------- /Demo/FHHFPSIndicatorDemo/CommonPadding.h: -------------------------------------------------------------------------------- 1 | // 2 | // CommonPadding.h 3 | // FHHFPSIndicatorDemo 4 | // 5 | // Created by hefanghui on 2017/9/5. 6 | // Copyright © 2017年 002. All rights reserved. 7 | // 8 | 9 | #define PADDING_20PX 10.0 10 | #define PADDING_22PX 11.0 11 | #define PADDING_24PX 12.0 12 | #define PADDING_26PX 13.0 13 | #define PADDING_28PX 14.0 14 | #define PADDING_30PX 15.0 15 | #define PADDING_32PX 16.0 16 | #define PADDING_34PX 17.0 17 | #define PADDING_36PX 18.0 18 | #define PADDING_38PX 19.0 19 | #define PADDING_40PX 20.0 20 | #define PADDING_42PX 21.0 21 | -------------------------------------------------------------------------------- /Demo/FHHFPSIndicatorDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /Demo/FHHFPSIndicatorDemo/PrefixHeader.pch: -------------------------------------------------------------------------------- 1 | // 2 | // PrefixHeader.pch 3 | // FHHFPSIndicatorDemo 4 | // 5 | // Created by hefanghui on 2017/9/5. 6 | // Copyright © 2017年 002. All rights reserved. 7 | // 8 | 9 | #import "Commom.h" 10 | #import "CommonFont.h" 11 | #import "CommonColor.h" 12 | #import "CommonPadding.h" 13 | -------------------------------------------------------------------------------- /Demo/FHHFPSIndicatorDemo/Utility/UIView+FHH.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+FHH.h 3 | // 4 | // 5 | // Created by 002 on 15/10/1. 6 | // Copyright (c) 2015年 002. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIView (FHH) 12 | 13 | @property (nonatomic, assign) CGFloat x; 14 | @property (nonatomic, assign) CGFloat y; 15 | @property (nonatomic, assign) CGFloat right; 16 | @property (nonatomic, assign) CGFloat bottom; 17 | @property (nonatomic, assign) CGFloat centerX; 18 | @property (nonatomic, assign) CGFloat centerY; 19 | @property (nonatomic, assign) CGFloat width; 20 | @property (nonatomic, assign) CGFloat height; 21 | @property (nonatomic, assign) CGPoint origin; 22 | @property (nonatomic, assign) CGSize size; 23 | 24 | - (CGRect)convertRectToView:(UIView *)view; 25 | - (CGFloat)xInView:(UIView *)view; 26 | - (CGFloat)yInView:(UIView *)view; 27 | - (CGFloat)rightInView:(UIView *)view; 28 | - (CGFloat)bottomInView:(UIView *)view; 29 | - (CGFloat)centerXInView:(UIView *)view; 30 | - (CGFloat)centerYInView:(UIView *)view; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Demo/FHHFPSIndicatorDemo/Utility/UIView+FHH.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+FHH.m 3 | // 4 | // 5 | // Created by 002 on 15/10/1. 6 | // Copyright (c) 2015年 002. All rights reserved. 7 | // 8 | 9 | #import "UIView+FHH.h" 10 | 11 | @implementation UIView (FHH) 12 | 13 | #pragma mark - Setter 14 | - (void)setX:(CGFloat)x { 15 | CGRect frame = self.frame; 16 | frame.origin.x = x; 17 | self.frame = frame; 18 | } 19 | 20 | - (void)setY:(CGFloat)y { 21 | CGRect frame = self.frame; 22 | frame.origin.y = y; 23 | self.frame = frame; 24 | } 25 | 26 | - (void)setRight:(CGFloat)right { 27 | self.frame = CGRectMake(right - self.width, self.y, self.width, self.height); 28 | } 29 | 30 | - (void)setBottom:(CGFloat)bottom { 31 | self.frame = CGRectMake(self.x, bottom - self.height, self.width, self.height); 32 | } 33 | 34 | - (void)setCenterX:(CGFloat)centerX{ 35 | CGPoint center = self.center; 36 | center.x = centerX; 37 | self.center = center; 38 | } 39 | 40 | - (void)setCenterY:(CGFloat)centerY { 41 | CGPoint center = self.center; 42 | center.y = centerY; 43 | self.center = center; 44 | } 45 | 46 | - (void)setWidth:(CGFloat)width { 47 | CGRect frame = self.frame; 48 | frame.size.width = width; 49 | self.frame = frame; 50 | } 51 | 52 | - (void)setHeight:(CGFloat)height { 53 | CGRect frame = self.frame; 54 | frame.size.height = height; 55 | self.frame = frame; 56 | } 57 | 58 | - (void)setOrigin:(CGPoint)origin { 59 | CGRect frame = self.frame; 60 | frame.origin = origin; 61 | self.frame = frame; 62 | } 63 | 64 | - (void)setSize:(CGSize)size { 65 | CGRect tempFrame = self.frame; 66 | tempFrame.size = size; 67 | self.frame = tempFrame; 68 | } 69 | 70 | #pragma mark - Getter 71 | - (CGFloat)x { 72 | return self.frame.origin.x; 73 | } 74 | 75 | - (CGFloat)y { 76 | return self.frame.origin.y; 77 | } 78 | 79 | - (CGFloat)width { 80 | return self.frame.size.width; 81 | } 82 | 83 | - (CGFloat)height { 84 | return self.frame.size.height; 85 | } 86 | 87 | - (CGSize)size { 88 | return self.frame.size; 89 | } 90 | 91 | - (CGPoint)origin { 92 | return self.frame.origin; 93 | } 94 | 95 | - (CGFloat)centerX { 96 | return self.center.x; 97 | } 98 | 99 | - (CGFloat)centerY { 100 | return self.center.y; 101 | } 102 | 103 | - (CGFloat)bottom { 104 | return self.y + self.height; 105 | } 106 | 107 | - (CGFloat)right { 108 | return self.x + self.width; 109 | } 110 | 111 | #pragma mark - Functions 112 | - (CGRect)convertRectToView:(UIView *)view { 113 | CGRect newFrame = [self convertRect:self.bounds toView:view]; 114 | return newFrame; 115 | } 116 | 117 | - (CGFloat)xInView:(UIView *)view { 118 | CGRect newFrame = [self convertRect:self.bounds toView:view]; 119 | return newFrame.origin.x; 120 | } 121 | 122 | - (CGFloat)yInView:(UIView *)view { 123 | CGRect newFrame = [self convertRect:self.bounds toView:view]; 124 | return newFrame.origin.y; 125 | } 126 | 127 | - (CGFloat)rightInView:(UIView *)view { 128 | CGRect newFrame = [self convertRect:self.bounds toView:view]; 129 | return newFrame.origin.x + newFrame.size.width; 130 | } 131 | 132 | - (CGFloat)bottomInView:(UIView *)view { 133 | CGRect newFrame = [self convertRect:self.bounds toView:view]; 134 | return newFrame.origin.y + newFrame.size.height; 135 | } 136 | 137 | - (CGFloat)centerXInView:(UIView *)view { 138 | CGRect newFrame = [self convertRect:self.bounds toView:view]; 139 | return newFrame.origin.x + newFrame.size.width * 0.5; 140 | } 141 | 142 | - (CGFloat)centerYInView:(UIView *)view { 143 | CGRect newFrame = [self convertRect:self.bounds toView:view]; 144 | return newFrame.origin.y + newFrame.size.height * 0.5; 145 | } 146 | 147 | @end 148 | -------------------------------------------------------------------------------- /Demo/FHHFPSIndicatorDemo/Utility/UIViewController+CustomNavigationBar.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+CustomNavigationBar.h 3 | // LoveTourGuide 4 | // 5 | // Created by 002 on 16/1/5. 6 | // Copyright © 2016年 fhhe. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIViewController (CustomNavigationBar) 12 | 13 | @property (nonatomic, strong) UIView *navigationBar; // 自定义navigationBar 14 | @property (nonatomic, strong) UIButton *navMiddleButton; // 中间按钮 15 | @property (nonatomic, strong) UIButton *navLeftButton; // 左边按钮 16 | @property (nonatomic, strong) UIButton *navRightButton; // 右边按钮 17 | @property (nonatomic, assign) BOOL isPushed; // 是否push进来 18 | 19 | /** 20 | 21 | 只有 ‘标题’ 22 | 23 | @param title 导航栏标题 24 | */ 25 | - (void)setNavigationBarTitle:(NSString *)title; 26 | 27 | /** 28 | 29 | 有 ‘标题’ 和 ‘左边按钮’ 30 | 31 | @param title 导航栏标题 32 | @param navLeftButtonIcon 左边按钮的 ‘图片’ 名称 33 | */ 34 | - (void)setNavigationBarTitle:(NSString *)title navLeftButtonIcon:(NSString *)navLeftButtonIcon; 35 | 36 | /** 37 | 38 | 有 ‘标题’ 和 ‘左边按钮’ 和 ‘右边按钮’(显示为文字) 39 | 40 | @param title 导航栏标题 41 | @param navLeftButtonIcon 左边按钮的 ‘图片’ 名称 42 | @param navRightButtonTitle 右边按钮的 ‘title’ 名称 43 | */ 44 | - (void)setNavigationBarTitle:(NSString *)title 45 | navLeftButtonIcon:(NSString *)navLeftButtonIcon 46 | navRightButtonTitle:(NSString *)navRightButtonTitle; 47 | 48 | /** 49 | 50 | 有 ‘标题’ 和 ‘左边按钮’ 和 ‘右边按钮’(显示图片) 51 | 52 | @param title 导航栏标题 53 | @param navLeftButtonIcon 左边按钮的 ‘图片’ 名称 54 | @param navRightButtonIcon 右边按钮的 ‘title’ 名称 55 | */ 56 | - (void)setNavigationBarTitle:(NSString *)title 57 | navLeftButtonIcon:(NSString *)navLeftButtonIcon 58 | navRightButtonIcon:(NSString *)navRightButtonIcon; 59 | 60 | /** 61 | 有 ‘标题’ 和 ‘左边按钮’ 和 ‘右边按钮’(包含图片和文字) 62 | 63 | @param title 导航栏标题 64 | @param navLeftButtonIcon 左边按钮的 ‘图片’ 名称 65 | @param navRightButtonIcon 右边按钮的 ‘title’ 名称 66 | @param navRightButtonTitle 右边按钮的 ‘图片’ 名称 67 | */ 68 | - (void)setNavigationBarTitle:(NSString *)title 69 | navLeftButtonIcon:(NSString *)navLeftButtonIcon 70 | navRightButtonIcon:(NSString *)navRightButtonIcon 71 | navRightButtonTitle:(NSString *)navRightButtonTitle; 72 | 73 | 74 | /** 75 | 删除左边按钮默认返回事件 76 | */ 77 | - (void)removeNavLeftButtonDefaultEvent; 78 | 79 | /** 80 | 中间按钮重新布局 81 | */ 82 | - (void)reConfigNavMiddleButton; 83 | 84 | /** 85 | 右边按钮重新布局 86 | */ 87 | - (void)reConfigNavRightButton; 88 | 89 | @end 90 | -------------------------------------------------------------------------------- /Demo/FHHFPSIndicatorDemo/Utility/UIViewController+CustomNavigationBar.m: -------------------------------------------------------------------------------- 1 | // 2 | // ************************************************************************ 3 | // 4 | // UIViewController+CustomNavigationBar.m 5 | // LoveTourGuide 6 | // 7 | // Created by 002 on 2017/7/26. 8 | // Copyright © 2017年 hqyxedu. All rights reserved. 9 | // 10 | // Main function:自定义导航栏控制器分类 11 | // 12 | // Other specifications: 13 | // 14 | // ************************************************************************ 15 | 16 | #import "UIViewController+CustomNavigationBar.h" 17 | #import "UIView+FHH.h" 18 | #import 19 | 20 | #define RGBColor(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0] 21 | #define KColorBlue RGBColor(0, 160, 233) 22 | #define ScreenWidth ([[UIScreen mainScreen] bounds].size.width) 23 | 24 | const char *NavigationBarKey = "navigationBar"; 25 | const char *NavMiddleButtonKey = "navMiddleButton"; 26 | const char *NavLeftButtonKey = "navLeftButton"; 27 | const char *NavRightButtonKey = "navRightButton"; 28 | const char *IsPushedKey = "IsPushed"; 29 | 30 | @implementation UIViewController (CustomNavigationBar) 31 | 32 | #pragma mark - 导航栏 33 | - (void)setNavigationBarTitle:(NSString *)title { 34 | [self setNavigationBarTitle:title 35 | navLeftButtonIcon:nil 36 | navRightButtonIcon:nil 37 | navRightButtonTitle:nil]; 38 | self.navLeftButton.hidden = YES; 39 | } 40 | 41 | - (void)setNavigationBarTitle:(NSString *)title navLeftButtonIcon:(NSString *)navLeftButtonIcon { 42 | [self setNavigationBarTitle:title 43 | navLeftButtonIcon:navLeftButtonIcon 44 | navRightButtonIcon:nil 45 | navRightButtonTitle:nil]; 46 | } 47 | 48 | - (void)setNavigationBarTitle:(NSString *)title 49 | navLeftButtonIcon:(NSString *)navLeftButtonIcon 50 | navRightButtonTitle:(NSString *)navRightButtonTitle { 51 | 52 | [self setNavigationBarTitle:title 53 | navLeftButtonIcon:navLeftButtonIcon 54 | navRightButtonIcon:nil 55 | navRightButtonTitle:navRightButtonTitle]; 56 | } 57 | 58 | - (void)setNavigationBarTitle:(NSString *)title 59 | navLeftButtonIcon:(NSString *)navLeftButtonIcon 60 | navRightButtonIcon:(NSString *)navRightButtonIcon { 61 | 62 | [self setNavigationBarTitle:title 63 | navLeftButtonIcon:navLeftButtonIcon 64 | navRightButtonIcon:navRightButtonIcon 65 | navRightButtonTitle:nil]; 66 | } 67 | 68 | - (void)setNavigationBarTitle:(NSString *)title 69 | navLeftButtonIcon:(NSString *)navLeftButtonIcon 70 | navRightButtonIcon:(NSString *)navRightButtonIcon 71 | navRightButtonTitle:(NSString *)navRightButtonTitle { 72 | [self pc_configCustomNavigationBar]; 73 | [self pc_configCustomNavLeftButtonWithNavLeftButtonIcon:navLeftButtonIcon]; 74 | [self pc_configCustomNavRightButtonWithNavRightButtonIcon:navRightButtonIcon 75 | navRightButtonTitle:navRightButtonTitle]; 76 | [self pc_configCustomNavMiddleButtonWithTitle:title]; 77 | [self pc_configBottomSepImageView]; 78 | } 79 | 80 | - (void)pc_configCustomNavigationBar { 81 | if (self.navigationController.navigationBar != nil) { 82 | [self.navigationController.navigationBar removeFromSuperview]; 83 | } 84 | if (self.navigationBar != nil) { 85 | [self.navigationBar removeFromSuperview]; 86 | } 87 | self.isPushed = YES; 88 | // 1.自定义UIView代替导航栏 89 | // 1.1) 创建并定义属性 90 | self.navigationBar = [[UIView alloc] init]; 91 | self.navigationBar.frame = CGRectMake(0, 0, ScreenWidth, 64.0); 92 | self.navigationBar.backgroundColor = RGBColor(0, 160, 233); 93 | [self.view addSubview:self.navigationBar]; 94 | } 95 | 96 | - (void)pc_configCustomNavLeftButtonWithNavLeftButtonIcon:(NSString *)NavLeftButtonIcon { 97 | // 2.‘左边’ 按钮 98 | self.navLeftButton = [[UIButton alloc] init]; 99 | self.navLeftButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft; 100 | if (!NavLeftButtonIcon || [@"" isEqualToString:NavLeftButtonIcon]) { 101 | NavLeftButtonIcon = @"nav_return"; 102 | self.navLeftButton.hidden = YES; 103 | } 104 | [self.navLeftButton addTarget:self action:@selector(clickLeftNavButton) forControlEvents:UIControlEventTouchUpInside]; 105 | [self.navLeftButton setImage:[UIImage imageNamed:NavLeftButtonIcon] forState:UIControlStateNormal]; 106 | [self configLeftButton]; 107 | [self p_configLeftButtonEdgeInsets]; 108 | } 109 | 110 | - (void)pc_configCustomNavRightButtonWithNavRightButtonIcon:(NSString *)NavRightButtonIcon 111 | navRightButtonTitle:(NSString *)navRightButtonTitle { 112 | if (NavRightButtonIcon || navRightButtonTitle) { 113 | self.navRightButton = [UIButton buttonWithType:UIButtonTypeCustom]; 114 | self.navRightButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft; 115 | if (navRightButtonTitle && ![@"" isEqualToString:navRightButtonTitle]) { 116 | [self.navRightButton setTitle:navRightButtonTitle forState:UIControlStateNormal]; 117 | } 118 | if (NavRightButtonIcon && ![@"" isEqualToString:NavRightButtonIcon]) { 119 | [self.navRightButton setImage:[UIImage imageNamed:NavRightButtonIcon] forState:UIControlStateNormal]; 120 | } 121 | self.navRightButton.titleLabel.font = [UIFont systemFontOfSize:T5_30PX]; 122 | [self.navRightButton setTitleColor:kColorC4_1 forState:UIControlStateNormal]; 123 | [self.navigationBar addSubview:self.navRightButton]; 124 | [self reConfigNavRightButton]; 125 | [self p_configRightButtonEdgeInsets]; 126 | } 127 | } 128 | 129 | - (void)pc_configCustomNavMiddleButtonWithTitle:(NSString *)title { 130 | if (title && ![@"" isEqualToString:title]) { 131 | [self addBarMiddleButtonWithTitle:title]; 132 | } 133 | } 134 | 135 | - (void)addBarMiddleButtonWithTitle:(NSString *)title { 136 | self.navMiddleButton = [[UIButton alloc] init]; 137 | self.navMiddleButton.titleLabel.lineBreakMode = NSLineBreakByTruncatingTail; 138 | [self.navMiddleButton setTitle:title forState:UIControlStateNormal]; 139 | [self.navMiddleButton setTitleColor:kColorC4_1 forState:UIControlStateNormal]; 140 | self.navMiddleButton.titleLabel.font = [UIFont systemFontOfSize:T3_34PX]; 141 | [self reConfigNavMiddleButton]; 142 | 143 | // 添加到当前view 144 | [self.navigationBar addSubview:self.navMiddleButton]; 145 | } 146 | 147 | - (void)pc_configBottomSepImageView { 148 | CGRect frame = CGRectMake(0, self.navigationBar.height - 0.5, self.navigationBar.width, 0.5); 149 | UIImageView *bottomSepImageView = [[UIImageView alloc] initWithFrame:frame]; 150 | [self.navigationBar addSubview:bottomSepImageView]; 151 | bottomSepImageView.backgroundColor = kColorC3_1; 152 | } 153 | 154 | - (void)configLeftButton { 155 | [self.navLeftButton sizeToFit]; 156 | self.navLeftButton.frame = CGRectMake(0, 28 , 50, 64); 157 | self.navLeftButton.bottom = self.navigationBar.height; 158 | [self.navigationBar addSubview:self.navLeftButton]; 159 | } 160 | 161 | - (void)p_configLeftButtonEdgeInsets { 162 | self.navLeftButton.imageEdgeInsets = UIEdgeInsetsMake((50 - 30), S3_PAGE_PADDING_30PX, 0, 0); 163 | } 164 | 165 | - (void)p_configRightButtonEdgeInsets { 166 | CGSize imageSize = self.navRightButton.imageView.size; 167 | CGSize titleSize = self.navRightButton.titleLabel.size; 168 | CGFloat imageLeftInset = (self.navRightButton.width - imageSize.width - MARGIN_COMMON); 169 | CGFloat titleLeftInset = (self.navRightButton.width - titleSize.width - MARGIN_COMMON + 2); 170 | 171 | self.navRightButton.imageEdgeInsets = UIEdgeInsetsMake(0, imageLeftInset, 0, -imageLeftInset); 172 | self.navRightButton.titleEdgeInsets = UIEdgeInsetsMake(0, 0, 0, titleLeftInset); 173 | } 174 | 175 | - (void)clickLeftNavButton { 176 | if (self.isPushed) { 177 | [self.navigationController popViewControllerAnimated:YES]; 178 | } else { 179 | if (self.navigationController != nil) { 180 | [self.navigationController dismissViewControllerAnimated:YES completion:nil]; 181 | } else { 182 | [self dismissViewControllerAnimated:YES completion:nil]; 183 | } 184 | } 185 | } 186 | 187 | - (void)removeNavLeftButtonDefaultEvent { 188 | [self.navLeftButton removeTarget:self 189 | action:@selector(clickLeftNavButton) 190 | forControlEvents:UIControlEventTouchUpInside]; 191 | } 192 | 193 | - (void)reConfigNavMiddleButton { 194 | [self.navMiddleButton sizeToFit]; 195 | CGFloat maxWidth = self.navigationBar.width - 2 * PADDING_30PX; 196 | if (self.navLeftButton != nil && self.navRightButton != nil) { 197 | maxWidth = self.navRightButton.x - self.navLeftButton.right; 198 | } else if (self.navLeftButton != nil) { 199 | maxWidth = self.navigationBar.width - 2 * self.navLeftButton.right; 200 | } 201 | if (self.navMiddleButton.width > maxWidth) { 202 | self.navMiddleButton.width = maxWidth; 203 | } 204 | self.navMiddleButton.center = CGPointMake(self.navigationBar.centerX , 205 | self.navLeftButton.centerY + 20 * 0.5); 206 | } 207 | 208 | - (void)reConfigNavRightButton { 209 | if (self.navRightButton.currentBackgroundImage == nil) { 210 | [self.navRightButton sizeToFit]; 211 | self.navRightButton.width = self.navRightButton.width + MARGIN_COMMON; 212 | self.navRightButton.height = 44; 213 | if (self.navRightButton.width < 40) { 214 | self.navRightButton.width = 40; 215 | } 216 | 217 | self.navRightButton.centerY = self.navLeftButton.centerY + (20 * 0.5); 218 | self.navRightButton.right = self.navigationBar.right; 219 | } 220 | else { 221 | self.navRightButton.centerY = self.navLeftButton.centerY + (20 * 0.5); 222 | self.navRightButton.right = self.navigationBar.right - MARGIN_COMMON; 223 | } 224 | } 225 | 226 | #pragma mark - 运行时添加实例变量 227 | - (void)setNavigationBar:(UIView *)navigationBar { 228 | objc_setAssociatedObject(self, 229 | NavigationBarKey, 230 | navigationBar, 231 | OBJC_ASSOCIATION_RETAIN_NONATOMIC); 232 | } 233 | 234 | - (UIView *)navigationBar { 235 | return objc_getAssociatedObject(self, NavigationBarKey); 236 | } 237 | 238 | - (void)setNavMiddleButton:(UIButton *)navMiddleButton { 239 | objc_setAssociatedObject(self, 240 | NavMiddleButtonKey, 241 | navMiddleButton, 242 | OBJC_ASSOCIATION_RETAIN_NONATOMIC); 243 | } 244 | 245 | - (UIButton *)navMiddleButton { 246 | return objc_getAssociatedObject(self, NavMiddleButtonKey); 247 | } 248 | 249 | - (void)setNavLeftButton:(UIButton *)navLeftButton { 250 | objc_setAssociatedObject(self, 251 | NavLeftButtonKey, 252 | navLeftButton, 253 | OBJC_ASSOCIATION_RETAIN_NONATOMIC); 254 | } 255 | 256 | - (UIButton *)navLeftButton { 257 | return objc_getAssociatedObject(self, NavLeftButtonKey); 258 | } 259 | 260 | - (void)setNavRightButton:(UIButton *)navRightButton { 261 | objc_setAssociatedObject(self, 262 | NavRightButtonKey, 263 | navRightButton, 264 | OBJC_ASSOCIATION_RETAIN_NONATOMIC); 265 | } 266 | 267 | - (UIButton *)navRightButton { 268 | return objc_getAssociatedObject(self, NavRightButtonKey); 269 | } 270 | 271 | - (void)setIsPushed:(BOOL)isPushed { 272 | NSNumber *isPushedNumber = [NSNumber numberWithBool:isPushed]; 273 | objc_setAssociatedObject(self, 274 | IsPushedKey, 275 | isPushedNumber, 276 | OBJC_ASSOCIATION_ASSIGN); 277 | } 278 | 279 | - (BOOL)isPushed { 280 | NSNumber *isPushedInNumber = objc_getAssociatedObject(self, IsPushedKey); 281 | bool isPushed = [isPushedInNumber boolValue]; 282 | return isPushed; 283 | } 284 | 285 | @end 286 | -------------------------------------------------------------------------------- /Demo/FHHFPSIndicatorDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // FHHFPSIndicatorDemo 4 | // 5 | // Created by 002 on 16/6/27. 6 | // Copyright © 2016年 002. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Demo/Snapshots/snapshot1.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/002and001/FHHFPSIndicator/b6e52f91cc01ffef5f9b139d66a07ac10dc2a744/Demo/Snapshots/snapshot1.PNG -------------------------------------------------------------------------------- /Demo/Snapshots/snapshot2.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/002and001/FHHFPSIndicator/b6e52f91cc01ffef5f9b139d66a07ac10dc2a744/Demo/Snapshots/snapshot2.PNG -------------------------------------------------------------------------------- /Demo/Snapshots/snapshot3.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/002and001/FHHFPSIndicator/b6e52f91cc01ffef5f9b139d66a07ac10dc2a744/Demo/Snapshots/snapshot3.PNG -------------------------------------------------------------------------------- /Demo/Snapshots/snapshot4.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/002and001/FHHFPSIndicator/b6e52f91cc01ffef5f9b139d66a07ac10dc2a744/Demo/Snapshots/snapshot4.PNG -------------------------------------------------------------------------------- /FHHFPSIndicator.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod spec lint FHHFPSIndicator.podspec' to ensure this is a 3 | # valid spec and to remove all comments including this before submitting the spec. 4 | # 5 | # To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html 6 | # To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/ 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | 11 | s.name = 'FHHFPSIndicator' 12 | s.summary = 'show FPS On keyWindow.' 13 | s.version = '1.0.2' 14 | s.license = { :type => 'MIT', :file => 'LICENSE' } 15 | s.authors = { '002and001' => 'xxewz1@163.com' } 16 | s.social_media_url = 'http://www.jianshu.com/users/d8d972561b59/timeline' 17 | s.homepage = 'https://github.com/jvjishou/FHHFPSIndicator' 18 | s.source = { :git => 'https://github.com/jvjishou/FHHFPSIndicator.git', :tag => s.version } 19 | s.frameworks = 'Foundation', 'UIKit' 20 | s.platform = :ios, '7.0' 21 | s.source_files = 'FHHFPSIndicator/**/*.{h,m,png}' 22 | s.requires_arc = true 23 | 24 | end 25 | -------------------------------------------------------------------------------- /FHHFPSIndicator/FHHFPSIndicator.h: -------------------------------------------------------------------------------- 1 | // 2 | // FHHFPSIndicator.h 3 | // FHHFPSIndicator:https://github.com/jvjishou/FHHFPSIndicator 4 | // 5 | // Created by 002 on 16/6/27. 6 | // Copyright © 2016年 002. All rights reserved. 7 | // 8 | // This source code is licensed under the MIT-style license found in the 9 | // LICENSE file in the root directory of this source tree. 10 | // 11 | 12 | #import 13 | #import 14 | #import "UIWindow+FHH.h" 15 | 16 | 17 | // FpsLabel's position. Default is FPSIndicatorPositionBottomCenter 18 | // If your device is iPhone4's or iPhone5's series,use FPSIndicatorPositionBottomCenter to make the fpsLabel show completed. 19 | typedef enum { 20 | FPSIndicatorPositionTopLeft, /// 10 | 11 | @interface UIWindow (FHH) 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /FHHFPSIndicator/UIWindow+FHH.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIWindow+FHH.m 3 | // flashServesCustomer 4 | // 5 | // Created by 002 on 16/6/27. 6 | // Copyright © 2016年 002. All rights reserved. 7 | // 8 | 9 | #import "UIWindow+FHH.h" 10 | 11 | static NSInteger kFpsLabelTag = 110213; 12 | 13 | @implementation UIWindow (FHH) 14 | 15 | - (void)layoutSubviews { 16 | [super layoutSubviews]; 17 | 18 | for (NSUInteger i = 0; i < self.subviews.count; ++i) { 19 | UIView *view = self.subviews[self.subviews.count - 1 - i]; 20 | if ([view isKindOfClass:[UILabel class]] && view.tag == kFpsLabelTag) { 21 | if (view == self.subviews.lastObject) { 22 | return; 23 | } 24 | [self bringSubviewToFront:view]; 25 | return; 26 | } 27 | } 28 | } 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 jvjishou 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # FHHFPSIndicator 2 | [![License MIT](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://raw.githubusercontent.com/jvjishou/FHHFPSIndicator/master/LICENSE)  3 | [![CocoaPods](http://img.shields.io/cocoapods/v/FHHFPSIndicator.svg?style=flat)](http://cocoapods.org/?q=FHHFPSIndicator)  4 | [![CocoaPods](http://img.shields.io/cocoapods/p/FHHFPSIndicator.svg?style=flat)](http://cocoapods.org/?q=FHHFPSIndicator)  5 | 6 | 7 | FHHFPSIndicator can show FPS in your APP 8 | 9 | Demo Project 10 | ============== 11 | See `Demo/FHHFPSIndicatorDemo` 12 | 13 | 14 |
15 | 16 |
17 | 18 |
19 | 20 |

21 | 22 | 23 | Installation 24 | ============== 25 | ### CocoaPods 26 | 27 | 1. Add `pod "FHHFPSIndicator"` to your Podfile. 28 | 2. Run `pod install` or `pod update`. 29 | 3. Import \. 30 | 31 | ### Manually 32 | 1. Drag all source files under floder `FHHFPSIndicator` to your project 33 | 2. Import the main header file:`#import "FHHFPSIndicator.h"` 34 | 35 | ###Instruction 36 | you shoud call after the keyWindw becomes keyAndVisible; 37 | 38 | Advice:Use FHHFPSIndicator in DEBUG mode 39 | 40 | add the code in AppDelegate.m 41 | 42 |
 43 | #if defined(DEBUG) || defined(_DEBUG)
 44 | #import "FHHFPSIndicator.h"
 45 | #endif
 46 | 
 47 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
 48 |     // Override point for customization after application launch.
 49 |     
 50 |     self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
 51 |     [self.window makeKeyAndVisible];
 52 |     
 53 |     // add the follwing code after the window become keyAndVisible
 54 |     #if defined(DEBUG) || defined(_DEBUG)
 55 |         [[FHHFPSIndicator sharedFPSIndicator] show];
 56 | //        [FHHFPSIndicator sharedFPSIndicator].fpsLabelPosition = FPSIndicatorPositionTopRight;
 57 |     #endif
 58 |     
 59 |     self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:[[HomeViewController alloc] init]];
 60 |     
 61 |     return YES;
 62 | }
 63 | 
 64 | 
65 | 66 | License 67 | ============== 68 | FHHFPSIndicator is provided under the MIT license. See LICENSE file for details. 69 | 70 |
71 | --- 72 | 中文介绍 73 | ============== 74 | FHHFPSIndicator可以用于在iOS开发中显示当前画面的FPS. 75 | 76 | 演示项目 77 | ============== 78 | 查看并运行 `Demo/FHHFPSIndicatorDemo` 79 | 80 | 81 |
82 | 83 |
84 | 85 |
86 | 87 |

88 | 89 | 安装 90 | ============== 91 | 92 | ### CocoaPods 93 | 94 | 1. 在 Podfile 中添加 `pod "FHHFPSIndicator"`。 95 | 2. 执行 `pod install` 或 `pod update`。 96 | 3. 导入 \。 97 | 98 | ### 手动安装 99 | 1. 将`FHHFPSIndicator`文件夹中的所有源代码拽入项目中。 100 | 2. 导入主头文件:`#import "FHHFPSIndicator.h"`。 101 | 102 | ###使用说明 103 | 在AppDelegate.m文件中的didFinishLaunchingWithOptions方法中,当执行了`[self.window makeKeyAndVisible];`后,调用`[[FHHFPSIndicator sharedFPSIndicator] show]`。
104 | 建议:在DEBUG模式下使用显示FPS功能 105 | 106 |
107 | #if defined(DEBUG) || defined(_DEBUG)
108 | #import "FHHFPSIndicator.h"
109 | #endif
110 | 
111 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
112 |     // Override point for customization after application launch.
113 |     
114 |     self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
115 |     [self.window makeKeyAndVisible];
116 |     
117 |     // add the follwing code after the window become keyAndVisible
118 |     #if defined(DEBUG) || defined(_DEBUG)
119 |         [[FHHFPSIndicator sharedFPSIndicator] show];
120 | //        [FHHFPSIndicator sharedFPSIndicator].fpsLabelPosition = FPSIndicatorPositionTopRight;
121 |     #endif
122 |     
123 |     self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:[[HomeViewController alloc] init]];
124 |     
125 |     return YES;
126 | }
127 | 
128 | 
129 | 130 | 许可证 131 | ============== 132 | FHHFPSIndicator 使用 MIT 许可证,详情见 LICENSE 文件。 133 | --------------------------------------------------------------------------------