├── .gitignore ├── .travis.yml ├── Example ├── .idea │ ├── .name │ ├── Example.iml │ ├── misc.xml │ ├── modules.xml │ ├── workspace.xml │ └── xcode.xml ├── Podfile ├── Podfile.lock ├── Pods │ ├── AFNetworking │ │ ├── AFNetworking │ │ │ ├── AFHTTPSessionManager.h │ │ │ ├── AFHTTPSessionManager.m │ │ │ ├── AFNetworkReachabilityManager.h │ │ │ ├── AFNetworkReachabilityManager.m │ │ │ ├── AFNetworking.h │ │ │ ├── AFSecurityPolicy.h │ │ │ ├── AFSecurityPolicy.m │ │ │ ├── AFURLRequestSerialization.h │ │ │ ├── AFURLRequestSerialization.m │ │ │ ├── AFURLResponseSerialization.h │ │ │ ├── AFURLResponseSerialization.m │ │ │ ├── AFURLSessionManager.h │ │ │ └── AFURLSessionManager.m │ │ ├── LICENSE │ │ ├── README.md │ │ └── UIKit+AFNetworking │ │ │ ├── AFAutoPurgingImageCache.h │ │ │ ├── AFAutoPurgingImageCache.m │ │ │ ├── AFImageDownloader.h │ │ │ ├── AFImageDownloader.m │ │ │ ├── AFNetworkActivityIndicatorManager.h │ │ │ ├── AFNetworkActivityIndicatorManager.m │ │ │ ├── UIActivityIndicatorView+AFNetworking.h │ │ │ ├── UIActivityIndicatorView+AFNetworking.m │ │ │ ├── UIButton+AFNetworking.h │ │ │ ├── UIButton+AFNetworking.m │ │ │ ├── UIImage+AFNetworking.h │ │ │ ├── UIImageView+AFNetworking.h │ │ │ ├── UIImageView+AFNetworking.m │ │ │ ├── UIKit+AFNetworking.h │ │ │ ├── UIProgressView+AFNetworking.h │ │ │ ├── UIProgressView+AFNetworking.m │ │ │ ├── UIRefreshControl+AFNetworking.h │ │ │ ├── UIRefreshControl+AFNetworking.m │ │ │ ├── UIWebView+AFNetworking.h │ │ │ └── UIWebView+AFNetworking.m │ ├── FMDB │ │ ├── LICENSE.txt │ │ ├── README.markdown │ │ └── src │ │ │ └── fmdb │ │ │ ├── FMDB.h │ │ │ ├── FMDatabase.h │ │ │ ├── FMDatabase.m │ │ │ ├── FMDatabaseAdditions.h │ │ │ ├── FMDatabaseAdditions.m │ │ │ ├── FMDatabasePool.h │ │ │ ├── FMDatabasePool.m │ │ │ ├── FMDatabaseQueue.h │ │ │ ├── FMDatabaseQueue.m │ │ │ ├── FMResultSet.h │ │ │ └── FMResultSet.m │ ├── Local Podspecs │ │ └── SSJNetWork.podspec.json │ ├── Manifest.lock │ ├── Pods.xcodeproj │ │ └── project.pbxproj │ ├── SQLCipher │ │ ├── LICENSE │ │ ├── README.md │ │ ├── sqlite3.c │ │ └── sqlite3.h │ ├── Target Support Files │ │ ├── AFNetworking │ │ │ ├── AFNetworking-Info.plist │ │ │ ├── AFNetworking-dummy.m │ │ │ ├── AFNetworking-prefix.pch │ │ │ ├── AFNetworking-umbrella.h │ │ │ ├── AFNetworking.modulemap │ │ │ └── AFNetworking.xcconfig │ │ ├── FMDB │ │ │ ├── FMDB-Info.plist │ │ │ ├── FMDB-dummy.m │ │ │ ├── FMDB-prefix.pch │ │ │ ├── FMDB-umbrella.h │ │ │ ├── FMDB.modulemap │ │ │ └── FMDB.xcconfig │ │ ├── Pods-SSJNetWork_Example │ │ │ ├── Pods-SSJNetWork_Example-Info.plist │ │ │ ├── Pods-SSJNetWork_Example-acknowledgements.markdown │ │ │ ├── Pods-SSJNetWork_Example-acknowledgements.plist │ │ │ ├── Pods-SSJNetWork_Example-dummy.m │ │ │ ├── Pods-SSJNetWork_Example-frameworks.sh │ │ │ ├── Pods-SSJNetWork_Example-umbrella.h │ │ │ ├── Pods-SSJNetWork_Example.debug.xcconfig │ │ │ ├── Pods-SSJNetWork_Example.modulemap │ │ │ └── Pods-SSJNetWork_Example.release.xcconfig │ │ ├── SQLCipher │ │ │ ├── SQLCipher-Info.plist │ │ │ ├── SQLCipher-dummy.m │ │ │ ├── SQLCipher-prefix.pch │ │ │ ├── SQLCipher-umbrella.h │ │ │ ├── SQLCipher.modulemap │ │ │ └── SQLCipher.xcconfig │ │ ├── SSJNetWork │ │ │ ├── SSJNetWork-Info.plist │ │ │ ├── SSJNetWork-dummy.m │ │ │ ├── SSJNetWork-prefix.pch │ │ │ ├── SSJNetWork-umbrella.h │ │ │ ├── SSJNetWork.modulemap │ │ │ └── SSJNetWork.xcconfig │ │ └── YYCache │ │ │ ├── YYCache-Info.plist │ │ │ ├── YYCache-dummy.m │ │ │ ├── YYCache-prefix.pch │ │ │ ├── YYCache-umbrella.h │ │ │ ├── YYCache.modulemap │ │ │ └── YYCache.xcconfig │ └── YYCache │ │ ├── LICENSE │ │ ├── README.md │ │ └── YYCache │ │ ├── YYCache.h │ │ ├── YYCache.m │ │ ├── YYDiskCache.h │ │ ├── YYDiskCache.m │ │ ├── YYKVStorage.h │ │ ├── YYKVStorage.m │ │ ├── YYMemoryCache.h │ │ └── YYMemoryCache.m ├── SSJNetWork.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── SSJNetWork-Example.xcscheme ├── SSJNetWork.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings ├── SSJNetWork │ ├── Base.lproj │ │ └── LaunchScreen.storyboard │ ├── HTTPService │ │ ├── SSJRequestService.h │ │ └── SSJRequestService.m │ ├── Home │ │ ├── Controller │ │ │ ├── SSJHomeViewController.h │ │ │ └── SSJHomeViewController.m │ │ └── Service │ │ │ ├── SSJHomeRequestService.h │ │ │ └── SSJHomeRequestService.m │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Main.storyboard │ ├── SSJAppDelegate.h │ ├── SSJAppDelegate.m │ ├── SSJNetWork-Info.plist │ ├── SSJNetWork-Prefix.pch │ ├── SSJNetWork │ │ └── Classes │ │ │ ├── .gitkeep │ │ │ ├── Cache │ │ │ ├── SSJMemCacheDataCenter.h │ │ │ └── SSJMemCacheDataCenter.m │ │ │ ├── Catagory │ │ │ ├── NSDictionary+SSJNetWork.h │ │ │ ├── NSDictionary+SSJNetWork.m │ │ │ ├── NSString+SSJNetWork.h │ │ │ ├── NSString+SSJNetWork.m │ │ │ ├── UINavigationController+SSJNetWork.h │ │ │ ├── UINavigationController+SSJNetWork.m │ │ │ ├── UIViewController+SSJNetWork.h │ │ │ └── UIViewController+SSJNetWork.m │ │ │ ├── Log │ │ │ ├── NEHTTPEyeDetailViewController.h │ │ │ ├── NEHTTPEyeDetailViewController.m │ │ │ ├── NEHTTPEyeViewController.h │ │ │ ├── NEHTTPEyeViewController.m │ │ │ ├── NEHTTPModelManager.h │ │ │ ├── NEHTTPModelManager.m │ │ │ ├── SSJLogManager.h │ │ │ ├── SSJLogManager.m │ │ │ ├── SSJNetWorkLogHelper.h │ │ │ └── SSJNetWorkLogHelper.m │ │ │ ├── Request │ │ │ ├── SSJApiProxy.h │ │ │ ├── SSJApiProxy.m │ │ │ ├── SSJApiRequestManager.h │ │ │ ├── SSJApiRequestManager.m │ │ │ ├── SSJHTTPSessionModel.h │ │ │ ├── SSJHTTPSessionModel.m │ │ │ ├── SSJNetWorkConfig.h │ │ │ ├── SSJNetWorkConfig.m │ │ │ ├── SSJNetWorkHelper.h │ │ │ ├── SSJNetWorkHelper.m │ │ │ ├── SSJNetworkRequestConfig.h │ │ │ ├── SSJNetworkRequestConfig.m │ │ │ ├── SSJURLRequestManager.h │ │ │ └── SSJURLRequestManager.m │ │ │ ├── SSJNetWork.h │ │ │ └── Support Files │ │ │ └── SSJNetworkingDefines.h │ ├── en.lproj │ │ └── InfoPlist.strings │ └── main.m └── Tests │ ├── Tests-Info.plist │ ├── Tests-Prefix.pch │ ├── Tests.m │ └── en.lproj │ └── InfoPlist.strings ├── LICENSE ├── README.md ├── SSJNetWork.podspec ├── SSJNetWork ├── Assets │ └── .gitkeep └── Classes │ ├── .gitkeep │ ├── Cache │ ├── SSJMemCacheDataCenter.h │ └── SSJMemCacheDataCenter.m │ ├── Catagory │ ├── NSDictionary+SSJNetWork.h │ ├── NSDictionary+SSJNetWork.m │ ├── NSObject+SSJNetWork.h │ ├── NSObject+SSJNetWork.m │ ├── NSString+SSJNetWork.h │ ├── NSString+SSJNetWork.m │ ├── UINavigationController+SSJNetWork.h │ ├── UINavigationController+SSJNetWork.m │ ├── UIViewController+SSJNetWork.h │ └── UIViewController+SSJNetWork.m │ ├── Log │ ├── NEHTTPEyeDetailViewController.h │ ├── NEHTTPEyeDetailViewController.m │ ├── NEHTTPEyeViewController.h │ ├── NEHTTPEyeViewController.m │ ├── NEHTTPModelManager.h │ ├── NEHTTPModelManager.m │ ├── SSJLogManager.h │ ├── SSJLogManager.m │ ├── SSJNetWorkLogHelper.h │ └── SSJNetWorkLogHelper.m │ ├── Request │ ├── SSJApiProxy.h │ ├── SSJApiProxy.m │ ├── SSJApiRequestManager.h │ ├── SSJApiRequestManager.m │ ├── SSJHTTPSessionModel.h │ ├── SSJHTTPSessionModel.m │ ├── SSJNetWorkConfig.h │ ├── SSJNetWorkConfig.m │ ├── SSJNetWorkHelper.h │ ├── SSJNetWorkHelper.m │ ├── SSJNetworkRequestConfig.h │ ├── SSJNetworkRequestConfig.m │ ├── SSJURLRequestManager.h │ ├── SSJURLRequestManager.m │ ├── SSUploadTaskRequest.h │ └── SSUploadTaskRequest.m │ ├── SSJNetWork.h │ └── Support Files │ └── SSJNetworkingDefines.h └── _Pods.xcodeproj /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | # Xcode 5 | build/ 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata/ 15 | *.xccheckout 16 | profile 17 | *.moved-aside 18 | DerivedData 19 | *.hmap 20 | *.ipa 21 | 22 | # Bundler 23 | .bundle 24 | 25 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 26 | # Carthage/Checkouts 27 | 28 | Carthage/Build 29 | 30 | # We recommend against adding the Pods directory to your .gitignore. However 31 | # you should judge for yourself, the pros and cons are mentioned at: 32 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 33 | # 34 | # Note: if you ignore the Pods directory, make sure to uncomment 35 | # `pod install` in .travis.yml 36 | # 37 | # Pods/ 38 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # references: 2 | # * https://www.objc.io/issues/6-build-tools/travis-ci/ 3 | # * https://github.com/supermarin/xcpretty#usage 4 | 5 | osx_image: xcode7.3 6 | language: objective-c 7 | # cache: cocoapods 8 | # podfile: Example/Podfile 9 | # before_install: 10 | # - gem install cocoapods # Since Travis is not always on latest version 11 | # - pod install --project-directory=Example 12 | script: 13 | - set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/SSJNetWork.xcworkspace -scheme SSJNetWork-Example -sdk iphonesimulator9.3 ONLY_ACTIVE_ARCH=NO | xcpretty 14 | - pod lib lint 15 | -------------------------------------------------------------------------------- /Example/.idea/.name: -------------------------------------------------------------------------------- 1 | SSJNetWork -------------------------------------------------------------------------------- /Example/.idea/Example.iml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Example/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /Example/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 13 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 1556101314464 26 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /Example/.idea/xcode.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | use_frameworks! 2 | 3 | platform :ios, '8.0' 4 | 5 | target 'SSJNetWork_Example' do 6 | pod 'SSJNetWork', :path => '../' 7 | pod 'YYCache' 8 | pod 'FMDB/SQLCipher', '~> 2.5' 9 | pod 'AFNetworking', '~>3.1.0' 10 | 11 | end 12 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AFNetworking (3.1.0): 3 | - AFNetworking/NSURLSession (= 3.1.0) 4 | - AFNetworking/Reachability (= 3.1.0) 5 | - AFNetworking/Security (= 3.1.0) 6 | - AFNetworking/Serialization (= 3.1.0) 7 | - AFNetworking/UIKit (= 3.1.0) 8 | - AFNetworking/NSURLSession (3.1.0): 9 | - AFNetworking/Reachability 10 | - AFNetworking/Security 11 | - AFNetworking/Serialization 12 | - AFNetworking/Reachability (3.1.0) 13 | - AFNetworking/Security (3.1.0) 14 | - AFNetworking/Serialization (3.1.0) 15 | - AFNetworking/UIKit (3.1.0): 16 | - AFNetworking/NSURLSession 17 | - FMDB/SQLCipher (2.7.5): 18 | - SQLCipher 19 | - SQLCipher (4.1.0): 20 | - SQLCipher/standard (= 4.1.0) 21 | - SQLCipher/common (4.1.0) 22 | - SQLCipher/standard (4.1.0): 23 | - SQLCipher/common 24 | - SSJNetWork (0.1.0) 25 | - YYCache (1.0.4) 26 | 27 | DEPENDENCIES: 28 | - AFNetworking (~> 3.1.0) 29 | - FMDB/SQLCipher (~> 2.5) 30 | - SSJNetWork (from `../`) 31 | - YYCache 32 | 33 | SPEC REPOS: 34 | https://github.com/cocoapods/specs.git: 35 | - AFNetworking 36 | - FMDB 37 | - SQLCipher 38 | - YYCache 39 | 40 | EXTERNAL SOURCES: 41 | SSJNetWork: 42 | :path: "../" 43 | 44 | SPEC CHECKSUMS: 45 | AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67 46 | FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a 47 | SQLCipher: efbdb52cdbe340bcd892b1b14297df4e07241b7f 48 | SSJNetWork: 61a5d436fdf2074d5d07c9ee70ae1812917d2d6e 49 | YYCache: 8105b6638f5e849296c71f331ff83891a4942952 50 | 51 | PODFILE CHECKSUM: 0a2d6c314acd9bdec67c8e6e86a3fb0a1918f666 52 | 53 | COCOAPODS: 1.6.1 54 | -------------------------------------------------------------------------------- /Example/Pods/AFNetworking/AFNetworking/AFNetworking.h: -------------------------------------------------------------------------------- 1 | // AFNetworking.h 2 | // 3 | // Copyright (c) 2013 AFNetworking (http://afnetworking.com/) 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 13 | // all 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 21 | // THE SOFTWARE. 22 | 23 | #import 24 | #import 25 | #import 26 | 27 | #ifndef _AFNETWORKING_ 28 | #define _AFNETWORKING_ 29 | 30 | #import "AFURLRequestSerialization.h" 31 | #import "AFURLResponseSerialization.h" 32 | #import "AFSecurityPolicy.h" 33 | 34 | #if !TARGET_OS_WATCH 35 | #import "AFNetworkReachabilityManager.h" 36 | #endif 37 | 38 | #import "AFURLSessionManager.h" 39 | #import "AFHTTPSessionManager.h" 40 | 41 | #endif /* _AFNETWORKING_ */ 42 | -------------------------------------------------------------------------------- /Example/Pods/AFNetworking/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011–2016 Alamofire Software Foundation (http://alamofire.org/) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Example/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIActivityIndicatorView+AFNetworking.h 2 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | 24 | #import 25 | 26 | #if TARGET_OS_IOS || TARGET_OS_TV 27 | 28 | #import 29 | 30 | /** 31 | This category adds methods to the UIKit framework's `UIActivityIndicatorView` class. The methods in this category provide support for automatically starting and stopping animation depending on the loading state of a session task. 32 | */ 33 | @interface UIActivityIndicatorView (AFNetworking) 34 | 35 | ///---------------------------------- 36 | /// @name Animating for Session Tasks 37 | ///---------------------------------- 38 | 39 | /** 40 | Binds the animating state to the state of the specified task. 41 | 42 | @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled. 43 | */ 44 | - (void)setAnimatingWithStateOfTask:(nullable NSURLSessionTask *)task; 45 | 46 | @end 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /Example/Pods/AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+AFNetworking.h 3 | // 4 | // 5 | // Created by Paulo Ferreira on 08/07/15. 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #if TARGET_OS_IOS || TARGET_OS_TV 26 | 27 | #import 28 | 29 | @interface UIImage (AFNetworking) 30 | 31 | + (UIImage*) safeImageWithData:(NSData*)data; 32 | 33 | @end 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /Example/Pods/AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIKit+AFNetworking.h 2 | // 3 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 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 13 | // all 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 21 | // THE SOFTWARE. 22 | 23 | #if TARGET_OS_IOS || TARGET_OS_TV 24 | #import 25 | 26 | #ifndef _UIKIT_AFNETWORKING_ 27 | #define _UIKIT_AFNETWORKING_ 28 | 29 | #if TARGET_OS_IOS 30 | #import "AFAutoPurgingImageCache.h" 31 | #import "AFImageDownloader.h" 32 | #import "AFNetworkActivityIndicatorManager.h" 33 | #import "UIRefreshControl+AFNetworking.h" 34 | #import "UIWebView+AFNetworking.h" 35 | #endif 36 | 37 | #import "UIActivityIndicatorView+AFNetworking.h" 38 | #import "UIButton+AFNetworking.h" 39 | #import "UIImageView+AFNetworking.h" 40 | #import "UIProgressView+AFNetworking.h" 41 | #endif /* _UIKIT_AFNETWORKING_ */ 42 | #endif 43 | -------------------------------------------------------------------------------- /Example/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIProgressView+AFNetworking.h 2 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | 24 | #import 25 | 26 | #if TARGET_OS_IOS || TARGET_OS_TV 27 | 28 | #import 29 | 30 | NS_ASSUME_NONNULL_BEGIN 31 | 32 | 33 | /** 34 | This category adds methods to the UIKit framework's `UIProgressView` class. The methods in this category provide support for binding the progress to the upload and download progress of a session task. 35 | */ 36 | @interface UIProgressView (AFNetworking) 37 | 38 | ///------------------------------------ 39 | /// @name Setting Session Task Progress 40 | ///------------------------------------ 41 | 42 | /** 43 | Binds the progress to the upload progress of the specified session task. 44 | 45 | @param task The session task. 46 | @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. 47 | */ 48 | - (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task 49 | animated:(BOOL)animated; 50 | 51 | /** 52 | Binds the progress to the download progress of the specified session task. 53 | 54 | @param task The session task. 55 | @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. 56 | */ 57 | - (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task 58 | animated:(BOOL)animated; 59 | 60 | @end 61 | 62 | NS_ASSUME_NONNULL_END 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /Example/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIRefreshControl+AFNetworking.m 2 | // 3 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 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 13 | // all 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 21 | // THE SOFTWARE. 22 | 23 | #import 24 | 25 | #import 26 | 27 | #if TARGET_OS_IOS 28 | 29 | #import 30 | 31 | NS_ASSUME_NONNULL_BEGIN 32 | 33 | /** 34 | This category adds methods to the UIKit framework's `UIRefreshControl` class. The methods in this category provide support for automatically beginning and ending refreshing depending on the loading state of a session task. 35 | */ 36 | @interface UIRefreshControl (AFNetworking) 37 | 38 | ///----------------------------------- 39 | /// @name Refreshing for Session Tasks 40 | ///----------------------------------- 41 | 42 | /** 43 | Binds the refreshing state to the state of the specified task. 44 | 45 | @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled. 46 | */ 47 | - (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task; 48 | 49 | @end 50 | 51 | NS_ASSUME_NONNULL_END 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /Example/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIWebView+AFNetworking.h 2 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | 24 | #import 25 | 26 | #if TARGET_OS_IOS 27 | 28 | #import 29 | 30 | NS_ASSUME_NONNULL_BEGIN 31 | 32 | @class AFHTTPSessionManager; 33 | 34 | /** 35 | This category adds methods to the UIKit framework's `UIWebView` class. The methods in this category provide increased control over the request cycle, including progress monitoring and success / failure handling. 36 | 37 | @discussion When using these category methods, make sure to assign `delegate` for the web view, which implements `–webView:shouldStartLoadWithRequest:navigationType:` appropriately. This allows for tapped links to be loaded through AFNetworking, and can ensure that `canGoBack` & `canGoForward` update their values correctly. 38 | */ 39 | @interface UIWebView (AFNetworking) 40 | 41 | /** 42 | The session manager used to download all requests. 43 | */ 44 | @property (nonatomic, strong) AFHTTPSessionManager *sessionManager; 45 | 46 | /** 47 | Asynchronously loads the specified request. 48 | 49 | @param request A URL request identifying the location of the content to load. This must not be `nil`. 50 | @param progress A progress object monitoring the current download progress. 51 | @param success A block object to be executed when the request finishes loading successfully. This block returns the HTML string to be loaded by the web view, and takes two arguments: the response, and the response string. 52 | @param failure A block object to be executed when the data task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a single argument: the error that occurred. 53 | */ 54 | - (void)loadRequest:(NSURLRequest *)request 55 | progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress 56 | success:(nullable NSString * (^)(NSHTTPURLResponse *response, NSString *HTML))success 57 | failure:(nullable void (^)(NSError *error))failure; 58 | 59 | /** 60 | Asynchronously loads the data associated with a particular request with a specified MIME type and text encoding. 61 | 62 | @param request A URL request identifying the location of the content to load. This must not be `nil`. 63 | @param MIMEType The MIME type of the content. Defaults to the content type of the response if not specified. 64 | @param textEncodingName The IANA encoding name, as in `utf-8` or `utf-16`. Defaults to the response text encoding if not specified. 65 | @param progress A progress object monitoring the current download progress. 66 | @param success A block object to be executed when the request finishes loading successfully. This block returns the data to be loaded by the web view and takes two arguments: the response, and the downloaded data. 67 | @param failure A block object to be executed when the data task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a single argument: the error that occurred. 68 | */ 69 | - (void)loadRequest:(NSURLRequest *)request 70 | MIMEType:(nullable NSString *)MIMEType 71 | textEncodingName:(nullable NSString *)textEncodingName 72 | progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress 73 | success:(nullable NSData * (^)(NSHTTPURLResponse *response, NSData *data))success 74 | failure:(nullable void (^)(NSError *error))failure; 75 | 76 | @end 77 | 78 | NS_ASSUME_NONNULL_END 79 | 80 | #endif 81 | -------------------------------------------------------------------------------- /Example/Pods/FMDB/LICENSE.txt: -------------------------------------------------------------------------------- 1 | If you are using FMDB in your project, I'd love to hear about it. Let Gus know 2 | by sending an email to gus@flyingmeat.com. 3 | 4 | And if you happen to come across either Gus Mueller or Rob Ryan in a bar, you 5 | might consider purchasing a drink of their choosing if FMDB has been useful to 6 | you. 7 | 8 | Finally, and shortly, this is the MIT License. 9 | 10 | Copyright (c) 2008-2014 Flying Meat Inc. 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files (the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions: 18 | 19 | The above copyright notice and this permission notice shall be included in 20 | all copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 28 | THE SOFTWARE. -------------------------------------------------------------------------------- /Example/Pods/FMDB/src/fmdb/FMDB.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | FOUNDATION_EXPORT double FMDBVersionNumber; 4 | FOUNDATION_EXPORT const unsigned char FMDBVersionString[]; 5 | 6 | #import "FMDatabase.h" 7 | #import "FMResultSet.h" 8 | #import "FMDatabaseAdditions.h" 9 | #import "FMDatabaseQueue.h" 10 | #import "FMDatabasePool.h" 11 | -------------------------------------------------------------------------------- /Example/Pods/Local Podspecs/SSJNetWork.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "SSJNetWork", 3 | "version": "0.1.0", 4 | "summary": "A short description of SSJNetWork.", 5 | "description": "TODO: Add long description of the pod here.", 6 | "homepage": "https://github.com/15220092519@163.com/SSJNetWork", 7 | "license": { 8 | "type": "MIT", 9 | "file": "LICENSE" 10 | }, 11 | "authors": { 12 | "15220092519@163.com": "15220092519@163.com" 13 | }, 14 | "source": { 15 | "git": "https://github.com/15220092519@163.com/SSJNetWork.git", 16 | "tag": "0.1.0" 17 | }, 18 | "platforms": { 19 | "ios": "8.0" 20 | }, 21 | "source_files": "SSJNetWork/Classes/**/*" 22 | } 23 | -------------------------------------------------------------------------------- /Example/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AFNetworking (3.1.0): 3 | - AFNetworking/NSURLSession (= 3.1.0) 4 | - AFNetworking/Reachability (= 3.1.0) 5 | - AFNetworking/Security (= 3.1.0) 6 | - AFNetworking/Serialization (= 3.1.0) 7 | - AFNetworking/UIKit (= 3.1.0) 8 | - AFNetworking/NSURLSession (3.1.0): 9 | - AFNetworking/Reachability 10 | - AFNetworking/Security 11 | - AFNetworking/Serialization 12 | - AFNetworking/Reachability (3.1.0) 13 | - AFNetworking/Security (3.1.0) 14 | - AFNetworking/Serialization (3.1.0) 15 | - AFNetworking/UIKit (3.1.0): 16 | - AFNetworking/NSURLSession 17 | - FMDB/SQLCipher (2.7.5): 18 | - SQLCipher 19 | - SQLCipher (4.1.0): 20 | - SQLCipher/standard (= 4.1.0) 21 | - SQLCipher/common (4.1.0) 22 | - SQLCipher/standard (4.1.0): 23 | - SQLCipher/common 24 | - SSJNetWork (0.1.0) 25 | - YYCache (1.0.4) 26 | 27 | DEPENDENCIES: 28 | - AFNetworking (~> 3.1.0) 29 | - FMDB/SQLCipher (~> 2.5) 30 | - SSJNetWork (from `../`) 31 | - YYCache 32 | 33 | SPEC REPOS: 34 | https://github.com/cocoapods/specs.git: 35 | - AFNetworking 36 | - FMDB 37 | - SQLCipher 38 | - YYCache 39 | 40 | EXTERNAL SOURCES: 41 | SSJNetWork: 42 | :path: "../" 43 | 44 | SPEC CHECKSUMS: 45 | AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67 46 | FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a 47 | SQLCipher: efbdb52cdbe340bcd892b1b14297df4e07241b7f 48 | SSJNetWork: 61a5d436fdf2074d5d07c9ee70ae1812917d2d6e 49 | YYCache: 8105b6638f5e849296c71f331ff83891a4942952 50 | 51 | PODFILE CHECKSUM: 0a2d6c314acd9bdec67c8e6e86a3fb0a1918f666 52 | 53 | COCOAPODS: 1.6.1 54 | -------------------------------------------------------------------------------- /Example/Pods/SQLCipher/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2008, ZETETIC LLC 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of the ZETETIC LLC nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY ZETETIC LLC ''AS IS'' AND ANY 16 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL ZETETIC LLC BE LIABLE FOR ANY 19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/AFNetworking/AFNetworking-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 | FMWK 17 | CFBundleShortVersionString 18 | 3.1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/AFNetworking/AFNetworking-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_AFNetworking : NSObject 3 | @end 4 | @implementation PodsDummy_AFNetworking 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/AFNetworking/AFNetworking-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #ifndef TARGET_OS_IOS 14 | #define TARGET_OS_IOS TARGET_OS_IPHONE 15 | #endif 16 | 17 | #ifndef TARGET_OS_WATCH 18 | #define TARGET_OS_WATCH 0 19 | #endif 20 | 21 | #ifndef TARGET_OS_TV 22 | #define TARGET_OS_TV 0 23 | #endif 24 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/AFNetworking/AFNetworking-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "AFNetworking.h" 14 | #import "AFHTTPSessionManager.h" 15 | #import "AFURLSessionManager.h" 16 | #import "AFNetworkReachabilityManager.h" 17 | #import "AFSecurityPolicy.h" 18 | #import "AFURLRequestSerialization.h" 19 | #import "AFURLResponseSerialization.h" 20 | #import "AFAutoPurgingImageCache.h" 21 | #import "AFImageDownloader.h" 22 | #import "AFNetworkActivityIndicatorManager.h" 23 | #import "UIActivityIndicatorView+AFNetworking.h" 24 | #import "UIButton+AFNetworking.h" 25 | #import "UIImage+AFNetworking.h" 26 | #import "UIImageView+AFNetworking.h" 27 | #import "UIKit+AFNetworking.h" 28 | #import "UIProgressView+AFNetworking.h" 29 | #import "UIRefreshControl+AFNetworking.h" 30 | #import "UIWebView+AFNetworking.h" 31 | 32 | FOUNDATION_EXPORT double AFNetworkingVersionNumber; 33 | FOUNDATION_EXPORT const unsigned char AFNetworkingVersionString[]; 34 | 35 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/AFNetworking/AFNetworking.modulemap: -------------------------------------------------------------------------------- 1 | framework module AFNetworking { 2 | umbrella header "AFNetworking-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/AFNetworking/AFNetworking.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | OTHER_LDFLAGS = $(inherited) -framework "CoreGraphics" -framework "MobileCoreServices" -framework "Security" -framework "SystemConfiguration" 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/AFNetworking 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/FMDB/FMDB-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 | FMWK 17 | CFBundleShortVersionString 18 | 2.7.5 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/FMDB/FMDB-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_FMDB : NSObject 3 | @end 4 | @implementation PodsDummy_FMDB 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/FMDB/FMDB-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/FMDB/FMDB-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "FMDatabase.h" 14 | #import "FMDatabaseAdditions.h" 15 | #import "FMDatabasePool.h" 16 | #import "FMDatabaseQueue.h" 17 | #import "FMDB.h" 18 | #import "FMResultSet.h" 19 | 20 | FOUNDATION_EXPORT double FMDBVersionNumber; 21 | FOUNDATION_EXPORT const unsigned char FMDBVersionString[]; 22 | 23 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/FMDB/FMDB.modulemap: -------------------------------------------------------------------------------- 1 | framework module FMDB { 2 | umbrella header "FMDB-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/FMDB/FMDB.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/FMDB 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SQLCipher" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = SQLCipher 5 | OTHER_CFLAGS = $(inherited) -DSQLITE_HAS_CODEC -DHAVE_USLEEP=1 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_ROOT = ${SRCROOT} 9 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/FMDB 10 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | SKIP_INSTALL = YES 12 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-SSJNetWork_Example/Pods-SSJNetWork_Example-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 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-SSJNetWork_Example/Pods-SSJNetWork_Example-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_SSJNetWork_Example : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_SSJNetWork_Example 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-SSJNetWork_Example/Pods-SSJNetWork_Example-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_SSJNetWork_ExampleVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_SSJNetWork_ExampleVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-SSJNetWork_Example/Pods-SSJNetWork_Example.debug.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking" "${PODS_CONFIGURATION_BUILD_DIR}/FMDB" "${PODS_CONFIGURATION_BUILD_DIR}/SQLCipher" "${PODS_CONFIGURATION_BUILD_DIR}/YYCache" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 $(inherited) SQLITE_HAS_CODEC=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking/AFNetworking.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/FMDB/FMDB.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/SQLCipher/SQLCipher.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/YYCache/YYCache.framework/Headers" SQLCipher $(PODS_ROOT)/SQLCipher 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -DSQLITE_HAS_CODEC -DHAVE_USLEEP=1 $(inherited) -DSQLITE_HAS_CODEC -DSQLITE_TEMP_STORE=2 -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_STAT3 -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_LOAD_EXTENSION -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS4_UNICODE61 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLCIPHER_CRYPTO_CC -DHAVE_USLEEP=1 -DSQLITE_MAX_VARIABLE_NUMBER=99999 6 | OTHER_LDFLAGS = $(inherited) -l"sqlite3" -framework "AFNetworking" -framework "CoreFoundation" -framework "CoreGraphics" -framework "FMDB" -framework "Foundation" -framework "MobileCoreServices" -framework "QuartzCore" -framework "SQLCipher" -framework "Security" -framework "SystemConfiguration" -framework "UIKit" -framework "YYCache" 7 | PODS_BUILD_DIR = ${BUILD_DIR} 8 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 10 | PODS_ROOT = ${SRCROOT}/Pods 11 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-SSJNetWork_Example/Pods-SSJNetWork_Example.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_SSJNetWork_Example { 2 | umbrella header "Pods-SSJNetWork_Example-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-SSJNetWork_Example/Pods-SSJNetWork_Example.release.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking" "${PODS_CONFIGURATION_BUILD_DIR}/FMDB" "${PODS_CONFIGURATION_BUILD_DIR}/SQLCipher" "${PODS_CONFIGURATION_BUILD_DIR}/YYCache" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 $(inherited) SQLITE_HAS_CODEC=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking/AFNetworking.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/FMDB/FMDB.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/SQLCipher/SQLCipher.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/YYCache/YYCache.framework/Headers" SQLCipher $(PODS_ROOT)/SQLCipher 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -DSQLITE_HAS_CODEC -DHAVE_USLEEP=1 $(inherited) -DSQLITE_HAS_CODEC -DSQLITE_TEMP_STORE=2 -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_STAT3 -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_LOAD_EXTENSION -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS4_UNICODE61 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLCIPHER_CRYPTO_CC -DHAVE_USLEEP=1 -DSQLITE_MAX_VARIABLE_NUMBER=99999 6 | OTHER_LDFLAGS = $(inherited) -l"sqlite3" -framework "AFNetworking" -framework "CoreFoundation" -framework "CoreGraphics" -framework "FMDB" -framework "Foundation" -framework "MobileCoreServices" -framework "QuartzCore" -framework "SQLCipher" -framework "Security" -framework "SystemConfiguration" -framework "UIKit" -framework "YYCache" 7 | PODS_BUILD_DIR = ${BUILD_DIR} 8 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 10 | PODS_ROOT = ${SRCROOT}/Pods 11 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/SQLCipher/SQLCipher-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 | FMWK 17 | CFBundleShortVersionString 18 | 4.1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/SQLCipher/SQLCipher-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_SQLCipher : NSObject 3 | @end 4 | @implementation PodsDummy_SQLCipher 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/SQLCipher/SQLCipher-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/SQLCipher/SQLCipher-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "sqlite3.h" 14 | 15 | FOUNDATION_EXPORT double SQLCipherVersionNumber; 16 | FOUNDATION_EXPORT const unsigned char SQLCipherVersionString[]; 17 | 18 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/SQLCipher/SQLCipher.modulemap: -------------------------------------------------------------------------------- 1 | framework module SQLCipher { 2 | umbrella header "SQLCipher-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/SQLCipher/SQLCipher.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/SQLCipher 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 $(inherited) SQLITE_HAS_CODEC=1 3 | HEADER_SEARCH_PATHS = $(PODS_ROOT)/SQLCipher 4 | OTHER_CFLAGS = $(inherited) -DSQLITE_HAS_CODEC -DSQLITE_TEMP_STORE=2 -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_STAT3 -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_LOAD_EXTENSION -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS4_UNICODE61 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLCIPHER_CRYPTO_CC -DHAVE_USLEEP=1 -DSQLITE_MAX_VARIABLE_NUMBER=99999 5 | OTHER_LDFLAGS = $(inherited) -framework "Foundation" -framework "Security" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_ROOT = ${SRCROOT} 9 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/SQLCipher 10 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | SKIP_INSTALL = YES 12 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/SSJNetWork/SSJNetWork-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 | FMWK 17 | CFBundleShortVersionString 18 | 0.1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/SSJNetWork/SSJNetWork-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_SSJNetWork : NSObject 3 | @end 4 | @implementation PodsDummy_SSJNetWork 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/SSJNetWork/SSJNetWork-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/SSJNetWork/SSJNetWork-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double SSJNetWorkVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char SSJNetWorkVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/SSJNetWork/SSJNetWork.modulemap: -------------------------------------------------------------------------------- 1 | framework module SSJNetWork { 2 | umbrella header "SSJNetWork-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/SSJNetWork/SSJNetWork.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/SSJNetWork 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | PODS_BUILD_DIR = ${BUILD_DIR} 4 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 5 | PODS_ROOT = ${SRCROOT} 6 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. 7 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 8 | SKIP_INSTALL = YES 9 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/YYCache/YYCache-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 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.4 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/YYCache/YYCache-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_YYCache : NSObject 3 | @end 4 | @implementation PodsDummy_YYCache 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/YYCache/YYCache-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/YYCache/YYCache-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "YYCache.h" 14 | #import "YYDiskCache.h" 15 | #import "YYKVStorage.h" 16 | #import "YYMemoryCache.h" 17 | 18 | FOUNDATION_EXPORT double YYCacheVersionNumber; 19 | FOUNDATION_EXPORT const unsigned char YYCacheVersionString[]; 20 | 21 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/YYCache/YYCache.modulemap: -------------------------------------------------------------------------------- 1 | framework module YYCache { 2 | umbrella header "YYCache-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/YYCache/YYCache.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/YYCache 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | OTHER_LDFLAGS = $(inherited) -l"sqlite3" -framework "CoreFoundation" -framework "QuartzCore" -framework "UIKit" 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/YYCache 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /Example/Pods/YYCache/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 ibireme 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 | 23 | -------------------------------------------------------------------------------- /Example/Pods/YYCache/YYCache/YYCache.m: -------------------------------------------------------------------------------- 1 | // 2 | // YYCache.m 3 | // YYCache 4 | // 5 | // Created by ibireme on 15/2/13. 6 | // Copyright (c) 2015 ibireme. 7 | // 8 | // This source code is licensed under the MIT-style license found in the 9 | // LICENSE file in the root directory of this source tree. 10 | // 11 | 12 | #import "YYCache.h" 13 | #import "YYMemoryCache.h" 14 | #import "YYDiskCache.h" 15 | 16 | @implementation YYCache 17 | 18 | - (instancetype) init { 19 | NSLog(@"Use \"initWithName\" or \"initWithPath\" to create YYCache instance."); 20 | return [self initWithPath:@""]; 21 | } 22 | 23 | - (instancetype)initWithName:(NSString *)name { 24 | if (name.length == 0) return nil; 25 | NSString *cacheFolder = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject]; 26 | NSString *path = [cacheFolder stringByAppendingPathComponent:name]; 27 | return [self initWithPath:path]; 28 | } 29 | 30 | - (instancetype)initWithPath:(NSString *)path { 31 | if (path.length == 0) return nil; 32 | YYDiskCache *diskCache = [[YYDiskCache alloc] initWithPath:path]; 33 | if (!diskCache) return nil; 34 | NSString *name = [path lastPathComponent]; 35 | YYMemoryCache *memoryCache = [YYMemoryCache new]; 36 | memoryCache.name = name; 37 | 38 | self = [super init]; 39 | _name = name; 40 | _diskCache = diskCache; 41 | _memoryCache = memoryCache; 42 | return self; 43 | } 44 | 45 | + (instancetype)cacheWithName:(NSString *)name { 46 | return [[self alloc] initWithName:name]; 47 | } 48 | 49 | + (instancetype)cacheWithPath:(NSString *)path { 50 | return [[self alloc] initWithPath:path]; 51 | } 52 | 53 | - (BOOL)containsObjectForKey:(NSString *)key { 54 | return [_memoryCache containsObjectForKey:key] || [_diskCache containsObjectForKey:key]; 55 | } 56 | 57 | - (void)containsObjectForKey:(NSString *)key withBlock:(void (^)(NSString *key, BOOL contains))block { 58 | if (!block) return; 59 | 60 | if ([_memoryCache containsObjectForKey:key]) { 61 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ 62 | block(key, YES); 63 | }); 64 | } else { 65 | [_diskCache containsObjectForKey:key withBlock:block]; 66 | } 67 | } 68 | 69 | - (id)objectForKey:(NSString *)key { 70 | id object = [_memoryCache objectForKey:key]; 71 | if (!object) { 72 | object = [_diskCache objectForKey:key]; 73 | if (object) { 74 | [_memoryCache setObject:object forKey:key]; 75 | } 76 | } 77 | return object; 78 | } 79 | 80 | - (void)objectForKey:(NSString *)key withBlock:(void (^)(NSString *key, id object))block { 81 | if (!block) return; 82 | id object = [_memoryCache objectForKey:key]; 83 | if (object) { 84 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ 85 | block(key, object); 86 | }); 87 | } else { 88 | [_diskCache objectForKey:key withBlock:^(NSString *key, id object) { 89 | if (object && ![_memoryCache objectForKey:key]) { 90 | [_memoryCache setObject:object forKey:key]; 91 | } 92 | block(key, object); 93 | }]; 94 | } 95 | } 96 | 97 | - (void)setObject:(id)object forKey:(NSString *)key { 98 | [_memoryCache setObject:object forKey:key]; 99 | [_diskCache setObject:object forKey:key]; 100 | } 101 | 102 | - (void)setObject:(id)object forKey:(NSString *)key withBlock:(void (^)(void))block { 103 | [_memoryCache setObject:object forKey:key]; 104 | [_diskCache setObject:object forKey:key withBlock:block]; 105 | } 106 | 107 | - (void)removeObjectForKey:(NSString *)key { 108 | [_memoryCache removeObjectForKey:key]; 109 | [_diskCache removeObjectForKey:key]; 110 | } 111 | 112 | - (void)removeObjectForKey:(NSString *)key withBlock:(void (^)(NSString *key))block { 113 | [_memoryCache removeObjectForKey:key]; 114 | [_diskCache removeObjectForKey:key withBlock:block]; 115 | } 116 | 117 | - (void)removeAllObjects { 118 | [_memoryCache removeAllObjects]; 119 | [_diskCache removeAllObjects]; 120 | } 121 | 122 | - (void)removeAllObjectsWithBlock:(void(^)(void))block { 123 | [_memoryCache removeAllObjects]; 124 | [_diskCache removeAllObjectsWithBlock:block]; 125 | } 126 | 127 | - (void)removeAllObjectsWithProgressBlock:(void(^)(int removedCount, int totalCount))progress 128 | endBlock:(void(^)(BOOL error))end { 129 | [_memoryCache removeAllObjects]; 130 | [_diskCache removeAllObjectsWithProgressBlock:progress endBlock:end]; 131 | 132 | } 133 | 134 | - (NSString *)description { 135 | if (_name) return [NSString stringWithFormat:@"<%@: %p> (%@)", self.class, self, _name]; 136 | else return [NSString stringWithFormat:@"<%@: %p>", self.class, self]; 137 | } 138 | 139 | @end 140 | -------------------------------------------------------------------------------- /Example/SSJNetWork.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/SSJNetWork.xcodeproj/xcshareddata/xcschemes/SSJNetWork-Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 64 | 66 | 72 | 73 | 74 | 75 | 76 | 77 | 83 | 85 | 91 | 92 | 93 | 94 | 96 | 97 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /Example/SSJNetWork.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/SSJNetWork.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/SSJNetWork.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildSystemType 6 | Original 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/SSJNetWork/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 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Example/SSJNetWork/HTTPService/SSJRequestService.h: -------------------------------------------------------------------------------- 1 | // 2 | // SSJRequestService.h 3 | // SSJNetWork_Example 4 | // 5 | // Created by Sunjie on 2019/4/22. 6 | // Copyright © 2019 15220092519@163.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface SSJRequestService : NSObject 14 | 15 | - (void)GET:(NSString *)URLString ClassName:(NSString *)className parameters:(nullable id)parameter completion:(void(^)(NSError *error, id responseObject))completion; 16 | 17 | 18 | - (void)POST:(NSString *)URLString ClassName:(NSString *)className parameters:(nullable id)parameter 19 | completion:(void(^)(NSError *error, id responseObject))completion; 20 | 21 | @end 22 | 23 | NS_ASSUME_NONNULL_END 24 | -------------------------------------------------------------------------------- /Example/SSJNetWork/HTTPService/SSJRequestService.m: -------------------------------------------------------------------------------- 1 | // 2 | // SSJRequestService.m 3 | // SSJNetWork_Example 4 | // 5 | // Created by Sunjie on 2019/4/22. 6 | // Copyright © 2019 15220092519@163.com. All rights reserved. 7 | // 8 | 9 | #import "SSJRequestService.h" 10 | #import "SSJNetWork.h" 11 | 12 | @implementation SSJRequestService 13 | 14 | //- (void)GET:(NSString *)URLString ClassName:(NSString *)className parameters:(id)parameter completion:(void (^)(NSError * _Nonnull, id _Nonnull))completion { 15 | // [self method:@"GET" ClassName:className urlsString:URLString parameters:parameter completion:completion]; 16 | //} 17 | // 18 | //- (void)POST:(NSString *)URLString ClassName:(NSString *)className parameters:(id)parameter completion:(void (^)(NSError * _Nonnull, id _Nonnull))completion { 19 | // [self method:@"POST" ClassName:className urlsString:URLString parameters:parameter completion:completion]; 20 | //} 21 | // 22 | //- (void)method:(NSString *)method ClassName:(NSString *)className urlsString:(NSString *)urlString parameters:(id)parameters completion:(void (^)(NSError * _Nonnull, id _Nonnull))completion { 23 | // SSJNetworkRequestConfig *requestConfig = [[SSJNetworkRequestConfig alloc] init]; 24 | // requestConfig.method = method; 25 | // requestConfig.className = className; 26 | // requestConfig.urlString = urlString; 27 | // requestConfig.params = parameters; 28 | // [self networkRequestConfig:requestConfig completion:completion]; 29 | //} 30 | // 31 | //- (void)networkRequestConfig:(SSJNetworkRequestConfig *)config completion:(void (^)(NSError * _Nonnull, id _Nonnull))completion { 32 | // [[SSJApiRequestManager requestManager] ssj_networkRequestConfig:config completionBlock:^(NSError * _Nullable error, id _Nonnull responseObject) { 33 | // //一些错误提示处理 34 | // if (error.code == SSJApiManagerErrorTypeNoNetWork) { 35 | // //错误操作 36 | // } else if (error.code == SSJApiManagerErrorTypeTimeOut) { 37 | // //错误操作 38 | // } 39 | // if (completion) { 40 | // completion(error,completion); 41 | // } 42 | // }]; 43 | //} 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /Example/SSJNetWork/Home/Controller/SSJHomeViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SJHomeViewController.h 3 | // SJNetWork 4 | // 5 | // Created by Sunjie on 2019/4/17. 6 | // Copyright © 2019 sxmaps. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface SSJHomeViewController : UIViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/SSJNetWork/Home/Controller/SSJHomeViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // SJHomeViewController.m 3 | // SJNetWork 4 | // 5 | // Created by Sunjie on 2019/4/17. 6 | // Copyright © 2019 sxmaps. All rights reserved. 7 | // 8 | 9 | #import "SSJHomeViewController.h" 10 | #import "SSJHomeRequestService.h" 11 | #import "SSJNetWork.h" 12 | 13 | @interface SSJHomeViewController () 14 | 15 | @property (nonatomic, strong) SSJHomeRequestService *requestService; 16 | 17 | @end 18 | 19 | @implementation SSJHomeViewController 20 | 21 | - (void)viewDidLoad { 22 | [super viewDidLoad]; 23 | // Do any additional setup after loading the view. 24 | [self setupConfigurator]; 25 | [self loadData]; 26 | } 27 | 28 | - (void)setupConfigurator { 29 | _requestService = [[SSJHomeRequestService alloc] initWitHomeVC:self]; 30 | } 31 | 32 | - (void)loadData { 33 | //回调什么具体可以自己在block里面定义 34 | [_requestService getHomeRequestUserId:@"123" completion:^(NSError * _Nonnull error, id _Nonnull responseObject) { 35 | NSLog(@"请求数据成功"); 36 | }];; 37 | [_requestService getHomeRequestUserName:@"" completion:^(NSError * _Nonnull error, id _Nonnull responseObject) { 38 | NSLog(@"请求数据成功"); 39 | }]; 40 | } 41 | 42 | - (IBAction)clickLogButton:(id)sender { 43 | UIViewController *vc = [SSJLogManager sharedManager].LogViewController; 44 | [self presentViewController:vc animated:YES completion:nil]; 45 | } 46 | 47 | 48 | /* 49 | #pragma mark - Navigation 50 | 51 | // In a storyboard-based application, you will often want to do a little preparation before navigation 52 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 53 | // Get the new view controller using [segue destinationViewController]. 54 | // Pass the selected object to the new view controller. 55 | } 56 | */ 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /Example/SSJNetWork/Home/Service/SSJHomeRequestService.h: -------------------------------------------------------------------------------- 1 | // 2 | // SJHomeRequestService.h 3 | // SJNetWork 4 | // 5 | // Created by Sunjie on 2019/4/17. 6 | // Copyright © 2019 sxmaps. All rights reserved. 7 | // 8 | 9 | #import 10 | @class SSJHomeViewController; 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface SSJHomeRequestService : NSObject 15 | 16 | - (instancetype)initWitHomeVC:(SSJHomeViewController *)vc; 17 | 18 | //假如有一些参数传递 19 | - (void)getHomeRequestUserId:(NSString *)userId completion:(void(^)(NSError *error, id responseObject))completion; 20 | - (void)getHomeRequestUserName:(NSString *)userName completion:(nonnull void (^)(NSError *error, id responseObject))completion; 21 | 22 | @end 23 | 24 | NS_ASSUME_NONNULL_END 25 | -------------------------------------------------------------------------------- /Example/SSJNetWork/Home/Service/SSJHomeRequestService.m: -------------------------------------------------------------------------------- 1 | // 2 | // SJHomeRequestService.m 3 | // SJNetWork 4 | // 5 | // Created by Sunjie on 2019/4/17. 6 | // Copyright © 2019 sxmaps. All rights reserved. 7 | // 8 | 9 | #import "SSJHomeRequestService.h" 10 | #import "NSObject+SSJNetWork.h" 11 | #import "SSJHomeViewController.h" 12 | 13 | //NSString *url2 = @"https://news-at.zhihu.com/api/4/news/9710114"; 14 | //NSString *url3 = @"https://news-at.zhihu.com/api/4/news/9710124"; 15 | //NSString *url4 = @"https://news-at.zhihu.com/api/4/news/9710133"; 16 | //NSString *url5 = @"https://news-at.zhihu.com/api/4/news/9710027";; 17 | 18 | 19 | #define kHomeUrl @"https://news-at.zhihu.com/api/4/news/9710114" 20 | #define kHomeUrl2 @"https://news-at.zhihu.com/api/4/news/9710027" 21 | 22 | @interface SSJHomeRequestService () 23 | 24 | @property (nonatomic, assign) SSJHomeViewController *vc; 25 | 26 | @end 27 | 28 | @implementation SSJHomeRequestService 29 | 30 | - (instancetype)initWitHomeVC:(SSJHomeViewController *)vc { 31 | if (self = [super init]) { 32 | self.vc = vc; 33 | } 34 | return self; 35 | } 36 | 37 | - (void)getHomeRequestUserId:(NSString *)userId completion:(nonnull void (^)(NSError * _Nonnull, id _Nonnull))completion{ 38 | // 39 | // NSMutableDictionary *params = [NSMutableDictionary dictionaryWithCapacity:1]; 40 | // [params setObject:userId forKey:@"userId"] 41 | 42 | [self.vc GET:kHomeUrl parameters:nil completion:^(NSError * _Nonnull error, id _Nonnull responseObject) { 43 | //转化成对应的模型回调 44 | if (completion) { 45 | completion(error,responseObject); 46 | } 47 | 48 | }]; 49 | } 50 | 51 | - (void)getHomeRequestUserName:(NSString *)userName completion:(nonnull void (^)(NSError * _Nonnull, id _Nonnull))completion{ 52 | // 53 | // NSMutableDictionary *params = [NSMutableDictionary dictionaryWithCapacity:1]; 54 | // [params setObject:userId forKey:@"userId"] 55 | 56 | [self.vc GET:kHomeUrl2 parameters:nil completion:^(NSError * _Nonnull error, id _Nonnull responseObject) { 57 | //转化成对应的模型回调 58 | if (completion) { 59 | completion(error,responseObject); 60 | } 61 | 62 | }]; 63 | } 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /Example/SSJNetWork/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /Example/SSJNetWork/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Example/SSJNetWork/SSJAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // SSJAppDelegate.h 3 | // SSJNetWork 4 | // 5 | // Created by 15220092519@163.com on 04/22/2019. 6 | // Copyright (c) 2019 15220092519@163.com. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | @interface SSJAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Example/SSJNetWork/SSJAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // SSJAppDelegate.m 3 | // SSJNetWork 4 | // 5 | // Created by 15220092519@163.com on 04/22/2019. 6 | // Copyright (c) 2019 15220092519@163.com. All rights reserved. 7 | // 8 | 9 | #import "SSJAppDelegate.h" 10 | 11 | @implementation SSJAppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | // Override point for customization after application launch. 16 | return YES; 17 | } 18 | 19 | - (void)applicationWillResignActive:(UIApplication *)application 20 | { 21 | // 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. 22 | // 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. 23 | } 24 | 25 | - (void)applicationDidEnterBackground:(UIApplication *)application 26 | { 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 | { 33 | // 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. 34 | } 35 | 36 | - (void)applicationDidBecomeActive:(UIApplication *)application 37 | { 38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application 42 | { 43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Example/SSJNetWork/SSJNetWork-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Example/SSJNetWork/SSJNetWork-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | @import UIKit; 15 | @import Foundation; 16 | #endif 17 | -------------------------------------------------------------------------------- /Example/SSJNetWork/SSJNetWork/Classes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunjie19921111/SSJNetWork/ef424e990984100b4a72e3748e69bda6685cfe8c/Example/SSJNetWork/SSJNetWork/Classes/.gitkeep -------------------------------------------------------------------------------- /Example/SSJNetWork/SSJNetWork/Classes/Cache/SSJMemCacheDataCenter.h: -------------------------------------------------------------------------------- 1 | // 2 | // SJMemCacheDataCenter.h 3 | // SJNetWork 4 | // 5 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #import 26 | 27 | typedef void(^SJJCacheQueryCompletedBlock)(id response, NSError *error); 28 | 29 | @interface SSJMemCacheConfigModel : NSObject 30 | 31 | @property (nonatomic, copy) NSString *cacheVersion; 32 | @property (nonatomic, copy) NSDate *cacheTime; 33 | @property (nonatomic, copy) NSString *appVersion; 34 | - (instancetype)initWithCacheTime:(NSDate*)cacheTime; 35 | 36 | @end 37 | 38 | 39 | @interface SSJMemCacheDataCenter : NSObject 40 | 41 | + (instancetype)shareInstance; 42 | 43 | - (void)sj_configSetObject:(id)object forKey:(NSString *)key; 44 | - (id)sj_configObjectForKey:(NSString *)key; 45 | - (void)sj_configRemoveObjectForKey:(NSString *)key; 46 | - (void)sj_configRemoveAllObjects; 47 | 48 | - (void)sj_responseSetObject:(id)object forKey:(NSString *)key; 49 | - (id)sj_responseObjectForKey:(NSString *)key; 50 | - (void)sj_responseRemoveObjectForKey:(NSString *)key; 51 | - (void)sj_responseRemoveAllObjects; 52 | 53 | - (void)sj_responseAndConfigRemoveAllObjects; 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /Example/SSJNetWork/SSJNetWork/Classes/Catagory/NSDictionary+SSJNetWork.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSDictionary+SSJNetWork.h 3 | // SSJNetWork_Example 4 | // 5 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | 26 | 27 | NS_ASSUME_NONNULL_BEGIN 28 | 29 | @interface NSDictionary (SSJNetWork) 30 | 31 | - (NSString *)ssj_jsonString; 32 | - (NSString *)ssj_transformToUrlParamString; 33 | 34 | @end 35 | 36 | NS_ASSUME_NONNULL_END 37 | -------------------------------------------------------------------------------- /Example/SSJNetWork/SSJNetWork/Classes/Catagory/NSDictionary+SSJNetWork.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSDictionary+SSJNetWork.m 3 | // SSJNetWork_Example 4 | // 5 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #import "NSDictionary+SSJNetWork.h" 26 | 27 | @implementation NSDictionary (SSJNetWork) 28 | 29 | - (NSString *)ssj_transformToUrlParamString { 30 | NSMutableString *paramString = [NSMutableString string]; 31 | for (int i = 0; i < self.count; i ++) { 32 | NSString *string = nil; 33 | if (i == 0) { 34 | string = [NSString stringWithFormat:@"?%@=%@",self.allKeys[i],self[self.allKeys[i]]]; 35 | } else { 36 | string = [NSString stringWithFormat:@"&%@=%@",self.allKeys[i],self[self.allKeys[i]]]; 37 | } 38 | [paramString appendString:string]; 39 | } 40 | return paramString; 41 | } 42 | 43 | - (NSString *)ssj_jsonString { 44 | NSData *jsonData = [NSJSONSerialization dataWithJSONObject:self options:NSJSONWritingPrettyPrinted error:NULL]; 45 | return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; 46 | } 47 | 48 | 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /Example/SSJNetWork/SSJNetWork/Classes/Catagory/NSString+SSJNetWork.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+SSJNetWork.h 3 | // SSJNetWork_Example 4 | // 5 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | 26 | NS_ASSUME_NONNULL_BEGIN 27 | 28 | @interface NSString (SSJNetWork) 29 | 30 | - (NSString *)ssj_MD5String; 31 | 32 | @end 33 | 34 | NS_ASSUME_NONNULL_END 35 | -------------------------------------------------------------------------------- /Example/SSJNetWork/SSJNetWork/Classes/Catagory/NSString+SSJNetWork.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+SSJNetWork.m 3 | // SSJNetWork_Example 4 | // 5 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #import "NSString+SSJNetWork.h" 26 | #import 27 | 28 | @implementation NSString (SSJNetWork) 29 | 30 | - (NSString *)ssj_MD5String { 31 | const char *cstr = [self UTF8String]; 32 | unsigned char result[16]; 33 | CC_MD5(cstr, (CC_LONG)strlen(cstr), result); 34 | return [NSString stringWithFormat: 35 | @"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", 36 | result[0], result[1], result[2], result[3], 37 | result[4], result[5], result[6], result[7], 38 | result[8], result[9], result[10], result[11], 39 | result[12], result[13], result[14], result[15] 40 | ]; 41 | } 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /Example/SSJNetWork/SSJNetWork/Classes/Catagory/UINavigationController+SSJNetWork.h: -------------------------------------------------------------------------------- 1 | // 2 | // UINavigationController+SSJNetWork.h 3 | // SSJNetWork_Example 4 | // 5 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | 26 | 27 | NS_ASSUME_NONNULL_BEGIN 28 | 29 | @interface UINavigationController (SSJNetWork) 30 | 31 | @end 32 | 33 | NS_ASSUME_NONNULL_END 34 | -------------------------------------------------------------------------------- /Example/SSJNetWork/SSJNetWork/Classes/Catagory/UINavigationController+SSJNetWork.m: -------------------------------------------------------------------------------- 1 | // 2 | // UINavigationController+SSJNetWork.m 3 | // SSJNetWork_Example 4 | // 5 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #import "UINavigationController+SSJNetWork.h" 26 | #import "SSJNetworkingDefines.h" 27 | #import "SSJURLRequestManager.h" 28 | 29 | @implementation UINavigationController (SSJNetWork) 30 | 31 | + (void)load { 32 | static dispatch_once_t onceToken; 33 | dispatch_once(&onceToken, ^{ 34 | swizzling_exchangeMethod([self class],@selector(popViewControllerAnimated:), @selector(ssj_popViewControllerAnimated:)); 35 | swizzling_exchangeMethod([self class],@selector(popToRootViewControllerAnimated:), @selector(ssj_popToRootViewControllerAnimated:)); 36 | swizzling_exchangeMethod([self class],@selector(popToViewController:animated:), @selector(ssj_popToViewController:animated:)); 37 | }); 38 | } 39 | 40 | - (nullable UIViewController *)ssj_popViewControllerAnimated:(BOOL)animated; { 41 | [self canceledClassRequest]; 42 | return [self ssj_popViewControllerAnimated:animated]; 43 | } 44 | 45 | - (nullable NSArray<__kindof UIViewController *> *)ssj_popToViewController:(UIViewController *)viewController animated:(BOOL)animated { 46 | [self canceledClassRequest]; 47 | return [self ssj_popToViewController:viewController animated:animated]; 48 | } 49 | 50 | - (nullable NSArray<__kindof UIViewController *> *)ssj_popToRootViewControllerAnimated:(BOOL)animated { 51 | [self canceledClassRequest]; 52 | return [self ssj_popToRootViewControllerAnimated:animated]; 53 | } 54 | 55 | - (void)canceledClassRequest{ 56 | [[SSJURLRequestManager requestManager] ssj_cancelObjectClassName:NSStringFromClass([self.topViewController class])]; 57 | } 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /Example/SSJNetWork/SSJNetWork/Classes/Catagory/UIViewController+SSJNetWork.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+SSJNetWork.h 3 | // SSJNetWork_Example 4 | // 5 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | 26 | 27 | NS_ASSUME_NONNULL_BEGIN 28 | 29 | @interface UIViewController (SSJNetWork) 30 | 31 | @end 32 | 33 | NS_ASSUME_NONNULL_END 34 | -------------------------------------------------------------------------------- /Example/SSJNetWork/SSJNetWork/Classes/Catagory/UIViewController+SSJNetWork.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+SSJNetWork.m 3 | // SSJNetWork_Example 4 | // 5 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #import "UIViewController+SSJNetWork.h" 26 | #import "SSJNetworkingDefines.h" 27 | #import "SSJURLRequestManager.h" 28 | 29 | @implementation UIViewController (SSJNetWork) 30 | 31 | +(void)load { 32 | static dispatch_once_t onceToken; 33 | dispatch_once(&onceToken, ^{ 34 | swizzling_exchangeMethod([self class],@selector(dismissViewControllerAnimated:completion:), @selector(ssj_dismissViewControllerAnimated:completion:)); 35 | }); 36 | } 37 | 38 | - (void)ssj_dismissViewControllerAnimated: (BOOL)flag completion: (void (^ __nullable)(void))completion { 39 | [self ssj_dismissViewControllerAnimated:flag completion:completion]; 40 | [self canceledClassRequest]; 41 | } 42 | 43 | - (void)canceledClassRequest { 44 | [[SSJURLRequestManager requestManager] ssj_cancelObjectClassName:NSStringFromClass([self class])]; 45 | } 46 | 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Example/SSJNetWork/SSJNetWork/Classes/Log/NEHTTPEyeDetailViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // NEHTTPEyeDetailViewController.h 3 | // NetworkEye 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 13 | // all 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 21 | // THE SOFTWARE. 22 | 23 | #import 24 | 25 | @class SSJHTTPSessionModel; 26 | 27 | @interface NEHTTPEyeDetailViewController : UIViewController 28 | /** 29 | * detail page's data model,about request,response and data 30 | */ 31 | @property (nonatomic,strong) SSJHTTPSessionModel *model; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Example/SSJNetWork/SSJNetWork/Classes/Log/NEHTTPEyeViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // NEHTTPEyeViewController.h 3 | // NetworkEye 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 13 | // all 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 21 | // THE SOFTWARE. 22 | 23 | #import 24 | 25 | @interface NEHTTPEyeViewController : UIViewController 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Example/SSJNetWork/SSJNetWork/Classes/Log/NEHTTPModelManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // NEHTTPModelManager.h 3 | // SJNetWork 4 | // 5 | // Created by Sunjie on 2019/4/16. 6 | // Copyright © 2019 sxmaps. All rights reserved. 7 | // 8 | 9 | #import 10 | @class SSJHTTPSessionModel; 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface NEHTTPModelManager : NSObject 15 | 16 | { 17 | NSMutableArray *allRequests; 18 | BOOL enablePersistent; 19 | } 20 | 21 | @property(nonatomic,strong) NSString *sqlitePassword; 22 | @property(nonatomic,assign) NSInteger saveRequestMaxCount; 23 | 24 | /** 25 | * get recorded requests 's SQLite filename 26 | * 27 | * @return filename 28 | */ 29 | + (NSString *)filename; 30 | 31 | /** 32 | * get NEHTTPModelManager's singleton object 33 | * 34 | * @return singleton object 35 | */ 36 | + (instancetype)defaultManager; 37 | 38 | /** 39 | * create NEHTTPModel table 40 | */ 41 | - (void)createTable; 42 | 43 | 44 | /** 45 | * add a NEHTTPModel object to SQLite 46 | * 47 | * @param aModel a NEHTTPModel object 48 | */ 49 | - (void)addModel:(SSJHTTPSessionModel *) aModel; 50 | 51 | /** 52 | * get SQLite all NEHTTPModel object 53 | * 54 | * @return all NEHTTPModel object 55 | */ 56 | - (NSMutableArray *)allobjects; 57 | 58 | /** 59 | * delete all SQLite records 60 | */ 61 | - (void) deleteAllItem; 62 | 63 | - (NSMutableArray *)allMapObjects; 64 | - (void)addMapObject:(SSJHTTPSessionModel *)mapReq; 65 | - (void)removeMapObject:(SSJHTTPSessionModel *)mapReq; 66 | - (void)removeAllMapObjects; 67 | 68 | 69 | 70 | @end 71 | 72 | NS_ASSUME_NONNULL_END 73 | -------------------------------------------------------------------------------- /Example/SSJNetWork/SSJNetWork/Classes/Log/SSJLogManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // SSJLogManager.h 3 | // SSJNetWork_Example 4 | // 5 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #import 26 | 27 | NS_ASSUME_NONNULL_BEGIN 28 | 29 | @interface SSJLogManager : NSObject 30 | 31 | + (instancetype)sharedManager; 32 | 33 | - (UIViewController *)LogViewController; 34 | 35 | @end 36 | 37 | NS_ASSUME_NONNULL_END 38 | -------------------------------------------------------------------------------- /Example/SSJNetWork/SSJNetWork/Classes/Log/SSJLogManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // SSJLogManager.m 3 | // SSJNetWork_Example 4 | // 5 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #import "SSJLogManager.h" 26 | #import "NEHTTPEyeViewController.h" 27 | 28 | @implementation SSJLogManager 29 | 30 | + (instancetype)sharedManager { 31 | static SSJLogManager *logManager = nil; 32 | static dispatch_once_t onceToken; 33 | dispatch_once(&onceToken, ^{ 34 | logManager = [[SSJLogManager alloc] init]; 35 | }); 36 | return logManager; 37 | } 38 | 39 | 40 | - (UIViewController *)LogViewController { 41 | NEHTTPEyeViewController *vc = [[NEHTTPEyeViewController alloc] init]; 42 | return vc; 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /Example/SSJNetWork/SSJNetWork/Classes/Log/SSJNetWorkLogHelper.h: -------------------------------------------------------------------------------- 1 | // 2 | // SSJNetWorkLogHelper.h 3 | // SSJNetWork_Example 4 | // 5 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #import 26 | 27 | @class SSJHTTPSessionModel; 28 | 29 | NS_ASSUME_NONNULL_BEGIN 30 | 31 | @interface SSJNetWorkLogHelper : NSObject 32 | 33 | - (instancetype)initWithSessionModel:(SSJHTTPSessionModel *)sessionModel; 34 | 35 | - (NSString *)printRequestLog; 36 | 37 | @end 38 | 39 | NS_ASSUME_NONNULL_END 40 | -------------------------------------------------------------------------------- /Example/SSJNetWork/SSJNetWork/Classes/Request/SSJApiProxy.h: -------------------------------------------------------------------------------- 1 | // 2 | // SSJApiProxy.h 3 | // SSJNetWork_Example 4 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import 25 | @class SSJNetworkRequestConfig; 26 | 27 | NS_ASSUME_NONNULL_BEGIN 28 | 29 | 30 | typedef void(^SJJRequestCompletionBlock)(NSError * _Nullable error, id _Nonnull responseObject,SSJNetworkRequestConfig *requestConfig); 31 | 32 | @interface SSJApiProxy : NSObject 33 | 34 | + (instancetype)sharedInstance; 35 | - (void)callNetWorkRequestConfig:(SSJNetworkRequestConfig *)requestConfig completionBlock:(SJJRequestCompletionBlock)completion; 36 | 37 | 38 | @end 39 | 40 | NS_ASSUME_NONNULL_END 41 | -------------------------------------------------------------------------------- /Example/SSJNetWork/SSJNetWork/Classes/Request/SSJApiRequestManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // SSJApiRequestManager.h 3 | // SSJNetWork_Example 4 | // 5 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #import 26 | @class SSJNetworkRequestConfig; 27 | 28 | 29 | typedef void(^SSJRequestingBlock)(NSError * _Nullable error, id _Nullable responseObject); 30 | 31 | NS_ASSUME_NONNULL_BEGIN 32 | 33 | @interface SSJApiRequestManager : NSObject 34 | 35 | + (instancetype)requestManager; 36 | 37 | - (void)ssj_networkRequestConfig:(SSJNetworkRequestConfig *)config completionBlock:(SSJRequestingBlock)completion; 38 | 39 | @end 40 | 41 | NS_ASSUME_NONNULL_END 42 | -------------------------------------------------------------------------------- /Example/SSJNetWork/SSJNetWork/Classes/Request/SSJHTTPSessionModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // SSJHTTPSessionModel.h 3 | // SSJNetWork_Example 4 | // 5 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #import 26 | 27 | NS_ASSUME_NONNULL_BEGIN 28 | 29 | @interface SSJHTTPSessionModel : NSObject 30 | 31 | @property (nonatomic, strong) NSURLRequest *ne_request; 32 | @property (nonatomic, strong) NSHTTPURLResponse *ne_response; 33 | @property (nonatomic, assign) double ID; 34 | @property (nonatomic, strong) NSString *startDateString; 35 | @property (nonatomic, strong) NSString *endDateString; 36 | 37 | //request 38 | @property (nonatomic, strong) NSString *requestURLString; 39 | @property (nonatomic, strong) NSString *requestCachePolicy; 40 | @property (nonatomic, assign) double requestTimeoutInterval; 41 | @property (nonatomic, nullable, strong) NSString *requestHTTPMethod; 42 | @property (nonatomic, nullable,strong) NSString *requestAllHTTPHeaderFields; 43 | @property (nonatomic, nullable,strong) NSString *requestHTTPBody; 44 | 45 | //response 46 | @property (nonatomic, nullable, strong) NSString *responseMIMEType; 47 | @property (nonatomic, strong) NSString *responseExpectedContentLength; 48 | @property (nonatomic, nullable, strong) NSString *responseTextEncodingName; 49 | @property (nullable, nonatomic, strong) NSString *responseSuggestedFilename; 50 | @property (nonatomic, assign) NSInteger responseStatusCode; 51 | @property (nonatomic, nullable, strong) NSString *responseAllHeaderFields; 52 | 53 | //JSONData 54 | @property (nonatomic, strong) NSString *receiveJSONData; 55 | 56 | @property (nonatomic, strong) NSString *mapPath; 57 | @property (nonatomic, strong) NSString *mapJSONData; 58 | 59 | 60 | @property (nonatomic, strong) NSString *errorDescription; 61 | 62 | - (void)startLoadingRequest:(NSURLRequest *)request; 63 | - (void)endLoadingResponse:(NSURLResponse *)response responseObject:(id)responseObject ErrorDescription:(NSString *)errorDescription; 64 | 65 | 66 | @end 67 | 68 | NS_ASSUME_NONNULL_END 69 | -------------------------------------------------------------------------------- /Example/SSJNetWork/SSJNetWork/Classes/Request/SSJNetWorkConfig.h: -------------------------------------------------------------------------------- 1 | // 2 | // SSJNetWorkConfig.h 3 | // SSJNetWork_Example 4 | // 5 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #import 26 | 27 | @class AFJSONResponseSerializer; 28 | @class AFHTTPSessionManager; 29 | 30 | NS_ASSUME_NONNULL_BEGIN 31 | 32 | @interface SSJNetWorkConfig : NSObject 33 | 34 | - (instancetype)init NS_UNAVAILABLE; 35 | + (instancetype)new NS_UNAVAILABLE; 36 | 37 | + (instancetype)netWorkConfig; 38 | 39 | /** 40 | Set the maximum cache limit 41 | */ 42 | @property (readwrite,nonatomic, assign) NSInteger countLimit; 43 | 44 | /** 45 | Network timeout 46 | */ 47 | @property (readwrite,nonatomic, assign) NSInteger timeoutInterval; 48 | 49 | /** 50 | Cache version 51 | */ 52 | @property (readwrite,nonatomic, assign) NSString *memoryCacheVersion; 53 | 54 | /** 55 | Cache expiration time 56 | */ 57 | @property (readwrite,nonatomic, assign) NSString *cacheTimeInSeconds; 58 | 59 | /** 60 | Request header 61 | */ 62 | @property (readwrite, nonatomic, strong) NSMutableDictionary *mutableHTTPRequestHeaders; 63 | 64 | 65 | /** 66 | Whether log printing is enabled 67 | */ 68 | @property (readwrite,nonatomic, assign) BOOL dubugLogeEnable; 69 | 70 | /** 71 | Whether SQLLog is enabled 72 | */ 73 | @property (readwrite,nonatomic, assign) BOOL SQLLogEnable; 74 | 75 | /** 76 | log password 77 | */ 78 | @property (readwrite,nonatomic, assign) NSString *ne_sqlitePassword; 79 | /** 80 | Set the maximum cache limit 81 | */ 82 | @property (readwrite,nonatomic, assign) NSInteger ne_saveRequestMaxCount; 83 | 84 | /** 85 | demo [SJNetWorkConfig netWorkConfig].sessionManager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"application/json",@"text/json", @"text/javascript",@"text/html",@"text/plain",nil]; 86 | */ 87 | 88 | @property (readwrite,nonatomic, strong) AFJSONResponseSerializer *responseSerializer; 89 | @property (readwrite,nonatomic, strong) AFHTTPSessionManager *sessionManager; 90 | @property (readwrite,nonatomic, strong) NSURLSessionConfiguration *sessionConfiguration; 91 | 92 | @end 93 | 94 | NS_ASSUME_NONNULL_END 95 | -------------------------------------------------------------------------------- /Example/SSJNetWork/SSJNetWork/Classes/Request/SSJNetWorkConfig.m: -------------------------------------------------------------------------------- 1 | // 2 | // SSJNetWorkConfig.m 3 | // SSJNetWork_Example 4 | // 5 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #import "SSJNetWorkConfig.h" 26 | 27 | #if __has_include() 28 | #import 29 | #else 30 | #import "AFNetworking.h" 31 | #endif 32 | 33 | @implementation SSJNetWorkConfig 34 | 35 | + (instancetype)netWorkConfig{ 36 | static SSJNetWorkConfig *netWorkConfig = nil; 37 | static dispatch_once_t onceToken; 38 | dispatch_once(&onceToken, ^{ 39 | netWorkConfig = [[self alloc] init]; 40 | }); 41 | 42 | return netWorkConfig; 43 | } 44 | 45 | - (instancetype)init { 46 | if (self = [super init]) { 47 | 48 | _timeoutInterval = 30; 49 | _cacheTimeInSeconds = @"3"; 50 | _memoryCacheVersion = @"1"; 51 | _countLimit = 5; 52 | _mutableHTTPRequestHeaders = [NSMutableDictionary dictionaryWithCapacity:1]; 53 | _ne_sqlitePassword = @"SJNetwork"; 54 | _ne_saveRequestMaxCount = 300; 55 | _SQLLogEnable = YES; 56 | _dubugLogeEnable = YES; 57 | 58 | _sessionConfiguration = [NSURLSessionConfiguration defaultSessionConfiguration]; 59 | _sessionManager = [[AFHTTPSessionManager alloc] initWithSessionConfiguration:self.sessionConfiguration]; 60 | } 61 | return self; 62 | } 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /Example/SSJNetWork/SSJNetWork/Classes/Request/SSJNetWorkHelper.h: -------------------------------------------------------------------------------- 1 | // 2 | // SSJNetWorkHelper.h 3 | // SSJNetWork_Example 4 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import 25 | 26 | NS_ASSUME_NONNULL_BEGIN 27 | 28 | @interface SSJNetWorkHelper : NSObject 29 | 30 | /** 31 | Get current time 32 | 33 | @return current time 34 | */ 35 | + (NSDate *)ssj_currentDate; 36 | 37 | /** 38 | Get app version 39 | 40 | @return The app version 41 | */ 42 | + (NSString *)ssj_appVersion; 43 | 44 | /** 45 | Get current time 46 | 47 | @return The current time 48 | */ 49 | + (NSString *)ssj_currentTimeString; 50 | 51 | /** 52 | Set the format 53 | 54 | @return Time format 55 | */ 56 | + (NSDateFormatter *)ssj_dateFormatter; 57 | 58 | /** 59 | Compare the current time to the anotherDate size 60 | 61 | @param anotherDate time 62 | @return YES currentDay > anotherDay NO currentDay > anotherDay 63 | */ 64 | + (BOOL)ssj_ratherCurrentTimeWithAnotherTime:(NSDate *)anotherDate; 65 | 66 | 67 | /** 68 | Comparison time size 69 | 70 | @param oneDay time 71 | @param anotherDay time 72 | @return YES oneDay > anotherDay NO oneDay > anotherDay 73 | */ 74 | + (BOOL)ssj_ratherCurrentTimeDay:(NSDate *)oneDay withAnotherDay:(NSDate *)anotherDay; 75 | 76 | /** 77 | Whether the network is connected 78 | 79 | @return YES connection NO not connection 80 | */ 81 | + (BOOL)ssj_isReachable; 82 | 83 | 84 | @end 85 | 86 | NS_ASSUME_NONNULL_END 87 | -------------------------------------------------------------------------------- /Example/SSJNetWork/SSJNetWork/Classes/Request/SSJNetWorkHelper.m: -------------------------------------------------------------------------------- 1 | // 2 | // SSJNetWorkHelper.m 3 | // SSJNetWork_Example 4 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | #import "SSJNetWorkHelper.h" 24 | #import "NSDictionary+SSJNetWork.h" 25 | #import "NSString+SSJNetWork.h" 26 | #import "SSJNetWorkConfig.h" 27 | 28 | 29 | #if __has_include() 30 | #import 31 | #else 32 | #import "AFNetworkReachabilityManager.h" 33 | #endif 34 | 35 | 36 | @implementation SSJNetWorkHelper 37 | 38 | + (NSDate *)ssj_currentDate { 39 | return [NSDate date]; 40 | } 41 | 42 | + (NSString *)ssj_appVersion { 43 | return [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]; 44 | } 45 | 46 | + (BOOL)ssj_ratherCurrentTimeDay:(NSDate *)oneDay withAnotherDay:(NSDate *)anotherDay { 47 | NSTimeInterval delta = [oneDay timeIntervalSinceDate:anotherDay]; 48 | CGFloat minutes = [[SSJNetWorkConfig netWorkConfig].cacheTimeInSeconds floatValue]; 49 | if (delta > 60 * minutes) { 50 | return NO; 51 | } 52 | return YES; 53 | } 54 | 55 | + (BOOL)ssj_ratherCurrentTimeWithAnotherTime:(NSDate *)anotherDate { 56 | NSDate *now = [self ssj_currentDate]; 57 | return [self ssj_ratherCurrentTimeDay:now withAnotherDay:anotherDate]; 58 | } 59 | 60 | + (NSString *)ssj_currentTimeString { 61 | return [[self ssj_dateFormatter] stringFromDate:[self ssj_currentDate]]; 62 | } 63 | 64 | + (NSDateFormatter *)ssj_dateFormatter { 65 | static NSDateFormatter *formatter = nil; 66 | static dispatch_once_t onceToken; 67 | dispatch_once(&onceToken, ^{ 68 | formatter = [[NSDateFormatter alloc] init]; 69 | [formatter setDateFormat:@"yyyy-mm-dd hh:mm:ss zzz"]; 70 | }); 71 | return formatter; 72 | } 73 | 74 | + (BOOL)ssj_isReachable { 75 | 76 | 77 | BOOL reachable = YES; 78 | NSString *netWorkState = [[AFNetworkReachabilityManager sharedManager] localizedNetworkReachabilityStatusString]; 79 | if ([netWorkState isEqualToString:@"Unknow"] || [netWorkState isEqualToString:@"Not Reachable"]) {// 未知 或 无网络 80 | return reachable = NO; 81 | } else if ([netWorkState isEqualToString:@"Reachable via WWAN"]) {// 蜂窝数据 82 | 83 | } else { 84 | 85 | } 86 | return reachable; 87 | } 88 | 89 | 90 | 91 | @end 92 | -------------------------------------------------------------------------------- /Example/SSJNetWork/SSJNetWork/Classes/Request/SSJNetworkRequestConfig.h: -------------------------------------------------------------------------------- 1 | // 2 | // SSJNetworkRequestConfig.h 3 | // SSJNetWork_Example 4 | // 5 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #import 26 | 27 | NS_ASSUME_NONNULL_BEGIN 28 | 29 | @interface SSJNetworkRequestConfig : NSObject 30 | 31 | /** 32 | request metdod 33 | */ 34 | @property (nonatomic, copy) NSString *method; 35 | 36 | /** 37 | requested url 38 | */ 39 | @property (nonatomic, copy) NSString *urlString; 40 | 41 | /** 42 | Request parameters 43 | */ 44 | @property (nonatomic, strong) NSMutableDictionary *params; 45 | 46 | /** 47 | Request the VC class name 48 | */ 49 | @property (nonatomic, copy) NSString *className; 50 | 51 | /** 52 | Ignore Cache 53 | */ 54 | @property (nonatomic, assign) BOOL shouldAllIgnoreCache; 55 | 56 | 57 | @end 58 | 59 | NS_ASSUME_NONNULL_END 60 | -------------------------------------------------------------------------------- /Example/SSJNetWork/SSJNetWork/Classes/Request/SSJNetworkRequestConfig.m: -------------------------------------------------------------------------------- 1 | // 2 | // SSJNetworkRequestConfig.m 3 | // SSJNetWork_Example 4 | // 5 | /// Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | #import "SSJNetworkRequestConfig.h" 25 | 26 | @implementation SSJNetworkRequestConfig 27 | 28 | - (instancetype)init { 29 | if (self = [super init]) { 30 | _shouldAllIgnoreCache = NO; 31 | _params = [NSMutableDictionary dictionaryWithCapacity:1]; 32 | } 33 | return self; 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Example/SSJNetWork/SSJNetWork/Classes/Request/SSJURLRequestManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // SSJURLRequestManager.h 3 | // SSJNetWork_Example 4 | // 5 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #import 26 | #import "SSJNetworkRequestConfig.h" 27 | #import "SSJHTTPSessionModel.h" 28 | 29 | NS_ASSUME_NONNULL_BEGIN 30 | 31 | @interface SSJNetWorkRequestModel : NSObject 32 | 33 | @property (nonatomic, copy) NSString *requestID; 34 | @property (nonatomic, copy) NSString *ClassName; 35 | @property (nonatomic, strong) NSURLSessionDataTask *dataTask; 36 | @property (nonatomic, strong) SSJNetworkRequestConfig *requestConfig; 37 | @property (nonatomic, strong) SSJHTTPSessionModel *sessionModel; 38 | 39 | - (instancetype)initWithRequestID:(NSString *)requestID ClassName:(NSString *)className dataTask:(NSURLSessionDataTask *)dataTask RequestConfig:(SSJNetworkRequestConfig *)requestConfig sessionModel:(SSJHTTPSessionModel *)model; 40 | 41 | @end 42 | 43 | @interface SSJURLRequestManager : NSObject 44 | 45 | + (SSJURLRequestManager *)requestManager; 46 | 47 | - (void)ssj_cancelAllRequest; 48 | - (void)ssj_removeObjectRequestID:(NSString *)requestID; 49 | - (void)ssj_cancelObjectRequestID:(NSString *)requestID; 50 | - (void)ssj_cancelObjectClassName:(NSString *)className; 51 | - (void)ssj_addObjectRequestModel:(SSJNetWorkRequestModel *)model; 52 | -(SSJNetWorkRequestModel *)ssj_valueForKeyRequestID:(NSString *)requestID; 53 | 54 | 55 | @end 56 | 57 | NS_ASSUME_NONNULL_END 58 | -------------------------------------------------------------------------------- /Example/SSJNetWork/SSJNetWork/Classes/SSJNetWork.h: -------------------------------------------------------------------------------- 1 | // 2 | // SJNetWork.h 3 | // SJNetWork 4 | // 5 | // Created by Sunjie on 2019/4/16. 6 | // Copyright © 2019 sxmaps. All rights reserved. 7 | // 8 | 9 | #ifndef SSJNetWork_h 10 | #define SSJNetWork_h 11 | 12 | #import "SSJApiRequestManager.h" 13 | #import "SSJNetWorkConfig.h" 14 | #import "SSJNetworkRequestConfig.h" 15 | #import "SSJNetworkingDefines.h" 16 | 17 | #import "NEHTTPEyeViewController.h" 18 | #import "NEHTTPEyeDetailViewController.h" 19 | 20 | //#import "MBProgressHUD+SJAdditional.h" 21 | 22 | 23 | #endif /* SJNetWork_h */ 24 | 25 | -------------------------------------------------------------------------------- /Example/SSJNetWork/SSJNetWork/Classes/Support Files/SSJNetworkingDefines.h: -------------------------------------------------------------------------------- 1 | // 2 | // SJNetworkingDefines.h 3 | // SJNetWork 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 13 | // all 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 21 | // THE SOFTWARE. 22 | 23 | #ifndef SSJNetworkingDefines_h 24 | #define SSJNetworkingDefines_h 25 | #import 26 | #import "SSJNetWorkConfig.h" 27 | 28 | static inline void swizzling_exchangeMethod(Class _Nonnull clazz, SEL _Nonnull originalSelector, SEL _Nonnull swizzledSelector) { 29 | Method originalMethod = class_getInstanceMethod(clazz, originalSelector); 30 | Method swizzledMethod = class_getInstanceMethod(clazz, swizzledSelector); 31 | 32 | BOOL success = class_addMethod(clazz, originalSelector, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod)); 33 | if (success) { 34 | class_replaceMethod(clazz, swizzledSelector, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod)); 35 | } else { 36 | method_exchangeImplementations(originalMethod, swizzledMethod); 37 | } 38 | } 39 | 40 | typedef NS_ENUM(NSInteger,SSJApiManagerErrorType) { 41 | SSJApiManagerErrorTypeRefreshToken = -1, 42 | SSJApiManagerErrorTypeLogin = -2, 43 | SSJApiManagerErrorTypeCanceled = -3, 44 | SSJApiManagerErrorTypeNoNetWork = -4, 45 | SSJApiManagerErrorTypeTimeOut = -5, 46 | SSJApiManagerErrorTypeSuccess = -6, 47 | SSJApiManagerErrorTypeCacheExpire = -7, 48 | SSJApiManagerErrorTypeDateExpire = -8, 49 | SSJApiManagerErrorTypeAppVersionExpire = -9, 50 | SSJApiManagerErrorTypeInvaliData = -10, 51 | }; 52 | 53 | typedef NS_ENUM(NSInteger,SSJApiManagerNetWorkType) { 54 | SSJApiManagerNetWorkTypeWiFi = 1, 55 | SSJApiManagerNetWorkTypeWWAN , 56 | SSJApiManagerNetWorkTypeNoReachable, 57 | }; 58 | 59 | 60 | #endif /* SJNetworkingDefines_h */ 61 | -------------------------------------------------------------------------------- /Example/SSJNetWork/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example/SSJNetWork/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // SSJNetWork 4 | // 5 | // Created by 15220092519@163.com on 04/22/2019. 6 | // Copyright (c) 2019 15220092519@163.com. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | #import "SSJAppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) 13 | { 14 | @autoreleasepool { 15 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([SSJAppDelegate class])); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Example/Tests/Tests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Example/Tests/Tests-Prefix.pch: -------------------------------------------------------------------------------- 1 | // The contents of this file are implicitly included at the beginning of every test case source file. 2 | 3 | #ifdef __OBJC__ 4 | 5 | 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /Example/Tests/Tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // SSJNetWorkTests.m 3 | // SSJNetWorkTests 4 | // 5 | // Created by 15220092519@163.com on 04/22/2019. 6 | // Copyright (c) 2019 15220092519@163.com. All rights reserved. 7 | // 8 | 9 | @import XCTest; 10 | 11 | @interface Tests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation Tests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | 36 | -------------------------------------------------------------------------------- /Example/Tests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 SUNJIE 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 | -------------------------------------------------------------------------------- /SSJNetWork.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod lib lint SSJNetWork.podspec' to ensure this is a 3 | # valid spec before submitting. 4 | # 5 | # Any lines starting with a # are optional, but their use is encouraged 6 | # To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | s.name = 'SSJNetWork' 11 | s.version = '0.3.0' 12 | s.summary = 'SSJNetWork' 13 | 14 | # This description is used to generate tags and improve search results. 15 | # * Think: What does it do? Why did you write it? What is the focus? 16 | # * Try to keep it short, snappy and to the point. 17 | # * Write the description between the DESC delimiters below. 18 | # * Finally, don't worry about the indent, CocoaPods strips it! 19 | 20 | s.description = '对AFNetWorking 二次封装 实现自动取消网络请求,网络请求缓冲,网络请求日志详细打印' 21 | 22 | s.homepage = 'https://github.com/sunjie19921111/SSJNetWork' 23 | # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2' 24 | s.license = { :type => 'MIT', :file => 'LICENSE' } 25 | s.author = { '15220092519@163.com' => '15220092519@163.com' } 26 | s.source = { :git => 'https://github.com/sunjie19921111/SSJNetWork.git', :tag => s.version.to_s } 27 | # s.social_media_url = 'https://twitter.com/' 28 | 29 | s.ios.deployment_target = '8.0' 30 | 31 | s.source_files = 'SSJNetWork/Classes/**/*' 32 | 33 | s.dependency 'AFNetworking' 34 | s.dependency 'YYCache' 35 | s.dependency 'FMDB/SQLCipher' 36 | 37 | # s.resource_bundles = { 38 | # 'SSJNetWork' => ['SSJNetWork/Assets/*.png'] 39 | # } 40 | 41 | # s.public_header_files = 'Pod/Classes/**/*.h' 42 | # s.frameworks = 'UIKit', 'MapKit' 43 | # s.dependency 'AFNetworking', '~> 2.3' 44 | end 45 | -------------------------------------------------------------------------------- /SSJNetWork/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunjie19921111/SSJNetWork/ef424e990984100b4a72e3748e69bda6685cfe8c/SSJNetWork/Assets/.gitkeep -------------------------------------------------------------------------------- /SSJNetWork/Classes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sunjie19921111/SSJNetWork/ef424e990984100b4a72e3748e69bda6685cfe8c/SSJNetWork/Classes/.gitkeep -------------------------------------------------------------------------------- /SSJNetWork/Classes/Cache/SSJMemCacheDataCenter.h: -------------------------------------------------------------------------------- 1 | // 2 | // SJMemCacheDataCenter.h 3 | // SJNetWork 4 | // 5 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #import 26 | 27 | typedef void(^SJJCacheQueryCompletedBlock)(id response, NSError *error); 28 | 29 | @interface SSJMemCacheConfigModel : NSObject 30 | 31 | @property (nonatomic, copy) NSString *cacheVersion; 32 | @property (nonatomic, copy) NSDate *cacheTime; 33 | @property (nonatomic, copy) NSString *appVersion; 34 | - (instancetype)initWithCacheTime:(NSDate*)cacheTime; 35 | 36 | @end 37 | 38 | 39 | @interface SSJMemCacheDataCenter : NSObject 40 | 41 | + (instancetype)shareInstance; 42 | 43 | - (void)sj_configSetObject:(id)object forKey:(NSString *)key; 44 | - (id)sj_configObjectForKey:(NSString *)key; 45 | - (void)sj_configRemoveObjectForKey:(NSString *)key; 46 | - (void)sj_configRemoveAllObjects; 47 | 48 | - (void)sj_responseSetObject:(id)object forKey:(NSString *)key; 49 | - (id)sj_responseObjectForKey:(NSString *)key; 50 | - (void)sj_responseRemoveObjectForKey:(NSString *)key; 51 | - (void)sj_responseRemoveAllObjects; 52 | 53 | - (void)sj_responseAndConfigRemoveAllObjects; 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /SSJNetWork/Classes/Catagory/NSDictionary+SSJNetWork.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSDictionary+SSJNetWork.h 3 | // SSJNetWork_Example 4 | // 5 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | 26 | 27 | NS_ASSUME_NONNULL_BEGIN 28 | 29 | @interface NSDictionary (SSJNetWork) 30 | 31 | - (NSString *)ssj_jsonString; 32 | - (NSString *)ssj_transformToUrlParamString; 33 | 34 | @end 35 | 36 | NS_ASSUME_NONNULL_END 37 | -------------------------------------------------------------------------------- /SSJNetWork/Classes/Catagory/NSDictionary+SSJNetWork.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSDictionary+SSJNetWork.m 3 | // SSJNetWork_Example 4 | // 5 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #import "NSDictionary+SSJNetWork.h" 26 | 27 | @implementation NSDictionary (SSJNetWork) 28 | 29 | - (NSString *)ssj_transformToUrlParamString { 30 | NSMutableString *paramString = [NSMutableString string]; 31 | for (int i = 0; i < self.count; i ++) { 32 | NSString *string = nil; 33 | if (i == 0) { 34 | string = [NSString stringWithFormat:@"?%@=%@",self.allKeys[i],self[self.allKeys[i]]]; 35 | } else { 36 | string = [NSString stringWithFormat:@"&%@=%@",self.allKeys[i],self[self.allKeys[i]]]; 37 | } 38 | [paramString appendString:string]; 39 | } 40 | return paramString; 41 | } 42 | 43 | - (NSString *)ssj_jsonString { 44 | NSData *jsonData = [NSJSONSerialization dataWithJSONObject:self options:NSJSONWritingPrettyPrinted error:NULL]; 45 | return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; 46 | } 47 | 48 | 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /SSJNetWork/Classes/Catagory/NSObject+SSJNetWork.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+SJNetWork.h 3 | // SJNetWork 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 13 | // all 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 21 | // THE SOFTWARE. 22 | 23 | #import 24 | @class SSJNetworkRequestConfig; 25 | 26 | NS_ASSUME_NONNULL_BEGIN 27 | 28 | typedef NS_ENUM(NSInteger, SSJNetWorkImageType) { 29 | SSJNetWorkImageTypeJPEG, 30 | SSJNetWorkImageTypePNG, 31 | SSJNetWorkImageTypeGIF, 32 | SSJNetWorkImageTypeTIFF, 33 | SSJNetWorkImageTypeUNKNOWN 34 | }; 35 | 36 | @interface NSObject (SSJNetWork) 37 | 38 | - (void)GET:(NSString *)URLString parameters:(nullable id)parameter completion:(void(^)(NSError *error, id responseObject))completion; 39 | 40 | - (void)GET:(NSString *)URLString parameters:(nullable id)parameter useCache:(BOOL)useCache completion:(void(^)(NSError *error, id responseObject))completion; 41 | 42 | - (void)HEAD:(NSString *)URLString 43 | parameters:(nullable id)parameters 44 | completion:(void (^)(NSError * _Nonnull, id _Nonnull))completion; 45 | 46 | - (void)POST:(NSString *)URLString parameters:(nullable id)parameter completion:(void(^)(NSError *error, id responseObject))completion; 47 | 48 | - (void)POST:(NSString *)URLString parameters:(nullable id)parameter 49 | useCache:(BOOL)useCache completion:(void(^)(NSError *error, id responseObject))completion; 50 | 51 | - (void)POST:(NSString *)URLString parameters:(nullable id)parameter 52 | useCache:(BOOL)useCache 53 | progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgress completion:(void(^)(NSError *error, id responseObject))completion; 54 | 55 | - (void)PUT:(NSString *)URLString parameters:(nullable id)parameter completion:(void(^)(NSError *error, id responseObject))completion; 56 | 57 | - (void)DELETE:(NSString *)URLString parameters:(nullable id)parameter completion:(void(^)(NSError *error, id responseObject))completion; 58 | // 59 | - (void)PATCH:(NSString *)URLString parameters:(nullable id)parameter 60 | progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgress completion:(void(^)(NSError *error, id responseObject))completion; 61 | 62 | - (NSURLSessionDataTask *)upload:(NSString *)url params:(id)params 63 | name:(NSString *)name 64 | images:(NSArray *)images 65 | imageScale:(CGFloat)imageScale 66 | imageType:(SSJNetWorkImageType)imageType 67 | progress:(void (^)(NSProgress * _Nonnull))progress 68 | completion:(void (^)(NSError * _Nonnull, id _Nonnull))completion; 69 | 70 | - (NSURLSessionDataTask *)upload:(NSString *)url 71 | params:(id)params 72 | name:(NSString *)name 73 | imageDatas:(NSArray *)imageDatas 74 | progress:(void (^)(NSProgress * _Nonnull))progress 75 | completion:(void (^)(NSError * _Nonnull, id _Nonnull))completion; 76 | 77 | - (NSURLSessionDataTask *)upload:(NSString *)url 78 | params:(id)params 79 | name:(NSString *)name 80 | fileName:(NSString *)fileName 81 | videoURL:(NSString *)videoURL 82 | progress:(void (^)(NSProgress * _Nonnull))progress 83 | completion:(void (^)(NSError * _Nonnull, id _Nonnull))completion; 84 | 85 | - (NSURLSessionDownloadTask *)download:(NSString *)url 86 | fileDir:(NSString *)fileDir 87 | progress:(void (^)(NSProgress * _Nonnull))progress 88 | completion:(void (^)(NSError * _Nonnull, NSURL *filePath))completion; 89 | 90 | @end 91 | 92 | NS_ASSUME_NONNULL_END 93 | -------------------------------------------------------------------------------- /SSJNetWork/Classes/Catagory/NSString+SSJNetWork.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+SSJNetWork.h 3 | // SSJNetWork_Example 4 | // 5 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | 26 | NS_ASSUME_NONNULL_BEGIN 27 | 28 | @interface NSString (SSJNetWork) 29 | 30 | - (NSString *)ssj_MD5String; 31 | 32 | @end 33 | 34 | NS_ASSUME_NONNULL_END 35 | -------------------------------------------------------------------------------- /SSJNetWork/Classes/Catagory/NSString+SSJNetWork.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+SSJNetWork.m 3 | // SSJNetWork_Example 4 | // 5 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #import "NSString+SSJNetWork.h" 26 | #import 27 | 28 | @implementation NSString (SSJNetWork) 29 | 30 | - (NSString *)ssj_MD5String { 31 | const char *cstr = [self UTF8String]; 32 | unsigned char result[16]; 33 | CC_MD5(cstr, (CC_LONG)strlen(cstr), result); 34 | return [NSString stringWithFormat: 35 | @"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", 36 | result[0], result[1], result[2], result[3], 37 | result[4], result[5], result[6], result[7], 38 | result[8], result[9], result[10], result[11], 39 | result[12], result[13], result[14], result[15] 40 | ]; 41 | } 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /SSJNetWork/Classes/Catagory/UINavigationController+SSJNetWork.h: -------------------------------------------------------------------------------- 1 | // 2 | // UINavigationController+SSJNetWork.h 3 | // SSJNetWork_Example 4 | // 5 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | 26 | 27 | NS_ASSUME_NONNULL_BEGIN 28 | 29 | @interface UINavigationController (SSJNetWork) 30 | 31 | @end 32 | 33 | NS_ASSUME_NONNULL_END 34 | -------------------------------------------------------------------------------- /SSJNetWork/Classes/Catagory/UINavigationController+SSJNetWork.m: -------------------------------------------------------------------------------- 1 | // 2 | // UINavigationController+SSJNetWork.m 3 | // SSJNetWork_Example 4 | // 5 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #import "UINavigationController+SSJNetWork.h" 26 | #import "SSJNetworkingDefines.h" 27 | #import "SSJURLRequestManager.h" 28 | 29 | @implementation UINavigationController (SSJNetWork) 30 | 31 | + (void)load { 32 | static dispatch_once_t onceToken; 33 | dispatch_once(&onceToken, ^{ 34 | swizzling_exchangeMethod([self class],@selector(popViewControllerAnimated:), @selector(ssj_popViewControllerAnimated:)); 35 | swizzling_exchangeMethod([self class],@selector(popToRootViewControllerAnimated:), @selector(ssj_popToRootViewControllerAnimated:)); 36 | swizzling_exchangeMethod([self class],@selector(popToViewController:animated:), @selector(ssj_popToViewController:animated:)); 37 | }); 38 | } 39 | 40 | - (nullable UIViewController *)ssj_popViewControllerAnimated:(BOOL)animated; { 41 | [self canceledClassRequest]; 42 | return [self ssj_popViewControllerAnimated:animated]; 43 | } 44 | 45 | - (nullable NSArray<__kindof UIViewController *> *)ssj_popToViewController:(UIViewController *)viewController animated:(BOOL)animated { 46 | [self canceledClassRequest]; 47 | 48 | return [self ssj_popToViewController:viewController animated:animated]; 49 | } 50 | 51 | - (nullable NSArray<__kindof UIViewController *> *)ssj_popToRootViewControllerAnimated:(BOOL)animated { 52 | [self canceledClassRequest]; 53 | return [self ssj_popToRootViewControllerAnimated:animated]; 54 | } 55 | 56 | - (void)canceledClassRequest{ 57 | [[SSJURLRequestManager requestManager] ssj_cancelObjectClassName:NSStringFromClass([self.topViewController class])]; 58 | } 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /SSJNetWork/Classes/Catagory/UIViewController+SSJNetWork.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+SSJNetWork.h 3 | // SSJNetWork_Example 4 | // 5 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | 26 | 27 | NS_ASSUME_NONNULL_BEGIN 28 | 29 | @interface UIViewController (SSJNetWork) 30 | 31 | @end 32 | 33 | NS_ASSUME_NONNULL_END 34 | -------------------------------------------------------------------------------- /SSJNetWork/Classes/Catagory/UIViewController+SSJNetWork.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+SSJNetWork.m 3 | // SSJNetWork_Example 4 | // 5 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #import "UIViewController+SSJNetWork.h" 26 | #import "SSJNetworkingDefines.h" 27 | #import "SSJURLRequestManager.h" 28 | 29 | @implementation UIViewController (SSJNetWork) 30 | 31 | +(void)load { 32 | static dispatch_once_t onceToken; 33 | dispatch_once(&onceToken, ^{ 34 | swizzling_exchangeMethod([self class],@selector(dismissViewControllerAnimated:completion:), @selector(ssj_dismissViewControllerAnimated:completion:)); 35 | }); 36 | } 37 | 38 | - (void)ssj_dismissViewControllerAnimated: (BOOL)flag completion: (void (^ __nullable)(void))completion { 39 | [self ssj_dismissViewControllerAnimated:flag completion:completion]; 40 | [self canceledClassRequest]; 41 | } 42 | 43 | - (void)canceledClassRequest { 44 | [[SSJURLRequestManager requestManager] ssj_cancelObjectClassName:NSStringFromClass([self class])]; 45 | } 46 | 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /SSJNetWork/Classes/Log/NEHTTPEyeDetailViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // NEHTTPEyeDetailViewController.h 3 | // NetworkEye 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 13 | // all 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 21 | // THE SOFTWARE. 22 | 23 | #import 24 | 25 | @class SSJHTTPSessionModel; 26 | 27 | @interface NEHTTPEyeDetailViewController : UIViewController 28 | /** 29 | * detail page's data model,about request,response and data 30 | */ 31 | @property (nonatomic,strong) SSJHTTPSessionModel *model; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /SSJNetWork/Classes/Log/NEHTTPEyeViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // NEHTTPEyeViewController.h 3 | // NetworkEye 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 13 | // all 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 21 | // THE SOFTWARE. 22 | 23 | #import 24 | 25 | @interface NEHTTPEyeViewController : UIViewController 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /SSJNetWork/Classes/Log/NEHTTPModelManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // NEHTTPModelManager.h 3 | // SJNetWork 4 | // 5 | // Created by Sunjie on 2019/4/16. 6 | // Copyright © 2019 sxmaps. All rights reserved. 7 | // 8 | 9 | #import 10 | @class SSJHTTPSessionModel; 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface NEHTTPModelManager : NSObject 15 | 16 | { 17 | NSMutableArray *allRequests; 18 | BOOL enablePersistent; 19 | } 20 | 21 | @property(nonatomic,strong) NSString *sqlitePassword; 22 | @property(nonatomic,assign) NSInteger saveRequestMaxCount; 23 | 24 | /** 25 | * get recorded requests 's SQLite filename 26 | * 27 | * @return filename 28 | */ 29 | + (NSString *)filename; 30 | 31 | /** 32 | * get NEHTTPModelManager's singleton object 33 | * 34 | * @return singleton object 35 | */ 36 | + (instancetype)defaultManager; 37 | 38 | /** 39 | * create NEHTTPModel table 40 | */ 41 | - (void)createTable; 42 | 43 | 44 | /** 45 | * add a NEHTTPModel object to SQLite 46 | * 47 | * @param aModel a NEHTTPModel object 48 | */ 49 | - (void)addModel:(SSJHTTPSessionModel *) aModel; 50 | 51 | /** 52 | * get SQLite all NEHTTPModel object 53 | * 54 | * @return all NEHTTPModel object 55 | */ 56 | - (NSMutableArray *)allobjects; 57 | 58 | /** 59 | * delete all SQLite records 60 | */ 61 | - (void) deleteAllItem; 62 | 63 | - (NSMutableArray *)allMapObjects; 64 | - (void)addMapObject:(SSJHTTPSessionModel *)mapReq; 65 | - (void)removeMapObject:(SSJHTTPSessionModel *)mapReq; 66 | - (void)removeAllMapObjects; 67 | 68 | 69 | 70 | @end 71 | 72 | NS_ASSUME_NONNULL_END 73 | -------------------------------------------------------------------------------- /SSJNetWork/Classes/Log/SSJLogManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // SSJLogManager.h 3 | // SSJNetWork_Example 4 | // 5 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #import 26 | 27 | NS_ASSUME_NONNULL_BEGIN 28 | 29 | @interface SSJLogManager : NSObject 30 | 31 | + (instancetype)sharedManager; 32 | 33 | - (UIViewController *)LogViewController; 34 | 35 | @end 36 | 37 | NS_ASSUME_NONNULL_END 38 | -------------------------------------------------------------------------------- /SSJNetWork/Classes/Log/SSJLogManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // SSJLogManager.m 3 | // SSJNetWork_Example 4 | // 5 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #import "SSJLogManager.h" 26 | #import "NEHTTPEyeViewController.h" 27 | 28 | @implementation SSJLogManager 29 | 30 | + (instancetype)sharedManager { 31 | static SSJLogManager *logManager = nil; 32 | static dispatch_once_t onceToken; 33 | dispatch_once(&onceToken, ^{ 34 | logManager = [[SSJLogManager alloc] init]; 35 | }); 36 | return logManager; 37 | } 38 | 39 | 40 | - (UIViewController *)LogViewController { 41 | NEHTTPEyeViewController *vc = [[NEHTTPEyeViewController alloc] init]; 42 | return vc; 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /SSJNetWork/Classes/Log/SSJNetWorkLogHelper.h: -------------------------------------------------------------------------------- 1 | // 2 | // SSJNetWorkLogHelper.h 3 | // SSJNetWork_Example 4 | // 5 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #import 26 | 27 | @class SSJHTTPSessionModel; 28 | 29 | NS_ASSUME_NONNULL_BEGIN 30 | 31 | @interface SSJNetWorkLogHelper : NSObject 32 | 33 | - (instancetype)initWithSessionModel:(SSJHTTPSessionModel *)sessionModel; 34 | 35 | - (NSString *)printRequestLog; 36 | 37 | @end 38 | 39 | NS_ASSUME_NONNULL_END 40 | -------------------------------------------------------------------------------- /SSJNetWork/Classes/Request/SSJApiProxy.h: -------------------------------------------------------------------------------- 1 | // 2 | // SSJApiProxy.h 3 | // SSJNetWork_Example 4 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import 25 | @class SSJNetworkRequestConfig; 26 | 27 | NS_ASSUME_NONNULL_BEGIN 28 | 29 | 30 | typedef void(^SJJRequestCompletionBlock)(NSError * _Nullable error, id _Nonnull responseObject,SSJNetworkRequestConfig *requestConfig); 31 | 32 | @interface SSJApiProxy : NSObject 33 | 34 | + (instancetype)sharedInstance; 35 | - (void)callNetWorkRequestConfig:(SSJNetworkRequestConfig *)requestConfig 36 | progress:(nullable void (^)(NSProgress * _Nonnull))progress completion:(nonnull SJJRequestCompletionBlock)completion; 37 | 38 | 39 | @end 40 | 41 | NS_ASSUME_NONNULL_END 42 | -------------------------------------------------------------------------------- /SSJNetWork/Classes/Request/SSJApiRequestManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // SSJApiRequestManager.h 3 | // SSJNetWork_Example 4 | // 5 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #import 26 | @class SSJNetworkRequestConfig; 27 | 28 | 29 | typedef void(^SSJRequestingBlock)(NSError * _Nullable error, id _Nullable responseObject); 30 | 31 | NS_ASSUME_NONNULL_BEGIN 32 | 33 | @interface SSJApiRequestManager : NSObject 34 | 35 | + (instancetype)requestManager; 36 | 37 | - (void)ssj_callRequestConfig:(SSJNetworkRequestConfig *)config progress:(nullable void (^)(NSProgress * _Nonnull))uploadProgress 38 | completionBlock:(nullable SSJRequestingBlock)completion; 39 | 40 | @end 41 | 42 | NS_ASSUME_NONNULL_END 43 | -------------------------------------------------------------------------------- /SSJNetWork/Classes/Request/SSJHTTPSessionModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // SSJHTTPSessionModel.h 3 | // SSJNetWork_Example 4 | // 5 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #import 26 | 27 | NS_ASSUME_NONNULL_BEGIN 28 | 29 | @interface SSJHTTPSessionModel : NSObject 30 | 31 | @property (nonatomic, strong) NSURLRequest *ne_request; 32 | @property (nonatomic, strong) NSHTTPURLResponse *ne_response; 33 | @property (nonatomic, assign) double ID; 34 | @property (nonatomic, strong) NSString *startDateString; 35 | @property (nonatomic, strong) NSString *endDateString; 36 | 37 | //request 38 | @property (nonatomic, strong) NSString *requestURLString; 39 | @property (nonatomic, strong) NSString *requestCachePolicy; 40 | @property (nonatomic, assign) double requestTimeoutInterval; 41 | @property (nonatomic, nullable, strong) NSString *requestHTTPMethod; 42 | @property (nonatomic, nullable,strong) NSString *requestAllHTTPHeaderFields; 43 | @property (nonatomic, nullable,strong) NSString *requestHTTPBody; 44 | 45 | //response 46 | @property (nonatomic, nullable, strong) NSString *responseMIMEType; 47 | @property (nonatomic, strong) NSString *responseExpectedContentLength; 48 | @property (nonatomic, nullable, strong) NSString *responseTextEncodingName; 49 | @property (nullable, nonatomic, strong) NSString *responseSuggestedFilename; 50 | @property (nonatomic, assign) NSInteger responseStatusCode; 51 | @property (nonatomic, nullable, strong) NSString *responseAllHeaderFields; 52 | 53 | //JSONData 54 | @property (nonatomic, strong) NSString *receiveJSONData; 55 | 56 | @property (nonatomic, strong) NSString *mapPath; 57 | @property (nonatomic, strong) NSString *mapJSONData; 58 | 59 | 60 | @property (nonatomic, strong) NSString *errorDescription; 61 | 62 | - (void)startLoadingRequest:(NSURLRequest *)request; 63 | - (void)endLoadingResponse:(NSURLResponse *)response responseObject:(id)responseObject ErrorDescription:(NSString *)errorDescription; 64 | 65 | 66 | @end 67 | 68 | NS_ASSUME_NONNULL_END 69 | -------------------------------------------------------------------------------- /SSJNetWork/Classes/Request/SSJNetWorkConfig.h: -------------------------------------------------------------------------------- 1 | // 2 | // SSJNetWorkConfig.h 3 | // SSJNetWork_Example 4 | // 5 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #import 26 | 27 | @class AFJSONResponseSerializer; 28 | @class AFHTTPSessionManager; 29 | 30 | NS_ASSUME_NONNULL_BEGIN 31 | 32 | @interface SSJNetWorkConfig : NSObject 33 | 34 | - (instancetype)init NS_UNAVAILABLE; 35 | + (instancetype)new NS_UNAVAILABLE; 36 | 37 | + (instancetype)netWorkConfig; 38 | 39 | 40 | @property (readwrite,nonatomic, strong) NSString *baseUrl; 41 | 42 | /** 43 | Set the maximum cache limit 44 | */ 45 | @property (readwrite,nonatomic, assign) NSInteger countLimit; 46 | 47 | /** 48 | Network timeout 49 | */ 50 | @property (readwrite,nonatomic, assign) NSInteger timeoutInterval; 51 | 52 | /** 53 | Cache version 54 | */ 55 | @property (readwrite,nonatomic, assign) NSString *memoryCacheVersion; 56 | 57 | /** 58 | Cache expiration time 59 | */ 60 | @property (readwrite,nonatomic, assign) NSString *cacheTimeInSeconds; 61 | 62 | /** 63 | Request header 64 | */ 65 | @property (readwrite, nonatomic, strong) NSMutableDictionary *mutableHTTPRequestHeaders; 66 | 67 | 68 | /** 69 | Whether log printing is enabled 70 | */ 71 | @property (readwrite,nonatomic, assign) BOOL dubugLogeEnable; 72 | 73 | /** 74 | Whether SQLLog is enabled 75 | */ 76 | @property (readwrite,nonatomic, assign) BOOL SQLLogEnable; 77 | 78 | /** 79 | log password 80 | */ 81 | @property (readwrite,nonatomic, assign) NSString *ne_sqlitePassword; 82 | /** 83 | Set the maximum cache limit 84 | */ 85 | @property (readwrite,nonatomic, assign) NSInteger ne_saveRequestMaxCount; 86 | 87 | /** 88 | demo [SJNetWorkConfig netWorkConfig].sessionManager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"application/json",@"text/json", @"text/javascript",@"text/html",@"text/plain",nil]; 89 | */ 90 | 91 | @property (readwrite,nonatomic, strong) AFHTTPSessionManager *sessionManager; 92 | 93 | @end 94 | 95 | NS_ASSUME_NONNULL_END 96 | -------------------------------------------------------------------------------- /SSJNetWork/Classes/Request/SSJNetWorkConfig.m: -------------------------------------------------------------------------------- 1 | // 2 | // SSJNetWorkConfig.m 3 | // SSJNetWork_Example 4 | // 5 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #import "SSJNetWorkConfig.h" 26 | 27 | #if __has_include() 28 | #import 29 | #else 30 | #import "AFNetworking.h" 31 | #endif 32 | 33 | @implementation SSJNetWorkConfig 34 | 35 | + (instancetype)netWorkConfig{ 36 | static SSJNetWorkConfig *netWorkConfig = nil; 37 | static dispatch_once_t onceToken; 38 | dispatch_once(&onceToken, ^{ 39 | netWorkConfig = [[self alloc] init]; 40 | }); 41 | 42 | return netWorkConfig; 43 | } 44 | 45 | - (instancetype)init { 46 | if (self = [super init]) { 47 | 48 | _timeoutInterval = 30; 49 | _cacheTimeInSeconds = @"3"; 50 | _memoryCacheVersion = @"1"; 51 | _countLimit = 5; 52 | _mutableHTTPRequestHeaders = [NSMutableDictionary dictionaryWithCapacity:1]; 53 | _ne_sqlitePassword = @"SJNetwork"; 54 | _ne_saveRequestMaxCount = 300; 55 | _SQLLogEnable = YES; 56 | _dubugLogeEnable = YES; 57 | 58 | _sessionManager = [[AFHTTPSessionManager alloc] initWithSessionConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]]; 59 | _sessionManager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/html", @"text/json", @"text/plain", @"text/javascript", @"text/xml", @"image/*", nil]; 60 | } 61 | return self; 62 | } 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /SSJNetWork/Classes/Request/SSJNetWorkHelper.h: -------------------------------------------------------------------------------- 1 | // 2 | // SSJNetWorkHelper.h 3 | // SSJNetWork_Example 4 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import 25 | 26 | NS_ASSUME_NONNULL_BEGIN 27 | 28 | @interface SSJNetWorkHelper : NSObject 29 | 30 | /** 31 | Get current time 32 | 33 | @return current time 34 | */ 35 | + (NSDate *)ssj_currentDate; 36 | 37 | /** 38 | Get app version 39 | 40 | @return The app version 41 | */ 42 | + (NSString *)ssj_appVersion; 43 | 44 | /** 45 | Get current time 46 | 47 | @return The current time 48 | */ 49 | + (NSString *)ssj_currentTimeString; 50 | 51 | /** 52 | Set the format 53 | 54 | @return Time format 55 | */ 56 | + (NSDateFormatter *)ssj_dateFormatter; 57 | 58 | /** 59 | Compare the current time to the anotherDate size 60 | 61 | @param anotherDate time 62 | @return YES currentDay > anotherDay NO currentDay > anotherDay 63 | */ 64 | + (BOOL)ssj_ratherCurrentTimeWithAnotherTime:(NSDate *)anotherDate; 65 | 66 | 67 | /** 68 | Comparison time size 69 | 70 | @param oneDay time 71 | @param anotherDay time 72 | @return YES oneDay > anotherDay NO oneDay > anotherDay 73 | */ 74 | + (BOOL)ssj_ratherCurrentTimeDay:(NSDate *)oneDay withAnotherDay:(NSDate *)anotherDay; 75 | 76 | /** 77 | Whether the network is connected 78 | 79 | @return YES connection NO not connection 80 | */ 81 | + (BOOL)ssj_isReachable; 82 | 83 | 84 | @end 85 | 86 | NS_ASSUME_NONNULL_END 87 | -------------------------------------------------------------------------------- /SSJNetWork/Classes/Request/SSJNetWorkHelper.m: -------------------------------------------------------------------------------- 1 | // 2 | // SSJNetWorkHelper.m 3 | // SSJNetWork_Example 4 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | #import "SSJNetWorkHelper.h" 24 | #import "NSDictionary+SSJNetWork.h" 25 | #import "NSString+SSJNetWork.h" 26 | #import "SSJNetWorkConfig.h" 27 | 28 | 29 | #if __has_include() 30 | #import 31 | #else 32 | #import "AFNetworkReachabilityManager.h" 33 | #endif 34 | 35 | 36 | @implementation SSJNetWorkHelper 37 | 38 | + (NSDate *)ssj_currentDate { 39 | return [NSDate date]; 40 | } 41 | 42 | + (NSString *)ssj_appVersion { 43 | return [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]; 44 | } 45 | 46 | + (BOOL)ssj_ratherCurrentTimeDay:(NSDate *)oneDay withAnotherDay:(NSDate *)anotherDay { 47 | NSTimeInterval delta = [oneDay timeIntervalSinceDate:anotherDay]; 48 | CGFloat minutes = [[SSJNetWorkConfig netWorkConfig].cacheTimeInSeconds floatValue]; 49 | if (delta > 60 * minutes) { 50 | return NO; 51 | } 52 | return YES; 53 | } 54 | 55 | + (BOOL)ssj_ratherCurrentTimeWithAnotherTime:(NSDate *)anotherDate { 56 | NSDate *now = [self ssj_currentDate]; 57 | return [self ssj_ratherCurrentTimeDay:now withAnotherDay:anotherDate]; 58 | } 59 | 60 | + (NSString *)ssj_currentTimeString { 61 | return [[self ssj_dateFormatter] stringFromDate:[self ssj_currentDate]]; 62 | } 63 | 64 | + (NSDateFormatter *)ssj_dateFormatter { 65 | static NSDateFormatter *formatter = nil; 66 | static dispatch_once_t onceToken; 67 | dispatch_once(&onceToken, ^{ 68 | formatter = [[NSDateFormatter alloc] init]; 69 | [formatter setDateFormat:@"yyyy-mm-dd hh:mm:ss zzz"]; 70 | }); 71 | return formatter; 72 | } 73 | 74 | + (BOOL)ssj_isReachable { 75 | 76 | 77 | BOOL reachable = YES; 78 | NSString *netWorkState = [[AFNetworkReachabilityManager sharedManager] localizedNetworkReachabilityStatusString]; 79 | if ([netWorkState isEqualToString:@"Unknow"] || [netWorkState isEqualToString:@"Not Reachable"]) {// 未知 或 无网络 80 | return reachable = NO; 81 | } else if ([netWorkState isEqualToString:@"Reachable via WWAN"]) {// 蜂窝数据 82 | 83 | } else { 84 | 85 | } 86 | return reachable; 87 | } 88 | 89 | 90 | 91 | @end 92 | -------------------------------------------------------------------------------- /SSJNetWork/Classes/Request/SSJNetworkRequestConfig.h: -------------------------------------------------------------------------------- 1 | // 2 | // SSJNetworkRequestConfig.h 3 | // SSJNetWork_Example 4 | // 5 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #import 26 | 27 | NS_ASSUME_NONNULL_BEGIN 28 | 29 | @interface SSJNetworkRequestConfig : NSObject 30 | 31 | /** 32 | request metdod 33 | */ 34 | @property (nonatomic, copy) NSString *method; 35 | 36 | /** 37 | requested url 38 | */ 39 | @property (nonatomic, copy) NSString *urlString; 40 | 41 | /** 42 | Request parameters 43 | */ 44 | @property (nonatomic, strong) NSMutableDictionary *params; 45 | 46 | /** 47 | Request the VC class name 48 | */ 49 | @property (nonatomic, copy) NSString *className; 50 | 51 | /** 52 | isUserCache 53 | */ 54 | @property (nonatomic, assign, getter=isUserCache) BOOL useCache; 55 | 56 | 57 | @end 58 | 59 | NS_ASSUME_NONNULL_END 60 | -------------------------------------------------------------------------------- /SSJNetWork/Classes/Request/SSJNetworkRequestConfig.m: -------------------------------------------------------------------------------- 1 | // 2 | // SSJNetworkRequestConfig.m 3 | // SSJNetWork_Example 4 | // 5 | /// Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | #import "SSJNetworkRequestConfig.h" 25 | 26 | @implementation SSJNetworkRequestConfig 27 | 28 | - (instancetype)init { 29 | if (self = [super init]) { 30 | _useCache = YES; 31 | _params = [NSMutableDictionary dictionaryWithCapacity:1]; 32 | } 33 | return self; 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /SSJNetWork/Classes/Request/SSJURLRequestManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // SSJURLRequestManager.h 3 | // SSJNetWork_Example 4 | // 5 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #import 26 | #import "SSJNetworkRequestConfig.h" 27 | #import "SSJHTTPSessionModel.h" 28 | 29 | NS_ASSUME_NONNULL_BEGIN 30 | 31 | @interface SSJNetWorkRequestModel : NSObject 32 | 33 | @property (nonatomic, copy) NSString *requestID; 34 | @property (nonatomic, copy) NSString *ClassName; 35 | @property (nonatomic, strong) NSURLSessionDataTask *dataTask; 36 | @property (nonatomic, strong) SSJNetworkRequestConfig *requestConfig; 37 | @property (nonatomic, strong) SSJHTTPSessionModel *sessionModel; 38 | 39 | - (instancetype)initWithRequestID:(NSString *)requestID ClassName:(NSString *)className dataTask:(NSURLSessionDataTask *)dataTask RequestConfig:(SSJNetworkRequestConfig *)requestConfig sessionModel:(SSJHTTPSessionModel *)model; 40 | 41 | @end 42 | 43 | @interface SSJURLRequestManager : NSObject 44 | 45 | + (SSJURLRequestManager *)requestManager; 46 | 47 | - (void)ssj_cancelAllRequest; 48 | - (void)ssj_removeObjectRequestID:(NSString *)requestID; 49 | - (void)ssj_cancelObjectRequestID:(NSString *)requestID; 50 | - (void)ssj_cancelObjectClassName:(NSString *)className; 51 | - (void)ssj_addObjectRequestModel:(SSJNetWorkRequestModel *)model; 52 | -(SSJNetWorkRequestModel *)ssj_valueForKeyRequestID:(NSString *)requestID; 53 | 54 | 55 | @end 56 | 57 | NS_ASSUME_NONNULL_END 58 | -------------------------------------------------------------------------------- /SSJNetWork/Classes/Request/SSJURLRequestManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // SSJURLRequestManager.m 3 | // SSJNetWork_Example 4 | // 5 | // Copyright (c) 2012-2016 SSJNetWork https://github.com/sunjie19921111/SSJNetWork 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #import "SSJURLRequestManager.h" 26 | 27 | #import "SSJNetworkRequestConfig.h" 28 | #import "SSJHTTPSessionModel.h" 29 | 30 | @implementation SSJNetWorkRequestModel 31 | 32 | - (instancetype)initWithRequestID:(NSString *)requestID ClassName:(NSString *)className dataTask:(nonnull NSURLSessionDataTask *)dataTask RequestConfig:(nonnull SSJNetworkRequestConfig *)requestConfig sessionModel:(nonnull SSJHTTPSessionModel *)model { 33 | if (self = [ super init]) { 34 | self.requestID = requestID; 35 | self.ClassName = className; 36 | self.dataTask = dataTask; 37 | self.requestConfig = requestConfig; 38 | self.sessionModel = model; 39 | } 40 | return self; 41 | } 42 | 43 | @end 44 | 45 | @interface SSJURLRequestManager () 46 | 47 | @property (nonatomic, strong) NSMutableArray *requestIds; 48 | 49 | @end 50 | 51 | @implementation SSJURLRequestManager 52 | 53 | + (SSJURLRequestManager *)requestManager { 54 | static SSJURLRequestManager *manager = nil; 55 | static dispatch_once_t onceToken; 56 | dispatch_once(&onceToken, ^{ 57 | manager = [[SSJURLRequestManager alloc] init]; 58 | }); 59 | return manager; 60 | } 61 | 62 | - (instancetype)init { 63 | if (self = [super init]) { 64 | _requestIds = [NSMutableArray arrayWithCapacity:1]; 65 | } 66 | return self; 67 | } 68 | 69 | - (void)ssj_addObjectRequestModel:(SSJNetWorkRequestModel *)model { 70 | @synchronized (self) { 71 | [_requestIds addObject:model]; 72 | } 73 | } 74 | 75 | - (void)ssj_removeObjectRequestID:(NSString *)requestID { 76 | @synchronized (self) { 77 | __block SSJNetWorkRequestModel *model = nil; 78 | [_requestIds enumerateObjectsUsingBlock:^(SSJNetWorkRequestModel *obj, NSUInteger idx, BOOL * _Nonnull stop) { 79 | if ([obj.requestID isEqualToString:requestID]) { 80 | model = obj; 81 | *stop = YES; 82 | } 83 | }]; 84 | if (model) { 85 | [self.requestIds removeObject:model]; 86 | } 87 | } 88 | } 89 | 90 | -(SSJNetWorkRequestModel *)ssj_valueForKeyRequestID:(NSString *)requestID { 91 | @synchronized (self) { 92 | __block SSJNetWorkRequestModel *model = nil; 93 | [_requestIds enumerateObjectsUsingBlock:^(SSJNetWorkRequestModel *obj, NSUInteger idx, BOOL * _Nonnull stop) { 94 | if ([obj.requestID isEqualToString:requestID]) { 95 | model = obj; 96 | } 97 | }]; 98 | return model; 99 | } 100 | } 101 | 102 | - (void)ssj_cancelObjectRequestID:(NSString *)requestID { 103 | @synchronized (self) { 104 | __block SSJNetWorkRequestModel *model = nil; 105 | [_requestIds enumerateObjectsUsingBlock:^(SSJNetWorkRequestModel *obj, NSUInteger idx, BOOL * _Nonnull stop) { 106 | if ([obj.requestID isEqualToString:requestID]) { 107 | *stop = YES; 108 | model = obj; 109 | } 110 | }]; 111 | if (model) { 112 | [model.dataTask cancel]; 113 | [self.requestIds removeObject:model]; 114 | } 115 | } 116 | } 117 | 118 | - (void)ssj_cancelObjectClassName:(NSString *)className { 119 | @synchronized (self) { 120 | NSMutableArray *classRequests = [NSMutableArray arrayWithCapacity:1]; 121 | [_requestIds enumerateObjectsUsingBlock:^(SSJNetWorkRequestModel *obj, NSUInteger idx, BOOL * _Nonnull stop) { 122 | if ([obj.ClassName isEqualToString:className]) { 123 | [obj.dataTask cancel]; 124 | [classRequests addObject:obj]; 125 | } 126 | }]; 127 | [classRequests enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { 128 | [self.requestIds removeObject:obj]; 129 | }]; 130 | } 131 | } 132 | 133 | - (void)ssj_cancelAllRequest { 134 | [self.requestIds removeAllObjects]; 135 | } 136 | 137 | @end 138 | -------------------------------------------------------------------------------- /SSJNetWork/Classes/Request/SSUploadTaskRequest.h: -------------------------------------------------------------------------------- 1 | // 2 | // SSUploadTaskRequest.h 3 | // SSJNetWork_Example 4 | // 5 | // Created by apple on 2019/8/29. 6 | // Copyright © 2019 15220092519@163.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //typedef NS_ENUM(NSInteger, SSJNetWorkImageType) { 12 | // SSJNetWorkImageTypeJPEG, 13 | // SSJNetWorkImageTypePNG, 14 | // SSJNetWorkImageTypeGIF, 15 | // SSJNetWorkImageTypeTIFF, 16 | // SSJNetWorkImageTypeUNKNOWN 17 | //}; 18 | 19 | NS_ASSUME_NONNULL_BEGIN 20 | 21 | @interface SSUploadTaskRequest : NSObject 22 | 23 | @end 24 | 25 | NS_ASSUME_NONNULL_END 26 | -------------------------------------------------------------------------------- /SSJNetWork/Classes/SSJNetWork.h: -------------------------------------------------------------------------------- 1 | // 2 | // SJNetWork.h 3 | // SJNetWork 4 | // 5 | // Created by Sunjie on 2019/4/16. 6 | // Copyright © 2019 sxmaps. All rights reserved. 7 | // 8 | 9 | #ifndef SSJNetWork_h 10 | #define SSJNetWork_h 11 | 12 | #import "SSJApiRequestManager.h" 13 | #import "SSJNetWorkConfig.h" 14 | #import "SSJNetworkRequestConfig.h" 15 | #import "SSJNetworkingDefines.h" 16 | #import "SSJLogManager.h" 17 | #import "NSObject+SSJNetWork.h" 18 | 19 | #import "NEHTTPEyeViewController.h" 20 | #import "NEHTTPEyeDetailViewController.h" 21 | 22 | //#import "MBProgressHUD+SJAdditional.h" 23 | 24 | 25 | #endif /* SJNetWork_h */ 26 | 27 | -------------------------------------------------------------------------------- /SSJNetWork/Classes/Support Files/SSJNetworkingDefines.h: -------------------------------------------------------------------------------- 1 | // 2 | // SJNetworkingDefines.h 3 | // SJNetWork 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 13 | // all 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 21 | // THE SOFTWARE. 22 | 23 | #ifndef SSJNetworkingDefines_h 24 | #define SSJNetworkingDefines_h 25 | #import 26 | #import "SSJNetWorkConfig.h" 27 | 28 | static inline void swizzling_exchangeMethod(Class _Nonnull clazz, SEL _Nonnull originalSelector, SEL _Nonnull swizzledSelector) { 29 | Method originalMethod = class_getInstanceMethod(clazz, originalSelector); 30 | Method swizzledMethod = class_getInstanceMethod(clazz, swizzledSelector); 31 | 32 | BOOL success = class_addMethod(clazz, originalSelector, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod)); 33 | if (success) { 34 | class_replaceMethod(clazz, swizzledSelector, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod)); 35 | } else { 36 | method_exchangeImplementations(originalMethod, swizzledMethod); 37 | } 38 | } 39 | 40 | typedef NS_ENUM(NSInteger,SSJApiManagerErrorType) { 41 | SSJApiManagerErrorTypeRefreshToken = -1, 42 | SSJApiManagerErrorTypeLogin = -2, 43 | SSJApiManagerErrorTypeCanceled = -3, 44 | SSJApiManagerErrorTypeNoNetWork = -4, 45 | SSJApiManagerErrorTypeTimeOut = -5, 46 | SSJApiManagerErrorTypeSuccess = -6, 47 | SSJApiManagerErrorTypeCacheExpire = -7, 48 | SSJApiManagerErrorTypeDateExpire = -8, 49 | SSJApiManagerErrorTypeAppVersionExpire = -9, 50 | SSJApiManagerErrorTypeInvaliData = -10, 51 | }; 52 | 53 | typedef NS_ENUM(NSInteger,SSJApiManagerNetWorkType) { 54 | SSJApiManagerNetWorkTypeWiFi = 1, 55 | SSJApiManagerNetWorkTypeWWAN , 56 | SSJApiManagerNetWorkTypeNoReachable, 57 | }; 58 | 59 | 60 | #endif /* SJNetworkingDefines_h */ 61 | -------------------------------------------------------------------------------- /_Pods.xcodeproj: -------------------------------------------------------------------------------- 1 | Example/Pods/Pods.xcodeproj --------------------------------------------------------------------------------