├── Example └── SwiftNetTest │ ├── Pods │ ├── SwiftyNet │ │ ├── README.md │ │ ├── SwiftyNet.xcframework │ │ │ ├── ios-arm64 │ │ │ │ └── SwiftyNet.framework │ │ │ │ │ ├── Info.plist │ │ │ │ │ ├── SwiftyNet │ │ │ │ │ ├── Modules │ │ │ │ │ ├── SwiftyNet.swiftmodule │ │ │ │ │ │ ├── arm64.swiftdoc │ │ │ │ │ │ └── arm64-apple-ios.swiftdoc │ │ │ │ │ └── module.modulemap │ │ │ │ │ └── Headers │ │ │ │ │ └── SwiftyNet.h │ │ │ ├── ios-arm64_x86_64-simulator │ │ │ │ └── SwiftyNet.framework │ │ │ │ │ ├── Info.plist │ │ │ │ │ ├── SwiftyNet │ │ │ │ │ ├── Modules │ │ │ │ │ ├── module.modulemap │ │ │ │ │ └── SwiftyNet.swiftmodule │ │ │ │ │ │ ├── arm64.swiftdoc │ │ │ │ │ │ ├── x86_64.swiftdoc │ │ │ │ │ │ ├── arm64-apple-ios-simulator.swiftdoc │ │ │ │ │ │ └── x86_64-apple-ios-simulator.swiftdoc │ │ │ │ │ └── Headers │ │ │ │ │ └── SwiftyNet.h │ │ │ └── Info.plist │ │ └── LICENSE │ ├── Target Support Files │ │ ├── SwiftyNet │ │ │ ├── SwiftyNet-xcframeworks-output-files.xcfilelist │ │ │ ├── SwiftyNet-xcframeworks-input-files.xcfilelist │ │ │ ├── SwiftyNet.debug.xcconfig │ │ │ └── SwiftyNet.release.xcconfig │ │ ├── Alamofire │ │ │ ├── Alamofire.modulemap │ │ │ ├── Alamofire-dummy.m │ │ │ ├── Alamofire-prefix.pch │ │ │ ├── Alamofire-umbrella.h │ │ │ ├── Alamofire.debug.xcconfig │ │ │ ├── Alamofire.release.xcconfig │ │ │ └── Alamofire-Info.plist │ │ ├── Pods-SwiftNetTest │ │ │ ├── Pods-SwiftNetTest.modulemap │ │ │ ├── Pods-SwiftNetTest-dummy.m │ │ │ ├── Pods-SwiftNetTest-frameworks-Debug-output-files.xcfilelist │ │ │ ├── Pods-SwiftNetTest-frameworks-Release-output-files.xcfilelist │ │ │ ├── Pods-SwiftNetTest-frameworks-Debug-input-files.xcfilelist │ │ │ ├── Pods-SwiftNetTest-frameworks-Release-input-files.xcfilelist │ │ │ ├── Pods-SwiftNetTest-umbrella.h │ │ │ ├── Pods-SwiftNetTest-Info.plist │ │ │ ├── Pods-SwiftNetTest.debug.xcconfig │ │ │ ├── Pods-SwiftNetTest.release.xcconfig │ │ │ ├── Pods-SwiftNetTest-acknowledgements.markdown │ │ │ └── Pods-SwiftNetTest-acknowledgements.plist │ │ ├── Pods-SwiftNetTestTests │ │ │ ├── Pods-SwiftNetTestTests-acknowledgements.markdown │ │ │ ├── Pods-SwiftNetTestTests.modulemap │ │ │ ├── Pods-SwiftNetTestTests-dummy.m │ │ │ ├── Pods-SwiftNetTestTests-umbrella.h │ │ │ ├── Pods-SwiftNetTestTests.debug.xcconfig │ │ │ ├── Pods-SwiftNetTestTests.release.xcconfig │ │ │ ├── Pods-SwiftNetTestTests-Info.plist │ │ │ └── Pods-SwiftNetTestTests-acknowledgements.plist │ │ └── Pods-SwiftNetTest-SwiftNetTestUITests │ │ │ ├── Pods-SwiftNetTest-SwiftNetTestUITests-frameworks-Debug-output-files.xcfilelist │ │ │ ├── Pods-SwiftNetTest-SwiftNetTestUITests-frameworks-Release-output-files.xcfilelist │ │ │ ├── Pods-SwiftNetTest-SwiftNetTestUITests.modulemap │ │ │ ├── Pods-SwiftNetTest-SwiftNetTestUITests-dummy.m │ │ │ ├── Pods-SwiftNetTest-SwiftNetTestUITests-frameworks-Debug-input-files.xcfilelist │ │ │ ├── Pods-SwiftNetTest-SwiftNetTestUITests-frameworks-Release-input-files.xcfilelist │ │ │ ├── Pods-SwiftNetTest-SwiftNetTestUITests-umbrella.h │ │ │ ├── Pods-SwiftNetTest-SwiftNetTestUITests-Info.plist │ │ │ ├── Pods-SwiftNetTest-SwiftNetTestUITests.debug.xcconfig │ │ │ ├── Pods-SwiftNetTest-SwiftNetTestUITests.release.xcconfig │ │ │ ├── Pods-SwiftNetTest-SwiftNetTestUITests-acknowledgements.markdown │ │ │ └── Pods-SwiftNetTest-SwiftNetTestUITests-acknowledgements.plist │ ├── Manifest.lock │ └── Alamofire │ │ ├── LICENSE │ │ └── Source │ │ ├── Alamofire.swift │ │ ├── DispatchQueue+Alamofire.swift │ │ ├── URLRequest+Alamofire.swift │ │ ├── URLSessionConfiguration+Alamofire.swift │ │ ├── StringEncoding+Alamofire.swift │ │ ├── HTTPMethod.swift │ │ ├── AlamofireExtended.swift │ │ ├── OperationQueue+Alamofire.swift │ │ ├── MultipartUpload.swift │ │ ├── CachedResponseHandler.swift │ │ ├── URLConvertible+URLRequestConvertible.swift │ │ └── RedirectHandler.swift │ ├── SwiftNetTest │ ├── Assets.xcassets │ │ ├── Contents.json │ │ ├── AccentColor.colorset │ │ │ └── Contents.json │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── UsersRouter.swift │ ├── ViewController.swift │ ├── AppDelegate.swift │ ├── UsersNetworking.swift │ ├── Base.lproj │ │ ├── Main.storyboard │ │ └── LaunchScreen.storyboard │ ├── Info.plist │ └── SceneDelegate.swift │ ├── SwiftNetTest.xcodeproj │ └── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ ├── SwiftNetTest.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ ├── Podfile.lock │ ├── Podfile │ ├── SwiftNetTestTests │ ├── Info.plist │ └── SwiftNetTestTests.swift │ └── SwiftNetTestUITests │ ├── Info.plist │ └── SwiftNetTestUITests.swift ├── Pods ├── Target Support Files │ ├── Alamofire │ │ ├── Alamofire.modulemap │ │ ├── Alamofire-dummy.m │ │ ├── Alamofire-prefix.pch │ │ ├── Alamofire-umbrella.h │ │ ├── Alamofire.debug.xcconfig │ │ ├── Alamofire.release.xcconfig │ │ └── Alamofire-Info.plist │ ├── Pods-SwiftyNet-SwiftyNetTests │ │ ├── Pods-SwiftyNet-SwiftyNetTests-frameworks-Debug-output-files.xcfilelist │ │ ├── Pods-SwiftyNet-SwiftyNetTests-frameworks-Release-output-files.xcfilelist │ │ ├── Pods-SwiftyNet-SwiftyNetTests.modulemap │ │ ├── Pods-SwiftyNet-SwiftyNetTests-dummy.m │ │ ├── Pods-SwiftyNet-SwiftyNetTests-frameworks-Debug-input-files.xcfilelist │ │ ├── Pods-SwiftyNet-SwiftyNetTests-frameworks-Release-input-files.xcfilelist │ │ ├── Pods-SwiftyNet-SwiftyNetTests-umbrella.h │ │ ├── Pods-SwiftyNet-SwiftyNetTests.debug.xcconfig │ │ ├── Pods-SwiftyNet-SwiftyNetTests-Info.plist │ │ ├── Pods-SwiftyNet-SwiftyNetTests.release.xcconfig │ │ ├── Pods-SwiftyNet-SwiftyNetTests-acknowledgements.markdown │ │ └── Pods-SwiftyNet-SwiftyNetTests-acknowledgements.plist │ └── Pods-SwiftyNet │ │ ├── Pods-SwiftyNet.modulemap │ │ ├── Pods-SwiftyNet-dummy.m │ │ ├── Pods-SwiftyNet-umbrella.h │ │ ├── Pods-SwiftyNet.debug.xcconfig │ │ ├── Pods-SwiftyNet.release.xcconfig │ │ ├── Pods-SwiftyNet-Info.plist │ │ ├── Pods-SwiftyNet-acknowledgements.markdown │ │ └── Pods-SwiftyNet-acknowledgements.plist ├── Manifest.lock └── Alamofire │ ├── LICENSE │ └── Source │ ├── Alamofire.swift │ ├── DispatchQueue+Alamofire.swift │ ├── URLRequest+Alamofire.swift │ ├── URLSessionConfiguration+Alamofire.swift │ ├── StringEncoding+Alamofire.swift │ ├── HTTPMethod.swift │ ├── AlamofireExtended.swift │ ├── OperationQueue+Alamofire.swift │ ├── MultipartUpload.swift │ ├── CachedResponseHandler.swift │ ├── URLConvertible+URLRequestConvertible.swift │ └── RedirectHandler.swift ├── SwiftyNet.xcframework ├── ios-arm64 │ └── SwiftyNet.framework │ │ ├── Info.plist │ │ ├── SwiftyNet │ │ ├── Modules │ │ ├── SwiftyNet.swiftmodule │ │ │ ├── arm64.swiftdoc │ │ │ ├── arm64-apple-ios.swiftdoc │ │ │ ├── arm64.swiftinterface │ │ │ └── arm64-apple-ios.swiftinterface │ │ └── module.modulemap │ │ └── Headers │ │ └── SwiftyNet.h ├── ios-arm64_x86_64-simulator │ └── SwiftyNet.framework │ │ ├── SwiftyNet │ │ ├── Info.plist │ │ ├── Modules │ │ ├── SwiftyNet.swiftmodule │ │ │ ├── arm64.swiftdoc │ │ │ ├── x86_64.swiftdoc │ │ │ ├── arm64-apple-ios-simulator.swiftdoc │ │ │ ├── x86_64-apple-ios-simulator.swiftdoc │ │ │ ├── arm64.swiftinterface │ │ │ └── x86_64.swiftinterface │ │ └── module.modulemap │ │ └── Headers │ │ └── SwiftyNet.h └── Info.plist ├── SwiftyNet.xcodeproj └── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── SwiftyNet.xcworkspace ├── contents.xcworkspacedata └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── Podfile.lock ├── Podfile ├── SwiftyNet ├── SwiftyNet.h ├── Info.plist ├── SessionManager │ └── SessionManager.swift ├── Support │ ├── NetworkResponse.swift │ ├── NetworkRequest.swift │ └── NetworkError.swift ├── Extensions │ └── Data+Extensions.swift └── Executer │ └── NetworkExecutor.swift ├── SwiftyNet.podspec ├── SwiftyNetTests ├── Info.plist └── SwiftyNetTests.swift ├── LICENSE ├── README.md └── .gitignore /Example/SwiftNetTest/Pods/SwiftyNet/README.md: -------------------------------------------------------------------------------- 1 | # SwiftyNet 2 | A generic network layer written in swift 3 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Target Support Files/SwiftyNet/SwiftyNet-xcframeworks-output-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${PODS_XCFRAMEWORKS_BUILD_DIR}/SwiftyNet -------------------------------------------------------------------------------- /Example/SwiftNetTest/SwiftNetTest/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Alamofire/Alamofire.modulemap: -------------------------------------------------------------------------------- 1 | framework module Alamofire { 2 | umbrella header "Alamofire-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftyNet-SwiftyNetTests/Pods-SwiftyNet-SwiftyNetTests-frameworks-Debug-output-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftyNet-SwiftyNetTests/Pods-SwiftyNet-SwiftyNetTests-frameworks-Release-output-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework -------------------------------------------------------------------------------- /SwiftyNet.xcframework/ios-arm64/SwiftyNet.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohammed-salah-zidane/SwiftyNet/HEAD/SwiftyNet.xcframework/ios-arm64/SwiftyNet.framework/Info.plist -------------------------------------------------------------------------------- /SwiftyNet.xcframework/ios-arm64/SwiftyNet.framework/SwiftyNet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohammed-salah-zidane/SwiftyNet/HEAD/SwiftyNet.xcframework/ios-arm64/SwiftyNet.framework/SwiftyNet -------------------------------------------------------------------------------- /Pods/Target Support Files/Alamofire/Alamofire-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Alamofire : NSObject 3 | @end 4 | @implementation PodsDummy_Alamofire 5 | @end 6 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Target Support Files/Alamofire/Alamofire.modulemap: -------------------------------------------------------------------------------- 1 | framework module Alamofire { 2 | umbrella header "Alamofire-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftyNet/Pods-SwiftyNet.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_SwiftyNet { 2 | umbrella header "Pods-SwiftyNet-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Target Support Files/Alamofire/Alamofire-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Alamofire : NSObject 3 | @end 4 | @implementation PodsDummy_Alamofire 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftyNet/Pods-SwiftyNet-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_SwiftyNet : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_SwiftyNet 5 | @end 6 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Target Support Files/SwiftyNet/SwiftyNet-xcframeworks-input-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${PODS_ROOT}/Target Support Files/SwiftyNet/SwiftyNet-xcframeworks.sh 2 | ${PODS_ROOT}/SwiftyNet/SwiftyNet.xcframework -------------------------------------------------------------------------------- /SwiftyNet.xcframework/ios-arm64_x86_64-simulator/SwiftyNet.framework/SwiftyNet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohammed-salah-zidane/SwiftyNet/HEAD/SwiftyNet.xcframework/ios-arm64_x86_64-simulator/SwiftyNet.framework/SwiftyNet -------------------------------------------------------------------------------- /SwiftyNet.xcframework/ios-arm64_x86_64-simulator/SwiftyNet.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohammed-salah-zidane/SwiftyNet/HEAD/SwiftyNet.xcframework/ios-arm64_x86_64-simulator/SwiftyNet.framework/Info.plist -------------------------------------------------------------------------------- /SwiftyNet.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Target Support Files/Pods-SwiftNetTest/Pods-SwiftNetTest.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_SwiftNetTest { 2 | umbrella header "Pods-SwiftNetTest-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Target Support Files/Pods-SwiftNetTest/Pods-SwiftNetTest-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_SwiftNetTest : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_SwiftNetTest 5 | @end 6 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/SwiftNetTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Target Support Files/Pods-SwiftNetTest/Pods-SwiftNetTest-frameworks-Debug-output-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework 2 | ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyNet.framework -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/SwiftyNet/SwiftyNet.xcframework/ios-arm64/SwiftyNet.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohammed-salah-zidane/SwiftyNet/HEAD/Example/SwiftNetTest/Pods/SwiftyNet/SwiftyNet.xcframework/ios-arm64/SwiftyNet.framework/Info.plist -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/SwiftyNet/SwiftyNet.xcframework/ios-arm64/SwiftyNet.framework/SwiftyNet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohammed-salah-zidane/SwiftyNet/HEAD/Example/SwiftNetTest/Pods/SwiftyNet/SwiftyNet.xcframework/ios-arm64/SwiftyNet.framework/SwiftyNet -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Target Support Files/Pods-SwiftNetTest/Pods-SwiftNetTest-frameworks-Release-output-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework 2 | ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyNet.framework -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Target Support Files/Pods-SwiftNetTestTests/Pods-SwiftNetTestTests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | Generated by CocoaPods - https://cocoapods.org 4 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Target Support Files/Pods-SwiftNetTestTests/Pods-SwiftNetTestTests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_SwiftNetTestTests { 2 | umbrella header "Pods-SwiftNetTestTests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/SwiftNetTest/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /SwiftyNet.xcframework/ios-arm64/SwiftyNet.framework/Modules/SwiftyNet.swiftmodule/arm64.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohammed-salah-zidane/SwiftyNet/HEAD/SwiftyNet.xcframework/ios-arm64/SwiftyNet.framework/Modules/SwiftyNet.swiftmodule/arm64.swiftdoc -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Target Support Files/Pods-SwiftNetTestTests/Pods-SwiftNetTestTests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_SwiftNetTestTests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_SwiftNetTestTests 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftyNet-SwiftyNetTests/Pods-SwiftyNet-SwiftyNetTests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_SwiftyNet_SwiftyNetTests { 2 | umbrella header "Pods-SwiftyNet-SwiftyNetTests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftyNet-SwiftyNetTests/Pods-SwiftyNet-SwiftyNetTests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_SwiftyNet_SwiftyNetTests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_SwiftyNet_SwiftyNetTests 5 | @end 6 | -------------------------------------------------------------------------------- /SwiftyNet.xcframework/ios-arm64/SwiftyNet.framework/Modules/SwiftyNet.swiftmodule/arm64-apple-ios.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohammed-salah-zidane/SwiftyNet/HEAD/SwiftyNet.xcframework/ios-arm64/SwiftyNet.framework/Modules/SwiftyNet.swiftmodule/arm64-apple-ios.swiftdoc -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftyNet-SwiftyNetTests/Pods-SwiftyNet-SwiftyNetTests-frameworks-Debug-input-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${PODS_ROOT}/Target Support Files/Pods-SwiftyNet-SwiftyNetTests/Pods-SwiftyNet-SwiftyNetTests-frameworks.sh 2 | ${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftyNet-SwiftyNetTests/Pods-SwiftyNet-SwiftyNetTests-frameworks-Release-input-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${PODS_ROOT}/Target Support Files/Pods-SwiftyNet-SwiftyNetTests/Pods-SwiftyNet-SwiftyNetTests-frameworks.sh 2 | ${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework -------------------------------------------------------------------------------- /SwiftyNet.xcframework/ios-arm64_x86_64-simulator/SwiftyNet.framework/Modules/SwiftyNet.swiftmodule/arm64.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohammed-salah-zidane/SwiftyNet/HEAD/SwiftyNet.xcframework/ios-arm64_x86_64-simulator/SwiftyNet.framework/Modules/SwiftyNet.swiftmodule/arm64.swiftdoc -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/SwiftyNet/SwiftyNet.xcframework/ios-arm64_x86_64-simulator/SwiftyNet.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohammed-salah-zidane/SwiftyNet/HEAD/Example/SwiftNetTest/Pods/SwiftyNet/SwiftyNet.xcframework/ios-arm64_x86_64-simulator/SwiftyNet.framework/Info.plist -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/SwiftyNet/SwiftyNet.xcframework/ios-arm64_x86_64-simulator/SwiftyNet.framework/SwiftyNet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohammed-salah-zidane/SwiftyNet/HEAD/Example/SwiftNetTest/Pods/SwiftyNet/SwiftyNet.xcframework/ios-arm64_x86_64-simulator/SwiftyNet.framework/SwiftyNet -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Target Support Files/Pods-SwiftNetTest-SwiftNetTestUITests/Pods-SwiftNetTest-SwiftNetTestUITests-frameworks-Debug-output-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework 2 | ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyNet.framework -------------------------------------------------------------------------------- /SwiftyNet.xcframework/ios-arm64_x86_64-simulator/SwiftyNet.framework/Modules/SwiftyNet.swiftmodule/x86_64.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohammed-salah-zidane/SwiftyNet/HEAD/SwiftyNet.xcframework/ios-arm64_x86_64-simulator/SwiftyNet.framework/Modules/SwiftyNet.swiftmodule/x86_64.swiftdoc -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Target Support Files/Pods-SwiftNetTest-SwiftNetTestUITests/Pods-SwiftNetTest-SwiftNetTestUITests-frameworks-Release-output-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework 2 | ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyNet.framework -------------------------------------------------------------------------------- /SwiftyNet.xcframework/ios-arm64/SwiftyNet.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module SwiftyNet { 2 | umbrella header "SwiftyNet.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | 8 | module SwiftyNet.Swift { 9 | header "SwiftyNet-Swift.h" 10 | requires objc 11 | } 12 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Alamofire/Alamofire-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/SwiftNetTest/Pods/Target Support Files/Pods-SwiftNetTest-SwiftNetTestUITests/Pods-SwiftNetTest-SwiftNetTestUITests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_SwiftNetTest_SwiftNetTestUITests { 2 | umbrella header "Pods-SwiftNetTest-SwiftNetTestUITests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Target Support Files/Pods-SwiftNetTest-SwiftNetTestUITests/Pods-SwiftNetTest-SwiftNetTestUITests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_SwiftNetTest_SwiftNetTestUITests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_SwiftNetTest_SwiftNetTestUITests 5 | @end 6 | -------------------------------------------------------------------------------- /SwiftyNet.xcframework/ios-arm64_x86_64-simulator/SwiftyNet.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module SwiftyNet { 2 | umbrella header "SwiftyNet.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | 8 | module SwiftyNet.Swift { 9 | header "SwiftyNet-Swift.h" 10 | requires objc 11 | } 12 | -------------------------------------------------------------------------------- /SwiftyNet.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/SwiftyNet/SwiftyNet.xcframework/ios-arm64/SwiftyNet.framework/Modules/SwiftyNet.swiftmodule/arm64.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohammed-salah-zidane/SwiftyNet/HEAD/Example/SwiftNetTest/Pods/SwiftyNet/SwiftyNet.xcframework/ios-arm64/SwiftyNet.framework/Modules/SwiftyNet.swiftmodule/arm64.swiftdoc -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Target Support Files/Alamofire/Alamofire-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 | -------------------------------------------------------------------------------- /SwiftyNet.xcframework/ios-arm64_x86_64-simulator/SwiftyNet.framework/Modules/SwiftyNet.swiftmodule/arm64-apple-ios-simulator.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohammed-salah-zidane/SwiftyNet/HEAD/SwiftyNet.xcframework/ios-arm64_x86_64-simulator/SwiftyNet.framework/Modules/SwiftyNet.swiftmodule/arm64-apple-ios-simulator.swiftdoc -------------------------------------------------------------------------------- /SwiftyNet.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Target Support Files/Pods-SwiftNetTest/Pods-SwiftNetTest-frameworks-Debug-input-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${PODS_ROOT}/Target Support Files/Pods-SwiftNetTest/Pods-SwiftNetTest-frameworks.sh 2 | ${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework 3 | ${PODS_XCFRAMEWORKS_BUILD_DIR}/SwiftyNet/SwiftyNet.framework/SwiftyNet -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Target Support Files/Pods-SwiftNetTest/Pods-SwiftNetTest-frameworks-Release-input-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${PODS_ROOT}/Target Support Files/Pods-SwiftNetTest/Pods-SwiftNetTest-frameworks.sh 2 | ${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework 3 | ${PODS_XCFRAMEWORKS_BUILD_DIR}/SwiftyNet/SwiftyNet.framework/SwiftyNet -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Alamofire (5.4.1) 3 | 4 | DEPENDENCIES: 5 | - Alamofire 6 | 7 | SPEC REPOS: 8 | trunk: 9 | - Alamofire 10 | 11 | SPEC CHECKSUMS: 12 | Alamofire: 2291f7d21ca607c491dd17642e5d40fdcda0e65c 13 | 14 | PODFILE CHECKSUM: 2105d9f74b498a68ae9037efd8b3fcd225c15357 15 | 16 | COCOAPODS: 1.10.0 17 | -------------------------------------------------------------------------------- /SwiftyNet.xcframework/ios-arm64_x86_64-simulator/SwiftyNet.framework/Modules/SwiftyNet.swiftmodule/x86_64-apple-ios-simulator.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohammed-salah-zidane/SwiftyNet/HEAD/SwiftyNet.xcframework/ios-arm64_x86_64-simulator/SwiftyNet.framework/Modules/SwiftyNet.swiftmodule/x86_64-apple-ios-simulator.swiftdoc -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/SwiftyNet/SwiftyNet.xcframework/ios-arm64/SwiftyNet.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module SwiftyNet { 2 | umbrella header "SwiftyNet.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | 8 | module SwiftyNet.Swift { 9 | header "SwiftyNet-Swift.h" 10 | requires objc 11 | } 12 | -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Alamofire (5.4.1) 3 | 4 | DEPENDENCIES: 5 | - Alamofire 6 | 7 | SPEC REPOS: 8 | trunk: 9 | - Alamofire 10 | 11 | SPEC CHECKSUMS: 12 | Alamofire: 2291f7d21ca607c491dd17642e5d40fdcda0e65c 13 | 14 | PODFILE CHECKSUM: 2105d9f74b498a68ae9037efd8b3fcd225c15357 15 | 16 | COCOAPODS: 1.10.0 17 | -------------------------------------------------------------------------------- /SwiftyNet.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/SwiftyNet/SwiftyNet.xcframework/ios-arm64/SwiftyNet.framework/Modules/SwiftyNet.swiftmodule/arm64-apple-ios.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohammed-salah-zidane/SwiftyNet/HEAD/Example/SwiftNetTest/Pods/SwiftyNet/SwiftyNet.xcframework/ios-arm64/SwiftyNet.framework/Modules/SwiftyNet.swiftmodule/arm64-apple-ios.swiftdoc -------------------------------------------------------------------------------- /Example/SwiftNetTest/SwiftNetTest.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/SwiftNetTest.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/SwiftyNet/SwiftyNet.xcframework/ios-arm64_x86_64-simulator/SwiftyNet.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module SwiftyNet { 2 | umbrella header "SwiftyNet.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | 8 | module SwiftyNet.Swift { 9 | header "SwiftyNet-Swift.h" 10 | requires objc 11 | } 12 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/SwiftyNet/SwiftyNet.xcframework/ios-arm64_x86_64-simulator/SwiftyNet.framework/Modules/SwiftyNet.swiftmodule/arm64.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohammed-salah-zidane/SwiftyNet/HEAD/Example/SwiftNetTest/Pods/SwiftyNet/SwiftyNet.xcframework/ios-arm64_x86_64-simulator/SwiftyNet.framework/Modules/SwiftyNet.swiftmodule/arm64.swiftdoc -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/SwiftyNet/SwiftyNet.xcframework/ios-arm64_x86_64-simulator/SwiftyNet.framework/Modules/SwiftyNet.swiftmodule/x86_64.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohammed-salah-zidane/SwiftyNet/HEAD/Example/SwiftNetTest/Pods/SwiftyNet/SwiftyNet.xcframework/ios-arm64_x86_64-simulator/SwiftyNet.framework/Modules/SwiftyNet.swiftmodule/x86_64.swiftdoc -------------------------------------------------------------------------------- /Example/SwiftNetTest/SwiftNetTest.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | target 'SwiftyNet' do 5 | # Comment the next line if you don't want to use dynamic frameworks 6 | use_frameworks! 7 | pod 'Alamofire' 8 | # Pods for SwiftyNet 9 | 10 | target 'SwiftyNetTests' do 11 | # Pods for testing 12 | end 13 | 14 | end 15 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/SwiftyNet/SwiftyNet.xcframework/ios-arm64_x86_64-simulator/SwiftyNet.framework/Modules/SwiftyNet.swiftmodule/arm64-apple-ios-simulator.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohammed-salah-zidane/SwiftyNet/HEAD/Example/SwiftNetTest/Pods/SwiftyNet/SwiftyNet.xcframework/ios-arm64_x86_64-simulator/SwiftyNet.framework/Modules/SwiftyNet.swiftmodule/arm64-apple-ios-simulator.swiftdoc -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/SwiftyNet/SwiftyNet.xcframework/ios-arm64_x86_64-simulator/SwiftyNet.framework/Modules/SwiftyNet.swiftmodule/x86_64-apple-ios-simulator.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohammed-salah-zidane/SwiftyNet/HEAD/Example/SwiftNetTest/Pods/SwiftyNet/SwiftyNet.xcframework/ios-arm64_x86_64-simulator/SwiftyNet.framework/Modules/SwiftyNet.swiftmodule/x86_64-apple-ios-simulator.swiftdoc -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Target Support Files/Pods-SwiftNetTest-SwiftNetTestUITests/Pods-SwiftNetTest-SwiftNetTestUITests-frameworks-Debug-input-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${PODS_ROOT}/Target Support Files/Pods-SwiftNetTest-SwiftNetTestUITests/Pods-SwiftNetTest-SwiftNetTestUITests-frameworks.sh 2 | ${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework 3 | ${PODS_XCFRAMEWORKS_BUILD_DIR}/SwiftyNet/SwiftyNet.framework/SwiftyNet -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Target Support Files/Pods-SwiftNetTest-SwiftNetTestUITests/Pods-SwiftNetTest-SwiftNetTestUITests-frameworks-Release-input-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${PODS_ROOT}/Target Support Files/Pods-SwiftNetTest-SwiftNetTestUITests/Pods-SwiftNetTest-SwiftNetTestUITests-frameworks.sh 2 | ${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework 3 | ${PODS_XCFRAMEWORKS_BUILD_DIR}/SwiftyNet/SwiftyNet.framework/SwiftyNet -------------------------------------------------------------------------------- /Pods/Target Support Files/Alamofire/Alamofire-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 AlamofireVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char AlamofireVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Target Support Files/Alamofire/Alamofire-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 AlamofireVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char AlamofireVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftyNet/Pods-SwiftyNet-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_SwiftyNetVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_SwiftyNetVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Target Support Files/Pods-SwiftNetTest/Pods-SwiftNetTest-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_SwiftNetTestVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_SwiftNetTestVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Alamofire (5.4.1) 3 | - SwiftyNet (1.0.0): 4 | - Alamofire 5 | 6 | DEPENDENCIES: 7 | - Alamofire 8 | - SwiftyNet (~> 1.0.0) 9 | 10 | SPEC REPOS: 11 | trunk: 12 | - Alamofire 13 | - SwiftyNet 14 | 15 | SPEC CHECKSUMS: 16 | Alamofire: 2291f7d21ca607c491dd17642e5d40fdcda0e65c 17 | SwiftyNet: 13aee8808cac85264f455568fc87058f6beaf75d 18 | 19 | PODFILE CHECKSUM: 8ac4b891d54649d85f3caba10afa153a24f19c70 20 | 21 | COCOAPODS: 1.10.0 22 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Target Support Files/Pods-SwiftNetTestTests/Pods-SwiftNetTestTests-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_SwiftNetTestTestsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_SwiftNetTestTestsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Alamofire (5.4.1) 3 | - SwiftyNet (1.0.0): 4 | - Alamofire 5 | 6 | DEPENDENCIES: 7 | - Alamofire 8 | - SwiftyNet (~> 1.0.0) 9 | 10 | SPEC REPOS: 11 | trunk: 12 | - Alamofire 13 | - SwiftyNet 14 | 15 | SPEC CHECKSUMS: 16 | Alamofire: 2291f7d21ca607c491dd17642e5d40fdcda0e65c 17 | SwiftyNet: 13aee8808cac85264f455568fc87058f6beaf75d 18 | 19 | PODFILE CHECKSUM: 8ac4b891d54649d85f3caba10afa153a24f19c70 20 | 21 | COCOAPODS: 1.10.0 22 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftyNet-SwiftyNetTests/Pods-SwiftyNet-SwiftyNetTests-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_SwiftyNet_SwiftyNetTestsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_SwiftyNet_SwiftyNetTestsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /SwiftyNet/SwiftyNet.h: -------------------------------------------------------------------------------- 1 | // 2 | // SwiftyNet.h 3 | // SwiftyNet 4 | // 5 | // Created by prog_zidane on 4/29/21. 6 | // 7 | 8 | #import 9 | 10 | //! Project version number for SwiftyNet. 11 | FOUNDATION_EXPORT double SwiftyNetVersionNumber; 12 | 13 | //! Project version string for SwiftyNet. 14 | FOUNDATION_EXPORT const unsigned char SwiftyNetVersionString[]; 15 | 16 | // In this header, you should import all the public headers of your framework using statements like #import 17 | 18 | 19 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | target 'SwiftNetTest' do 5 | # Comment the next line if you don't want to use dynamic frameworks 6 | use_frameworks! 7 | 8 | # Pods for SwiftNetTest 9 | pod 'Alamofire' 10 | pod 'SwiftyNet', '~> 1.0.0' 11 | 12 | target 'SwiftNetTestTests' do 13 | inherit! :search_paths 14 | # Pods for testing 15 | end 16 | 17 | target 'SwiftNetTestUITests' do 18 | # Pods for testing 19 | end 20 | 21 | end 22 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Target Support Files/Pods-SwiftNetTest-SwiftNetTestUITests/Pods-SwiftNetTest-SwiftNetTestUITests-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_SwiftNetTest_SwiftNetTestUITestsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_SwiftNetTest_SwiftNetTestUITestsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /SwiftyNet.xcframework/ios-arm64/SwiftyNet.framework/Headers/SwiftyNet.h: -------------------------------------------------------------------------------- 1 | // 2 | // SwiftyNet.h 3 | // SwiftyNet 4 | // 5 | // Created by prog_zidane on 4/29/21. 6 | // 7 | 8 | #import 9 | 10 | //! Project version number for SwiftyNet. 11 | FOUNDATION_EXPORT double SwiftyNetVersionNumber; 12 | 13 | //! Project version string for SwiftyNet. 14 | FOUNDATION_EXPORT const unsigned char SwiftyNetVersionString[]; 15 | 16 | // In this header, you should import all the public headers of your framework using statements like #import 17 | 18 | 19 | -------------------------------------------------------------------------------- /SwiftyNet.xcframework/ios-arm64_x86_64-simulator/SwiftyNet.framework/Headers/SwiftyNet.h: -------------------------------------------------------------------------------- 1 | // 2 | // SwiftyNet.h 3 | // SwiftyNet 4 | // 5 | // Created by prog_zidane on 4/29/21. 6 | // 7 | 8 | #import 9 | 10 | //! Project version number for SwiftyNet. 11 | FOUNDATION_EXPORT double SwiftyNetVersionNumber; 12 | 13 | //! Project version string for SwiftyNet. 14 | FOUNDATION_EXPORT const unsigned char SwiftyNetVersionString[]; 15 | 16 | // In this header, you should import all the public headers of your framework using statements like #import 17 | 18 | 19 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/SwiftyNet/SwiftyNet.xcframework/ios-arm64/SwiftyNet.framework/Headers/SwiftyNet.h: -------------------------------------------------------------------------------- 1 | // 2 | // SwiftyNet.h 3 | // SwiftyNet 4 | // 5 | // Created by prog_zidane on 4/29/21. 6 | // 7 | 8 | #import 9 | 10 | //! Project version number for SwiftyNet. 11 | FOUNDATION_EXPORT double SwiftyNetVersionNumber; 12 | 13 | //! Project version string for SwiftyNet. 14 | FOUNDATION_EXPORT const unsigned char SwiftyNetVersionString[]; 15 | 16 | // In this header, you should import all the public headers of your framework using statements like #import 17 | 18 | 19 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/SwiftNetTest/UsersRouter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UsersRouter.swift 3 | // SwiftNetTest 4 | // 5 | // Created by prog_zidane on 4/29/21. 6 | // 7 | 8 | import Foundation 9 | 10 | import SwiftyNet 11 | 12 | class UserModel: Codable { 13 | var name: String? 14 | 15 | enum CodingKeys: String, CodingKey { 16 | case name = "employee_name" 17 | } 18 | } 19 | 20 | class BaseResponse: Codable { 21 | var status: String? 22 | var data: T? 23 | 24 | enum CodingKeys: String, CodingKey { 25 | case status = "status" 26 | case data = "data" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/SwiftyNet/SwiftyNet.xcframework/ios-arm64_x86_64-simulator/SwiftyNet.framework/Headers/SwiftyNet.h: -------------------------------------------------------------------------------- 1 | // 2 | // SwiftyNet.h 3 | // SwiftyNet 4 | // 5 | // Created by prog_zidane on 4/29/21. 6 | // 7 | 8 | #import 9 | 10 | //! Project version number for SwiftyNet. 11 | FOUNDATION_EXPORT double SwiftyNetVersionNumber; 12 | 13 | //! Project version string for SwiftyNet. 14 | FOUNDATION_EXPORT const unsigned char SwiftyNetVersionString[]; 15 | 16 | // In this header, you should import all the public headers of your framework using statements like #import 17 | 18 | 19 | -------------------------------------------------------------------------------- /SwiftyNet.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |spec| 2 | spec.name = 'SwiftyNet' 3 | spec.version = '1.0.0' 4 | spec.license = { :type => 'MIT' } 5 | spec.homepage = 'https://github.com/mohammed-salah-zidane/SwiftyNet' 6 | spec.authors = { 'Mohamed Salah Zidane' => 'mohamed.zidane95@gmail.com' } 7 | spec.summary = 'A generic network layer written in swift' 8 | spec.source = { :git => 'https://github.com/mohammed-salah-zidane/SwiftyNet.git', :tag => spec.version } 9 | spec.swift_version = "5.0" 10 | spec.platform = :ios, "13.0" 11 | spec.ios.deployment_target = "13.0" 12 | spec.vendored_frameworks = 'SwiftyNet.xcframework' 13 | spec.dependency 'Alamofire' 14 | end -------------------------------------------------------------------------------- /Pods/Target Support Files/Alamofire/Alamofire.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Alamofire 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | OTHER_LDFLAGS = $(inherited) -framework "CFNetwork" 5 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 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}/Alamofire 10 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 11 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 12 | SKIP_INSTALL = YES 13 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 14 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Alamofire/Alamofire.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Alamofire 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | OTHER_LDFLAGS = $(inherited) -framework "CFNetwork" 5 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 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}/Alamofire 10 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 11 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 12 | SKIP_INSTALL = YES 13 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 14 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Target Support Files/Alamofire/Alamofire.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Alamofire 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | OTHER_LDFLAGS = $(inherited) -framework "CFNetwork" 5 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 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}/Alamofire 10 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 11 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 12 | SKIP_INSTALL = YES 13 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 14 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Target Support Files/Alamofire/Alamofire.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Alamofire 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | OTHER_LDFLAGS = $(inherited) -framework "CFNetwork" 5 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 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}/Alamofire 10 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 11 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 12 | SKIP_INSTALL = YES 13 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 14 | -------------------------------------------------------------------------------- /SwiftyNetTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /SwiftyNet/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | 22 | 23 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/SwiftNetTestTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Target Support Files/SwiftyNet/SwiftyNet.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/SwiftyNet 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "${PODS_ROOT}/SwiftyNet" "${PODS_XCFRAMEWORKS_BUILD_DIR}/SwiftyNet" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/SwiftyNet 9 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 10 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | SKIP_INSTALL = YES 12 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 13 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Target Support Files/SwiftyNet/SwiftyNet.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/SwiftyNet 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "${PODS_ROOT}/SwiftyNet" "${PODS_XCFRAMEWORKS_BUILD_DIR}/SwiftyNet" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/SwiftyNet 9 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 10 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | SKIP_INSTALL = YES 12 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 13 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/SwiftNetTestUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Target Support Files/Pods-SwiftNetTestTests/Pods-SwiftNetTestTests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "${PODS_ROOT}/SwiftyNet" "${PODS_XCFRAMEWORKS_BUILD_DIR}/SwiftyNet" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" 5 | OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "CFNetwork" -framework "SwiftyNet" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 11 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 12 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Target Support Files/Pods-SwiftNetTestTests/Pods-SwiftNetTestTests.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "${PODS_ROOT}/SwiftyNet" "${PODS_XCFRAMEWORKS_BUILD_DIR}/SwiftyNet" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" 5 | OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "CFNetwork" -framework "SwiftyNet" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 11 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 12 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/SwiftNetTest/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // SwiftNetTest 4 | // 5 | // Created by prog_zidane on 4/29/21. 6 | // 7 | 8 | import UIKit 9 | import SwiftyNet 10 | 11 | class ViewController: UIViewController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | 16 | let request = UsersRequests.getUsers 17 | let router = NetworkRouter() 18 | 19 | router.request( 20 | targetRequest: request, 21 | responseObject: BaseResponse<[UserModel]>.self 22 | ) { result in 23 | switch result { 24 | case .success(let data): 25 | print(data.data?.count) 26 | case .failure(let error): 27 | print(error.errorDescription) 28 | @unknown default: 29 | fatalError() 30 | } 31 | } 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftyNet/Pods-SwiftyNet.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' '@executable_path/../../Frameworks' 6 | OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "CFNetwork" 7 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 13 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 14 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftyNet/Pods-SwiftyNet.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' '@executable_path/../../Frameworks' 6 | OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "CFNetwork" 7 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 13 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 14 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Alamofire/Alamofire-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 | 5.4.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftyNet/Pods-SwiftyNet-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/SwiftNetTest/Pods/Target Support Files/Alamofire/Alamofire-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 | 5.4.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Target Support Files/Pods-SwiftNetTest/Pods-SwiftNetTest-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 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftyNet-SwiftyNetTests/Pods-SwiftyNet-SwiftyNetTests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" 6 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 7 | OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "CFNetwork" 8 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 9 | PODS_BUILD_DIR = ${BUILD_DIR} 10 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 11 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 12 | PODS_ROOT = ${SRCROOT}/Pods 13 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 14 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 15 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftyNet-SwiftyNetTests/Pods-SwiftyNet-SwiftyNetTests-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 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftyNet-SwiftyNetTests/Pods-SwiftyNet-SwiftyNetTests.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" 6 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 7 | OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "CFNetwork" 8 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 9 | PODS_BUILD_DIR = ${BUILD_DIR} 10 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 11 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 12 | PODS_ROOT = ${SRCROOT}/Pods 13 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 14 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 15 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Target Support Files/Pods-SwiftNetTestTests/Pods-SwiftNetTestTests-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/SwiftNetTest/Pods/Target Support Files/Pods-SwiftNetTestTests/Pods-SwiftNetTestTests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Generated by CocoaPods - https://cocoapods.org 18 | Title 19 | 20 | Type 21 | PSGroupSpecifier 22 | 23 | 24 | StringsTable 25 | Acknowledgements 26 | Title 27 | Acknowledgements 28 | 29 | 30 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Target Support Files/Pods-SwiftNetTest-SwiftNetTestUITests/Pods-SwiftNetTest-SwiftNetTestUITests-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 | -------------------------------------------------------------------------------- /SwiftyNet/SessionManager/SessionManager.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SessionManager.swift 3 | // SwiftyNet 4 | // 5 | // Created by prog_zidane on 4/29/21. 6 | // 7 | 8 | import Foundation 9 | import Alamofire 10 | 11 | final class ApiSessionManager: NSObject { 12 | 13 | private static var manager: Session? 14 | public static var sessionManager: Session { 15 | get { 16 | if manager == nil { 17 | manager = Session(configuration: Session.default.sessionConfiguration,interceptor: Interceptor()) 18 | } 19 | return manager! 20 | } 21 | } 22 | 23 | private override init() { 24 | super.init() 25 | } 26 | /// Use for update the header to contain token 27 | /// Use this func after every Login (after success validation with the server) 28 | static func cancelAllRequests() { 29 | manager = nil 30 | // it will automaticaly invalidateAndCancel() 31 | } 32 | 33 | deinit { 34 | ApiSessionManager.cancelAllRequests() 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /SwiftyNetTests/SwiftyNetTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SwiftyNetTests.swift 3 | // SwiftyNetTests 4 | // 5 | // Created by prog_zidane on 4/29/21. 6 | // 7 | 8 | import XCTest 9 | @testable import SwiftyNet 10 | 11 | class SwiftyNetTests: XCTestCase { 12 | 13 | override func setUpWithError() throws { 14 | // Put setup code here. This method is called before the invocation of each test method in the class. 15 | } 16 | 17 | override func tearDownWithError() throws { 18 | // Put teardown code here. This method is called after the invocation of each test method in the class. 19 | } 20 | 21 | func testExample() throws { 22 | // This is an example of a functional test case. 23 | // Use XCTAssert and related functions to verify your tests produce the correct results. 24 | } 25 | 26 | func testPerformanceExample() throws { 27 | // This is an example of a performance test case. 28 | self.measure { 29 | // Put the code you want to measure the time of here. 30 | } 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Target Support Files/Pods-SwiftNetTest/Pods-SwiftNetTest.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "${PODS_ROOT}/SwiftyNet" "${PODS_XCFRAMEWORKS_BUILD_DIR}/SwiftyNet" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" 6 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 7 | OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "CFNetwork" -framework "SwiftyNet" 8 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 9 | PODS_BUILD_DIR = ${BUILD_DIR} 10 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 11 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 12 | PODS_ROOT = ${SRCROOT}/Pods 13 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 14 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 15 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Target Support Files/Pods-SwiftNetTest/Pods-SwiftNetTest.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "${PODS_ROOT}/SwiftyNet" "${PODS_XCFRAMEWORKS_BUILD_DIR}/SwiftyNet" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" 6 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 7 | OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "CFNetwork" -framework "SwiftyNet" 8 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 9 | PODS_BUILD_DIR = ${BUILD_DIR} 10 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 11 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 12 | PODS_ROOT = ${SRCROOT}/Pods 13 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 14 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 15 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/SwiftNetTestTests/SwiftNetTestTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SwiftNetTestTests.swift 3 | // SwiftNetTestTests 4 | // 5 | // Created by prog_zidane on 4/29/21. 6 | // 7 | 8 | import XCTest 9 | @testable import SwiftNetTest 10 | 11 | class SwiftNetTestTests: XCTestCase { 12 | 13 | override func setUpWithError() throws { 14 | // Put setup code here. This method is called before the invocation of each test method in the class. 15 | } 16 | 17 | override func tearDownWithError() throws { 18 | // Put teardown code here. This method is called after the invocation of each test method in the class. 19 | } 20 | 21 | func testExample() throws { 22 | // This is an example of a functional test case. 23 | // Use XCTAssert and related functions to verify your tests produce the correct results. 24 | } 25 | 26 | func testPerformanceExample() throws { 27 | // This is an example of a performance test case. 28 | self.measure { 29 | // Put the code you want to measure the time of here. 30 | } 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Target Support Files/Pods-SwiftNetTest-SwiftNetTestUITests/Pods-SwiftNetTest-SwiftNetTestUITests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "${PODS_ROOT}/SwiftyNet" "${PODS_XCFRAMEWORKS_BUILD_DIR}/SwiftyNet" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" 6 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 7 | OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "CFNetwork" -framework "SwiftyNet" 8 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 9 | PODS_BUILD_DIR = ${BUILD_DIR} 10 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 11 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 12 | PODS_ROOT = ${SRCROOT}/Pods 13 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 14 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 15 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Target Support Files/Pods-SwiftNetTest-SwiftNetTestUITests/Pods-SwiftNetTest-SwiftNetTestUITests.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "${PODS_ROOT}/SwiftyNet" "${PODS_XCFRAMEWORKS_BUILD_DIR}/SwiftyNet" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" 6 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 7 | OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "CFNetwork" -framework "SwiftyNet" 8 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 9 | PODS_BUILD_DIR = ${BUILD_DIR} 10 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 11 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 12 | PODS_ROOT = ${SRCROOT}/Pods 13 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 14 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 15 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Mohamed Salah Zidane 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 | -------------------------------------------------------------------------------- /Pods/Alamofire/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2020 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/SwiftNetTest/Pods/SwiftyNet/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Mohamed Salah Zidane 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 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Alamofire/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2020 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 | -------------------------------------------------------------------------------- /SwiftyNet.xcframework/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AvailableLibraries 6 | 7 | 8 | LibraryIdentifier 9 | ios-arm64 10 | LibraryPath 11 | SwiftyNet.framework 12 | SupportedArchitectures 13 | 14 | arm64 15 | 16 | SupportedPlatform 17 | ios 18 | 19 | 20 | LibraryIdentifier 21 | ios-arm64_x86_64-simulator 22 | LibraryPath 23 | SwiftyNet.framework 24 | SupportedArchitectures 25 | 26 | arm64 27 | x86_64 28 | 29 | SupportedPlatform 30 | ios 31 | SupportedPlatformVariant 32 | simulator 33 | 34 | 35 | CFBundlePackageType 36 | XFWK 37 | XCFrameworkFormatVersion 38 | 1.0 39 | 40 | 41 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/SwiftyNet/SwiftyNet.xcframework/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AvailableLibraries 6 | 7 | 8 | LibraryIdentifier 9 | ios-arm64 10 | LibraryPath 11 | SwiftyNet.framework 12 | SupportedArchitectures 13 | 14 | arm64 15 | 16 | SupportedPlatform 17 | ios 18 | 19 | 20 | LibraryIdentifier 21 | ios-arm64_x86_64-simulator 22 | LibraryPath 23 | SwiftyNet.framework 24 | SupportedArchitectures 25 | 26 | arm64 27 | x86_64 28 | 29 | SupportedPlatform 30 | ios 31 | SupportedPlatformVariant 32 | simulator 33 | 34 | 35 | CFBundlePackageType 36 | XFWK 37 | XCFrameworkFormatVersion 38 | 1.0 39 | 40 | 41 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SwiftyNet 1.0.0 2 | A generic network layer written in swift. you can use it as an abstraction layer above Alamofire with generic returned types. 3 | 4 | ## Installation 5 | ### CocoaPods 6 | 7 | For SwiftyNet, use the following entry in your Podfile: 8 | 9 | ```rb 10 | pod 'SwiftyNet', '~> 1.0.0' 11 | ``` 12 | Then run `pod install`. 13 | 14 | ## Usage 15 | 16 | You can see [The Provided Example](https://github.com/mohammed-salah-zidane/SwiftyNet/tree/main/Example/SwiftNetTest), using SwiftyNet is really simple. You can access an API with the return object type you want: 17 | 18 | ```swift 19 | let request = UsersRequests.getUsers 20 | let router = NetworkRouter() 21 | 22 | router.request( 23 | targetRequest: request, 24 | responseObject: BaseResponse<[UserModel]>.self 25 | ) { result in 26 | switch result { 27 | case .success(let data): 28 | print(data.data?.count) 29 | case .failure(let error): 30 | print(error.errorDescription) 31 | default: 32 | fatalError() 33 | } 34 | } 35 | ``` 36 | 37 | ## License 38 | 39 | SwiftyNet is released under an MIT license. See [License.md](https://github.com/mohammed-salah-zidane/SwiftyNet/blob/main/LICENSE) for more information. 40 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftyNet/Pods-SwiftyNet-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## Alamofire 5 | 6 | Copyright (c) 2014-2020 Alamofire Software Foundation (http://alamofire.org/) 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | Generated by CocoaPods - https://cocoapods.org 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftyNet-SwiftyNetTests/Pods-SwiftyNet-SwiftyNetTests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## Alamofire 5 | 6 | Copyright (c) 2014-2020 Alamofire Software Foundation (http://alamofire.org/) 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | Generated by CocoaPods - https://cocoapods.org 27 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/SwiftNetTest/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // SwiftNetTest 4 | // 5 | // Created by prog_zidane on 4/29/21. 6 | // 7 | 8 | import UIKit 9 | 10 | @main 11 | class AppDelegate: UIResponder, UIApplicationDelegate { 12 | 13 | 14 | 15 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 16 | // Override point for customization after application launch. 17 | return true 18 | } 19 | 20 | // MARK: UISceneSession Lifecycle 21 | 22 | func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { 23 | // Called when a new scene session is being created. 24 | // Use this method to select a configuration to create the new scene with. 25 | return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) 26 | } 27 | 28 | func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { 29 | // Called when the user discards a scene session. 30 | // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. 31 | // Use this method to release any resources that were specific to the discarded scenes, as they will not return. 32 | } 33 | 34 | 35 | } 36 | 37 | -------------------------------------------------------------------------------- /Pods/Alamofire/Source/Alamofire.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Alamofire.swift 3 | // 4 | // Copyright (c) 2014-2018 Alamofire Software Foundation (http://alamofire.org/) 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 | 25 | /// Reference to `Session.default` for quick bootstrapping and examples. 26 | public let AF = Session.default 27 | 28 | /// Current Alamofire version. Necessary since SPM doesn't use dynamic libraries. Plus this will be more accurate. 29 | let version = "5.4.1" 30 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Alamofire/Source/Alamofire.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Alamofire.swift 3 | // 4 | // Copyright (c) 2014-2018 Alamofire Software Foundation (http://alamofire.org/) 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 | 25 | /// Reference to `Session.default` for quick bootstrapping and examples. 26 | public let AF = Session.default 27 | 28 | /// Current Alamofire version. Necessary since SPM doesn't use dynamic libraries. Plus this will be more accurate. 29 | let version = "5.4.1" 30 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/SwiftNetTest/UsersNetworking.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UsersNetworking.swift 3 | // SwiftNetTest 4 | // 5 | // Created by prog_zidane on 4/29/21. 6 | // 7 | 8 | import Foundation 9 | import Alamofire 10 | import SwiftyNet 11 | 12 | enum UsersRequests { 13 | case getUsers 14 | case createUser(name: String, job: String) 15 | } 16 | 17 | extension UsersRequests: NetworkRequest { 18 | var path: String { 19 | switch self { 20 | case .getUsers: 21 | return "/employees" 22 | case .createUser: 23 | return "/users" 24 | } 25 | } 26 | 27 | var baseUrl: URL { 28 | switch self { 29 | case .getUsers: 30 | return URL(string:"http://dummy.restapiexample.com/api/v1")! 31 | default: 32 | return URL(string:"https://reqres.in/api")! 33 | } 34 | } 35 | 36 | var method: HTTPMethod { 37 | switch self { 38 | case .getUsers: 39 | return .get 40 | case .createUser: 41 | return .post 42 | } 43 | } 44 | 45 | var parameters: Parameters? { 46 | switch self { 47 | case .getUsers: 48 | return nil 49 | case .createUser(let name, let job): 50 | return ["name": name, "job": job] 51 | } 52 | } 53 | 54 | var parameterEncoding: RequestParameterEncoding? { 55 | switch self { 56 | case .getUsers: 57 | return .queryString 58 | case .createUser: 59 | return .json 60 | } 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/SwiftNetTestUITests/SwiftNetTestUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SwiftNetTestUITests.swift 3 | // SwiftNetTestUITests 4 | // 5 | // Created by prog_zidane on 4/29/21. 6 | // 7 | 8 | import XCTest 9 | 10 | class SwiftNetTestUITests: XCTestCase { 11 | 12 | override func setUpWithError() throws { 13 | // Put setup code here. This method is called before the invocation of each test method in the class. 14 | 15 | // In UI tests it is usually best to stop immediately when a failure occurs. 16 | continueAfterFailure = false 17 | 18 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 19 | } 20 | 21 | override func tearDownWithError() throws { 22 | // Put teardown code here. This method is called after the invocation of each test method in the class. 23 | } 24 | 25 | func testExample() throws { 26 | // UI tests must launch the application that they test. 27 | let app = XCUIApplication() 28 | app.launch() 29 | 30 | // Use recording to get started writing UI tests. 31 | // Use XCTAssert and related functions to verify your tests produce the correct results. 32 | } 33 | 34 | func testLaunchPerformance() throws { 35 | if #available(macOS 10.15, iOS 13.0, tvOS 13.0, *) { 36 | // This measures how long it takes to launch your application. 37 | measure(metrics: [XCTApplicationLaunchMetric()]) { 38 | XCUIApplication().launch() 39 | } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/SwiftNetTest/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Pods/Alamofire/Source/DispatchQueue+Alamofire.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DispatchQueue+Alamofire.swift 3 | // 4 | // Copyright (c) 2014-2018 Alamofire Software Foundation (http://alamofire.org/) 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 | 25 | import Dispatch 26 | import Foundation 27 | 28 | extension DispatchQueue { 29 | /// Execute the provided closure after a `TimeInterval`. 30 | /// 31 | /// - Parameters: 32 | /// - delay: `TimeInterval` to delay execution. 33 | /// - closure: Closure to execute. 34 | func after(_ delay: TimeInterval, execute closure: @escaping () -> Void) { 35 | asyncAfter(deadline: .now() + delay, execute: closure) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/SwiftNetTest/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 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DispatchQueue+Alamofire.swift 3 | // 4 | // Copyright (c) 2014-2018 Alamofire Software Foundation (http://alamofire.org/) 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 | 25 | import Dispatch 26 | import Foundation 27 | 28 | extension DispatchQueue { 29 | /// Execute the provided closure after a `TimeInterval`. 30 | /// 31 | /// - Parameters: 32 | /// - delay: `TimeInterval` to delay execution. 33 | /// - closure: Closure to execute. 34 | func after(_ delay: TimeInterval, execute closure: @escaping () -> Void) { 35 | asyncAfter(deadline: .now() + delay, execute: closure) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Pods/Alamofire/Source/URLRequest+Alamofire.swift: -------------------------------------------------------------------------------- 1 | // 2 | // URLRequest+Alamofire.swift 3 | // 4 | // Copyright (c) 2019 Alamofire Software Foundation (http://alamofire.org/) 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 | 25 | import Foundation 26 | 27 | extension URLRequest { 28 | /// Returns the `httpMethod` as Alamofire's `HTTPMethod` type. 29 | public var method: HTTPMethod? { 30 | get { httpMethod.flatMap(HTTPMethod.init) } 31 | set { httpMethod = newValue?.rawValue } 32 | } 33 | 34 | public func validate() throws { 35 | if method == .get, let bodyData = httpBody { 36 | throw AFError.urlRequestValidationFailed(reason: .bodyDataInGETRequest(bodyData)) 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Alamofire/Source/URLRequest+Alamofire.swift: -------------------------------------------------------------------------------- 1 | // 2 | // URLRequest+Alamofire.swift 3 | // 4 | // Copyright (c) 2019 Alamofire Software Foundation (http://alamofire.org/) 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 | 25 | import Foundation 26 | 27 | extension URLRequest { 28 | /// Returns the `httpMethod` as Alamofire's `HTTPMethod` type. 29 | public var method: HTTPMethod? { 30 | get { httpMethod.flatMap(HTTPMethod.init) } 31 | set { httpMethod = newValue?.rawValue } 32 | } 33 | 34 | public func validate() throws { 35 | if method == .get, let bodyData = httpBody { 36 | throw AFError.urlRequestValidationFailed(reason: .bodyDataInGETRequest(bodyData)) 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Pods/Alamofire/Source/URLSessionConfiguration+Alamofire.swift: -------------------------------------------------------------------------------- 1 | // 2 | // URLSessionConfiguration+Alamofire.swift 3 | // 4 | // Copyright (c) 2014-2018 Alamofire Software Foundation (http://alamofire.org/) 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 | 25 | import Foundation 26 | 27 | extension URLSessionConfiguration: AlamofireExtended {} 28 | extension AlamofireExtension where ExtendedType: URLSessionConfiguration { 29 | /// Alamofire's default configuration. Same as `URLSessionConfiguration.default` but adds Alamofire default 30 | /// `Accept-Language`, `Accept-Encoding`, and `User-Agent` headers. 31 | public static var `default`: URLSessionConfiguration { 32 | let configuration = URLSessionConfiguration.default 33 | configuration.headers = .default 34 | 35 | return configuration 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Alamofire/Source/URLSessionConfiguration+Alamofire.swift: -------------------------------------------------------------------------------- 1 | // 2 | // URLSessionConfiguration+Alamofire.swift 3 | // 4 | // Copyright (c) 2014-2018 Alamofire Software Foundation (http://alamofire.org/) 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 | 25 | import Foundation 26 | 27 | extension URLSessionConfiguration: AlamofireExtended {} 28 | extension AlamofireExtension where ExtendedType: URLSessionConfiguration { 29 | /// Alamofire's default configuration. Same as `URLSessionConfiguration.default` but adds Alamofire default 30 | /// `Accept-Language`, `Accept-Encoding`, and `User-Agent` headers. 31 | public static var `default`: URLSessionConfiguration { 32 | let configuration = URLSessionConfiguration.default 33 | configuration.headers = .default 34 | 35 | return configuration 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /SwiftyNet/Support/NetworkResponse.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NetworkResponse.swift 3 | // SwiftyNet 4 | // 5 | // Created by prog_zidane on 4/29/21. 6 | // 7 | 8 | import Foundation 9 | import Alamofire 10 | 11 | /// The response from a method that can result in either a successful or failed state 12 | public typealias DataResponseType = AFDataResponse 13 | 14 | public enum NetworkResponse { 15 | case success(data: T) 16 | case failure(NetworkError) 17 | 18 | public init(_ dataResponse: DataResponseType) { 19 | 20 | print("Response Body : ", try? dataResponse.result.get() ,dataResponse.request) 21 | 22 | guard dataResponse.error == nil else { 23 | self = .failure(NetworkError(dataResponse.error!)) 24 | return 25 | } 26 | 27 | guard dataResponse.response != nil else { 28 | self = .failure(NetworkError(dataResponse.response!.statusCode)) 29 | return 30 | } 31 | 32 | guard dataResponse.response?.hasSuccessStatusCode == true else { 33 | self = .failure(NetworkError(dataResponse.response!.statusCode)) 34 | return 35 | } 36 | 37 | 38 | guard let jsonResponse = try? dataResponse.result.get() else { 39 | self = .failure(NetworkError(dataResponse.response!.statusCode)) 40 | return 41 | } 42 | 43 | guard let theJSONData = try? JSONSerialization.data(withJSONObject: jsonResponse, options: []) else { 44 | self = .failure(.parsingJSONError) 45 | return 46 | } 47 | guard let responseObj = try? JSONDecoder().decode(T.self, from: theJSONData) else { 48 | self = .failure(.parsingJSONError) 49 | return 50 | } 51 | 52 | self = .success(data: responseObj) 53 | } 54 | 55 | } 56 | 57 | extension HTTPURLResponse { 58 | var hasSuccessStatusCode: Bool { 59 | return 200...299 ~= statusCode 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/SwiftNetTest/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "scale" : "1x", 46 | "size" : "20x20" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "scale" : "2x", 51 | "size" : "20x20" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "scale" : "1x", 56 | "size" : "29x29" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "scale" : "2x", 61 | "size" : "29x29" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "scale" : "1x", 66 | "size" : "40x40" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "scale" : "2x", 71 | "size" : "40x40" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "scale" : "1x", 76 | "size" : "76x76" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "scale" : "2x", 81 | "size" : "76x76" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "scale" : "2x", 86 | "size" : "83.5x83.5" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "scale" : "1x", 91 | "size" : "1024x1024" 92 | } 93 | ], 94 | "info" : { 95 | "author" : "xcode", 96 | "version" : 1 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /SwiftyNet/Extensions/Data+Extensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Data+Extensions.swift 3 | // SwiftyNet 4 | // 5 | // Created by prog_zidane on 4/29/21. 6 | // 7 | 8 | import Foundation 9 | 10 | public enum MimeTypeSignatures { 11 | case jpeg 12 | case png 13 | case gif 14 | case pdf 15 | case tiff 16 | case video 17 | case vnd 18 | case text 19 | 20 | var mimeType: String { 21 | switch self { 22 | case .jpeg: 23 | return "image/jpeg" 24 | case .png: 25 | return "image/png" 26 | case .gif: 27 | return "image/gif" 28 | case .pdf: 29 | return "application/pdf" 30 | case .tiff: 31 | return "image/tiff" 32 | case .text: 33 | return "text/plain" 34 | case .vnd: 35 | return "application/vnd" 36 | case .video: 37 | return "video/mp4" 38 | 39 | } 40 | } 41 | 42 | var fileName: String { 43 | switch self { 44 | case .jpeg: 45 | return "\(UUID().uuidString).jpeg" 46 | case .png: 47 | return "\(UUID().uuidString).png" 48 | case .gif: 49 | return "\(UUID().uuidString).gif" 50 | case .pdf: 51 | return "\(UUID().uuidString).pdf" 52 | case .tiff: 53 | return "\(UUID().uuidString).tiff" 54 | case .text: 55 | return "\(UUID().uuidString).txt" 56 | case .vnd: 57 | return "\(UUID().uuidString).vnd" 58 | case .video: 59 | return "\(UUID().uuidString).mp4" 60 | } 61 | } 62 | } 63 | 64 | extension Data { 65 | 66 | var format: MimeTypeSignatures { 67 | let array = [UInt8](self) 68 | switch array[0] { 69 | case 0xFF: 70 | return .jpeg 71 | case 0x89: 72 | return .png 73 | case 0x47: 74 | return .gif 75 | case 0x49, 0x4D : 76 | return .tiff 77 | case 0x25: 78 | return .pdf 79 | case 0xD0: 80 | return .vnd 81 | case 0x46: 82 | return .text 83 | default: 84 | return .video 85 | } 86 | 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /Pods/Alamofire/Source/StringEncoding+Alamofire.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StringEncoding+Alamofire.swift 3 | // 4 | // Copyright (c) 2020 Alamofire Software Foundation (http://alamofire.org/) 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 | 25 | import Foundation 26 | 27 | extension String.Encoding { 28 | /// Creates an encoding from the IANA charset name. 29 | /// 30 | /// - Notes: These mappings match those [provided by CoreFoundation](https://opensource.apple.com/source/CF/CF-476.18/CFStringUtilities.c.auto.html) 31 | /// 32 | /// - Parameter name: IANA charset name. 33 | init?(ianaCharsetName name: String) { 34 | switch name.lowercased() { 35 | case "utf-8": 36 | self = .utf8 37 | case "iso-8859-1": 38 | self = .isoLatin1 39 | case "unicode-1-1", "iso-10646-ucs-2", "utf-16": 40 | self = .utf16 41 | case "utf-16be": 42 | self = .utf16BigEndian 43 | case "utf-16le": 44 | self = .utf16LittleEndian 45 | case "utf-32": 46 | self = .utf32 47 | case "utf-32be": 48 | self = .utf32BigEndian 49 | case "utf-32le": 50 | self = .utf32LittleEndian 51 | default: 52 | return nil 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftyNet/Pods-SwiftyNet-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2014-2020 Alamofire Software Foundation (http://alamofire.org/) 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | License 38 | MIT 39 | Title 40 | Alamofire 41 | Type 42 | PSGroupSpecifier 43 | 44 | 45 | FooterText 46 | Generated by CocoaPods - https://cocoapods.org 47 | Title 48 | 49 | Type 50 | PSGroupSpecifier 51 | 52 | 53 | StringsTable 54 | Acknowledgements 55 | Title 56 | Acknowledgements 57 | 58 | 59 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Alamofire/Source/StringEncoding+Alamofire.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StringEncoding+Alamofire.swift 3 | // 4 | // Copyright (c) 2020 Alamofire Software Foundation (http://alamofire.org/) 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 | 25 | import Foundation 26 | 27 | extension String.Encoding { 28 | /// Creates an encoding from the IANA charset name. 29 | /// 30 | /// - Notes: These mappings match those [provided by CoreFoundation](https://opensource.apple.com/source/CF/CF-476.18/CFStringUtilities.c.auto.html) 31 | /// 32 | /// - Parameter name: IANA charset name. 33 | init?(ianaCharsetName name: String) { 34 | switch name.lowercased() { 35 | case "utf-8": 36 | self = .utf8 37 | case "iso-8859-1": 38 | self = .isoLatin1 39 | case "unicode-1-1", "iso-10646-ucs-2", "utf-16": 40 | self = .utf16 41 | case "utf-16be": 42 | self = .utf16BigEndian 43 | case "utf-16le": 44 | self = .utf16LittleEndian 45 | case "utf-32": 46 | self = .utf32 47 | case "utf-32be": 48 | self = .utf32BigEndian 49 | case "utf-32le": 50 | self = .utf32LittleEndian 51 | default: 52 | return nil 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SwiftyNet-SwiftyNetTests/Pods-SwiftyNet-SwiftyNetTests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2014-2020 Alamofire Software Foundation (http://alamofire.org/) 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | License 38 | MIT 39 | Title 40 | Alamofire 41 | Type 42 | PSGroupSpecifier 43 | 44 | 45 | FooterText 46 | Generated by CocoaPods - https://cocoapods.org 47 | Title 48 | 49 | Type 50 | PSGroupSpecifier 51 | 52 | 53 | StringsTable 54 | Acknowledgements 55 | Title 56 | Acknowledgements 57 | 58 | 59 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/SwiftNetTest/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UIApplicationSceneManifest 24 | 25 | UIApplicationSupportsMultipleScenes 26 | 27 | UISceneConfigurations 28 | 29 | UIWindowSceneSessionRoleApplication 30 | 31 | 32 | UISceneConfigurationName 33 | Default Configuration 34 | UISceneDelegateClassName 35 | $(PRODUCT_MODULE_NAME).SceneDelegate 36 | UISceneStoryboardFile 37 | Main 38 | 39 | 40 | 41 | 42 | UIApplicationSupportsIndirectInputEvents 43 | 44 | UILaunchStoryboardName 45 | LaunchScreen 46 | UIMainStoryboardFile 47 | Main 48 | UIRequiredDeviceCapabilities 49 | 50 | armv7 51 | 52 | UISupportedInterfaceOrientations 53 | 54 | UIInterfaceOrientationPortrait 55 | UIInterfaceOrientationLandscapeLeft 56 | UIInterfaceOrientationLandscapeRight 57 | 58 | UISupportedInterfaceOrientations~ipad 59 | 60 | UIInterfaceOrientationPortrait 61 | UIInterfaceOrientationPortraitUpsideDown 62 | UIInterfaceOrientationLandscapeLeft 63 | UIInterfaceOrientationLandscapeRight 64 | 65 | NSAppTransportSecurity 66 | 67 | NSAllowsArbitraryLoads 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/SwiftNetTest/SceneDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SceneDelegate.swift 3 | // SwiftNetTest 4 | // 5 | // Created by prog_zidane on 4/29/21. 6 | // 7 | 8 | import UIKit 9 | 10 | class SceneDelegate: UIResponder, UIWindowSceneDelegate { 11 | 12 | var window: UIWindow? 13 | 14 | 15 | func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { 16 | // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. 17 | // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. 18 | // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). 19 | guard let _ = (scene as? UIWindowScene) else { return } 20 | } 21 | 22 | func sceneDidDisconnect(_ scene: UIScene) { 23 | // Called as the scene is being released by the system. 24 | // This occurs shortly after the scene enters the background, or when its session is discarded. 25 | // Release any resources associated with this scene that can be re-created the next time the scene connects. 26 | // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). 27 | } 28 | 29 | func sceneDidBecomeActive(_ scene: UIScene) { 30 | // Called when the scene has moved from an inactive state to an active state. 31 | // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. 32 | } 33 | 34 | func sceneWillResignActive(_ scene: UIScene) { 35 | // Called when the scene will move from an active state to an inactive state. 36 | // This may occur due to temporary interruptions (ex. an incoming phone call). 37 | } 38 | 39 | func sceneWillEnterForeground(_ scene: UIScene) { 40 | // Called as the scene transitions from the background to the foreground. 41 | // Use this method to undo the changes made on entering the background. 42 | } 43 | 44 | func sceneDidEnterBackground(_ scene: UIScene) { 45 | // Called as the scene transitions from the foreground to the background. 46 | // Use this method to save data, release shared resources, and store enough scene-specific state information 47 | // to restore the scene back to its current state. 48 | } 49 | 50 | 51 | } 52 | 53 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## User settings 6 | xcuserdata/ 7 | 8 | ## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) 9 | *.xcscmblueprint 10 | *.xccheckout 11 | 12 | ## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) 13 | build/ 14 | DerivedData/ 15 | *.moved-aside 16 | *.pbxuser 17 | !default.pbxuser 18 | *.mode1v3 19 | !default.mode1v3 20 | *.mode2v3 21 | !default.mode2v3 22 | *.perspectivev3 23 | !default.perspectivev3 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | 28 | ## App packaging 29 | *.ipa 30 | *.dSYM.zip 31 | *.dSYM 32 | 33 | ## Playgrounds 34 | timeline.xctimeline 35 | playground.xcworkspace 36 | 37 | # Swift Package Manager 38 | # 39 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 40 | # Packages/ 41 | # Package.pins 42 | # Package.resolved 43 | # *.xcodeproj 44 | # 45 | # Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata 46 | # hence it is not needed unless you have added a package configuration file to your project 47 | # .swiftpm 48 | 49 | .build/ 50 | 51 | # CocoaPods 52 | # 53 | # We recommend against adding the Pods directory to your .gitignore. However 54 | # you should judge for yourself, the pros and cons are mentioned at: 55 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 56 | # 57 | # Pods/ 58 | # 59 | # Add this line if you want to avoid checking in source code from the Xcode workspace 60 | # *.xcworkspace 61 | 62 | # Carthage 63 | # 64 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 65 | # Carthage/Checkouts 66 | 67 | Carthage/Build/ 68 | 69 | # Accio dependency management 70 | Dependencies/ 71 | .accio/ 72 | 73 | # fastlane 74 | # 75 | # It is recommended to not store the screenshots in the git repo. 76 | # Instead, use fastlane to re-generate the screenshots whenever they are needed. 77 | # For more information about the recommended setup visit: 78 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 79 | 80 | fastlane/report.xml 81 | fastlane/Preview.html 82 | fastlane/screenshots/**/*.png 83 | fastlane/test_output 84 | 85 | # Code Injection 86 | # 87 | # After new code Injection tools there's a generated folder /iOSInjectionProject 88 | # https://github.com/johnno1962/injectionforxcode 89 | 90 | iOSInjectionProject/ 91 | -------------------------------------------------------------------------------- /Pods/Alamofire/Source/HTTPMethod.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HTTPMethod.swift 3 | // 4 | // Copyright (c) 2014-2018 Alamofire Software Foundation (http://alamofire.org/) 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 | 25 | /// Type representing HTTP methods. Raw `String` value is stored and compared case-sensitively, so 26 | /// `HTTPMethod.get != HTTPMethod(rawValue: "get")`. 27 | /// 28 | /// See https://tools.ietf.org/html/rfc7231#section-4.3 29 | public struct HTTPMethod: RawRepresentable, Equatable, Hashable { 30 | /// `CONNECT` method. 31 | public static let connect = HTTPMethod(rawValue: "CONNECT") 32 | /// `DELETE` method. 33 | public static let delete = HTTPMethod(rawValue: "DELETE") 34 | /// `GET` method. 35 | public static let get = HTTPMethod(rawValue: "GET") 36 | /// `HEAD` method. 37 | public static let head = HTTPMethod(rawValue: "HEAD") 38 | /// `OPTIONS` method. 39 | public static let options = HTTPMethod(rawValue: "OPTIONS") 40 | /// `PATCH` method. 41 | public static let patch = HTTPMethod(rawValue: "PATCH") 42 | /// `POST` method. 43 | public static let post = HTTPMethod(rawValue: "POST") 44 | /// `PUT` method. 45 | public static let put = HTTPMethod(rawValue: "PUT") 46 | /// `TRACE` method. 47 | public static let trace = HTTPMethod(rawValue: "TRACE") 48 | 49 | public let rawValue: String 50 | 51 | public init(rawValue: String) { 52 | self.rawValue = rawValue 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Alamofire/Source/HTTPMethod.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HTTPMethod.swift 3 | // 4 | // Copyright (c) 2014-2018 Alamofire Software Foundation (http://alamofire.org/) 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 | 25 | /// Type representing HTTP methods. Raw `String` value is stored and compared case-sensitively, so 26 | /// `HTTPMethod.get != HTTPMethod(rawValue: "get")`. 27 | /// 28 | /// See https://tools.ietf.org/html/rfc7231#section-4.3 29 | public struct HTTPMethod: RawRepresentable, Equatable, Hashable { 30 | /// `CONNECT` method. 31 | public static let connect = HTTPMethod(rawValue: "CONNECT") 32 | /// `DELETE` method. 33 | public static let delete = HTTPMethod(rawValue: "DELETE") 34 | /// `GET` method. 35 | public static let get = HTTPMethod(rawValue: "GET") 36 | /// `HEAD` method. 37 | public static let head = HTTPMethod(rawValue: "HEAD") 38 | /// `OPTIONS` method. 39 | public static let options = HTTPMethod(rawValue: "OPTIONS") 40 | /// `PATCH` method. 41 | public static let patch = HTTPMethod(rawValue: "PATCH") 42 | /// `POST` method. 43 | public static let post = HTTPMethod(rawValue: "POST") 44 | /// `PUT` method. 45 | public static let put = HTTPMethod(rawValue: "PUT") 46 | /// `TRACE` method. 47 | public static let trace = HTTPMethod(rawValue: "TRACE") 48 | 49 | public let rawValue: String 50 | 51 | public init(rawValue: String) { 52 | self.rawValue = rawValue 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Target Support Files/Pods-SwiftNetTest/Pods-SwiftNetTest-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## Alamofire 5 | 6 | Copyright (c) 2014-2020 Alamofire Software Foundation (http://alamofire.org/) 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | 27 | ## SwiftyNet 28 | 29 | MIT License 30 | 31 | Copyright (c) 2021 Mohamed Salah Zidane 32 | 33 | Permission is hereby granted, free of charge, to any person obtaining a copy 34 | of this software and associated documentation files (the "Software"), to deal 35 | in the Software without restriction, including without limitation the rights 36 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 37 | copies of the Software, and to permit persons to whom the Software is 38 | furnished to do so, subject to the following conditions: 39 | 40 | The above copyright notice and this permission notice shall be included in all 41 | copies or substantial portions of the Software. 42 | 43 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 44 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 45 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 46 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 47 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 48 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 49 | SOFTWARE. 50 | 51 | Generated by CocoaPods - https://cocoapods.org 52 | -------------------------------------------------------------------------------- /Pods/Alamofire/Source/AlamofireExtended.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AlamofireExtended.swift 3 | // 4 | // Copyright (c) 2019 Alamofire Software Foundation (http://alamofire.org/) 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 | 25 | /// Type that acts as a generic extension point for all `AlamofireExtended` types. 26 | public struct AlamofireExtension { 27 | /// Stores the type or meta-type of any extended type. 28 | public private(set) var type: ExtendedType 29 | 30 | /// Create an instance from the provided value. 31 | /// 32 | /// - Parameter type: Instance being extended. 33 | public init(_ type: ExtendedType) { 34 | self.type = type 35 | } 36 | } 37 | 38 | /// Protocol describing the `af` extension points for Alamofire extended types. 39 | public protocol AlamofireExtended { 40 | /// Type being extended. 41 | associatedtype ExtendedType 42 | 43 | /// Static Alamofire extension point. 44 | static var af: AlamofireExtension.Type { get set } 45 | /// Instance Alamofire extension point. 46 | var af: AlamofireExtension { get set } 47 | } 48 | 49 | extension AlamofireExtended { 50 | /// Static Alamofire extension point. 51 | public static var af: AlamofireExtension.Type { 52 | get { AlamofireExtension.self } 53 | set {} 54 | } 55 | 56 | /// Instance Alamofire extension point. 57 | public var af: AlamofireExtension { 58 | get { AlamofireExtension(self) } 59 | set {} 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Alamofire/Source/AlamofireExtended.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AlamofireExtended.swift 3 | // 4 | // Copyright (c) 2019 Alamofire Software Foundation (http://alamofire.org/) 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 | 25 | /// Type that acts as a generic extension point for all `AlamofireExtended` types. 26 | public struct AlamofireExtension { 27 | /// Stores the type or meta-type of any extended type. 28 | public private(set) var type: ExtendedType 29 | 30 | /// Create an instance from the provided value. 31 | /// 32 | /// - Parameter type: Instance being extended. 33 | public init(_ type: ExtendedType) { 34 | self.type = type 35 | } 36 | } 37 | 38 | /// Protocol describing the `af` extension points for Alamofire extended types. 39 | public protocol AlamofireExtended { 40 | /// Type being extended. 41 | associatedtype ExtendedType 42 | 43 | /// Static Alamofire extension point. 44 | static var af: AlamofireExtension.Type { get set } 45 | /// Instance Alamofire extension point. 46 | var af: AlamofireExtension { get set } 47 | } 48 | 49 | extension AlamofireExtended { 50 | /// Static Alamofire extension point. 51 | public static var af: AlamofireExtension.Type { 52 | get { AlamofireExtension.self } 53 | set {} 54 | } 55 | 56 | /// Instance Alamofire extension point. 57 | public var af: AlamofireExtension { 58 | get { AlamofireExtension(self) } 59 | set {} 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Target Support Files/Pods-SwiftNetTest-SwiftNetTestUITests/Pods-SwiftNetTest-SwiftNetTestUITests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## Alamofire 5 | 6 | Copyright (c) 2014-2020 Alamofire Software Foundation (http://alamofire.org/) 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | 27 | ## SwiftyNet 28 | 29 | MIT License 30 | 31 | Copyright (c) 2021 Mohamed Salah Zidane 32 | 33 | Permission is hereby granted, free of charge, to any person obtaining a copy 34 | of this software and associated documentation files (the "Software"), to deal 35 | in the Software without restriction, including without limitation the rights 36 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 37 | copies of the Software, and to permit persons to whom the Software is 38 | furnished to do so, subject to the following conditions: 39 | 40 | The above copyright notice and this permission notice shall be included in all 41 | copies or substantial portions of the Software. 42 | 43 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 44 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 45 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 46 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 47 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 48 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 49 | SOFTWARE. 50 | 51 | Generated by CocoaPods - https://cocoapods.org 52 | -------------------------------------------------------------------------------- /Pods/Alamofire/Source/OperationQueue+Alamofire.swift: -------------------------------------------------------------------------------- 1 | // 2 | // OperationQueue+Alamofire.swift 3 | // 4 | // Copyright (c) 2014-2018 Alamofire Software Foundation (http://alamofire.org/) 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 | 25 | import Foundation 26 | 27 | extension OperationQueue { 28 | /// Creates an instance using the provided parameters. 29 | /// 30 | /// - Parameters: 31 | /// - qualityOfService: `QualityOfService` to be applied to the queue. `.default` by default. 32 | /// - maxConcurrentOperationCount: Maximum concurrent operations. 33 | /// `OperationQueue.defaultMaxConcurrentOperationCount` by default. 34 | /// - underlyingQueue: Underlying `DispatchQueue`. `nil` by default. 35 | /// - name: Name for the queue. `nil` by default. 36 | /// - startSuspended: Whether the queue starts suspended. `false` by default. 37 | convenience init(qualityOfService: QualityOfService = .default, 38 | maxConcurrentOperationCount: Int = OperationQueue.defaultMaxConcurrentOperationCount, 39 | underlyingQueue: DispatchQueue? = nil, 40 | name: String? = nil, 41 | startSuspended: Bool = false) { 42 | self.init() 43 | self.qualityOfService = qualityOfService 44 | self.maxConcurrentOperationCount = maxConcurrentOperationCount 45 | self.underlyingQueue = underlyingQueue 46 | self.name = name 47 | isSuspended = startSuspended 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Alamofire/Source/OperationQueue+Alamofire.swift: -------------------------------------------------------------------------------- 1 | // 2 | // OperationQueue+Alamofire.swift 3 | // 4 | // Copyright (c) 2014-2018 Alamofire Software Foundation (http://alamofire.org/) 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 | 25 | import Foundation 26 | 27 | extension OperationQueue { 28 | /// Creates an instance using the provided parameters. 29 | /// 30 | /// - Parameters: 31 | /// - qualityOfService: `QualityOfService` to be applied to the queue. `.default` by default. 32 | /// - maxConcurrentOperationCount: Maximum concurrent operations. 33 | /// `OperationQueue.defaultMaxConcurrentOperationCount` by default. 34 | /// - underlyingQueue: Underlying `DispatchQueue`. `nil` by default. 35 | /// - name: Name for the queue. `nil` by default. 36 | /// - startSuspended: Whether the queue starts suspended. `false` by default. 37 | convenience init(qualityOfService: QualityOfService = .default, 38 | maxConcurrentOperationCount: Int = OperationQueue.defaultMaxConcurrentOperationCount, 39 | underlyingQueue: DispatchQueue? = nil, 40 | name: String? = nil, 41 | startSuspended: Bool = false) { 42 | self.init() 43 | self.qualityOfService = qualityOfService 44 | self.maxConcurrentOperationCount = maxConcurrentOperationCount 45 | self.underlyingQueue = underlyingQueue 46 | self.name = name 47 | isSuspended = startSuspended 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /SwiftyNet/Support/NetworkRequest.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NetworkRequest.swift 3 | // SwiftyNet 4 | // 5 | // Created by prog_zidane on 4/29/21. 6 | // 7 | 8 | import Foundation 9 | import Alamofire 10 | 11 | // Multipart Model 12 | public struct MultipartData { 13 | var fileName = "media" 14 | var fileData : Data = Data() 15 | } 16 | 17 | /// A simple protocol to that holds the request related properties 18 | public protocol NetworkRequest: URLRequestConvertible { 19 | var path: String {get} 20 | var pathContainsHost: Bool {get} 21 | var baseUrl: URL {get} 22 | var method: HTTPMethod {get} 23 | var parameters: Parameters? {get} 24 | var parameterEncoding: RequestParameterEncoding? {get} 25 | var headers: [String: Any]? {get} 26 | var dataType: DataType {get} 27 | var multiPart: [MultipartData]? {get} 28 | } 29 | 30 | extension NetworkRequest { 31 | 32 | public var pathContainsHost: Bool { 33 | return false 34 | } 35 | 36 | public var headers: [String : Any]? { 37 | var headers = [String : Any]() 38 | headers["Content-type"] = "application/x-www-form-urlencoded; charset=utf-8" 39 | headers["Content-type"] = "application/json" 40 | headers["Accept"] = "application/json" 41 | return headers 42 | } 43 | 44 | public var dataType: DataType { 45 | return .JSON 46 | } 47 | 48 | public var multiPart: [MultipartData]? { 49 | return nil 50 | } 51 | 52 | public func asURLRequest() throws -> URLRequest { 53 | let url = try (baseUrl).asURL() 54 | var urlRequest = URLRequest(url: pathContainsHost ? URL(string: path)! : url.appendingPathComponent(path)) 55 | urlRequest.httpMethod = method.rawValue 56 | 57 | if let params = parameters { 58 | if let encodingType = parameterEncoding { 59 | urlRequest = try encodingType.encoding.encode(urlRequest, with: params) 60 | } else { 61 | urlRequest = try URLEncoding.default.encode(urlRequest, with: params) 62 | } 63 | } 64 | 65 | if let headers = headers { 66 | headers.forEach { 67 | if let value = $0.value as? String { 68 | urlRequest.setValue(value, forHTTPHeaderField: $0.key) 69 | } 70 | } 71 | } 72 | 73 | urlRequest.timeoutInterval = 120 74 | return urlRequest 75 | } 76 | } 77 | 78 | public enum RequestParameterEncoding: String { 79 | // json means you send paramter in => Body "Postman" 80 | // queryString means you send paramter in => Params "Postman" 81 | case queryString, httpBody, json 82 | 83 | public var encoding: ParameterEncoding { 84 | switch self { 85 | case .queryString: 86 | return URLEncoding.queryString 87 | case .httpBody: 88 | return URLEncoding.httpBody 89 | case .json: 90 | return JSONEncoding.default 91 | } 92 | } 93 | } 94 | 95 | public enum DataType { 96 | case JSON 97 | case data 98 | } 99 | -------------------------------------------------------------------------------- /SwiftyNet/Executer/NetworkExecutor.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NetworkExecutor.swift 3 | // SwiftyNet 4 | // 5 | // Created by prog_zidane on 4/29/21. 6 | // 7 | 8 | import Foundation 9 | import Alamofire 10 | 11 | public protocol Excutable: class { 12 | typealias OnProgressCallback = (CFloat) -> () 13 | 14 | func request( 15 | targetRequest: M, 16 | responseObject: T.Type, 17 | complation: @escaping (NetworkResponse)->()) 18 | 19 | func requestMultipart ( 20 | targetRequest: M, 21 | responseObject: T.Type, 22 | complation: @escaping (NetworkResponse)->(), 23 | onProgress: OnProgressCallback?) 24 | } 25 | 26 | /// Used to connect to any JSON API that is modeled by an AlamofireEndpoint 27 | public final class NetworkRouter: Excutable { 28 | 29 | private var queue: DispatchQueue = DispatchQueue.global(qos: .userInitiated) 30 | 31 | public init() { 32 | 33 | } 34 | 35 | public func request ( 36 | targetRequest: M, 37 | responseObject: T.Type, 38 | complation _complation: @escaping (NetworkResponse)->() 39 | ) { 40 | 41 | let complation: (NetworkResponse)->() = { responce in 42 | DispatchQueue.main.async { _complation(responce) } 43 | } 44 | 45 | ApiSessionManager 46 | .sessionManager 47 | .request(targetRequest) 48 | .validate() 49 | .responseJSON 50 | { (responce) in 51 | complation(NetworkResponse(responce)) 52 | } 53 | } 54 | 55 | 56 | public func requestMultipart ( 57 | targetRequest: M, 58 | responseObject: T.Type, 59 | complation _complation: @escaping (NetworkResponse)->(), 60 | onProgress _onProgress: OnProgressCallback? = nil 61 | ) { 62 | 63 | let onProgress: OnProgressCallback = { value in 64 | DispatchQueue.main.async { _onProgress?(value) } 65 | } 66 | 67 | let complation: (NetworkResponse)->() = { responce in 68 | DispatchQueue.main.async { _complation(responce) } 69 | } 70 | 71 | queue.async { 72 | ApiSessionManager 73 | .sessionManager 74 | .upload(multipartFormData: { (multipartFormData) in 75 | if let parameters = targetRequest.parameters { 76 | for (key, value) in parameters{ 77 | multipartFormData.append("\(value)".data(using: String.Encoding.utf8)!, withName: "\(key)") 78 | } 79 | } 80 | targetRequest.multiPart?.forEach({ (multipart) in 81 | multipartFormData.append(multipart.fileData, withName: multipart.fileName, fileName: multipart.fileData.format.fileName, mimeType: multipart.fileData.format.mimeType) 82 | }) 83 | },with: targetRequest).responseJSON(completionHandler: { (response) in 84 | switch response.result { 85 | case .success: 86 | complation(NetworkResponse(response)) 87 | case .failure(let error): 88 | complation(.failure(NetworkError(error))) 89 | } 90 | }).uploadProgress(closure: { (progress) in 91 | onProgress(Float(progress.fractionCompleted)) 92 | }) 93 | } 94 | 95 | } 96 | 97 | } 98 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Target Support Files/Pods-SwiftNetTest/Pods-SwiftNetTest-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2014-2020 Alamofire Software Foundation (http://alamofire.org/) 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | License 38 | MIT 39 | Title 40 | Alamofire 41 | Type 42 | PSGroupSpecifier 43 | 44 | 45 | FooterText 46 | MIT License 47 | 48 | Copyright (c) 2021 Mohamed Salah Zidane 49 | 50 | Permission is hereby granted, free of charge, to any person obtaining a copy 51 | of this software and associated documentation files (the "Software"), to deal 52 | in the Software without restriction, including without limitation the rights 53 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 54 | copies of the Software, and to permit persons to whom the Software is 55 | furnished to do so, subject to the following conditions: 56 | 57 | The above copyright notice and this permission notice shall be included in all 58 | copies or substantial portions of the Software. 59 | 60 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 61 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 62 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 63 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 64 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 65 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 66 | SOFTWARE. 67 | 68 | License 69 | MIT 70 | Title 71 | SwiftyNet 72 | Type 73 | PSGroupSpecifier 74 | 75 | 76 | FooterText 77 | Generated by CocoaPods - https://cocoapods.org 78 | Title 79 | 80 | Type 81 | PSGroupSpecifier 82 | 83 | 84 | StringsTable 85 | Acknowledgements 86 | Title 87 | Acknowledgements 88 | 89 | 90 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Target Support Files/Pods-SwiftNetTest-SwiftNetTestUITests/Pods-SwiftNetTest-SwiftNetTestUITests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2014-2020 Alamofire Software Foundation (http://alamofire.org/) 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | License 38 | MIT 39 | Title 40 | Alamofire 41 | Type 42 | PSGroupSpecifier 43 | 44 | 45 | FooterText 46 | MIT License 47 | 48 | Copyright (c) 2021 Mohamed Salah Zidane 49 | 50 | Permission is hereby granted, free of charge, to any person obtaining a copy 51 | of this software and associated documentation files (the "Software"), to deal 52 | in the Software without restriction, including without limitation the rights 53 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 54 | copies of the Software, and to permit persons to whom the Software is 55 | furnished to do so, subject to the following conditions: 56 | 57 | The above copyright notice and this permission notice shall be included in all 58 | copies or substantial portions of the Software. 59 | 60 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 61 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 62 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 63 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 64 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 65 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 66 | SOFTWARE. 67 | 68 | License 69 | MIT 70 | Title 71 | SwiftyNet 72 | Type 73 | PSGroupSpecifier 74 | 75 | 76 | FooterText 77 | Generated by CocoaPods - https://cocoapods.org 78 | Title 79 | 80 | Type 81 | PSGroupSpecifier 82 | 83 | 84 | StringsTable 85 | Acknowledgements 86 | Title 87 | Acknowledgements 88 | 89 | 90 | -------------------------------------------------------------------------------- /Pods/Alamofire/Source/MultipartUpload.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MultipartUpload.swift 3 | // 4 | // Copyright (c) 2014-2018 Alamofire Software Foundation (http://alamofire.org/) 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 | 25 | import Foundation 26 | 27 | /// Internal type which encapsulates a `MultipartFormData` upload. 28 | final class MultipartUpload { 29 | lazy var result = Result { try build() } 30 | 31 | let isInBackgroundSession: Bool 32 | let multipartFormData: MultipartFormData 33 | let encodingMemoryThreshold: UInt64 34 | let request: URLRequestConvertible 35 | let fileManager: FileManager 36 | 37 | init(isInBackgroundSession: Bool, 38 | encodingMemoryThreshold: UInt64, 39 | request: URLRequestConvertible, 40 | multipartFormData: MultipartFormData) { 41 | self.isInBackgroundSession = isInBackgroundSession 42 | self.encodingMemoryThreshold = encodingMemoryThreshold 43 | self.request = request 44 | fileManager = multipartFormData.fileManager 45 | self.multipartFormData = multipartFormData 46 | } 47 | 48 | func build() throws -> (request: URLRequest, uploadable: UploadRequest.Uploadable) { 49 | var urlRequest = try request.asURLRequest() 50 | urlRequest.setValue(multipartFormData.contentType, forHTTPHeaderField: "Content-Type") 51 | 52 | let uploadable: UploadRequest.Uploadable 53 | if multipartFormData.contentLength < encodingMemoryThreshold && !isInBackgroundSession { 54 | let data = try multipartFormData.encode() 55 | 56 | uploadable = .data(data) 57 | } else { 58 | let tempDirectoryURL = fileManager.temporaryDirectory 59 | let directoryURL = tempDirectoryURL.appendingPathComponent("org.alamofire.manager/multipart.form.data") 60 | let fileName = UUID().uuidString 61 | let fileURL = directoryURL.appendingPathComponent(fileName) 62 | 63 | try fileManager.createDirectory(at: directoryURL, withIntermediateDirectories: true, attributes: nil) 64 | 65 | do { 66 | try multipartFormData.writeEncodedData(to: fileURL) 67 | } catch { 68 | // Cleanup after attempted write if it fails. 69 | try? fileManager.removeItem(at: fileURL) 70 | throw error 71 | } 72 | 73 | uploadable = .file(fileURL, shouldRemove: true) 74 | } 75 | 76 | return (request: urlRequest, uploadable: uploadable) 77 | } 78 | } 79 | 80 | extension MultipartUpload: UploadConvertible { 81 | func asURLRequest() throws -> URLRequest { 82 | try result.get().request 83 | } 84 | 85 | func createUploadable() throws -> UploadRequest.Uploadable { 86 | try result.get().uploadable 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Alamofire/Source/MultipartUpload.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MultipartUpload.swift 3 | // 4 | // Copyright (c) 2014-2018 Alamofire Software Foundation (http://alamofire.org/) 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 | 25 | import Foundation 26 | 27 | /// Internal type which encapsulates a `MultipartFormData` upload. 28 | final class MultipartUpload { 29 | lazy var result = Result { try build() } 30 | 31 | let isInBackgroundSession: Bool 32 | let multipartFormData: MultipartFormData 33 | let encodingMemoryThreshold: UInt64 34 | let request: URLRequestConvertible 35 | let fileManager: FileManager 36 | 37 | init(isInBackgroundSession: Bool, 38 | encodingMemoryThreshold: UInt64, 39 | request: URLRequestConvertible, 40 | multipartFormData: MultipartFormData) { 41 | self.isInBackgroundSession = isInBackgroundSession 42 | self.encodingMemoryThreshold = encodingMemoryThreshold 43 | self.request = request 44 | fileManager = multipartFormData.fileManager 45 | self.multipartFormData = multipartFormData 46 | } 47 | 48 | func build() throws -> (request: URLRequest, uploadable: UploadRequest.Uploadable) { 49 | var urlRequest = try request.asURLRequest() 50 | urlRequest.setValue(multipartFormData.contentType, forHTTPHeaderField: "Content-Type") 51 | 52 | let uploadable: UploadRequest.Uploadable 53 | if multipartFormData.contentLength < encodingMemoryThreshold && !isInBackgroundSession { 54 | let data = try multipartFormData.encode() 55 | 56 | uploadable = .data(data) 57 | } else { 58 | let tempDirectoryURL = fileManager.temporaryDirectory 59 | let directoryURL = tempDirectoryURL.appendingPathComponent("org.alamofire.manager/multipart.form.data") 60 | let fileName = UUID().uuidString 61 | let fileURL = directoryURL.appendingPathComponent(fileName) 62 | 63 | try fileManager.createDirectory(at: directoryURL, withIntermediateDirectories: true, attributes: nil) 64 | 65 | do { 66 | try multipartFormData.writeEncodedData(to: fileURL) 67 | } catch { 68 | // Cleanup after attempted write if it fails. 69 | try? fileManager.removeItem(at: fileURL) 70 | throw error 71 | } 72 | 73 | uploadable = .file(fileURL, shouldRemove: true) 74 | } 75 | 76 | return (request: urlRequest, uploadable: uploadable) 77 | } 78 | } 79 | 80 | extension MultipartUpload: UploadConvertible { 81 | func asURLRequest() throws -> URLRequest { 82 | try result.get().request 83 | } 84 | 85 | func createUploadable() throws -> UploadRequest.Uploadable { 86 | try result.get().uploadable 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /SwiftyNet/Support/NetworkError.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NetworkError.swift 3 | // SwiftyNet 4 | // 5 | // Created by prog_zidane on 4/29/21. 6 | // 7 | 8 | import Foundation 9 | 10 | extension Error 11 | { 12 | var code: Int { return (self as NSError).code } 13 | var domain: String { return (self as NSError).domain } 14 | } 15 | 16 | public enum NetworkError: Error 17 | { 18 | case badJSON 19 | case noConnection 20 | case noData 21 | case notAuthenticated 22 | case forbidden 23 | case notFound 24 | case serverError 25 | case timeout 26 | case conflict 27 | case unknownError 28 | case parsingJSONError 29 | case errorMessage(text: String) 30 | 31 | init(_ error: Error) 32 | { 33 | let error: NSError = error as NSError 34 | if error.domain == NSURLErrorDomain 35 | { 36 | switch error.code 37 | { 38 | case NSURLErrorTimedOut: 39 | self = .timeout 40 | case NSURLErrorResourceUnavailable: 41 | self = .noData 42 | case NSURLErrorUserAuthenticationRequired: 43 | self = .notAuthenticated 44 | case NSURLErrorBadURL: 45 | self = .notFound 46 | case NSURLErrorNotConnectedToInternet: 47 | self = .noConnection 48 | case NSURLErrorCannotDecodeRawData, NSURLErrorCannotDecodeContentData, NSURLErrorCannotParseResponse: 49 | self = .parsingJSONError 50 | default: 51 | self = .unknownError 52 | } 53 | return 54 | } 55 | 56 | self = .unknownError 57 | } 58 | 59 | init(_ statusCode: Int) 60 | { 61 | switch statusCode 62 | { 63 | case 100: 64 | self = .badJSON 65 | case 400: 66 | self = .noConnection 67 | case 209: 68 | self = .notAuthenticated 69 | case 403: 70 | self = .forbidden 71 | case 404: 72 | self = .notFound 73 | case 409: 74 | self = .conflict 75 | case 500: 76 | self = .serverError 77 | default: 78 | self = .unknownError 79 | } 80 | } 81 | } 82 | 83 | extension NetworkError: LocalizedError 84 | { 85 | public var errorDescription: String? 86 | { 87 | switch self 88 | { 89 | case .badJSON: 90 | return NSLocalizedString("The data from the server is dammeged", comment: "") 91 | 92 | case .noConnection: 93 | return NSLocalizedString("Please check your internet connection and try again", comment: "") 94 | 95 | case .timeout: 96 | return NSLocalizedString("It took us too long to load the data, please try again later", comment: "") 97 | 98 | case .notAuthenticated, .forbidden: 99 | let appName = Bundle.main.object(forInfoDictionaryKey: "CFBundleDisplayName") as? String ?? "" 100 | return NSLocalizedString("please check your authorization with ", comment: "") + appName 101 | 102 | case .noData: 103 | let appName = Bundle.main.object(forInfoDictionaryKey: "CFBundleDisplayName") as? String ?? "" 104 | return NSLocalizedString("can not get data from \(appName) server", comment: "") 105 | 106 | case .notFound: 107 | return NSLocalizedString("seemes That your connection request un-avaliable link", comment: "") 108 | 109 | case .serverError: 110 | return NSLocalizedString("server error", comment: "") 111 | 112 | case .conflict: 113 | return NSLocalizedString("server conflict error", comment: "") 114 | 115 | case .parsingJSONError: 116 | return "CHECK YOUR MODEL KEYS AND VALUES" 117 | case .errorMessage(let text): 118 | return text 119 | default: 120 | return NSLocalizedString("There is something wrong please try again later", comment: "") 121 | } 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /Pods/Alamofire/Source/CachedResponseHandler.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CachedResponseHandler.swift 3 | // 4 | // Copyright (c) 2019 Alamofire Software Foundation (http://alamofire.org/) 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 | 25 | import Foundation 26 | 27 | /// A type that handles whether the data task should store the HTTP response in the cache. 28 | public protocol CachedResponseHandler { 29 | /// Determines whether the HTTP response should be stored in the cache. 30 | /// 31 | /// The `completion` closure should be passed one of three possible options: 32 | /// 33 | /// 1. The cached response provided by the server (this is the most common use case). 34 | /// 2. A modified version of the cached response (you may want to modify it in some way before caching). 35 | /// 3. A `nil` value to prevent the cached response from being stored in the cache. 36 | /// 37 | /// - Parameters: 38 | /// - task: The data task whose request resulted in the cached response. 39 | /// - response: The cached response to potentially store in the cache. 40 | /// - completion: The closure to execute containing cached response, a modified response, or `nil`. 41 | func dataTask(_ task: URLSessionDataTask, 42 | willCacheResponse response: CachedURLResponse, 43 | completion: @escaping (CachedURLResponse?) -> Void) 44 | } 45 | 46 | // MARK: - 47 | 48 | /// `ResponseCacher` is a convenience `CachedResponseHandler` making it easy to cache, not cache, or modify a cached 49 | /// response. 50 | public struct ResponseCacher { 51 | /// Defines the behavior of the `ResponseCacher` type. 52 | public enum Behavior { 53 | /// Stores the cached response in the cache. 54 | case cache 55 | /// Prevents the cached response from being stored in the cache. 56 | case doNotCache 57 | /// Modifies the cached response before storing it in the cache. 58 | case modify((URLSessionDataTask, CachedURLResponse) -> CachedURLResponse?) 59 | } 60 | 61 | /// Returns a `ResponseCacher` with a follow `Behavior`. 62 | public static let cache = ResponseCacher(behavior: .cache) 63 | /// Returns a `ResponseCacher` with a do not follow `Behavior`. 64 | public static let doNotCache = ResponseCacher(behavior: .doNotCache) 65 | 66 | /// The `Behavior` of the `ResponseCacher`. 67 | public let behavior: Behavior 68 | 69 | /// Creates a `ResponseCacher` instance from the `Behavior`. 70 | /// 71 | /// - Parameter behavior: The `Behavior`. 72 | public init(behavior: Behavior) { 73 | self.behavior = behavior 74 | } 75 | } 76 | 77 | extension ResponseCacher: CachedResponseHandler { 78 | public func dataTask(_ task: URLSessionDataTask, 79 | willCacheResponse response: CachedURLResponse, 80 | completion: @escaping (CachedURLResponse?) -> Void) { 81 | switch behavior { 82 | case .cache: 83 | completion(response) 84 | case .doNotCache: 85 | completion(nil) 86 | case let .modify(closure): 87 | let response = closure(task, response) 88 | completion(response) 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Alamofire/Source/CachedResponseHandler.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CachedResponseHandler.swift 3 | // 4 | // Copyright (c) 2019 Alamofire Software Foundation (http://alamofire.org/) 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 | 25 | import Foundation 26 | 27 | /// A type that handles whether the data task should store the HTTP response in the cache. 28 | public protocol CachedResponseHandler { 29 | /// Determines whether the HTTP response should be stored in the cache. 30 | /// 31 | /// The `completion` closure should be passed one of three possible options: 32 | /// 33 | /// 1. The cached response provided by the server (this is the most common use case). 34 | /// 2. A modified version of the cached response (you may want to modify it in some way before caching). 35 | /// 3. A `nil` value to prevent the cached response from being stored in the cache. 36 | /// 37 | /// - Parameters: 38 | /// - task: The data task whose request resulted in the cached response. 39 | /// - response: The cached response to potentially store in the cache. 40 | /// - completion: The closure to execute containing cached response, a modified response, or `nil`. 41 | func dataTask(_ task: URLSessionDataTask, 42 | willCacheResponse response: CachedURLResponse, 43 | completion: @escaping (CachedURLResponse?) -> Void) 44 | } 45 | 46 | // MARK: - 47 | 48 | /// `ResponseCacher` is a convenience `CachedResponseHandler` making it easy to cache, not cache, or modify a cached 49 | /// response. 50 | public struct ResponseCacher { 51 | /// Defines the behavior of the `ResponseCacher` type. 52 | public enum Behavior { 53 | /// Stores the cached response in the cache. 54 | case cache 55 | /// Prevents the cached response from being stored in the cache. 56 | case doNotCache 57 | /// Modifies the cached response before storing it in the cache. 58 | case modify((URLSessionDataTask, CachedURLResponse) -> CachedURLResponse?) 59 | } 60 | 61 | /// Returns a `ResponseCacher` with a follow `Behavior`. 62 | public static let cache = ResponseCacher(behavior: .cache) 63 | /// Returns a `ResponseCacher` with a do not follow `Behavior`. 64 | public static let doNotCache = ResponseCacher(behavior: .doNotCache) 65 | 66 | /// The `Behavior` of the `ResponseCacher`. 67 | public let behavior: Behavior 68 | 69 | /// Creates a `ResponseCacher` instance from the `Behavior`. 70 | /// 71 | /// - Parameter behavior: The `Behavior`. 72 | public init(behavior: Behavior) { 73 | self.behavior = behavior 74 | } 75 | } 76 | 77 | extension ResponseCacher: CachedResponseHandler { 78 | public func dataTask(_ task: URLSessionDataTask, 79 | willCacheResponse response: CachedURLResponse, 80 | completion: @escaping (CachedURLResponse?) -> Void) { 81 | switch behavior { 82 | case .cache: 83 | completion(response) 84 | case .doNotCache: 85 | completion(nil) 86 | case let .modify(closure): 87 | let response = closure(task, response) 88 | completion(response) 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /Pods/Alamofire/Source/URLConvertible+URLRequestConvertible.swift: -------------------------------------------------------------------------------- 1 | // 2 | // URLConvertible+URLRequestConvertible.swift 3 | // 4 | // Copyright (c) 2014-2018 Alamofire Software Foundation (http://alamofire.org/) 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 | 25 | import Foundation 26 | 27 | /// Types adopting the `URLConvertible` protocol can be used to construct `URL`s, which can then be used to construct 28 | /// `URLRequests`. 29 | public protocol URLConvertible { 30 | /// Returns a `URL` from the conforming instance or throws. 31 | /// 32 | /// - Returns: The `URL` created from the instance. 33 | /// - Throws: Any error thrown while creating the `URL`. 34 | func asURL() throws -> URL 35 | } 36 | 37 | extension String: URLConvertible { 38 | /// Returns a `URL` if `self` can be used to initialize a `URL` instance, otherwise throws. 39 | /// 40 | /// - Returns: The `URL` initialized with `self`. 41 | /// - Throws: An `AFError.invalidURL` instance. 42 | public func asURL() throws -> URL { 43 | guard let url = URL(string: self) else { throw AFError.invalidURL(url: self) } 44 | 45 | return url 46 | } 47 | } 48 | 49 | extension URL: URLConvertible { 50 | /// Returns `self`. 51 | public func asURL() throws -> URL { self } 52 | } 53 | 54 | extension URLComponents: URLConvertible { 55 | /// Returns a `URL` if the `self`'s `url` is not nil, otherwise throws. 56 | /// 57 | /// - Returns: The `URL` from the `url` property. 58 | /// - Throws: An `AFError.invalidURL` instance. 59 | public func asURL() throws -> URL { 60 | guard let url = url else { throw AFError.invalidURL(url: self) } 61 | 62 | return url 63 | } 64 | } 65 | 66 | // MARK: - 67 | 68 | /// Types adopting the `URLRequestConvertible` protocol can be used to safely construct `URLRequest`s. 69 | public protocol URLRequestConvertible { 70 | /// Returns a `URLRequest` or throws if an `Error` was encountered. 71 | /// 72 | /// - Returns: A `URLRequest`. 73 | /// - Throws: Any error thrown while constructing the `URLRequest`. 74 | func asURLRequest() throws -> URLRequest 75 | } 76 | 77 | extension URLRequestConvertible { 78 | /// The `URLRequest` returned by discarding any `Error` encountered. 79 | public var urlRequest: URLRequest? { try? asURLRequest() } 80 | } 81 | 82 | extension URLRequest: URLRequestConvertible { 83 | /// Returns `self`. 84 | public func asURLRequest() throws -> URLRequest { self } 85 | } 86 | 87 | // MARK: - 88 | 89 | extension URLRequest { 90 | /// Creates an instance with the specified `url`, `method`, and `headers`. 91 | /// 92 | /// - Parameters: 93 | /// - url: The `URLConvertible` value. 94 | /// - method: The `HTTPMethod`. 95 | /// - headers: The `HTTPHeaders`, `nil` by default. 96 | /// - Throws: Any error thrown while converting the `URLConvertible` to a `URL`. 97 | public init(url: URLConvertible, method: HTTPMethod, headers: HTTPHeaders? = nil) throws { 98 | let url = try url.asURL() 99 | 100 | self.init(url: url) 101 | 102 | httpMethod = method.rawValue 103 | allHTTPHeaderFields = headers?.dictionary 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Alamofire/Source/URLConvertible+URLRequestConvertible.swift: -------------------------------------------------------------------------------- 1 | // 2 | // URLConvertible+URLRequestConvertible.swift 3 | // 4 | // Copyright (c) 2014-2018 Alamofire Software Foundation (http://alamofire.org/) 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 | 25 | import Foundation 26 | 27 | /// Types adopting the `URLConvertible` protocol can be used to construct `URL`s, which can then be used to construct 28 | /// `URLRequests`. 29 | public protocol URLConvertible { 30 | /// Returns a `URL` from the conforming instance or throws. 31 | /// 32 | /// - Returns: The `URL` created from the instance. 33 | /// - Throws: Any error thrown while creating the `URL`. 34 | func asURL() throws -> URL 35 | } 36 | 37 | extension String: URLConvertible { 38 | /// Returns a `URL` if `self` can be used to initialize a `URL` instance, otherwise throws. 39 | /// 40 | /// - Returns: The `URL` initialized with `self`. 41 | /// - Throws: An `AFError.invalidURL` instance. 42 | public func asURL() throws -> URL { 43 | guard let url = URL(string: self) else { throw AFError.invalidURL(url: self) } 44 | 45 | return url 46 | } 47 | } 48 | 49 | extension URL: URLConvertible { 50 | /// Returns `self`. 51 | public func asURL() throws -> URL { self } 52 | } 53 | 54 | extension URLComponents: URLConvertible { 55 | /// Returns a `URL` if the `self`'s `url` is not nil, otherwise throws. 56 | /// 57 | /// - Returns: The `URL` from the `url` property. 58 | /// - Throws: An `AFError.invalidURL` instance. 59 | public func asURL() throws -> URL { 60 | guard let url = url else { throw AFError.invalidURL(url: self) } 61 | 62 | return url 63 | } 64 | } 65 | 66 | // MARK: - 67 | 68 | /// Types adopting the `URLRequestConvertible` protocol can be used to safely construct `URLRequest`s. 69 | public protocol URLRequestConvertible { 70 | /// Returns a `URLRequest` or throws if an `Error` was encountered. 71 | /// 72 | /// - Returns: A `URLRequest`. 73 | /// - Throws: Any error thrown while constructing the `URLRequest`. 74 | func asURLRequest() throws -> URLRequest 75 | } 76 | 77 | extension URLRequestConvertible { 78 | /// The `URLRequest` returned by discarding any `Error` encountered. 79 | public var urlRequest: URLRequest? { try? asURLRequest() } 80 | } 81 | 82 | extension URLRequest: URLRequestConvertible { 83 | /// Returns `self`. 84 | public func asURLRequest() throws -> URLRequest { self } 85 | } 86 | 87 | // MARK: - 88 | 89 | extension URLRequest { 90 | /// Creates an instance with the specified `url`, `method`, and `headers`. 91 | /// 92 | /// - Parameters: 93 | /// - url: The `URLConvertible` value. 94 | /// - method: The `HTTPMethod`. 95 | /// - headers: The `HTTPHeaders`, `nil` by default. 96 | /// - Throws: Any error thrown while converting the `URLConvertible` to a `URL`. 97 | public init(url: URLConvertible, method: HTTPMethod, headers: HTTPHeaders? = nil) throws { 98 | let url = try url.asURL() 99 | 100 | self.init(url: url) 101 | 102 | httpMethod = method.rawValue 103 | allHTTPHeaderFields = headers?.dictionary 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /Pods/Alamofire/Source/RedirectHandler.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RedirectHandler.swift 3 | // 4 | // Copyright (c) 2014-2018 Alamofire Software Foundation (http://alamofire.org/) 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 | 25 | import Foundation 26 | 27 | /// A type that handles how an HTTP redirect response from a remote server should be redirected to the new request. 28 | public protocol RedirectHandler { 29 | /// Determines how the HTTP redirect response should be redirected to the new request. 30 | /// 31 | /// The `completion` closure should be passed one of three possible options: 32 | /// 33 | /// 1. The new request specified by the redirect (this is the most common use case). 34 | /// 2. A modified version of the new request (you may want to route it somewhere else). 35 | /// 3. A `nil` value to deny the redirect request and return the body of the redirect response. 36 | /// 37 | /// - Parameters: 38 | /// - task: The `URLSessionTask` whose request resulted in a redirect. 39 | /// - request: The `URLRequest` to the new location specified by the redirect response. 40 | /// - response: The `HTTPURLResponse` containing the server's response to the original request. 41 | /// - completion: The closure to execute containing the new `URLRequest`, a modified `URLRequest`, or `nil`. 42 | func task(_ task: URLSessionTask, 43 | willBeRedirectedTo request: URLRequest, 44 | for response: HTTPURLResponse, 45 | completion: @escaping (URLRequest?) -> Void) 46 | } 47 | 48 | // MARK: - 49 | 50 | /// `Redirector` is a convenience `RedirectHandler` making it easy to follow, not follow, or modify a redirect. 51 | public struct Redirector { 52 | /// Defines the behavior of the `Redirector` type. 53 | public enum Behavior { 54 | /// Follow the redirect as defined in the response. 55 | case follow 56 | /// Do not follow the redirect defined in the response. 57 | case doNotFollow 58 | /// Modify the redirect request defined in the response. 59 | case modify((URLSessionTask, URLRequest, HTTPURLResponse) -> URLRequest?) 60 | } 61 | 62 | /// Returns a `Redirector` with a `.follow` `Behavior`. 63 | public static let follow = Redirector(behavior: .follow) 64 | /// Returns a `Redirector` with a `.doNotFollow` `Behavior`. 65 | public static let doNotFollow = Redirector(behavior: .doNotFollow) 66 | 67 | /// The `Behavior` of the `Redirector`. 68 | public let behavior: Behavior 69 | 70 | /// Creates a `Redirector` instance from the `Behavior`. 71 | /// 72 | /// - Parameter behavior: The `Behavior`. 73 | public init(behavior: Behavior) { 74 | self.behavior = behavior 75 | } 76 | } 77 | 78 | // MARK: - 79 | 80 | extension Redirector: RedirectHandler { 81 | public func task(_ task: URLSessionTask, 82 | willBeRedirectedTo request: URLRequest, 83 | for response: HTTPURLResponse, 84 | completion: @escaping (URLRequest?) -> Void) { 85 | switch behavior { 86 | case .follow: 87 | completion(request) 88 | case .doNotFollow: 89 | completion(nil) 90 | case let .modify(closure): 91 | let request = closure(task, request, response) 92 | completion(request) 93 | } 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /Example/SwiftNetTest/Pods/Alamofire/Source/RedirectHandler.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RedirectHandler.swift 3 | // 4 | // Copyright (c) 2014-2018 Alamofire Software Foundation (http://alamofire.org/) 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 | 25 | import Foundation 26 | 27 | /// A type that handles how an HTTP redirect response from a remote server should be redirected to the new request. 28 | public protocol RedirectHandler { 29 | /// Determines how the HTTP redirect response should be redirected to the new request. 30 | /// 31 | /// The `completion` closure should be passed one of three possible options: 32 | /// 33 | /// 1. The new request specified by the redirect (this is the most common use case). 34 | /// 2. A modified version of the new request (you may want to route it somewhere else). 35 | /// 3. A `nil` value to deny the redirect request and return the body of the redirect response. 36 | /// 37 | /// - Parameters: 38 | /// - task: The `URLSessionTask` whose request resulted in a redirect. 39 | /// - request: The `URLRequest` to the new location specified by the redirect response. 40 | /// - response: The `HTTPURLResponse` containing the server's response to the original request. 41 | /// - completion: The closure to execute containing the new `URLRequest`, a modified `URLRequest`, or `nil`. 42 | func task(_ task: URLSessionTask, 43 | willBeRedirectedTo request: URLRequest, 44 | for response: HTTPURLResponse, 45 | completion: @escaping (URLRequest?) -> Void) 46 | } 47 | 48 | // MARK: - 49 | 50 | /// `Redirector` is a convenience `RedirectHandler` making it easy to follow, not follow, or modify a redirect. 51 | public struct Redirector { 52 | /// Defines the behavior of the `Redirector` type. 53 | public enum Behavior { 54 | /// Follow the redirect as defined in the response. 55 | case follow 56 | /// Do not follow the redirect defined in the response. 57 | case doNotFollow 58 | /// Modify the redirect request defined in the response. 59 | case modify((URLSessionTask, URLRequest, HTTPURLResponse) -> URLRequest?) 60 | } 61 | 62 | /// Returns a `Redirector` with a `.follow` `Behavior`. 63 | public static let follow = Redirector(behavior: .follow) 64 | /// Returns a `Redirector` with a `.doNotFollow` `Behavior`. 65 | public static let doNotFollow = Redirector(behavior: .doNotFollow) 66 | 67 | /// The `Behavior` of the `Redirector`. 68 | public let behavior: Behavior 69 | 70 | /// Creates a `Redirector` instance from the `Behavior`. 71 | /// 72 | /// - Parameter behavior: The `Behavior`. 73 | public init(behavior: Behavior) { 74 | self.behavior = behavior 75 | } 76 | } 77 | 78 | // MARK: - 79 | 80 | extension Redirector: RedirectHandler { 81 | public func task(_ task: URLSessionTask, 82 | willBeRedirectedTo request: URLRequest, 83 | for response: HTTPURLResponse, 84 | completion: @escaping (URLRequest?) -> Void) { 85 | switch behavior { 86 | case .follow: 87 | completion(request) 88 | case .doNotFollow: 89 | completion(nil) 90 | case let .modify(closure): 91 | let request = closure(task, request, response) 92 | completion(request) 93 | } 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /SwiftyNet.xcframework/ios-arm64/SwiftyNet.framework/Modules/SwiftyNet.swiftmodule/arm64.swiftinterface: -------------------------------------------------------------------------------- 1 | // swift-interface-format-version: 1.0 2 | // swift-compiler-version: Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28) 3 | // swift-module-flags: -target arm64-apple-ios13.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name SwiftyNet 4 | import Alamofire 5 | import Foundation 6 | import Swift 7 | @_exported import SwiftyNet 8 | public protocol Excutable : AnyObject { 9 | typealias OnProgressCallback = (Swift.CFloat) -> () 10 | func request(targetRequest: M, responseObject: T.Type, complation: @escaping (SwiftyNet.NetworkResponse) -> ()) where T : Swift.Decodable, T : Swift.Encodable, M : SwiftyNet.NetworkRequest 11 | func requestMultipart(targetRequest: M, responseObject: T.Type, complation: @escaping (SwiftyNet.NetworkResponse) -> (), onProgress: Self.OnProgressCallback?) where T : Swift.Decodable, T : Swift.Encodable, M : SwiftyNet.NetworkRequest 12 | } 13 | final public class NetworkRouter : SwiftyNet.Excutable { 14 | public init() 15 | final public func request(targetRequest: M, responseObject: T.Type, complation _complation: @escaping (SwiftyNet.NetworkResponse) -> ()) where T : Swift.Decodable, T : Swift.Encodable, M : SwiftyNet.NetworkRequest 16 | final public func requestMultipart(targetRequest: M, responseObject: T.Type, complation _complation: @escaping (SwiftyNet.NetworkResponse) -> (), onProgress _onProgress: SwiftyNet.NetworkRouter.OnProgressCallback? = nil) where T : Swift.Decodable, T : Swift.Encodable, M : SwiftyNet.NetworkRequest 17 | @objc deinit 18 | } 19 | public enum NetworkError : Swift.Error { 20 | case badJSON 21 | case noConnection 22 | case noData 23 | case notAuthenticated 24 | case forbidden 25 | case notFound 26 | case serverError 27 | case timeout 28 | case conflict 29 | case unknownError 30 | case parsingJSONError 31 | case errorMessage(text: Swift.String) 32 | } 33 | extension NetworkError : Foundation.LocalizedError { 34 | public var errorDescription: Swift.String? { 35 | get 36 | } 37 | } 38 | public enum MimeTypeSignatures { 39 | case jpeg 40 | case png 41 | case gif 42 | case pdf 43 | case tiff 44 | case video 45 | case vnd 46 | case text 47 | public static func == (a: SwiftyNet.MimeTypeSignatures, b: SwiftyNet.MimeTypeSignatures) -> Swift.Bool 48 | public var hashValue: Swift.Int { 49 | get 50 | } 51 | public func hash(into hasher: inout Swift.Hasher) 52 | } 53 | public struct MultipartData { 54 | } 55 | public protocol NetworkRequest : Alamofire.URLRequestConvertible { 56 | var path: Swift.String { get } 57 | var pathContainsHost: Swift.Bool { get } 58 | var baseUrl: Foundation.URL { get } 59 | var method: Alamofire.HTTPMethod { get } 60 | var parameters: Alamofire.Parameters? { get } 61 | var parameterEncoding: SwiftyNet.RequestParameterEncoding? { get } 62 | var headers: [Swift.String : Any]? { get } 63 | var dataType: SwiftyNet.DataType { get } 64 | var multiPart: [SwiftyNet.MultipartData]? { get } 65 | } 66 | extension NetworkRequest { 67 | public var pathContainsHost: Swift.Bool { 68 | get 69 | } 70 | public var headers: [Swift.String : Any]? { 71 | get 72 | } 73 | public var dataType: SwiftyNet.DataType { 74 | get 75 | } 76 | public var multiPart: [SwiftyNet.MultipartData]? { 77 | get 78 | } 79 | public func asURLRequest() throws -> Foundation.URLRequest 80 | } 81 | public enum RequestParameterEncoding : Swift.String { 82 | case queryString, httpBody, json 83 | public var encoding: Alamofire.ParameterEncoding { 84 | get 85 | } 86 | public typealias RawValue = Swift.String 87 | public init?(rawValue: Swift.String) 88 | public var rawValue: Swift.String { 89 | get 90 | } 91 | } 92 | public enum DataType { 93 | case JSON 94 | case data 95 | public static func == (a: SwiftyNet.DataType, b: SwiftyNet.DataType) -> Swift.Bool 96 | public var hashValue: Swift.Int { 97 | get 98 | } 99 | public func hash(into hasher: inout Swift.Hasher) 100 | } 101 | public typealias DataResponseType = Alamofire.AFDataResponse 102 | public enum NetworkResponse where T : Swift.Decodable, T : Swift.Encodable { 103 | case success(data: T) 104 | case failure(SwiftyNet.NetworkError) 105 | public init(_ dataResponse: SwiftyNet.DataResponseType) 106 | } 107 | extension SwiftyNet.MimeTypeSignatures : Swift.Equatable {} 108 | extension SwiftyNet.MimeTypeSignatures : Swift.Hashable {} 109 | extension SwiftyNet.RequestParameterEncoding : Swift.Equatable {} 110 | extension SwiftyNet.RequestParameterEncoding : Swift.Hashable {} 111 | extension SwiftyNet.RequestParameterEncoding : Swift.RawRepresentable {} 112 | extension SwiftyNet.DataType : Swift.Equatable {} 113 | extension SwiftyNet.DataType : Swift.Hashable {} 114 | -------------------------------------------------------------------------------- /SwiftyNet.xcframework/ios-arm64/SwiftyNet.framework/Modules/SwiftyNet.swiftmodule/arm64-apple-ios.swiftinterface: -------------------------------------------------------------------------------- 1 | // swift-interface-format-version: 1.0 2 | // swift-compiler-version: Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28) 3 | // swift-module-flags: -target arm64-apple-ios13.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name SwiftyNet 4 | import Alamofire 5 | import Foundation 6 | import Swift 7 | @_exported import SwiftyNet 8 | public protocol Excutable : AnyObject { 9 | typealias OnProgressCallback = (Swift.CFloat) -> () 10 | func request(targetRequest: M, responseObject: T.Type, complation: @escaping (SwiftyNet.NetworkResponse) -> ()) where T : Swift.Decodable, T : Swift.Encodable, M : SwiftyNet.NetworkRequest 11 | func requestMultipart(targetRequest: M, responseObject: T.Type, complation: @escaping (SwiftyNet.NetworkResponse) -> (), onProgress: Self.OnProgressCallback?) where T : Swift.Decodable, T : Swift.Encodable, M : SwiftyNet.NetworkRequest 12 | } 13 | final public class NetworkRouter : SwiftyNet.Excutable { 14 | public init() 15 | final public func request(targetRequest: M, responseObject: T.Type, complation _complation: @escaping (SwiftyNet.NetworkResponse) -> ()) where T : Swift.Decodable, T : Swift.Encodable, M : SwiftyNet.NetworkRequest 16 | final public func requestMultipart(targetRequest: M, responseObject: T.Type, complation _complation: @escaping (SwiftyNet.NetworkResponse) -> (), onProgress _onProgress: SwiftyNet.NetworkRouter.OnProgressCallback? = nil) where T : Swift.Decodable, T : Swift.Encodable, M : SwiftyNet.NetworkRequest 17 | @objc deinit 18 | } 19 | public enum NetworkError : Swift.Error { 20 | case badJSON 21 | case noConnection 22 | case noData 23 | case notAuthenticated 24 | case forbidden 25 | case notFound 26 | case serverError 27 | case timeout 28 | case conflict 29 | case unknownError 30 | case parsingJSONError 31 | case errorMessage(text: Swift.String) 32 | } 33 | extension NetworkError : Foundation.LocalizedError { 34 | public var errorDescription: Swift.String? { 35 | get 36 | } 37 | } 38 | public enum MimeTypeSignatures { 39 | case jpeg 40 | case png 41 | case gif 42 | case pdf 43 | case tiff 44 | case video 45 | case vnd 46 | case text 47 | public static func == (a: SwiftyNet.MimeTypeSignatures, b: SwiftyNet.MimeTypeSignatures) -> Swift.Bool 48 | public var hashValue: Swift.Int { 49 | get 50 | } 51 | public func hash(into hasher: inout Swift.Hasher) 52 | } 53 | public struct MultipartData { 54 | } 55 | public protocol NetworkRequest : Alamofire.URLRequestConvertible { 56 | var path: Swift.String { get } 57 | var pathContainsHost: Swift.Bool { get } 58 | var baseUrl: Foundation.URL { get } 59 | var method: Alamofire.HTTPMethod { get } 60 | var parameters: Alamofire.Parameters? { get } 61 | var parameterEncoding: SwiftyNet.RequestParameterEncoding? { get } 62 | var headers: [Swift.String : Any]? { get } 63 | var dataType: SwiftyNet.DataType { get } 64 | var multiPart: [SwiftyNet.MultipartData]? { get } 65 | } 66 | extension NetworkRequest { 67 | public var pathContainsHost: Swift.Bool { 68 | get 69 | } 70 | public var headers: [Swift.String : Any]? { 71 | get 72 | } 73 | public var dataType: SwiftyNet.DataType { 74 | get 75 | } 76 | public var multiPart: [SwiftyNet.MultipartData]? { 77 | get 78 | } 79 | public func asURLRequest() throws -> Foundation.URLRequest 80 | } 81 | public enum RequestParameterEncoding : Swift.String { 82 | case queryString, httpBody, json 83 | public var encoding: Alamofire.ParameterEncoding { 84 | get 85 | } 86 | public typealias RawValue = Swift.String 87 | public init?(rawValue: Swift.String) 88 | public var rawValue: Swift.String { 89 | get 90 | } 91 | } 92 | public enum DataType { 93 | case JSON 94 | case data 95 | public static func == (a: SwiftyNet.DataType, b: SwiftyNet.DataType) -> Swift.Bool 96 | public var hashValue: Swift.Int { 97 | get 98 | } 99 | public func hash(into hasher: inout Swift.Hasher) 100 | } 101 | public typealias DataResponseType = Alamofire.AFDataResponse 102 | public enum NetworkResponse where T : Swift.Decodable, T : Swift.Encodable { 103 | case success(data: T) 104 | case failure(SwiftyNet.NetworkError) 105 | public init(_ dataResponse: SwiftyNet.DataResponseType) 106 | } 107 | extension SwiftyNet.MimeTypeSignatures : Swift.Equatable {} 108 | extension SwiftyNet.MimeTypeSignatures : Swift.Hashable {} 109 | extension SwiftyNet.RequestParameterEncoding : Swift.Equatable {} 110 | extension SwiftyNet.RequestParameterEncoding : Swift.Hashable {} 111 | extension SwiftyNet.RequestParameterEncoding : Swift.RawRepresentable {} 112 | extension SwiftyNet.DataType : Swift.Equatable {} 113 | extension SwiftyNet.DataType : Swift.Hashable {} 114 | -------------------------------------------------------------------------------- /SwiftyNet.xcframework/ios-arm64_x86_64-simulator/SwiftyNet.framework/Modules/SwiftyNet.swiftmodule/arm64.swiftinterface: -------------------------------------------------------------------------------- 1 | // swift-interface-format-version: 1.0 2 | // swift-compiler-version: Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28) 3 | // swift-module-flags: -target arm64-apple-ios13.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name SwiftyNet 4 | import Alamofire 5 | import Foundation 6 | import Swift 7 | @_exported import SwiftyNet 8 | public protocol Excutable : AnyObject { 9 | typealias OnProgressCallback = (Swift.CFloat) -> () 10 | func request(targetRequest: M, responseObject: T.Type, complation: @escaping (SwiftyNet.NetworkResponse) -> ()) where T : Swift.Decodable, T : Swift.Encodable, M : SwiftyNet.NetworkRequest 11 | func requestMultipart(targetRequest: M, responseObject: T.Type, complation: @escaping (SwiftyNet.NetworkResponse) -> (), onProgress: Self.OnProgressCallback?) where T : Swift.Decodable, T : Swift.Encodable, M : SwiftyNet.NetworkRequest 12 | } 13 | final public class NetworkRouter : SwiftyNet.Excutable { 14 | public init() 15 | final public func request(targetRequest: M, responseObject: T.Type, complation _complation: @escaping (SwiftyNet.NetworkResponse) -> ()) where T : Swift.Decodable, T : Swift.Encodable, M : SwiftyNet.NetworkRequest 16 | final public func requestMultipart(targetRequest: M, responseObject: T.Type, complation _complation: @escaping (SwiftyNet.NetworkResponse) -> (), onProgress _onProgress: SwiftyNet.NetworkRouter.OnProgressCallback? = nil) where T : Swift.Decodable, T : Swift.Encodable, M : SwiftyNet.NetworkRequest 17 | @objc deinit 18 | } 19 | public enum NetworkError : Swift.Error { 20 | case badJSON 21 | case noConnection 22 | case noData 23 | case notAuthenticated 24 | case forbidden 25 | case notFound 26 | case serverError 27 | case timeout 28 | case conflict 29 | case unknownError 30 | case parsingJSONError 31 | case errorMessage(text: Swift.String) 32 | } 33 | extension NetworkError : Foundation.LocalizedError { 34 | public var errorDescription: Swift.String? { 35 | get 36 | } 37 | } 38 | public enum MimeTypeSignatures { 39 | case jpeg 40 | case png 41 | case gif 42 | case pdf 43 | case tiff 44 | case video 45 | case vnd 46 | case text 47 | public static func == (a: SwiftyNet.MimeTypeSignatures, b: SwiftyNet.MimeTypeSignatures) -> Swift.Bool 48 | public var hashValue: Swift.Int { 49 | get 50 | } 51 | public func hash(into hasher: inout Swift.Hasher) 52 | } 53 | public struct MultipartData { 54 | } 55 | public protocol NetworkRequest : Alamofire.URLRequestConvertible { 56 | var path: Swift.String { get } 57 | var pathContainsHost: Swift.Bool { get } 58 | var baseUrl: Foundation.URL { get } 59 | var method: Alamofire.HTTPMethod { get } 60 | var parameters: Alamofire.Parameters? { get } 61 | var parameterEncoding: SwiftyNet.RequestParameterEncoding? { get } 62 | var headers: [Swift.String : Any]? { get } 63 | var dataType: SwiftyNet.DataType { get } 64 | var multiPart: [SwiftyNet.MultipartData]? { get } 65 | } 66 | extension NetworkRequest { 67 | public var pathContainsHost: Swift.Bool { 68 | get 69 | } 70 | public var headers: [Swift.String : Any]? { 71 | get 72 | } 73 | public var dataType: SwiftyNet.DataType { 74 | get 75 | } 76 | public var multiPart: [SwiftyNet.MultipartData]? { 77 | get 78 | } 79 | public func asURLRequest() throws -> Foundation.URLRequest 80 | } 81 | public enum RequestParameterEncoding : Swift.String { 82 | case queryString, httpBody, json 83 | public var encoding: Alamofire.ParameterEncoding { 84 | get 85 | } 86 | public typealias RawValue = Swift.String 87 | public init?(rawValue: Swift.String) 88 | public var rawValue: Swift.String { 89 | get 90 | } 91 | } 92 | public enum DataType { 93 | case JSON 94 | case data 95 | public static func == (a: SwiftyNet.DataType, b: SwiftyNet.DataType) -> Swift.Bool 96 | public var hashValue: Swift.Int { 97 | get 98 | } 99 | public func hash(into hasher: inout Swift.Hasher) 100 | } 101 | public typealias DataResponseType = Alamofire.AFDataResponse 102 | public enum NetworkResponse where T : Swift.Decodable, T : Swift.Encodable { 103 | case success(data: T) 104 | case failure(SwiftyNet.NetworkError) 105 | public init(_ dataResponse: SwiftyNet.DataResponseType) 106 | } 107 | extension SwiftyNet.MimeTypeSignatures : Swift.Equatable {} 108 | extension SwiftyNet.MimeTypeSignatures : Swift.Hashable {} 109 | extension SwiftyNet.RequestParameterEncoding : Swift.Equatable {} 110 | extension SwiftyNet.RequestParameterEncoding : Swift.Hashable {} 111 | extension SwiftyNet.RequestParameterEncoding : Swift.RawRepresentable {} 112 | extension SwiftyNet.DataType : Swift.Equatable {} 113 | extension SwiftyNet.DataType : Swift.Hashable {} 114 | -------------------------------------------------------------------------------- /SwiftyNet.xcframework/ios-arm64_x86_64-simulator/SwiftyNet.framework/Modules/SwiftyNet.swiftmodule/x86_64.swiftinterface: -------------------------------------------------------------------------------- 1 | // swift-interface-format-version: 1.0 2 | // swift-compiler-version: Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28) 3 | // swift-module-flags: -target x86_64-apple-ios13.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name SwiftyNet 4 | import Alamofire 5 | import Foundation 6 | import Swift 7 | @_exported import SwiftyNet 8 | public protocol Excutable : AnyObject { 9 | typealias OnProgressCallback = (Swift.CFloat) -> () 10 | func request(targetRequest: M, responseObject: T.Type, complation: @escaping (SwiftyNet.NetworkResponse) -> ()) where T : Swift.Decodable, T : Swift.Encodable, M : SwiftyNet.NetworkRequest 11 | func requestMultipart(targetRequest: M, responseObject: T.Type, complation: @escaping (SwiftyNet.NetworkResponse) -> (), onProgress: Self.OnProgressCallback?) where T : Swift.Decodable, T : Swift.Encodable, M : SwiftyNet.NetworkRequest 12 | } 13 | final public class NetworkRouter : SwiftyNet.Excutable { 14 | public init() 15 | final public func request(targetRequest: M, responseObject: T.Type, complation _complation: @escaping (SwiftyNet.NetworkResponse) -> ()) where T : Swift.Decodable, T : Swift.Encodable, M : SwiftyNet.NetworkRequest 16 | final public func requestMultipart(targetRequest: M, responseObject: T.Type, complation _complation: @escaping (SwiftyNet.NetworkResponse) -> (), onProgress _onProgress: SwiftyNet.NetworkRouter.OnProgressCallback? = nil) where T : Swift.Decodable, T : Swift.Encodable, M : SwiftyNet.NetworkRequest 17 | @objc deinit 18 | } 19 | public enum NetworkError : Swift.Error { 20 | case badJSON 21 | case noConnection 22 | case noData 23 | case notAuthenticated 24 | case forbidden 25 | case notFound 26 | case serverError 27 | case timeout 28 | case conflict 29 | case unknownError 30 | case parsingJSONError 31 | case errorMessage(text: Swift.String) 32 | } 33 | extension NetworkError : Foundation.LocalizedError { 34 | public var errorDescription: Swift.String? { 35 | get 36 | } 37 | } 38 | public enum MimeTypeSignatures { 39 | case jpeg 40 | case png 41 | case gif 42 | case pdf 43 | case tiff 44 | case video 45 | case vnd 46 | case text 47 | public static func == (a: SwiftyNet.MimeTypeSignatures, b: SwiftyNet.MimeTypeSignatures) -> Swift.Bool 48 | public var hashValue: Swift.Int { 49 | get 50 | } 51 | public func hash(into hasher: inout Swift.Hasher) 52 | } 53 | public struct MultipartData { 54 | } 55 | public protocol NetworkRequest : Alamofire.URLRequestConvertible { 56 | var path: Swift.String { get } 57 | var pathContainsHost: Swift.Bool { get } 58 | var baseUrl: Foundation.URL { get } 59 | var method: Alamofire.HTTPMethod { get } 60 | var parameters: Alamofire.Parameters? { get } 61 | var parameterEncoding: SwiftyNet.RequestParameterEncoding? { get } 62 | var headers: [Swift.String : Any]? { get } 63 | var dataType: SwiftyNet.DataType { get } 64 | var multiPart: [SwiftyNet.MultipartData]? { get } 65 | } 66 | extension NetworkRequest { 67 | public var pathContainsHost: Swift.Bool { 68 | get 69 | } 70 | public var headers: [Swift.String : Any]? { 71 | get 72 | } 73 | public var dataType: SwiftyNet.DataType { 74 | get 75 | } 76 | public var multiPart: [SwiftyNet.MultipartData]? { 77 | get 78 | } 79 | public func asURLRequest() throws -> Foundation.URLRequest 80 | } 81 | public enum RequestParameterEncoding : Swift.String { 82 | case queryString, httpBody, json 83 | public var encoding: Alamofire.ParameterEncoding { 84 | get 85 | } 86 | public typealias RawValue = Swift.String 87 | public init?(rawValue: Swift.String) 88 | public var rawValue: Swift.String { 89 | get 90 | } 91 | } 92 | public enum DataType { 93 | case JSON 94 | case data 95 | public static func == (a: SwiftyNet.DataType, b: SwiftyNet.DataType) -> Swift.Bool 96 | public var hashValue: Swift.Int { 97 | get 98 | } 99 | public func hash(into hasher: inout Swift.Hasher) 100 | } 101 | public typealias DataResponseType = Alamofire.AFDataResponse 102 | public enum NetworkResponse where T : Swift.Decodable, T : Swift.Encodable { 103 | case success(data: T) 104 | case failure(SwiftyNet.NetworkError) 105 | public init(_ dataResponse: SwiftyNet.DataResponseType) 106 | } 107 | extension SwiftyNet.MimeTypeSignatures : Swift.Equatable {} 108 | extension SwiftyNet.MimeTypeSignatures : Swift.Hashable {} 109 | extension SwiftyNet.RequestParameterEncoding : Swift.Equatable {} 110 | extension SwiftyNet.RequestParameterEncoding : Swift.Hashable {} 111 | extension SwiftyNet.RequestParameterEncoding : Swift.RawRepresentable {} 112 | extension SwiftyNet.DataType : Swift.Equatable {} 113 | extension SwiftyNet.DataType : Swift.Hashable {} 114 | --------------------------------------------------------------------------------