├── JPFPSStatus.podspec ├── JPFPSStatus.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── coderyi.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── coderyi.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── JPFPSStatus.xcscheme │ └── xcschememanagement.plist ├── JPFPSStatus ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── JPFPSStatus │ ├── JPFPSStatus.h │ └── JPFPSStatus.m ├── Resources │ └── jpfpsstatus1.jpg ├── ViewController.h ├── ViewController.m └── main.m ├── JPFPSStatusTests ├── Info.plist └── JPFPSStatusTests.m ├── JPFPSStatusUITests ├── Info.plist └── JPFPSStatusUITests.m ├── LICENSE ├── README.md └── README_Chinese.md /JPFPSStatus.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "JPFPSStatus" 3 | s.version = "0.1.1" 4 | s.summary = "JPFPSStatus - Show FPS Status on StatusBar" 5 | s.homepage = "https://github.com/joggerplus/JPFPSStatus" 6 | s.license = "MIT" 7 | s.authors = { "coderyi" => "coderyi@foxmail.com" } 8 | s.source = { :git => "https://github.com/joggerplus/JPFPSStatus.git", :tag => "0.1.1" } 9 | s.frameworks = 'Foundation', 'UIKit' 10 | s.platform = :ios, '7.0' 11 | s.source_files = 'JPFPSStatus/JPFPSStatus/**/*.{h,m,png}' 12 | s.requires_arc = true 13 | 14 | end -------------------------------------------------------------------------------- /JPFPSStatus.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | EE1E9F411D026D820003A77A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = EE1E9F401D026D820003A77A /* main.m */; }; 11 | EE1E9F441D026D820003A77A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = EE1E9F431D026D820003A77A /* AppDelegate.m */; }; 12 | EE1E9F471D026D820003A77A /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = EE1E9F461D026D820003A77A /* ViewController.m */; }; 13 | EE1E9F4A1D026D820003A77A /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EE1E9F481D026D820003A77A /* Main.storyboard */; }; 14 | EE1E9F4C1D026D820003A77A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = EE1E9F4B1D026D820003A77A /* Assets.xcassets */; }; 15 | EE1E9F4F1D026D820003A77A /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EE1E9F4D1D026D820003A77A /* LaunchScreen.storyboard */; }; 16 | EE1E9F5A1D026D820003A77A /* JPFPSStatusTests.m in Sources */ = {isa = PBXBuildFile; fileRef = EE1E9F591D026D820003A77A /* JPFPSStatusTests.m */; }; 17 | EE1E9F651D026D820003A77A /* JPFPSStatusUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = EE1E9F641D026D820003A77A /* JPFPSStatusUITests.m */; }; 18 | EE1E9F791D0270850003A77A /* JPFPSStatus.m in Sources */ = {isa = PBXBuildFile; fileRef = EE1E9F781D0270850003A77A /* JPFPSStatus.m */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXContainerItemProxy section */ 22 | EE1E9F561D026D820003A77A /* PBXContainerItemProxy */ = { 23 | isa = PBXContainerItemProxy; 24 | containerPortal = EE1E9F341D026D820003A77A /* Project object */; 25 | proxyType = 1; 26 | remoteGlobalIDString = EE1E9F3B1D026D820003A77A; 27 | remoteInfo = JPFPSStatus; 28 | }; 29 | EE1E9F611D026D820003A77A /* PBXContainerItemProxy */ = { 30 | isa = PBXContainerItemProxy; 31 | containerPortal = EE1E9F341D026D820003A77A /* Project object */; 32 | proxyType = 1; 33 | remoteGlobalIDString = EE1E9F3B1D026D820003A77A; 34 | remoteInfo = JPFPSStatus; 35 | }; 36 | /* End PBXContainerItemProxy section */ 37 | 38 | /* Begin PBXFileReference section */ 39 | EE1E9F3C1D026D820003A77A /* JPFPSStatus.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = JPFPSStatus.app; sourceTree = BUILT_PRODUCTS_DIR; }; 40 | EE1E9F401D026D820003A77A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 41 | EE1E9F421D026D820003A77A /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 42 | EE1E9F431D026D820003A77A /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 43 | EE1E9F451D026D820003A77A /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 44 | EE1E9F461D026D820003A77A /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 45 | EE1E9F491D026D820003A77A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 46 | EE1E9F4B1D026D820003A77A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 47 | EE1E9F4E1D026D820003A77A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 48 | EE1E9F501D026D820003A77A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 49 | EE1E9F551D026D820003A77A /* JPFPSStatusTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = JPFPSStatusTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | EE1E9F591D026D820003A77A /* JPFPSStatusTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = JPFPSStatusTests.m; sourceTree = ""; }; 51 | EE1E9F5B1D026D820003A77A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 52 | EE1E9F601D026D820003A77A /* JPFPSStatusUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = JPFPSStatusUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 53 | EE1E9F641D026D820003A77A /* JPFPSStatusUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = JPFPSStatusUITests.m; sourceTree = ""; }; 54 | EE1E9F661D026D820003A77A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 55 | EE1E9F771D0270850003A77A /* JPFPSStatus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JPFPSStatus.h; sourceTree = ""; }; 56 | EE1E9F781D0270850003A77A /* JPFPSStatus.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JPFPSStatus.m; sourceTree = ""; }; 57 | /* End PBXFileReference section */ 58 | 59 | /* Begin PBXFrameworksBuildPhase section */ 60 | EE1E9F391D026D820003A77A /* Frameworks */ = { 61 | isa = PBXFrameworksBuildPhase; 62 | buildActionMask = 2147483647; 63 | files = ( 64 | ); 65 | runOnlyForDeploymentPostprocessing = 0; 66 | }; 67 | EE1E9F521D026D820003A77A /* Frameworks */ = { 68 | isa = PBXFrameworksBuildPhase; 69 | buildActionMask = 2147483647; 70 | files = ( 71 | ); 72 | runOnlyForDeploymentPostprocessing = 0; 73 | }; 74 | EE1E9F5D1D026D820003A77A /* Frameworks */ = { 75 | isa = PBXFrameworksBuildPhase; 76 | buildActionMask = 2147483647; 77 | files = ( 78 | ); 79 | runOnlyForDeploymentPostprocessing = 0; 80 | }; 81 | /* End PBXFrameworksBuildPhase section */ 82 | 83 | /* Begin PBXGroup section */ 84 | EE1E9F331D026D820003A77A = { 85 | isa = PBXGroup; 86 | children = ( 87 | EE1E9F3E1D026D820003A77A /* JPFPSStatus */, 88 | EE1E9F581D026D820003A77A /* JPFPSStatusTests */, 89 | EE1E9F631D026D820003A77A /* JPFPSStatusUITests */, 90 | EE1E9F3D1D026D820003A77A /* Products */, 91 | ); 92 | sourceTree = ""; 93 | }; 94 | EE1E9F3D1D026D820003A77A /* Products */ = { 95 | isa = PBXGroup; 96 | children = ( 97 | EE1E9F3C1D026D820003A77A /* JPFPSStatus.app */, 98 | EE1E9F551D026D820003A77A /* JPFPSStatusTests.xctest */, 99 | EE1E9F601D026D820003A77A /* JPFPSStatusUITests.xctest */, 100 | ); 101 | name = Products; 102 | sourceTree = ""; 103 | }; 104 | EE1E9F3E1D026D820003A77A /* JPFPSStatus */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | EE1E9F761D0270850003A77A /* JPFPSStatus */, 108 | EE1E9F421D026D820003A77A /* AppDelegate.h */, 109 | EE1E9F431D026D820003A77A /* AppDelegate.m */, 110 | EE1E9F451D026D820003A77A /* ViewController.h */, 111 | EE1E9F461D026D820003A77A /* ViewController.m */, 112 | EE1E9F481D026D820003A77A /* Main.storyboard */, 113 | EE1E9F4B1D026D820003A77A /* Assets.xcassets */, 114 | EE1E9F4D1D026D820003A77A /* LaunchScreen.storyboard */, 115 | EE1E9F501D026D820003A77A /* Info.plist */, 116 | EE1E9F3F1D026D820003A77A /* Supporting Files */, 117 | ); 118 | path = JPFPSStatus; 119 | sourceTree = ""; 120 | }; 121 | EE1E9F3F1D026D820003A77A /* Supporting Files */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | EE1E9F401D026D820003A77A /* main.m */, 125 | ); 126 | name = "Supporting Files"; 127 | sourceTree = ""; 128 | }; 129 | EE1E9F581D026D820003A77A /* JPFPSStatusTests */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | EE1E9F591D026D820003A77A /* JPFPSStatusTests.m */, 133 | EE1E9F5B1D026D820003A77A /* Info.plist */, 134 | ); 135 | path = JPFPSStatusTests; 136 | sourceTree = ""; 137 | }; 138 | EE1E9F631D026D820003A77A /* JPFPSStatusUITests */ = { 139 | isa = PBXGroup; 140 | children = ( 141 | EE1E9F641D026D820003A77A /* JPFPSStatusUITests.m */, 142 | EE1E9F661D026D820003A77A /* Info.plist */, 143 | ); 144 | path = JPFPSStatusUITests; 145 | sourceTree = ""; 146 | }; 147 | EE1E9F761D0270850003A77A /* JPFPSStatus */ = { 148 | isa = PBXGroup; 149 | children = ( 150 | EE1E9F771D0270850003A77A /* JPFPSStatus.h */, 151 | EE1E9F781D0270850003A77A /* JPFPSStatus.m */, 152 | ); 153 | path = JPFPSStatus; 154 | sourceTree = ""; 155 | }; 156 | /* End PBXGroup section */ 157 | 158 | /* Begin PBXNativeTarget section */ 159 | EE1E9F3B1D026D820003A77A /* JPFPSStatus */ = { 160 | isa = PBXNativeTarget; 161 | buildConfigurationList = EE1E9F691D026D820003A77A /* Build configuration list for PBXNativeTarget "JPFPSStatus" */; 162 | buildPhases = ( 163 | EE1E9F381D026D820003A77A /* Sources */, 164 | EE1E9F391D026D820003A77A /* Frameworks */, 165 | EE1E9F3A1D026D820003A77A /* Resources */, 166 | ); 167 | buildRules = ( 168 | ); 169 | dependencies = ( 170 | ); 171 | name = JPFPSStatus; 172 | productName = JPFPSStatus; 173 | productReference = EE1E9F3C1D026D820003A77A /* JPFPSStatus.app */; 174 | productType = "com.apple.product-type.application"; 175 | }; 176 | EE1E9F541D026D820003A77A /* JPFPSStatusTests */ = { 177 | isa = PBXNativeTarget; 178 | buildConfigurationList = EE1E9F6C1D026D820003A77A /* Build configuration list for PBXNativeTarget "JPFPSStatusTests" */; 179 | buildPhases = ( 180 | EE1E9F511D026D820003A77A /* Sources */, 181 | EE1E9F521D026D820003A77A /* Frameworks */, 182 | EE1E9F531D026D820003A77A /* Resources */, 183 | ); 184 | buildRules = ( 185 | ); 186 | dependencies = ( 187 | EE1E9F571D026D820003A77A /* PBXTargetDependency */, 188 | ); 189 | name = JPFPSStatusTests; 190 | productName = JPFPSStatusTests; 191 | productReference = EE1E9F551D026D820003A77A /* JPFPSStatusTests.xctest */; 192 | productType = "com.apple.product-type.bundle.unit-test"; 193 | }; 194 | EE1E9F5F1D026D820003A77A /* JPFPSStatusUITests */ = { 195 | isa = PBXNativeTarget; 196 | buildConfigurationList = EE1E9F6F1D026D820003A77A /* Build configuration list for PBXNativeTarget "JPFPSStatusUITests" */; 197 | buildPhases = ( 198 | EE1E9F5C1D026D820003A77A /* Sources */, 199 | EE1E9F5D1D026D820003A77A /* Frameworks */, 200 | EE1E9F5E1D026D820003A77A /* Resources */, 201 | ); 202 | buildRules = ( 203 | ); 204 | dependencies = ( 205 | EE1E9F621D026D820003A77A /* PBXTargetDependency */, 206 | ); 207 | name = JPFPSStatusUITests; 208 | productName = JPFPSStatusUITests; 209 | productReference = EE1E9F601D026D820003A77A /* JPFPSStatusUITests.xctest */; 210 | productType = "com.apple.product-type.bundle.ui-testing"; 211 | }; 212 | /* End PBXNativeTarget section */ 213 | 214 | /* Begin PBXProject section */ 215 | EE1E9F341D026D820003A77A /* Project object */ = { 216 | isa = PBXProject; 217 | attributes = { 218 | LastUpgradeCheck = 0730; 219 | ORGANIZATIONNAME = coderyi; 220 | TargetAttributes = { 221 | EE1E9F3B1D026D820003A77A = { 222 | CreatedOnToolsVersion = 7.3.1; 223 | }; 224 | EE1E9F541D026D820003A77A = { 225 | CreatedOnToolsVersion = 7.3.1; 226 | TestTargetID = EE1E9F3B1D026D820003A77A; 227 | }; 228 | EE1E9F5F1D026D820003A77A = { 229 | CreatedOnToolsVersion = 7.3.1; 230 | TestTargetID = EE1E9F3B1D026D820003A77A; 231 | }; 232 | }; 233 | }; 234 | buildConfigurationList = EE1E9F371D026D820003A77A /* Build configuration list for PBXProject "JPFPSStatus" */; 235 | compatibilityVersion = "Xcode 3.2"; 236 | developmentRegion = English; 237 | hasScannedForEncodings = 0; 238 | knownRegions = ( 239 | en, 240 | Base, 241 | ); 242 | mainGroup = EE1E9F331D026D820003A77A; 243 | productRefGroup = EE1E9F3D1D026D820003A77A /* Products */; 244 | projectDirPath = ""; 245 | projectRoot = ""; 246 | targets = ( 247 | EE1E9F3B1D026D820003A77A /* JPFPSStatus */, 248 | EE1E9F541D026D820003A77A /* JPFPSStatusTests */, 249 | EE1E9F5F1D026D820003A77A /* JPFPSStatusUITests */, 250 | ); 251 | }; 252 | /* End PBXProject section */ 253 | 254 | /* Begin PBXResourcesBuildPhase section */ 255 | EE1E9F3A1D026D820003A77A /* Resources */ = { 256 | isa = PBXResourcesBuildPhase; 257 | buildActionMask = 2147483647; 258 | files = ( 259 | EE1E9F4F1D026D820003A77A /* LaunchScreen.storyboard in Resources */, 260 | EE1E9F4C1D026D820003A77A /* Assets.xcassets in Resources */, 261 | EE1E9F4A1D026D820003A77A /* Main.storyboard in Resources */, 262 | ); 263 | runOnlyForDeploymentPostprocessing = 0; 264 | }; 265 | EE1E9F531D026D820003A77A /* Resources */ = { 266 | isa = PBXResourcesBuildPhase; 267 | buildActionMask = 2147483647; 268 | files = ( 269 | ); 270 | runOnlyForDeploymentPostprocessing = 0; 271 | }; 272 | EE1E9F5E1D026D820003A77A /* Resources */ = { 273 | isa = PBXResourcesBuildPhase; 274 | buildActionMask = 2147483647; 275 | files = ( 276 | ); 277 | runOnlyForDeploymentPostprocessing = 0; 278 | }; 279 | /* End PBXResourcesBuildPhase section */ 280 | 281 | /* Begin PBXSourcesBuildPhase section */ 282 | EE1E9F381D026D820003A77A /* Sources */ = { 283 | isa = PBXSourcesBuildPhase; 284 | buildActionMask = 2147483647; 285 | files = ( 286 | EE1E9F471D026D820003A77A /* ViewController.m in Sources */, 287 | EE1E9F441D026D820003A77A /* AppDelegate.m in Sources */, 288 | EE1E9F411D026D820003A77A /* main.m in Sources */, 289 | EE1E9F791D0270850003A77A /* JPFPSStatus.m in Sources */, 290 | ); 291 | runOnlyForDeploymentPostprocessing = 0; 292 | }; 293 | EE1E9F511D026D820003A77A /* Sources */ = { 294 | isa = PBXSourcesBuildPhase; 295 | buildActionMask = 2147483647; 296 | files = ( 297 | EE1E9F5A1D026D820003A77A /* JPFPSStatusTests.m in Sources */, 298 | ); 299 | runOnlyForDeploymentPostprocessing = 0; 300 | }; 301 | EE1E9F5C1D026D820003A77A /* Sources */ = { 302 | isa = PBXSourcesBuildPhase; 303 | buildActionMask = 2147483647; 304 | files = ( 305 | EE1E9F651D026D820003A77A /* JPFPSStatusUITests.m in Sources */, 306 | ); 307 | runOnlyForDeploymentPostprocessing = 0; 308 | }; 309 | /* End PBXSourcesBuildPhase section */ 310 | 311 | /* Begin PBXTargetDependency section */ 312 | EE1E9F571D026D820003A77A /* PBXTargetDependency */ = { 313 | isa = PBXTargetDependency; 314 | target = EE1E9F3B1D026D820003A77A /* JPFPSStatus */; 315 | targetProxy = EE1E9F561D026D820003A77A /* PBXContainerItemProxy */; 316 | }; 317 | EE1E9F621D026D820003A77A /* PBXTargetDependency */ = { 318 | isa = PBXTargetDependency; 319 | target = EE1E9F3B1D026D820003A77A /* JPFPSStatus */; 320 | targetProxy = EE1E9F611D026D820003A77A /* PBXContainerItemProxy */; 321 | }; 322 | /* End PBXTargetDependency section */ 323 | 324 | /* Begin PBXVariantGroup section */ 325 | EE1E9F481D026D820003A77A /* Main.storyboard */ = { 326 | isa = PBXVariantGroup; 327 | children = ( 328 | EE1E9F491D026D820003A77A /* Base */, 329 | ); 330 | name = Main.storyboard; 331 | sourceTree = ""; 332 | }; 333 | EE1E9F4D1D026D820003A77A /* LaunchScreen.storyboard */ = { 334 | isa = PBXVariantGroup; 335 | children = ( 336 | EE1E9F4E1D026D820003A77A /* Base */, 337 | ); 338 | name = LaunchScreen.storyboard; 339 | sourceTree = ""; 340 | }; 341 | /* End PBXVariantGroup section */ 342 | 343 | /* Begin XCBuildConfiguration section */ 344 | EE1E9F671D026D820003A77A /* Debug */ = { 345 | isa = XCBuildConfiguration; 346 | buildSettings = { 347 | ALWAYS_SEARCH_USER_PATHS = NO; 348 | CLANG_ANALYZER_NONNULL = YES; 349 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 350 | CLANG_CXX_LIBRARY = "libc++"; 351 | CLANG_ENABLE_MODULES = YES; 352 | CLANG_ENABLE_OBJC_ARC = YES; 353 | CLANG_WARN_BOOL_CONVERSION = YES; 354 | CLANG_WARN_CONSTANT_CONVERSION = YES; 355 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 356 | CLANG_WARN_EMPTY_BODY = YES; 357 | CLANG_WARN_ENUM_CONVERSION = YES; 358 | CLANG_WARN_INT_CONVERSION = YES; 359 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 360 | CLANG_WARN_UNREACHABLE_CODE = YES; 361 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 362 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 363 | COPY_PHASE_STRIP = NO; 364 | DEBUG_INFORMATION_FORMAT = dwarf; 365 | ENABLE_STRICT_OBJC_MSGSEND = YES; 366 | ENABLE_TESTABILITY = YES; 367 | GCC_C_LANGUAGE_STANDARD = gnu99; 368 | GCC_DYNAMIC_NO_PIC = NO; 369 | GCC_NO_COMMON_BLOCKS = YES; 370 | GCC_OPTIMIZATION_LEVEL = 0; 371 | GCC_PREPROCESSOR_DEFINITIONS = ( 372 | "DEBUG=1", 373 | "$(inherited)", 374 | ); 375 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 376 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 377 | GCC_WARN_UNDECLARED_SELECTOR = YES; 378 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 379 | GCC_WARN_UNUSED_FUNCTION = YES; 380 | GCC_WARN_UNUSED_VARIABLE = YES; 381 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 382 | MTL_ENABLE_DEBUG_INFO = YES; 383 | ONLY_ACTIVE_ARCH = YES; 384 | SDKROOT = iphoneos; 385 | TARGETED_DEVICE_FAMILY = "1,2"; 386 | }; 387 | name = Debug; 388 | }; 389 | EE1E9F681D026D820003A77A /* Release */ = { 390 | isa = XCBuildConfiguration; 391 | buildSettings = { 392 | ALWAYS_SEARCH_USER_PATHS = NO; 393 | CLANG_ANALYZER_NONNULL = YES; 394 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 395 | CLANG_CXX_LIBRARY = "libc++"; 396 | CLANG_ENABLE_MODULES = YES; 397 | CLANG_ENABLE_OBJC_ARC = YES; 398 | CLANG_WARN_BOOL_CONVERSION = YES; 399 | CLANG_WARN_CONSTANT_CONVERSION = YES; 400 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 401 | CLANG_WARN_EMPTY_BODY = YES; 402 | CLANG_WARN_ENUM_CONVERSION = YES; 403 | CLANG_WARN_INT_CONVERSION = YES; 404 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 405 | CLANG_WARN_UNREACHABLE_CODE = YES; 406 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 407 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 408 | COPY_PHASE_STRIP = NO; 409 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 410 | ENABLE_NS_ASSERTIONS = NO; 411 | ENABLE_STRICT_OBJC_MSGSEND = YES; 412 | GCC_C_LANGUAGE_STANDARD = gnu99; 413 | GCC_NO_COMMON_BLOCKS = YES; 414 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 415 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 416 | GCC_WARN_UNDECLARED_SELECTOR = YES; 417 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 418 | GCC_WARN_UNUSED_FUNCTION = YES; 419 | GCC_WARN_UNUSED_VARIABLE = YES; 420 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 421 | MTL_ENABLE_DEBUG_INFO = NO; 422 | SDKROOT = iphoneos; 423 | TARGETED_DEVICE_FAMILY = "1,2"; 424 | VALIDATE_PRODUCT = YES; 425 | }; 426 | name = Release; 427 | }; 428 | EE1E9F6A1D026D820003A77A /* Debug */ = { 429 | isa = XCBuildConfiguration; 430 | buildSettings = { 431 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 432 | INFOPLIST_FILE = JPFPSStatus/Info.plist; 433 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 434 | PRODUCT_BUNDLE_IDENTIFIER = coderyi.JPFPSStatus; 435 | PRODUCT_NAME = "$(TARGET_NAME)"; 436 | }; 437 | name = Debug; 438 | }; 439 | EE1E9F6B1D026D820003A77A /* Release */ = { 440 | isa = XCBuildConfiguration; 441 | buildSettings = { 442 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 443 | INFOPLIST_FILE = JPFPSStatus/Info.plist; 444 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 445 | PRODUCT_BUNDLE_IDENTIFIER = coderyi.JPFPSStatus; 446 | PRODUCT_NAME = "$(TARGET_NAME)"; 447 | }; 448 | name = Release; 449 | }; 450 | EE1E9F6D1D026D820003A77A /* Debug */ = { 451 | isa = XCBuildConfiguration; 452 | buildSettings = { 453 | BUNDLE_LOADER = "$(TEST_HOST)"; 454 | INFOPLIST_FILE = JPFPSStatusTests/Info.plist; 455 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 456 | PRODUCT_BUNDLE_IDENTIFIER = coderyi.JPFPSStatusTests; 457 | PRODUCT_NAME = "$(TARGET_NAME)"; 458 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/JPFPSStatus.app/JPFPSStatus"; 459 | }; 460 | name = Debug; 461 | }; 462 | EE1E9F6E1D026D820003A77A /* Release */ = { 463 | isa = XCBuildConfiguration; 464 | buildSettings = { 465 | BUNDLE_LOADER = "$(TEST_HOST)"; 466 | INFOPLIST_FILE = JPFPSStatusTests/Info.plist; 467 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 468 | PRODUCT_BUNDLE_IDENTIFIER = coderyi.JPFPSStatusTests; 469 | PRODUCT_NAME = "$(TARGET_NAME)"; 470 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/JPFPSStatus.app/JPFPSStatus"; 471 | }; 472 | name = Release; 473 | }; 474 | EE1E9F701D026D820003A77A /* Debug */ = { 475 | isa = XCBuildConfiguration; 476 | buildSettings = { 477 | INFOPLIST_FILE = JPFPSStatusUITests/Info.plist; 478 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 479 | PRODUCT_BUNDLE_IDENTIFIER = coderyi.JPFPSStatusUITests; 480 | PRODUCT_NAME = "$(TARGET_NAME)"; 481 | TEST_TARGET_NAME = JPFPSStatus; 482 | }; 483 | name = Debug; 484 | }; 485 | EE1E9F711D026D820003A77A /* Release */ = { 486 | isa = XCBuildConfiguration; 487 | buildSettings = { 488 | INFOPLIST_FILE = JPFPSStatusUITests/Info.plist; 489 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 490 | PRODUCT_BUNDLE_IDENTIFIER = coderyi.JPFPSStatusUITests; 491 | PRODUCT_NAME = "$(TARGET_NAME)"; 492 | TEST_TARGET_NAME = JPFPSStatus; 493 | }; 494 | name = Release; 495 | }; 496 | /* End XCBuildConfiguration section */ 497 | 498 | /* Begin XCConfigurationList section */ 499 | EE1E9F371D026D820003A77A /* Build configuration list for PBXProject "JPFPSStatus" */ = { 500 | isa = XCConfigurationList; 501 | buildConfigurations = ( 502 | EE1E9F671D026D820003A77A /* Debug */, 503 | EE1E9F681D026D820003A77A /* Release */, 504 | ); 505 | defaultConfigurationIsVisible = 0; 506 | defaultConfigurationName = Release; 507 | }; 508 | EE1E9F691D026D820003A77A /* Build configuration list for PBXNativeTarget "JPFPSStatus" */ = { 509 | isa = XCConfigurationList; 510 | buildConfigurations = ( 511 | EE1E9F6A1D026D820003A77A /* Debug */, 512 | EE1E9F6B1D026D820003A77A /* Release */, 513 | ); 514 | defaultConfigurationIsVisible = 0; 515 | }; 516 | EE1E9F6C1D026D820003A77A /* Build configuration list for PBXNativeTarget "JPFPSStatusTests" */ = { 517 | isa = XCConfigurationList; 518 | buildConfigurations = ( 519 | EE1E9F6D1D026D820003A77A /* Debug */, 520 | EE1E9F6E1D026D820003A77A /* Release */, 521 | ); 522 | defaultConfigurationIsVisible = 0; 523 | }; 524 | EE1E9F6F1D026D820003A77A /* Build configuration list for PBXNativeTarget "JPFPSStatusUITests" */ = { 525 | isa = XCConfigurationList; 526 | buildConfigurations = ( 527 | EE1E9F701D026D820003A77A /* Debug */, 528 | EE1E9F711D026D820003A77A /* Release */, 529 | ); 530 | defaultConfigurationIsVisible = 0; 531 | }; 532 | /* End XCConfigurationList section */ 533 | }; 534 | rootObject = EE1E9F341D026D820003A77A /* Project object */; 535 | } 536 | -------------------------------------------------------------------------------- /JPFPSStatus.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /JPFPSStatus.xcodeproj/project.xcworkspace/xcuserdata/coderyi.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joggerplus/JPFPSStatus/bc6cde4903bdb5c7c54cb4ecb28642f1c5fa20ff/JPFPSStatus.xcodeproj/project.xcworkspace/xcuserdata/coderyi.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /JPFPSStatus.xcodeproj/xcuserdata/coderyi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 20 | 21 | 22 | 24 | 36 | 37 | 38 | 40 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /JPFPSStatus.xcodeproj/xcuserdata/coderyi.xcuserdatad/xcschemes/JPFPSStatus.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /JPFPSStatus.xcodeproj/xcuserdata/coderyi.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | JPFPSStatus.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | EE1E9F3B1D026D820003A77A 16 | 17 | primary 18 | 19 | 20 | EE1E9F541D026D820003A77A 21 | 22 | primary 23 | 24 | 25 | EE1E9F5F1D026D820003A77A 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /JPFPSStatus/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // JPFPSStatus 4 | // 5 | // Created by coderyi on 16/6/4. 6 | // Copyright © 2016年 http://coderyi.com . All rights reserved. 7 | // @ https://github.com/joggerplus/JPFPSStatus 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /JPFPSStatus/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // JPFPSStatus 4 | // 5 | // Created by coderyi on 16/6/4. 6 | // Copyright © 2016年 http://coderyi.com . All rights reserved. 7 | // @ https://github.com/joggerplus/JPFPSStatus 8 | 9 | #import "AppDelegate.h" 10 | #import "ViewController.h" 11 | #import "JPFPSStatus.h" 12 | @interface AppDelegate () 13 | 14 | @end 15 | 16 | @implementation AppDelegate 17 | 18 | 19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 20 | // Override point for customization after application launch. 21 | self.window.rootViewController=[[ViewController alloc] init]; 22 | #if defined(DEBUG)||defined(_DEBUG) 23 | [[JPFPSStatus sharedInstance] open]; 24 | #endif 25 | 26 | return YES; 27 | } 28 | 29 | - (void)applicationWillResignActive:(UIApplication *)application { 30 | // 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. 31 | // 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. 32 | } 33 | 34 | - (void)applicationDidEnterBackground:(UIApplication *)application { 35 | // 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. 36 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 37 | } 38 | 39 | - (void)applicationWillEnterForeground:(UIApplication *)application { 40 | // 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. 41 | } 42 | 43 | - (void)applicationDidBecomeActive:(UIApplication *)application { 44 | // 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. 45 | } 46 | 47 | - (void)applicationWillTerminate:(UIApplication *)application { 48 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /JPFPSStatus/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /JPFPSStatus/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 | -------------------------------------------------------------------------------- /JPFPSStatus/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /JPFPSStatus/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /JPFPSStatus/JPFPSStatus/JPFPSStatus.h: -------------------------------------------------------------------------------- 1 | // 2 | // JPFPSStatus.h 3 | // JPFPSStatus 4 | // 5 | // Created by coderyi on 16/6/4. 6 | // Copyright © 2016年 http://coderyi.com . All rights reserved. 7 | // @ https://github.com/joggerplus/JPFPSStatus 8 | 9 | #import 10 | #import 11 | @interface JPFPSStatus : NSObject 12 | 13 | @property (nonatomic,strong)UILabel *fpsLabel; 14 | 15 | + (JPFPSStatus *)sharedInstance; 16 | 17 | - (void)open; 18 | - (void)openWithHandler:(void (^)(NSInteger fpsValue))handler; 19 | - (void)close; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /JPFPSStatus/JPFPSStatus/JPFPSStatus.m: -------------------------------------------------------------------------------- 1 | // 2 | // JPFPSStatus.m 3 | // JPFPSStatus 4 | // 5 | // Created by coderyi on 16/6/4. 6 | // Copyright © 2016年 http://coderyi.com . All rights reserved. 7 | // @ https://github.com/joggerplus/JPFPSStatus 8 | 9 | #import "JPFPSStatus.h" 10 | 11 | @interface JPFPSStatus (){ 12 | CADisplayLink *displayLink; 13 | NSTimeInterval lastTime; 14 | NSUInteger count; 15 | } 16 | @property(nonatomic,copy) void (^fpsHandler)(NSInteger fpsValue); 17 | 18 | @end 19 | 20 | @implementation JPFPSStatus 21 | @synthesize fpsLabel; 22 | 23 | - (void)dealloc { 24 | [displayLink setPaused:YES]; 25 | [displayLink removeFromRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes]; 26 | } 27 | 28 | + (JPFPSStatus *)sharedInstance { 29 | static JPFPSStatus *sharedInstance; 30 | static dispatch_once_t onceToken; 31 | dispatch_once(&onceToken, ^{ 32 | sharedInstance = [[JPFPSStatus alloc] init]; 33 | }); 34 | return sharedInstance; 35 | } 36 | 37 | - (id)init { 38 | self = [super init]; 39 | if (self) { 40 | [[NSNotificationCenter defaultCenter] addObserver: self 41 | selector: @selector(applicationDidBecomeActiveNotification) 42 | name: UIApplicationDidBecomeActiveNotification 43 | object: nil]; 44 | 45 | [[NSNotificationCenter defaultCenter] addObserver: self 46 | selector: @selector(applicationWillResignActiveNotification) 47 | name: UIApplicationWillResignActiveNotification 48 | object: nil]; 49 | 50 | // Track FPS using display link 51 | displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(displayLinkTick:)]; 52 | [displayLink setPaused:YES]; 53 | [displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes]; 54 | 55 | // fpsLabel 56 | fpsLabel = [[UILabel alloc] initWithFrame:CGRectMake(([[UIScreen mainScreen] bounds].size.width-50)/2+50, 0, 50, 20)]; 57 | BOOL isiPhoneX = (([[UIScreen mainScreen] bounds].size.width == 375.f && [[UIScreen mainScreen] bounds].size.height == 812.f) || ([[UIScreen mainScreen] bounds].size.height == 375.f && [[UIScreen mainScreen] bounds].size.width == 812.f)); 58 | if (isiPhoneX) { 59 | fpsLabel.frame = CGRectMake(([[UIScreen mainScreen] bounds].size.width-50)/2+50, 24, 50, 20); 60 | } 61 | fpsLabel.font=[UIFont boldSystemFontOfSize:12]; 62 | fpsLabel.textColor=[UIColor colorWithRed:0.33 green:0.84 blue:0.43 alpha:1.00]; 63 | fpsLabel.backgroundColor=[UIColor clearColor]; 64 | fpsLabel.textAlignment=NSTextAlignmentRight; 65 | fpsLabel.tag=101; 66 | 67 | } 68 | return self; 69 | } 70 | 71 | - (void)displayLinkTick:(CADisplayLink *)link { 72 | if (lastTime == 0) { 73 | lastTime = link.timestamp; 74 | return; 75 | } 76 | 77 | count++; 78 | NSTimeInterval interval = link.timestamp - lastTime; 79 | if (interval < 1) return; 80 | lastTime = link.timestamp; 81 | float fps = count / interval; 82 | count = 0; 83 | 84 | NSString *text = [NSString stringWithFormat:@"%d FPS",(int)round(fps)]; 85 | [fpsLabel setText: text]; 86 | if (_fpsHandler) { 87 | _fpsHandler((int)round(fps)); 88 | } 89 | 90 | } 91 | 92 | - (void)open { 93 | 94 | NSArray *rootVCViewSubViews=[[UIApplication sharedApplication].delegate window].rootViewController.view.subviews; 95 | for (UIView *label in rootVCViewSubViews) { 96 | if ([label isKindOfClass:[UILabel class]]&& label.tag==101) { 97 | return; 98 | } 99 | } 100 | 101 | [displayLink setPaused:NO]; 102 | [[((NSObject *)([UIApplication sharedApplication].delegate)) window].rootViewController.view addSubview:fpsLabel]; 103 | } 104 | 105 | - (void)openWithHandler:(void (^)(NSInteger fpsValue))handler{ 106 | [[JPFPSStatus sharedInstance] open]; 107 | _fpsHandler=handler; 108 | } 109 | 110 | - (void)close { 111 | 112 | [displayLink setPaused:YES]; 113 | 114 | NSArray *rootVCViewSubViews=[[UIApplication sharedApplication].delegate window].rootViewController.view.subviews; 115 | for (UIView *label in rootVCViewSubViews) { 116 | if ([label isKindOfClass:[UILabel class]]&& label.tag==101) { 117 | [label removeFromSuperview]; 118 | return; 119 | } 120 | } 121 | 122 | } 123 | 124 | - (void)applicationDidBecomeActiveNotification { 125 | [displayLink setPaused:NO]; 126 | } 127 | 128 | - (void)applicationWillResignActiveNotification { 129 | [displayLink setPaused:YES]; 130 | } 131 | 132 | @end 133 | -------------------------------------------------------------------------------- /JPFPSStatus/Resources/jpfpsstatus1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joggerplus/JPFPSStatus/bc6cde4903bdb5c7c54cb4ecb28642f1c5fa20ff/JPFPSStatus/Resources/jpfpsstatus1.jpg -------------------------------------------------------------------------------- /JPFPSStatus/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // JPFPSStatus 4 | // 5 | // Created by coderyi on 16/6/4. 6 | // Copyright © 2016年 http://coderyi.com . All rights reserved. 7 | // @ https://github.com/joggerplus/JPFPSStatus 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /JPFPSStatus/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // JPFPSStatus 4 | // 5 | // Created by coderyi on 16/6/4. 6 | // Copyright © 2016年 http://coderyi.com . All rights reserved. 7 | // @ https://github.com/joggerplus/JPFPSStatus 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController () 12 | 13 | @end 14 | 15 | @implementation ViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view, typically from a nib. 20 | self.view.backgroundColor=[UIColor whiteColor]; 21 | 22 | UILabel *label=[[UILabel alloc] initWithFrame:CGRectMake(0, 300, [[UIScreen mainScreen] bounds].size.width, 40)]; 23 | [self.view addSubview:label]; 24 | label.textAlignment=NSTextAlignmentCenter; 25 | label.text=@"..............."; 26 | } 27 | 28 | - (void)didReceiveMemoryWarning { 29 | [super didReceiveMemoryWarning]; 30 | // Dispose of any resources that can be recreated. 31 | } 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /JPFPSStatus/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // JPFPSStatus 4 | // 5 | // Created by coderyi on 16/6/4. 6 | // Copyright © 2016年 coderyi. 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 | -------------------------------------------------------------------------------- /JPFPSStatusTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /JPFPSStatusTests/JPFPSStatusTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // JPFPSStatusTests.m 3 | // JPFPSStatusTests 4 | // 5 | // Created by coderyi on 16/6/4. 6 | // Copyright © 2016年 coderyi. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface JPFPSStatusTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation JPFPSStatusTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /JPFPSStatusUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /JPFPSStatusUITests/JPFPSStatusUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // JPFPSStatusUITests.m 3 | // JPFPSStatusUITests 4 | // 5 | // Created by coderyi on 16/6/4. 6 | // Copyright © 2016年 coderyi. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface JPFPSStatusUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation JPFPSStatusUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 coderyi 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. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | # JPFPSStatus 9 | [![Pod Version](http://img.shields.io/cocoapods/v/JPFPSStatus.svg?style=flat)](http://cocoadocs.org/docsets/JPFPSStatus/) 10 | [![Pod Platform](http://img.shields.io/cocoapods/p/JPFPSStatus.svg?style=flat)](http://cocoadocs.org/docsets/JPFPSStatus/) 11 | [![Pod License](http://img.shields.io/cocoapods/l/JPFPSStatus.svg?style=flat)](https://opensource.org/licenses/MIT) 12 | 13 | [README 中文](https://github.com/joggerplus/JPFPSStatus/blob/master/README_Chinese.md) 14 | 15 | Show FPS Status on StatusBar 16 | 17 | #### Podfile 18 | 19 | ```ruby 20 | platform :ios, '7.0' 21 | pod 'JPFPSStatus', '~> 0.1.1' 22 | ``` 23 | 24 | 25 | 26 | #### Instruction 27 | Note:Use JPFPSStatus in DEBUG mode 28 | 29 | add the code in AppDelegate.m 30 | 31 |
32 | #import "JPFPSStatus.h"
33 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
34 |     // Override point for customization after application launch.
35 | #if defined(DEBUG)||defined(_DEBUG)
36 |     [[JPFPSStatus sharedInstance] open];
37 | #endif
38 |     return YES;
39 | }
40 | 
41 | 
42 | 43 |
44 | #if defined(DEBUG)||defined(_DEBUG)
45 | 	[[JPFPSStatus sharedInstance] openWithHandler:^(NSInteger fpsValue) {
46 | 		NSLog(@"fpsvalue %@",@(fpsValue));
47 | 	}];
48 | #endif
49 | 
50 | 
51 | 52 | 53 |
54 | #if defined(DEBUG)||defined(_DEBUG)
55 |     [[JPFPSStatus sharedInstance] close];
56 | #endif
57 | 
58 | 59 | 60 | 61 | 62 | 63 | 64 | #### Licenses 65 | 66 | All source code is licensed under the [MIT License](https://github.com/joggerplus/JPFPSStatus/blob/master/LICENSE). 67 | -------------------------------------------------------------------------------- /README_Chinese.md: -------------------------------------------------------------------------------- 1 | # JPFPSStatus 2 | [![Pod Version](http://img.shields.io/cocoapods/v/JPFPSStatus.svg?style=flat)](http://cocoadocs.org/docsets/JPFPSStatus/) 3 | [![Pod Platform](http://img.shields.io/cocoapods/p/JPFPSStatus.svg?style=flat)](http://cocoadocs.org/docsets/JPFPSStatus/) 4 | [![Pod License](http://img.shields.io/cocoapods/l/JPFPSStatus.svg?style=flat)](https://opensource.org/licenses/MIT) 5 | 6 | [README English](https://github.com/joggerplus/JPFPSStatus/blob/master/README.md) 7 | 8 | JPFPSStatus是用来显示FPS状态在iOS状态栏,FPS是一秒钟渲染多少帧 Frame Per Second = FPS,FPS的值最佳为60左右,一般来说小于这个值就较为卡顿了。 9 | 10 | #### Podfile 11 | 12 | ```ruby 13 | platform :ios, '7.0' 14 | pod 'JPFPSStatus', '~> 0.1.1' 15 | ``` 16 | 17 | 18 | ######使用: 19 | 注意请在DEBUG模式下使用 JPFPSStatus 20 | 在AppDelegate.m里面加入下面代码就可以了 21 |
22 | #import "JPFPSStatus.h"
23 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
24 |     // Override point for customization after application launch.
25 | #if defined(DEBUG)||defined(_DEBUG)
26 |     [[JPFPSStatus sharedInstance] open];
27 | #endif
28 |     return YES;
29 | }
30 | 
31 | 
32 | 33 | 34 |
35 | #if defined(DEBUG)||defined(_DEBUG)
36 | 	[[JPFPSStatus sharedInstance] openWithHandler:^(NSInteger fpsValue) {
37 | 		NSLog(@"fpsvalue %@",@(fpsValue));
38 | 	}];
39 | #endif
40 | 
41 | 
42 | 43 | 44 | 45 | 不需要的时候可以关闭它在状态栏显示 46 |
47 | #if defined(DEBUG)||defined(_DEBUG)
48 |     [[JPFPSStatus sharedInstance] close];
49 | #endif
50 | 
51 | 52 | 53 | 54 | JPFPSStatus的显示效果如图: 55 | 56 | 57 | 58 | 59 | #### Licenses 60 | 61 | All source code is licensed under the [MIT License](https://github.com/joggerplus/JPFPSStatus/blob/master/LICENSE). 62 | --------------------------------------------------------------------------------