├── .gitignore ├── .travis.yml ├── AYCheckVersion.podspec ├── AYCheckVersion.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── AYCheckVersion ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Classes │ ├── AYCheckManager.h │ └── AYCheckManager.m ├── Info.plist ├── ViewController.h ├── ViewController.m └── main.m ├── AYCheckVersionTests ├── AYCheckVersionTests.m └── Info.plist ├── AYCheckVersionUITests ├── AYCheckVersionUITests.m └── Info.plist ├── 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 | *.xccheckout 22 | *.moved-aside 23 | *.xcuserstate 24 | *.xcscmblueprint 25 | 26 | ## Obj-C/Swift specific 27 | *.hmap 28 | *.ipa 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/docs/Gitignore.md 51 | 52 | fastlane/report.xml 53 | fastlane/screenshots 54 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | before_install: 3 | - brew update 4 | - brew install xctool 5 | script: xctool -project AYCheckVersion.xcodeproj -scheme 6 | AYCheckVersion -sdkiphonesimulator test 7 | -------------------------------------------------------------------------------- /AYCheckVersion.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "AYCheckVersion" 3 | s.version = "1.3.5" 4 | s.summary = "Check version from AppStore" 5 | s.homepage = "https://github.com/AYJk/AYCheckVersion" 6 | s.license = "MIT" 7 | s.author = { "Andy" => "andy5759520@gmail.com" } 8 | s.platform = :ios, "7.0" 9 | s.source = { :git => "https://github.com/AYJk/AYCheckVersion.git", :tag => "1.3.5" } 10 | s.source_files = "AYCheckVersion/Classes/*.{h,m}" 11 | s.requires_arc = true 12 | 13 | end 14 | -------------------------------------------------------------------------------- /AYCheckVersion.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 251AD21A1CB5549D00DB55A9 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 251AD2191CB5549D00DB55A9 /* main.m */; }; 11 | 251AD21D1CB5549D00DB55A9 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 251AD21C1CB5549D00DB55A9 /* AppDelegate.m */; }; 12 | 251AD2201CB5549D00DB55A9 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 251AD21F1CB5549D00DB55A9 /* ViewController.m */; }; 13 | 251AD2231CB5549D00DB55A9 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 251AD2211CB5549D00DB55A9 /* Main.storyboard */; }; 14 | 251AD2251CB5549D00DB55A9 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 251AD2241CB5549D00DB55A9 /* Assets.xcassets */; }; 15 | 251AD2281CB5549D00DB55A9 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 251AD2261CB5549D00DB55A9 /* LaunchScreen.storyboard */; }; 16 | 251AD2331CB5549E00DB55A9 /* AYCheckVersionTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 251AD2321CB5549E00DB55A9 /* AYCheckVersionTests.m */; }; 17 | 251AD23E1CB5549E00DB55A9 /* AYCheckVersionUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 251AD23D1CB5549E00DB55A9 /* AYCheckVersionUITests.m */; }; 18 | 251AD2541CB5557500DB55A9 /* AYCheckManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 251AD2531CB5557500DB55A9 /* AYCheckManager.m */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXContainerItemProxy section */ 22 | 251AD22F1CB5549E00DB55A9 /* PBXContainerItemProxy */ = { 23 | isa = PBXContainerItemProxy; 24 | containerPortal = 251AD20D1CB5549D00DB55A9 /* Project object */; 25 | proxyType = 1; 26 | remoteGlobalIDString = 251AD2141CB5549D00DB55A9; 27 | remoteInfo = AYCheckVersion; 28 | }; 29 | 251AD23A1CB5549E00DB55A9 /* PBXContainerItemProxy */ = { 30 | isa = PBXContainerItemProxy; 31 | containerPortal = 251AD20D1CB5549D00DB55A9 /* Project object */; 32 | proxyType = 1; 33 | remoteGlobalIDString = 251AD2141CB5549D00DB55A9; 34 | remoteInfo = AYCheckVersion; 35 | }; 36 | /* End PBXContainerItemProxy section */ 37 | 38 | /* Begin PBXFileReference section */ 39 | 251AD2151CB5549D00DB55A9 /* AYCheckVersion.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AYCheckVersion.app; sourceTree = BUILT_PRODUCTS_DIR; }; 40 | 251AD2191CB5549D00DB55A9 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 41 | 251AD21B1CB5549D00DB55A9 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 42 | 251AD21C1CB5549D00DB55A9 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 43 | 251AD21E1CB5549D00DB55A9 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 44 | 251AD21F1CB5549D00DB55A9 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 45 | 251AD2221CB5549D00DB55A9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 46 | 251AD2241CB5549D00DB55A9 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 47 | 251AD2271CB5549D00DB55A9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 48 | 251AD2291CB5549D00DB55A9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 49 | 251AD22E1CB5549E00DB55A9 /* AYCheckVersionTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AYCheckVersionTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | 251AD2321CB5549E00DB55A9 /* AYCheckVersionTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AYCheckVersionTests.m; sourceTree = ""; }; 51 | 251AD2341CB5549E00DB55A9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 52 | 251AD2391CB5549E00DB55A9 /* AYCheckVersionUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AYCheckVersionUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 53 | 251AD23D1CB5549E00DB55A9 /* AYCheckVersionUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AYCheckVersionUITests.m; sourceTree = ""; }; 54 | 251AD23F1CB5549E00DB55A9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 55 | 251AD2521CB5557500DB55A9 /* AYCheckManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AYCheckManager.h; sourceTree = ""; }; 56 | 251AD2531CB5557500DB55A9 /* AYCheckManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AYCheckManager.m; sourceTree = ""; }; 57 | /* End PBXFileReference section */ 58 | 59 | /* Begin PBXFrameworksBuildPhase section */ 60 | 251AD2121CB5549D00DB55A9 /* Frameworks */ = { 61 | isa = PBXFrameworksBuildPhase; 62 | buildActionMask = 2147483647; 63 | files = ( 64 | ); 65 | runOnlyForDeploymentPostprocessing = 0; 66 | }; 67 | 251AD22B1CB5549E00DB55A9 /* Frameworks */ = { 68 | isa = PBXFrameworksBuildPhase; 69 | buildActionMask = 2147483647; 70 | files = ( 71 | ); 72 | runOnlyForDeploymentPostprocessing = 0; 73 | }; 74 | 251AD2361CB5549E00DB55A9 /* Frameworks */ = { 75 | isa = PBXFrameworksBuildPhase; 76 | buildActionMask = 2147483647; 77 | files = ( 78 | ); 79 | runOnlyForDeploymentPostprocessing = 0; 80 | }; 81 | /* End PBXFrameworksBuildPhase section */ 82 | 83 | /* Begin PBXGroup section */ 84 | 251AD20C1CB5549D00DB55A9 = { 85 | isa = PBXGroup; 86 | children = ( 87 | 251AD2171CB5549D00DB55A9 /* AYCheckVersion */, 88 | 251AD2311CB5549E00DB55A9 /* AYCheckVersionTests */, 89 | 251AD23C1CB5549E00DB55A9 /* AYCheckVersionUITests */, 90 | 251AD2161CB5549D00DB55A9 /* Products */, 91 | ); 92 | sourceTree = ""; 93 | }; 94 | 251AD2161CB5549D00DB55A9 /* Products */ = { 95 | isa = PBXGroup; 96 | children = ( 97 | 251AD2151CB5549D00DB55A9 /* AYCheckVersion.app */, 98 | 251AD22E1CB5549E00DB55A9 /* AYCheckVersionTests.xctest */, 99 | 251AD2391CB5549E00DB55A9 /* AYCheckVersionUITests.xctest */, 100 | ); 101 | name = Products; 102 | sourceTree = ""; 103 | }; 104 | 251AD2171CB5549D00DB55A9 /* AYCheckVersion */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | 251AD24B1CB554BE00DB55A9 /* Classes */, 108 | 251AD21B1CB5549D00DB55A9 /* AppDelegate.h */, 109 | 251AD21C1CB5549D00DB55A9 /* AppDelegate.m */, 110 | 251AD21E1CB5549D00DB55A9 /* ViewController.h */, 111 | 251AD21F1CB5549D00DB55A9 /* ViewController.m */, 112 | 251AD2211CB5549D00DB55A9 /* Main.storyboard */, 113 | 251AD2241CB5549D00DB55A9 /* Assets.xcassets */, 114 | 251AD2261CB5549D00DB55A9 /* LaunchScreen.storyboard */, 115 | 251AD2291CB5549D00DB55A9 /* Info.plist */, 116 | 251AD2181CB5549D00DB55A9 /* Supporting Files */, 117 | ); 118 | path = AYCheckVersion; 119 | sourceTree = ""; 120 | }; 121 | 251AD2181CB5549D00DB55A9 /* Supporting Files */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | 251AD2191CB5549D00DB55A9 /* main.m */, 125 | ); 126 | name = "Supporting Files"; 127 | sourceTree = ""; 128 | }; 129 | 251AD2311CB5549E00DB55A9 /* AYCheckVersionTests */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | 251AD2321CB5549E00DB55A9 /* AYCheckVersionTests.m */, 133 | 251AD2341CB5549E00DB55A9 /* Info.plist */, 134 | ); 135 | path = AYCheckVersionTests; 136 | sourceTree = ""; 137 | }; 138 | 251AD23C1CB5549E00DB55A9 /* AYCheckVersionUITests */ = { 139 | isa = PBXGroup; 140 | children = ( 141 | 251AD23D1CB5549E00DB55A9 /* AYCheckVersionUITests.m */, 142 | 251AD23F1CB5549E00DB55A9 /* Info.plist */, 143 | ); 144 | path = AYCheckVersionUITests; 145 | sourceTree = ""; 146 | }; 147 | 251AD24B1CB554BE00DB55A9 /* Classes */ = { 148 | isa = PBXGroup; 149 | children = ( 150 | 251AD2521CB5557500DB55A9 /* AYCheckManager.h */, 151 | 251AD2531CB5557500DB55A9 /* AYCheckManager.m */, 152 | ); 153 | path = Classes; 154 | sourceTree = ""; 155 | }; 156 | /* End PBXGroup section */ 157 | 158 | /* Begin PBXNativeTarget section */ 159 | 251AD2141CB5549D00DB55A9 /* AYCheckVersion */ = { 160 | isa = PBXNativeTarget; 161 | buildConfigurationList = 251AD2421CB5549E00DB55A9 /* Build configuration list for PBXNativeTarget "AYCheckVersion" */; 162 | buildPhases = ( 163 | 251AD2111CB5549D00DB55A9 /* Sources */, 164 | 251AD2121CB5549D00DB55A9 /* Frameworks */, 165 | 251AD2131CB5549D00DB55A9 /* Resources */, 166 | ); 167 | buildRules = ( 168 | ); 169 | dependencies = ( 170 | ); 171 | name = AYCheckVersion; 172 | productName = AYCheckVersion; 173 | productReference = 251AD2151CB5549D00DB55A9 /* AYCheckVersion.app */; 174 | productType = "com.apple.product-type.application"; 175 | }; 176 | 251AD22D1CB5549E00DB55A9 /* AYCheckVersionTests */ = { 177 | isa = PBXNativeTarget; 178 | buildConfigurationList = 251AD2451CB5549E00DB55A9 /* Build configuration list for PBXNativeTarget "AYCheckVersionTests" */; 179 | buildPhases = ( 180 | 251AD22A1CB5549E00DB55A9 /* Sources */, 181 | 251AD22B1CB5549E00DB55A9 /* Frameworks */, 182 | 251AD22C1CB5549E00DB55A9 /* Resources */, 183 | ); 184 | buildRules = ( 185 | ); 186 | dependencies = ( 187 | 251AD2301CB5549E00DB55A9 /* PBXTargetDependency */, 188 | ); 189 | name = AYCheckVersionTests; 190 | productName = AYCheckVersionTests; 191 | productReference = 251AD22E1CB5549E00DB55A9 /* AYCheckVersionTests.xctest */; 192 | productType = "com.apple.product-type.bundle.unit-test"; 193 | }; 194 | 251AD2381CB5549E00DB55A9 /* AYCheckVersionUITests */ = { 195 | isa = PBXNativeTarget; 196 | buildConfigurationList = 251AD2481CB5549E00DB55A9 /* Build configuration list for PBXNativeTarget "AYCheckVersionUITests" */; 197 | buildPhases = ( 198 | 251AD2351CB5549E00DB55A9 /* Sources */, 199 | 251AD2361CB5549E00DB55A9 /* Frameworks */, 200 | 251AD2371CB5549E00DB55A9 /* Resources */, 201 | ); 202 | buildRules = ( 203 | ); 204 | dependencies = ( 205 | 251AD23B1CB5549E00DB55A9 /* PBXTargetDependency */, 206 | ); 207 | name = AYCheckVersionUITests; 208 | productName = AYCheckVersionUITests; 209 | productReference = 251AD2391CB5549E00DB55A9 /* AYCheckVersionUITests.xctest */; 210 | productType = "com.apple.product-type.bundle.ui-testing"; 211 | }; 212 | /* End PBXNativeTarget section */ 213 | 214 | /* Begin PBXProject section */ 215 | 251AD20D1CB5549D00DB55A9 /* Project object */ = { 216 | isa = PBXProject; 217 | attributes = { 218 | LastUpgradeCheck = 1000; 219 | ORGANIZATIONNAME = AYJkdev; 220 | TargetAttributes = { 221 | 251AD2141CB5549D00DB55A9 = { 222 | CreatedOnToolsVersion = 7.2.1; 223 | ProvisioningStyle = Manual; 224 | }; 225 | 251AD22D1CB5549E00DB55A9 = { 226 | CreatedOnToolsVersion = 7.2.1; 227 | TestTargetID = 251AD2141CB5549D00DB55A9; 228 | }; 229 | 251AD2381CB5549E00DB55A9 = { 230 | CreatedOnToolsVersion = 7.2.1; 231 | TestTargetID = 251AD2141CB5549D00DB55A9; 232 | }; 233 | }; 234 | }; 235 | buildConfigurationList = 251AD2101CB5549D00DB55A9 /* Build configuration list for PBXProject "AYCheckVersion" */; 236 | compatibilityVersion = "Xcode 3.2"; 237 | developmentRegion = English; 238 | hasScannedForEncodings = 0; 239 | knownRegions = ( 240 | en, 241 | Base, 242 | ); 243 | mainGroup = 251AD20C1CB5549D00DB55A9; 244 | productRefGroup = 251AD2161CB5549D00DB55A9 /* Products */; 245 | projectDirPath = ""; 246 | projectRoot = ""; 247 | targets = ( 248 | 251AD2141CB5549D00DB55A9 /* AYCheckVersion */, 249 | 251AD22D1CB5549E00DB55A9 /* AYCheckVersionTests */, 250 | 251AD2381CB5549E00DB55A9 /* AYCheckVersionUITests */, 251 | ); 252 | }; 253 | /* End PBXProject section */ 254 | 255 | /* Begin PBXResourcesBuildPhase section */ 256 | 251AD2131CB5549D00DB55A9 /* Resources */ = { 257 | isa = PBXResourcesBuildPhase; 258 | buildActionMask = 2147483647; 259 | files = ( 260 | 251AD2281CB5549D00DB55A9 /* LaunchScreen.storyboard in Resources */, 261 | 251AD2251CB5549D00DB55A9 /* Assets.xcassets in Resources */, 262 | 251AD2231CB5549D00DB55A9 /* Main.storyboard in Resources */, 263 | ); 264 | runOnlyForDeploymentPostprocessing = 0; 265 | }; 266 | 251AD22C1CB5549E00DB55A9 /* Resources */ = { 267 | isa = PBXResourcesBuildPhase; 268 | buildActionMask = 2147483647; 269 | files = ( 270 | ); 271 | runOnlyForDeploymentPostprocessing = 0; 272 | }; 273 | 251AD2371CB5549E00DB55A9 /* Resources */ = { 274 | isa = PBXResourcesBuildPhase; 275 | buildActionMask = 2147483647; 276 | files = ( 277 | ); 278 | runOnlyForDeploymentPostprocessing = 0; 279 | }; 280 | /* End PBXResourcesBuildPhase section */ 281 | 282 | /* Begin PBXSourcesBuildPhase section */ 283 | 251AD2111CB5549D00DB55A9 /* Sources */ = { 284 | isa = PBXSourcesBuildPhase; 285 | buildActionMask = 2147483647; 286 | files = ( 287 | 251AD2201CB5549D00DB55A9 /* ViewController.m in Sources */, 288 | 251AD21D1CB5549D00DB55A9 /* AppDelegate.m in Sources */, 289 | 251AD2541CB5557500DB55A9 /* AYCheckManager.m in Sources */, 290 | 251AD21A1CB5549D00DB55A9 /* main.m in Sources */, 291 | ); 292 | runOnlyForDeploymentPostprocessing = 0; 293 | }; 294 | 251AD22A1CB5549E00DB55A9 /* Sources */ = { 295 | isa = PBXSourcesBuildPhase; 296 | buildActionMask = 2147483647; 297 | files = ( 298 | 251AD2331CB5549E00DB55A9 /* AYCheckVersionTests.m in Sources */, 299 | ); 300 | runOnlyForDeploymentPostprocessing = 0; 301 | }; 302 | 251AD2351CB5549E00DB55A9 /* Sources */ = { 303 | isa = PBXSourcesBuildPhase; 304 | buildActionMask = 2147483647; 305 | files = ( 306 | 251AD23E1CB5549E00DB55A9 /* AYCheckVersionUITests.m in Sources */, 307 | ); 308 | runOnlyForDeploymentPostprocessing = 0; 309 | }; 310 | /* End PBXSourcesBuildPhase section */ 311 | 312 | /* Begin PBXTargetDependency section */ 313 | 251AD2301CB5549E00DB55A9 /* PBXTargetDependency */ = { 314 | isa = PBXTargetDependency; 315 | target = 251AD2141CB5549D00DB55A9 /* AYCheckVersion */; 316 | targetProxy = 251AD22F1CB5549E00DB55A9 /* PBXContainerItemProxy */; 317 | }; 318 | 251AD23B1CB5549E00DB55A9 /* PBXTargetDependency */ = { 319 | isa = PBXTargetDependency; 320 | target = 251AD2141CB5549D00DB55A9 /* AYCheckVersion */; 321 | targetProxy = 251AD23A1CB5549E00DB55A9 /* PBXContainerItemProxy */; 322 | }; 323 | /* End PBXTargetDependency section */ 324 | 325 | /* Begin PBXVariantGroup section */ 326 | 251AD2211CB5549D00DB55A9 /* Main.storyboard */ = { 327 | isa = PBXVariantGroup; 328 | children = ( 329 | 251AD2221CB5549D00DB55A9 /* Base */, 330 | ); 331 | name = Main.storyboard; 332 | sourceTree = ""; 333 | }; 334 | 251AD2261CB5549D00DB55A9 /* LaunchScreen.storyboard */ = { 335 | isa = PBXVariantGroup; 336 | children = ( 337 | 251AD2271CB5549D00DB55A9 /* Base */, 338 | ); 339 | name = LaunchScreen.storyboard; 340 | sourceTree = ""; 341 | }; 342 | /* End PBXVariantGroup section */ 343 | 344 | /* Begin XCBuildConfiguration section */ 345 | 224776AA1D7FF18A00C04981 /* ad hoc distribution */ = { 346 | isa = XCBuildConfiguration; 347 | buildSettings = { 348 | ALWAYS_SEARCH_USER_PATHS = NO; 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_BLOCK_CAPTURE_AUTORELEASING = YES; 354 | CLANG_WARN_BOOL_CONVERSION = YES; 355 | CLANG_WARN_COMMA = YES; 356 | CLANG_WARN_CONSTANT_CONVERSION = YES; 357 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 358 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 359 | CLANG_WARN_EMPTY_BODY = YES; 360 | CLANG_WARN_ENUM_CONVERSION = YES; 361 | CLANG_WARN_INFINITE_RECURSION = YES; 362 | CLANG_WARN_INT_CONVERSION = YES; 363 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 364 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 365 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 366 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 367 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 368 | CLANG_WARN_STRICT_PROTOTYPES = YES; 369 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 370 | CLANG_WARN_UNREACHABLE_CODE = YES; 371 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 372 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 373 | COPY_PHASE_STRIP = NO; 374 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 375 | ENABLE_NS_ASSERTIONS = NO; 376 | ENABLE_STRICT_OBJC_MSGSEND = YES; 377 | GCC_C_LANGUAGE_STANDARD = gnu99; 378 | GCC_NO_COMMON_BLOCKS = YES; 379 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 380 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 381 | GCC_WARN_UNDECLARED_SELECTOR = YES; 382 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 383 | GCC_WARN_UNUSED_FUNCTION = YES; 384 | GCC_WARN_UNUSED_VARIABLE = YES; 385 | IPHONEOS_DEPLOYMENT_TARGET = 9.2; 386 | MTL_ENABLE_DEBUG_INFO = NO; 387 | SDKROOT = iphoneos; 388 | VALIDATE_PRODUCT = YES; 389 | }; 390 | name = "ad hoc distribution"; 391 | }; 392 | 224776AB1D7FF18A00C04981 /* ad hoc distribution */ = { 393 | isa = XCBuildConfiguration; 394 | buildSettings = { 395 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 396 | CODE_SIGN_IDENTITY = "iPhone Developer"; 397 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 398 | CODE_SIGN_STYLE = Manual; 399 | DEVELOPMENT_TEAM = ""; 400 | INFOPLIST_FILE = AYCheckVersion/Info.plist; 401 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 402 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 403 | PRODUCT_BUNDLE_IDENTIFIER = com.tencent.mqq; 404 | PRODUCT_NAME = "$(TARGET_NAME)"; 405 | PROVISIONING_PROFILE_SPECIFIER = ""; 406 | }; 407 | name = "ad hoc distribution"; 408 | }; 409 | 224776AC1D7FF18A00C04981 /* ad hoc distribution */ = { 410 | isa = XCBuildConfiguration; 411 | buildSettings = { 412 | BUNDLE_LOADER = "$(TEST_HOST)"; 413 | INFOPLIST_FILE = AYCheckVersionTests/Info.plist; 414 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 415 | PRODUCT_BUNDLE_IDENTIFIER = com.ayjkdev.AYCheckVersionTests; 416 | PRODUCT_NAME = "$(TARGET_NAME)"; 417 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AYCheckVersion.app/AYCheckVersion"; 418 | }; 419 | name = "ad hoc distribution"; 420 | }; 421 | 224776AD1D7FF18A00C04981 /* ad hoc distribution */ = { 422 | isa = XCBuildConfiguration; 423 | buildSettings = { 424 | INFOPLIST_FILE = AYCheckVersionUITests/Info.plist; 425 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 426 | PRODUCT_BUNDLE_IDENTIFIER = com.ayjkdev.AYCheckVersionUITests; 427 | PRODUCT_NAME = "$(TARGET_NAME)"; 428 | TEST_TARGET_NAME = AYCheckVersion; 429 | USES_XCTRUNNER = YES; 430 | }; 431 | name = "ad hoc distribution"; 432 | }; 433 | 251AD2401CB5549E00DB55A9 /* Debug */ = { 434 | isa = XCBuildConfiguration; 435 | buildSettings = { 436 | ALWAYS_SEARCH_USER_PATHS = NO; 437 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 438 | CLANG_CXX_LIBRARY = "libc++"; 439 | CLANG_ENABLE_MODULES = YES; 440 | CLANG_ENABLE_OBJC_ARC = YES; 441 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 442 | CLANG_WARN_BOOL_CONVERSION = YES; 443 | CLANG_WARN_COMMA = YES; 444 | CLANG_WARN_CONSTANT_CONVERSION = YES; 445 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 446 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 447 | CLANG_WARN_EMPTY_BODY = YES; 448 | CLANG_WARN_ENUM_CONVERSION = YES; 449 | CLANG_WARN_INFINITE_RECURSION = YES; 450 | CLANG_WARN_INT_CONVERSION = YES; 451 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 452 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 453 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 454 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 455 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 456 | CLANG_WARN_STRICT_PROTOTYPES = YES; 457 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 458 | CLANG_WARN_UNREACHABLE_CODE = YES; 459 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 460 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 461 | COPY_PHASE_STRIP = NO; 462 | DEBUG_INFORMATION_FORMAT = dwarf; 463 | ENABLE_STRICT_OBJC_MSGSEND = YES; 464 | ENABLE_TESTABILITY = YES; 465 | GCC_C_LANGUAGE_STANDARD = gnu99; 466 | GCC_DYNAMIC_NO_PIC = NO; 467 | GCC_NO_COMMON_BLOCKS = YES; 468 | GCC_OPTIMIZATION_LEVEL = 0; 469 | GCC_PREPROCESSOR_DEFINITIONS = ( 470 | "DEBUG=1", 471 | "$(inherited)", 472 | ); 473 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 474 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 475 | GCC_WARN_UNDECLARED_SELECTOR = YES; 476 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 477 | GCC_WARN_UNUSED_FUNCTION = YES; 478 | GCC_WARN_UNUSED_VARIABLE = YES; 479 | IPHONEOS_DEPLOYMENT_TARGET = 9.2; 480 | MTL_ENABLE_DEBUG_INFO = YES; 481 | ONLY_ACTIVE_ARCH = YES; 482 | SDKROOT = iphoneos; 483 | }; 484 | name = Debug; 485 | }; 486 | 251AD2411CB5549E00DB55A9 /* Release */ = { 487 | isa = XCBuildConfiguration; 488 | buildSettings = { 489 | ALWAYS_SEARCH_USER_PATHS = NO; 490 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 491 | CLANG_CXX_LIBRARY = "libc++"; 492 | CLANG_ENABLE_MODULES = YES; 493 | CLANG_ENABLE_OBJC_ARC = YES; 494 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 495 | CLANG_WARN_BOOL_CONVERSION = YES; 496 | CLANG_WARN_COMMA = YES; 497 | CLANG_WARN_CONSTANT_CONVERSION = YES; 498 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 499 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 500 | CLANG_WARN_EMPTY_BODY = YES; 501 | CLANG_WARN_ENUM_CONVERSION = YES; 502 | CLANG_WARN_INFINITE_RECURSION = YES; 503 | CLANG_WARN_INT_CONVERSION = YES; 504 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 505 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 506 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 507 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 508 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 509 | CLANG_WARN_STRICT_PROTOTYPES = YES; 510 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 511 | CLANG_WARN_UNREACHABLE_CODE = YES; 512 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 513 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 514 | COPY_PHASE_STRIP = NO; 515 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 516 | ENABLE_NS_ASSERTIONS = NO; 517 | ENABLE_STRICT_OBJC_MSGSEND = YES; 518 | GCC_C_LANGUAGE_STANDARD = gnu99; 519 | GCC_NO_COMMON_BLOCKS = YES; 520 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 521 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 522 | GCC_WARN_UNDECLARED_SELECTOR = YES; 523 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 524 | GCC_WARN_UNUSED_FUNCTION = YES; 525 | GCC_WARN_UNUSED_VARIABLE = YES; 526 | IPHONEOS_DEPLOYMENT_TARGET = 9.2; 527 | MTL_ENABLE_DEBUG_INFO = NO; 528 | SDKROOT = iphoneos; 529 | VALIDATE_PRODUCT = YES; 530 | }; 531 | name = Release; 532 | }; 533 | 251AD2431CB5549E00DB55A9 /* Debug */ = { 534 | isa = XCBuildConfiguration; 535 | buildSettings = { 536 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 537 | CODE_SIGN_IDENTITY = "iPhone Developer"; 538 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 539 | CODE_SIGN_STYLE = Manual; 540 | DEVELOPMENT_TEAM = ""; 541 | INFOPLIST_FILE = AYCheckVersion/Info.plist; 542 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 543 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 544 | PRODUCT_BUNDLE_IDENTIFIER = com.tencent.mqq; 545 | PRODUCT_NAME = "$(TARGET_NAME)"; 546 | PROVISIONING_PROFILE_SPECIFIER = ""; 547 | }; 548 | name = Debug; 549 | }; 550 | 251AD2441CB5549E00DB55A9 /* Release */ = { 551 | isa = XCBuildConfiguration; 552 | buildSettings = { 553 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 554 | CODE_SIGN_IDENTITY = "iPhone Developer"; 555 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 556 | CODE_SIGN_STYLE = Manual; 557 | DEVELOPMENT_TEAM = ""; 558 | INFOPLIST_FILE = AYCheckVersion/Info.plist; 559 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 560 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 561 | PRODUCT_BUNDLE_IDENTIFIER = com.tencent.mqq; 562 | PRODUCT_NAME = "$(TARGET_NAME)"; 563 | PROVISIONING_PROFILE_SPECIFIER = ""; 564 | }; 565 | name = Release; 566 | }; 567 | 251AD2461CB5549E00DB55A9 /* Debug */ = { 568 | isa = XCBuildConfiguration; 569 | buildSettings = { 570 | BUNDLE_LOADER = "$(TEST_HOST)"; 571 | INFOPLIST_FILE = AYCheckVersionTests/Info.plist; 572 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 573 | PRODUCT_BUNDLE_IDENTIFIER = com.ayjkdev.AYCheckVersionTests; 574 | PRODUCT_NAME = "$(TARGET_NAME)"; 575 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AYCheckVersion.app/AYCheckVersion"; 576 | }; 577 | name = Debug; 578 | }; 579 | 251AD2471CB5549E00DB55A9 /* Release */ = { 580 | isa = XCBuildConfiguration; 581 | buildSettings = { 582 | BUNDLE_LOADER = "$(TEST_HOST)"; 583 | INFOPLIST_FILE = AYCheckVersionTests/Info.plist; 584 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 585 | PRODUCT_BUNDLE_IDENTIFIER = com.ayjkdev.AYCheckVersionTests; 586 | PRODUCT_NAME = "$(TARGET_NAME)"; 587 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AYCheckVersion.app/AYCheckVersion"; 588 | }; 589 | name = Release; 590 | }; 591 | 251AD2491CB5549E00DB55A9 /* Debug */ = { 592 | isa = XCBuildConfiguration; 593 | buildSettings = { 594 | INFOPLIST_FILE = AYCheckVersionUITests/Info.plist; 595 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 596 | PRODUCT_BUNDLE_IDENTIFIER = com.ayjkdev.AYCheckVersionUITests; 597 | PRODUCT_NAME = "$(TARGET_NAME)"; 598 | TEST_TARGET_NAME = AYCheckVersion; 599 | USES_XCTRUNNER = YES; 600 | }; 601 | name = Debug; 602 | }; 603 | 251AD24A1CB5549E00DB55A9 /* Release */ = { 604 | isa = XCBuildConfiguration; 605 | buildSettings = { 606 | INFOPLIST_FILE = AYCheckVersionUITests/Info.plist; 607 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 608 | PRODUCT_BUNDLE_IDENTIFIER = com.ayjkdev.AYCheckVersionUITests; 609 | PRODUCT_NAME = "$(TARGET_NAME)"; 610 | TEST_TARGET_NAME = AYCheckVersion; 611 | USES_XCTRUNNER = YES; 612 | }; 613 | name = Release; 614 | }; 615 | /* End XCBuildConfiguration section */ 616 | 617 | /* Begin XCConfigurationList section */ 618 | 251AD2101CB5549D00DB55A9 /* Build configuration list for PBXProject "AYCheckVersion" */ = { 619 | isa = XCConfigurationList; 620 | buildConfigurations = ( 621 | 251AD2401CB5549E00DB55A9 /* Debug */, 622 | 251AD2411CB5549E00DB55A9 /* Release */, 623 | 224776AA1D7FF18A00C04981 /* ad hoc distribution */, 624 | ); 625 | defaultConfigurationIsVisible = 0; 626 | defaultConfigurationName = Release; 627 | }; 628 | 251AD2421CB5549E00DB55A9 /* Build configuration list for PBXNativeTarget "AYCheckVersion" */ = { 629 | isa = XCConfigurationList; 630 | buildConfigurations = ( 631 | 251AD2431CB5549E00DB55A9 /* Debug */, 632 | 251AD2441CB5549E00DB55A9 /* Release */, 633 | 224776AB1D7FF18A00C04981 /* ad hoc distribution */, 634 | ); 635 | defaultConfigurationIsVisible = 0; 636 | defaultConfigurationName = Release; 637 | }; 638 | 251AD2451CB5549E00DB55A9 /* Build configuration list for PBXNativeTarget "AYCheckVersionTests" */ = { 639 | isa = XCConfigurationList; 640 | buildConfigurations = ( 641 | 251AD2461CB5549E00DB55A9 /* Debug */, 642 | 251AD2471CB5549E00DB55A9 /* Release */, 643 | 224776AC1D7FF18A00C04981 /* ad hoc distribution */, 644 | ); 645 | defaultConfigurationIsVisible = 0; 646 | defaultConfigurationName = Release; 647 | }; 648 | 251AD2481CB5549E00DB55A9 /* Build configuration list for PBXNativeTarget "AYCheckVersionUITests" */ = { 649 | isa = XCConfigurationList; 650 | buildConfigurations = ( 651 | 251AD2491CB5549E00DB55A9 /* Debug */, 652 | 251AD24A1CB5549E00DB55A9 /* Release */, 653 | 224776AD1D7FF18A00C04981 /* ad hoc distribution */, 654 | ); 655 | defaultConfigurationIsVisible = 0; 656 | defaultConfigurationName = Release; 657 | }; 658 | /* End XCConfigurationList section */ 659 | }; 660 | rootObject = 251AD20D1CB5549D00DB55A9 /* Project object */; 661 | } 662 | -------------------------------------------------------------------------------- /AYCheckVersion.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AYCheckVersion/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // AYCheckVersion 4 | // 5 | // Created by Andy on 16/4/6. 6 | // Copyright © 2016年 AYJkdev. 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 | -------------------------------------------------------------------------------- /AYCheckVersion/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // AYCheckVersion 4 | // 5 | // Created by Andy on 16/4/6. 6 | // Copyright © 2016年 AYJkdev. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 18 | return YES; 19 | } 20 | 21 | - (void)applicationWillResignActive:(UIApplication *)application { 22 | // 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. 23 | // 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. 24 | } 25 | 26 | - (void)applicationDidEnterBackground:(UIApplication *)application { 27 | // 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. 28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 29 | } 30 | 31 | - (void)applicationWillEnterForeground:(UIApplication *)application { 32 | // 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. 33 | 34 | } 35 | 36 | - (void)applicationDidBecomeActive:(UIApplication *)application { 37 | // 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. 38 | } 39 | 40 | - (void)applicationWillTerminate:(UIApplication *)application { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /AYCheckVersion/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 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /AYCheckVersion/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 | -------------------------------------------------------------------------------- /AYCheckVersion/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 | -------------------------------------------------------------------------------- /AYCheckVersion/Classes/AYCheckManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // AYCheckManager.h 3 | // AYCheckVersion 4 | // 5 | // Created by Andy on 16/4/6. 6 | // Copyright © 2016年 AYJkdev. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AYCheckManager : NSObject 12 | /** 13 | * open APPStore inside your APP, default is No. 14 | */ 15 | @property (nonatomic, assign) BOOL openAPPStoreInsideAPP; 16 | // if you can't get the update info of your APP. Set countryAbbreviation of the sale area. like `countryAbbreviation = @"cn"`,`countryAbbreviation = @"us"`.General, you don't need to set this property. 17 | @property (nonatomic, copy) NSString *countryAbbreviation; 18 | /** 19 | * get a singleton of the Check Manager 20 | */ 21 | + (instancetype)sharedCheckManager; 22 | /** 23 | * start check version with default param. 24 | */ 25 | - (void)checkVersion; 26 | /** 27 | * start check version with AlertTitle,NextTimeTitle,ConfimTitle. 28 | */ 29 | - (void)checkVersionWithAlertTitle:(NSString *)alertTitle nextTimeTitle:(NSString *)nextTimeTitle confimTitle:(NSString *)confimTitle; 30 | /** 31 | * start check version with AlertTitle,NextTimeTitle,ConfimTitle,skipVersionTitle. 32 | */ 33 | - (void)checkVersionWithAlertTitle:(NSString *)alertTitle nextTimeTitle:(NSString *)nextTimeTitle confimTitle:(NSString *)confimTitle skipVersionTitle:(NSString *)skipVersionTitle; 34 | @end 35 | -------------------------------------------------------------------------------- /AYCheckVersion/Classes/AYCheckManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // AYCheckManager.m 3 | // AYCheckVersion 4 | // com.ayjkdev.AYCheckVersion 5 | // Created by Andy on 16/4/6. 6 | // Copyright © 2016年 AYJkdev. All rights reserved. 7 | // 8 | 9 | #import "AYCheckManager.h" 10 | #import 11 | #define REQUEST_SUCCEED 200 12 | #define CURRENT_VERSION [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"] 13 | #define BUNDLE_IDENTIFIER [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleIdentifier"] 14 | #define SYSTEM_VERSION_8_OR_ABOVE (([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)? (YES):(NO)) 15 | #define TRACK_ID @"TRACKID" 16 | #define APP_LAST_VERSION @"APPLastVersion" 17 | #define APP_RELEASE_NOTES @"APPReleaseNotes" 18 | #define APP_TRACK_VIEW_URL @"APPTRACKVIEWURL" 19 | #define SPECIAL_MODE_CHECK_URL @"https://itunes.apple.com/lookup?country=%@&bundleId=%@×tamp=%ld" 20 | #define NORMAL_MODE_CHECK_URL @"https://itunes.apple.com/lookup?bundleId=%@×tamp=%ld" 21 | #define SKIP_CURRENT_VERSION @"SKIPCURRENTVERSION" 22 | #define SKIP_VERSION @"SKIPVERSION" 23 | @interface AYCheckManager () 24 | 25 | @property (nonatomic, copy) NSString *nextTimeTitle; 26 | @property (nonatomic, copy) NSString *confimTitle; 27 | @property (nonatomic, copy) NSString *alertTitle; 28 | @property (nonatomic, copy) NSString *skipVersionTitle; 29 | @end 30 | 31 | @implementation AYCheckManager 32 | 33 | static AYCheckManager *checkManager = nil; 34 | + (instancetype)sharedCheckManager { 35 | static dispatch_once_t onceToken; 36 | dispatch_once(&onceToken, ^{ 37 | checkManager = [[AYCheckManager alloc] init]; 38 | checkManager.nextTimeTitle = @"下次提示"; 39 | checkManager.confimTitle = @"前往更新"; 40 | checkManager.alertTitle = @"发现新版本"; 41 | checkManager.skipVersionTitle = nil; 42 | }); 43 | return checkManager; 44 | } 45 | 46 | - (void)checkVersion { 47 | [self checkVersionWithAlertTitle:self.alertTitle nextTimeTitle:self.nextTimeTitle confimTitle:self.confimTitle]; 48 | } 49 | 50 | - (void)checkVersionWithAlertTitle:(NSString *)alertTitle nextTimeTitle:(NSString *)nextTimeTitle confimTitle:(NSString *)confimTitle { 51 | [self checkVersionWithAlertTitle:alertTitle nextTimeTitle:nextTimeTitle confimTitle:confimTitle skipVersionTitle:nil]; 52 | } 53 | 54 | - (void)checkVersionWithAlertTitle:(NSString *)alertTitle nextTimeTitle:(NSString *)nextTimeTitle confimTitle:(NSString *)confimTitle skipVersionTitle:(NSString *)skipVersionTitle { 55 | self.alertTitle = alertTitle; 56 | self.nextTimeTitle = nextTimeTitle; 57 | self.confimTitle = confimTitle; 58 | self.skipVersionTitle = skipVersionTitle; 59 | [checkManager getInfoFromAppStore]; 60 | } 61 | 62 | - (void)getInfoFromAppStore { 63 | NSInteger timeStamp = [[NSDate date] timeIntervalSince1970]; 64 | NSURL *requestURL; 65 | if (self.countryAbbreviation == nil) { 66 | requestURL = [NSURL URLWithString:[NSString stringWithFormat:NORMAL_MODE_CHECK_URL,BUNDLE_IDENTIFIER,timeStamp]]; 67 | } else { 68 | requestURL = [NSURL URLWithString:[NSString stringWithFormat:SPECIAL_MODE_CHECK_URL,self.countryAbbreviation,BUNDLE_IDENTIFIER,timeStamp]]; 69 | } 70 | NSURLRequest *request = [NSURLRequest requestWithURL:requestURL]; 71 | NSURLSession *session = [NSURLSession sharedSession]; 72 | 73 | NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { 74 | 75 | NSHTTPURLResponse *urlResponse = (NSHTTPURLResponse *)response; 76 | if (data == nil) { 77 | return ; 78 | } 79 | if (urlResponse.statusCode == REQUEST_SUCCEED) { 80 | @try { 81 | NSDictionary *responseDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&error]; 82 | NSUserDefaults *userDefault = [NSUserDefaults standardUserDefaults]; 83 | if ([responseDic[@"resultCount"] intValue] == 1) { 84 | NSArray *results = responseDic[@"results"]; 85 | NSDictionary *resultDic = [results firstObject]; 86 | [userDefault setObject:resultDic[@"version"] forKey:APP_LAST_VERSION]; 87 | [userDefault setObject:resultDic[@"releaseNotes"] forKey:APP_RELEASE_NOTES]; 88 | [userDefault setObject:resultDic[@"trackViewUrl"] forKey:APP_TRACK_VIEW_URL]; 89 | [userDefault setObject:resultDic[@"trackId"] forKey:TRACK_ID]; 90 | if ([resultDic[@"version"] isEqualToString:CURRENT_VERSION] || ![[userDefault objectForKey:SKIP_VERSION] isEqualToString:resultDic[@"version"]]) { 91 | [userDefault setBool:NO forKey:SKIP_CURRENT_VERSION]; 92 | } 93 | [userDefault synchronize]; 94 | #ifdef DEBUG 95 | NSLog(@"*****************\nAPP_LAST_VERSION:\n%@\nAPP_RELEASE_NOTES:\n%@\n*****************",[userDefault objectForKey:APP_LAST_VERSION],[userDefault objectForKey:APP_RELEASE_NOTES]); 96 | #endif 97 | dispatch_async(dispatch_get_main_queue(), ^{ 98 | 99 | if (![[userDefault objectForKey:SKIP_CURRENT_VERSION] boolValue]) { 100 | if (![self isEqualByCompareLastVersion:resultDic[@"version"] withCurrentVersion:CURRENT_VERSION]) { 101 | [self compareWithCurrentVersion]; 102 | } 103 | } 104 | }); 105 | } 106 | } @catch (NSException *exception) { 107 | NSLog(@"exception.name = %@, exception.reason = %@", exception.name, exception.reason); 108 | } @finally { 109 | 110 | } 111 | } 112 | }]; 113 | [dataTask resume]; 114 | } 115 | 116 | /** 117 | * 比较当前版本号是否与沙盒中的版本号相同 118 | */ 119 | //- (BOOL)isEqualByCompareLastVersion:(NSString *)lastVersion withCurrentVersion:(NSString *)currentVersion { 120 | // NSArray *lastVersionArray = [lastVersion componentsSeparatedByString:@"."]; 121 | // NSArray *currentVersionArray = [currentVersion componentsSeparatedByString:@"."]; 122 | // if (lastVersionArray.count != currentVersionArray.count) { 123 | // return NO; 124 | // } 125 | // for (int index = 0; index < lastVersionArray.count; index++) { 126 | // if ([currentVersionArray[index] integerValue] != [lastVersionArray[index] integerValue]) { 127 | // return NO; 128 | // } 129 | // } 130 | // return YES; 131 | //} 132 | 133 | - (BOOL)isEqualByCompareLastVersion:(NSString *)lastVersion withCurrentVersion:(NSString *)currentVersion { 134 | NSMutableArray *lastVersionArray = [[lastVersion componentsSeparatedByString:@"."] mutableCopy]; 135 | NSMutableArray *currentVersionArray = [[currentVersion componentsSeparatedByString:@"."] mutableCopy]; 136 | int modifyCount = abs((int)(lastVersionArray.count - currentVersionArray.count)); 137 | if (lastVersionArray.count > currentVersionArray.count) { 138 | for (int index = 0; index < modifyCount; index ++) { 139 | [currentVersionArray addObject:@"0"]; 140 | } 141 | } else if (lastVersionArray.count < currentVersionArray.count) { 142 | for (int index = 0; index < modifyCount; index ++) { 143 | [lastVersionArray addObject:@"0"]; 144 | } 145 | } 146 | for (int index = 0; index < lastVersionArray.count; index++) { 147 | if ([currentVersionArray[index] integerValue] > [lastVersionArray[index] integerValue]) { 148 | return YES; 149 | } else if ([currentVersionArray[index] integerValue] < [lastVersionArray[index] integerValue]) { 150 | return NO; 151 | } 152 | } 153 | return NO; 154 | } 155 | 156 | - (double)floatForVersion:(NSString *)version { 157 | NSArray *versionArray = [version componentsSeparatedByString:@"."]; 158 | NSMutableString *versionString = @"".mutableCopy; 159 | for (int index = 0; index < versionArray.count; index++) { 160 | [versionString appendString:versionArray[index]]; 161 | if (!index) { 162 | [versionString appendString:@"."]; 163 | } 164 | } 165 | return versionString.doubleValue; 166 | } 167 | 168 | - (void)compareWithCurrentVersion { 169 | NSUserDefaults *userDefault = [NSUserDefaults standardUserDefaults]; 170 | NSString *updateMessage = [userDefault objectForKey:APP_RELEASE_NOTES]; 171 | if (![[userDefault objectForKey:APP_LAST_VERSION] isEqualToString:CURRENT_VERSION]) { 172 | if (SYSTEM_VERSION_8_OR_ABOVE) { 173 | __weak typeof(self) weakSelf = self; 174 | UIAlertController *alertControler = [UIAlertController alertControllerWithTitle:self.alertTitle message:updateMessage preferredStyle:UIAlertControllerStyleAlert]; 175 | UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:self.nextTimeTitle style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { 176 | 177 | }]; 178 | UIAlertAction *confimAction = [UIAlertAction actionWithTitle:self.confimTitle style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { 179 | 180 | [weakSelf openAPPStore]; 181 | }]; 182 | [alertControler addAction:confimAction]; 183 | [alertControler addAction:cancelAction]; 184 | if (self.skipVersionTitle != nil) { 185 | UIAlertAction *skipVersionAction = [UIAlertAction actionWithTitle:self.skipVersionTitle style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) { 186 | 187 | [userDefault setBool:YES forKey:SKIP_CURRENT_VERSION]; 188 | [userDefault setObject:[userDefault objectForKey:APP_LAST_VERSION] forKey:SKIP_VERSION]; 189 | }]; 190 | [alertControler addAction:skipVersionAction]; 191 | } 192 | [[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:alertControler animated:YES completion:^{ 193 | 194 | }]; 195 | } else { 196 | UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:self.alertTitle message:updateMessage delegate:self cancelButtonTitle:self.nextTimeTitle otherButtonTitles:self.confimTitle, self.skipVersionTitle,nil]; 197 | [alertView show]; 198 | } 199 | } 200 | } 201 | 202 | - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { 203 | if (buttonIndex != 0) { 204 | [self openAPPStore]; 205 | } 206 | } 207 | 208 | - (void)openAPPStore { 209 | NSUserDefaults *userDefault = [NSUserDefaults standardUserDefaults]; 210 | if (!self.openAPPStoreInsideAPP) { 211 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[userDefault objectForKey:APP_TRACK_VIEW_URL]]]; 212 | } else { 213 | SKStoreProductViewController *storeViewController = [[SKStoreProductViewController alloc] init]; 214 | storeViewController.delegate = self; 215 | 216 | NSDictionary *parametersDic = @{SKStoreProductParameterITunesItemIdentifier:[userDefault objectForKey:TRACK_ID]}; 217 | [storeViewController loadProductWithParameters:parametersDic completionBlock:^(BOOL result, NSError * _Nullable error) { 218 | 219 | if (result) { 220 | [[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:storeViewController animated:YES completion:^{ 221 | 222 | }]; 223 | } 224 | }]; 225 | } 226 | 227 | } 228 | 229 | - (void)productViewControllerDidFinish:(SKStoreProductViewController *)viewController { 230 | [[UIApplication sharedApplication].keyWindow.rootViewController dismissViewControllerAnimated:YES completion:^{ 231 | 232 | }]; 233 | } 234 | 235 | @end 236 | -------------------------------------------------------------------------------- /AYCheckVersion/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 | 7.6.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | NSAppTransportSecurity 26 | 27 | NSAllowsArbitraryLoads 28 | 29 | 30 | UILaunchStoryboardName 31 | LaunchScreen 32 | UIMainStoryboardFile 33 | Main 34 | UIRequiredDeviceCapabilities 35 | 36 | armv7 37 | 38 | UISupportedInterfaceOrientations 39 | 40 | UIInterfaceOrientationPortrait 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /AYCheckVersion/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // AYCheckVersion 4 | // 5 | // Created by Andy on 16/4/6. 6 | // Copyright © 2016年 AYJkdev. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /AYCheckVersion/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // AYCheckVersion 4 | // 5 | // Created by Andy on 16/4/6. 6 | // Copyright © 2016年 AYJkdev. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "AYCheckManager.h" 11 | 12 | //com.tencent.xin 13 | //com.facebook.Facebook 14 | @interface ViewController () 15 | 16 | @end 17 | 18 | @implementation ViewController 19 | 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | AYCheckManager *checkManger = [AYCheckManager sharedCheckManager]; 23 | checkManger.countryAbbreviation = @"cn"; 24 | checkManger.openAPPStoreInsideAPP = YES; 25 | // [checkManger checkVersion]; 26 | [checkManger checkVersionWithAlertTitle:@"发现新版本" nextTimeTitle:@"下次提示" confimTitle:@"前往更新" skipVersionTitle:@"跳过当前版本"]; 27 | } 28 | 29 | - (void)didReceiveMemoryWarning { 30 | [super didReceiveMemoryWarning]; 31 | // Dispose of any resources that can be recreated. 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /AYCheckVersion/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // AYCheckVersion 4 | // 5 | // Created by Andy on 16/4/6. 6 | // Copyright © 2016年 AYJkdev. 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 | -------------------------------------------------------------------------------- /AYCheckVersionTests/AYCheckVersionTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // AYCheckVersionTests.m 3 | // AYCheckVersionTests 4 | // 5 | // Created by Andy on 16/4/6. 6 | // Copyright © 2016年 AYJkdev. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AYCheckVersionTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation AYCheckVersionTests 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 | -------------------------------------------------------------------------------- /AYCheckVersionTests/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 | -------------------------------------------------------------------------------- /AYCheckVersionUITests/AYCheckVersionUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // AYCheckVersionUITests.m 3 | // AYCheckVersionUITests 4 | // 5 | // Created by Andy on 16/4/6. 6 | // Copyright © 2016年 AYJkdev. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AYCheckVersionUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation AYCheckVersionUITests 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 | -------------------------------------------------------------------------------- /AYCheckVersionUITests/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 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 黄鹏飞 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 | # AYCheckVersion 2 | 3 | [![LICENSE](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/AYJk/AYPageControl/blob/master/License)  4 | [![SUPPORT](https://img.shields.io/badge/support-iOS%207%2B%20-blue.svg)](https://en.wikipedia.org/wiki/IOS_7)  5 | ![CocoaPods Version](https://img.shields.io/badge/pod-v1.3.0-brightgreen.svg)  6 | 7 | 我的博客中有详尽的实现过程和相关说明: 8 | [iOS利用iTunesLookup检查更新](http://ayjkdev.top/2016/04/06/update-in-app-with-itunes-lookup/) 9 | 10 | # 介绍 11 | 12 | 这是一个从AppStore检测最新版本的工具类。 13 | *Debug环境下输出取回的应用更新信息,Release环境下不输出* 14 | # 安装 15 | 16 | 推荐使用[CocoaPods](http://cocoapods.org/)进行安装。 17 | 18 | ```ruby 19 | pod 'AYCheckVersion' 20 | ``` 21 | 22 | 然后输入 `pod install` or `pod update`。将会安装最新版本的AYCheckVersion。 23 | 24 | 最后导入头文件\ 25 | 26 | # 用法 27 | 28 | ```objc 29 | AYCheckManager *checkManger = [AYCheckManager sharedCheckManager]; 30 | [checkManger checkVersion]; 31 | ``` 32 | 33 | 使用默认属性进行版本的检测。 34 | 35 | ```objc 36 | - (void)checkVersion; 37 | ``` 38 | 39 | 自定义警示框的标题,下次提示的标题,立即更新的标题。 40 | 41 | ```objc 42 | - (void)checkVersionWithAlertTitle:(NSString *)alertTitle nextTimeTitle:(NSString *)nextTimeTitle confimTitle:(NSString *)confimTitle; 43 | ``` 44 | 45 | 自定义警示框的标题,下次提示的标题,立即更新的标题,跳过该版本的标题。 46 | 47 | ```objc 48 | - (void)checkVersionWithAlertTitle:(NSString *)alertTitle nextTimeTitle:(NSString *)nextTimeTitle confimTitle:(NSString *)confimTitle skipVersionTitle:(NSString *)skipVersionTitle; 49 | ``` 50 | 51 | 如果你想在当前应用中以模态视图的形式打开AppStore,请设置`openAPPStoreInsideAPP`,默认从应用跳转出去到AppStore。 52 | 53 | ```objc 54 | checkManger.openAPPStoreInsideAPP = YES; 55 | ``` 56 | 57 | 如果你无法检测到你的App的最新版。请设置你应用的销售地区,如:`countryAbbreviation = @"cn"`,`countryAbbreviation = @"us"`。通常情况下,你不需要设置这个属性。 58 | 59 | ```objc 60 | checkManger.countryAbbreviation = @"cn"; 61 | ``` 62 | 63 | # 版本更新 64 | v 1.3.5 解决修复苹果修改数据格式造成的问题。[issues10](https://github.com/AYJk/AYCheckVersion/issues/10) 65 | 66 | v 1.3.0 解决CDN缓存导致的更新延迟问题。[issues9](https://github.com/AYJk/AYCheckVersion/issues/9) 67 | 68 | v 1.2.0 修复个别线上版本号和提审版本号带来的问题 69 | 70 | v 1.1.2 修复由于iTunes被墙使返回的data为nil所导致的异常 [issues3](https://github.com/AYJk/AYCheckVersion/issues/3),去除debug开关,debug环境下默认输出更新内容 71 | 72 | v 1.1.0 修复因项目个别version问题导致的bug 73 | 74 | v 1.0.1 添加debug开关,输出当前更新信息 75 | 76 | v 1.0.0 首次提交 77 | 78 | # 许可证 79 | 80 | AYCheckVersion 使用 MIT 许可证,详情见 LICENSE 文件。 81 | 82 | 83 | --------------------------------------------------------------------------------