diff --git a/Bon.xcodeproj/project.pbxproj b/Bon.xcodeproj/project.pbxproj index 99e957c..48c1eff 100644 --- a/Bon.xcodeproj/project.pbxproj +++ b/Bon.xcodeproj/project.pbxproj @@ -223,12 +223,12 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0730; - LastUpgradeCheck = 0800; + LastUpgradeCheck = 0910; ORGANIZATIONNAME = Chris; TargetAttributes = { 832444E01CDF17860031CFE0 = { CreatedOnToolsVersion = 7.3; - LastSwiftMigration = 0830; + LastSwiftMigration = 0910; }; }; }; @@ -331,14 +331,20 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -378,14 +384,20 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -423,7 +435,8 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.chriskuei.Bon; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -441,7 +454,8 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.chriskuei.Bon; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.0; }; name = Release; }; diff --git a/Bon.xcodeproj/xcuserdata/Chris.xcuserdatad/xcschemes/Bon.xcscheme b/Bon.xcodeproj/xcuserdata/Chris.xcuserdatad/xcschemes/Bon.xcscheme index f1066b4..ba61020 100644 --- a/Bon.xcodeproj/xcuserdata/Chris.xcuserdatad/xcschemes/Bon.xcscheme +++ b/Bon.xcodeproj/xcuserdata/Chris.xcuserdatad/xcschemes/Bon.xcscheme @@ -1,6 +1,6 @@ @@ -45,6 +46,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/Bon/BonButton.swift b/Bon/BonButton.swift index 4b2ebed..323e1bd 100644 --- a/Bon/BonButton.swift +++ b/Bon/BonButton.swift @@ -10,7 +10,7 @@ import Cocoa class BonButton: NSButton { - fileprivate let cursor = NSCursor.pointingHand() + fileprivate let cursor = NSCursor.pointingHand fileprivate var normalStateImage: NSImage? fileprivate var highlightedStateImage: NSImage? fileprivate var trackingArea: NSTrackingArea? @@ -41,8 +41,8 @@ class BonButton: NSButton { func setImages(_ normalImage: String, highlitedImage: String) { self.setButtonType(.momentaryChange) - normalStateImage = NSImage(named: normalImage) - highlightedStateImage = NSImage(named: highlitedImage) + normalStateImage = NSImage(named: NSImage.Name(rawValue: normalImage)) + highlightedStateImage = NSImage(named: NSImage.Name(rawValue: highlitedImage)) } func resetTrackingArea() { @@ -55,7 +55,7 @@ class BonButton: NSButton { fileprivate func createTrackingAreaIfNeeded() { if trackingArea == nil { - trackingArea = NSTrackingArea(rect: CGRect.zero, options: [.inVisibleRect, .mouseEnteredAndExited, .activeAlways], owner: self, userInfo: nil) + trackingArea = NSTrackingArea(rect: CGRect.zero, options: [NSTrackingArea.Options.inVisibleRect, NSTrackingArea.Options.mouseEnteredAndExited, NSTrackingArea.Options.activeAlways], owner: self, userInfo: nil) } } diff --git a/Bon/BonCell.swift b/Bon/BonCell.swift index 0e6761b..cdef269 100644 --- a/Bon/BonCell.swift +++ b/Bon/BonCell.swift @@ -19,7 +19,7 @@ class BonCell: NSTableCellView { fileprivate var item: BonItem? - fileprivate let cursor = NSCursor.pointingHand() + fileprivate let cursor = NSCursor.pointingHand fileprivate var trackingArea: NSTrackingArea? fileprivate var mouseInside = false { didSet { @@ -28,7 +28,7 @@ class BonCell: NSTableCellView { } class func view(_ tableView: NSTableView, owner: AnyObject?, subject: AnyObject?) -> NSView { - let view = tableView.make(withIdentifier: "BonCell", owner: owner) as! BonCell + let view = tableView.makeView(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "BonCell"), owner: owner) as! BonCell if let item = subject as? BonItem { view.setItem(item) @@ -91,7 +91,7 @@ class BonCell: NSTableCellView { fileprivate func createTrackingAreaIfNeeded() { if trackingArea == nil { - trackingArea = NSTrackingArea(rect: CGRect.zero, options: [NSTrackingAreaOptions.inVisibleRect, NSTrackingAreaOptions.mouseEnteredAndExited, NSTrackingAreaOptions.activeAlways], owner: self, userInfo: nil) + trackingArea = NSTrackingArea(rect: CGRect.zero, options: [NSTrackingArea.Options.inVisibleRect, NSTrackingArea.Options.mouseEnteredAndExited, NSTrackingArea.Options.activeAlways], owner: self, userInfo: nil) } } diff --git a/Bon/BonNetwork.swift b/Bon/BonNetwork.swift index 7405e95..f74a18a 100644 --- a/Bon/BonNetwork.swift +++ b/Bon/BonNetwork.swift @@ -45,7 +45,7 @@ class BonNetwork: NSObject { success(value) case .failure(let error): - fail(error: error) + fail(error) } } @@ -53,7 +53,7 @@ class BonNetwork: NSObject { } - static func logout() { + @objc static func logout() { let parameters = [ "action": "auto_logout" diff --git a/Bon/BonTextField.swift b/Bon/BonTextField.swift index e78192e..2767dd1 100644 --- a/Bon/BonTextField.swift +++ b/Bon/BonTextField.swift @@ -15,8 +15,8 @@ class BonTextField: NSTextField { extension BonTextField { override func performKeyEquivalent(with event: NSEvent) -> Bool { - if event.type == NSEventType.keyDown { - if (event.modifierFlags.rawValue & NSEventModifierFlags.deviceIndependentFlagsMask.rawValue) == NSEventModifierFlags.command.rawValue { + if event.type == NSEvent.EventType.keyDown { + if (event.modifierFlags.rawValue & NSEvent.ModifierFlags.deviceIndependentFlagsMask.rawValue) == NSEvent.ModifierFlags.command.rawValue { switch event.charactersIgnoringModifiers! { case "x": if NSApp.sendAction(#selector(NSText.cut(_:)), to:nil, from:self) { return true } @@ -32,7 +32,7 @@ extension BonTextField { break } } - else if (event.modifierFlags.rawValue & NSEventModifierFlags.deviceIndependentFlagsMask.rawValue) == NSEventModifierFlags.command.rawValue | NSEventModifierFlags.shift.rawValue { + else if (event.modifierFlags.rawValue & NSEvent.ModifierFlags.deviceIndependentFlagsMask.rawValue) == NSEvent.ModifierFlags.command.rawValue | NSEvent.ModifierFlags.shift.rawValue { if event.charactersIgnoringModifiers == "Z" { if NSApp.sendAction(Selector(("redo:")), to:nil, from:self) { return true } } diff --git a/Bon/BonViewController.swift b/Bon/BonViewController.swift index 4eb5d26..2ff4a3c 100644 --- a/Bon/BonViewController.swift +++ b/Bon/BonViewController.swift @@ -191,7 +191,7 @@ class BonViewController: NSViewController { // MARK : - get online info - func getOnlineInfo() { + @objc func getOnlineInfo() { let parameters = [ "action": "get_online_info" diff --git a/Bon/EventMonitor.swift b/Bon/EventMonitor.swift index 267107d..6e9ad7c 100644 --- a/Bon/EventMonitor.swift +++ b/Bon/EventMonitor.swift @@ -10,10 +10,10 @@ import Cocoa open class EventMonitor { fileprivate var monitor: AnyObject? - fileprivate let mask: NSEventMask + fileprivate let mask: NSEvent.EventTypeMask fileprivate let handler: (NSEvent?) -> () - public init(mask: NSEventMask, handler: @escaping (NSEvent?) -> ()) { + public init(mask: NSEvent.EventTypeMask, handler: @escaping (NSEvent?) -> ()) { self.mask = mask self.handler = handler } diff --git a/Bon/Info.plist b/Bon/Info.plist index 766e403..5aa3f95 100644 --- a/Bon/Info.plist +++ b/Bon/Info.plist @@ -17,11 +17,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.5.1 + 0.5.2 CFBundleSignature ???? CFBundleVersion - 170403 + 171115 LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) LSUIElement diff --git a/Bon/MainViewController.swift b/Bon/MainViewController.swift index 09a8e42..3f8c1b7 100644 --- a/Bon/MainViewController.swift +++ b/Bon/MainViewController.swift @@ -9,25 +9,25 @@ import Cocoa class MainViewController: NSViewController { - let statusItem = NSStatusBar.system().statusItem(withLength: -2) + let statusItem = NSStatusBar.system.statusItem(withLength: -2) let popover = NSPopover() var eventMonitor: EventMonitor? var refreshTimer: Timer? override func awakeFromNib() { if let button = statusItem.button { - let icon = NSImage(named: "icon_status") + let icon = NSImage(named: NSImage.Name(rawValue: "icon_status")) icon?.isTemplate = false button.image = icon button.action = #selector(self.togglePopover(_:)) } popover.behavior = .transient - popover.contentViewController = BonViewController(nibName: "BonViewController", bundle: nil) - popover.appearance = NSAppearance(named: NSAppearanceNameAqua) + popover.contentViewController = BonViewController(nibName: NSNib.Name(rawValue: "BonViewController"), bundle: nil) + popover.appearance = NSAppearance(named: NSAppearance.Name.aqua) popover.behavior = .transient - eventMonitor = EventMonitor(mask: [.leftMouseDown, .rightMouseDown]) { [unowned self] event in + eventMonitor = EventMonitor(mask: [NSEvent.EventTypeMask.leftMouseDown, NSEvent.EventTypeMask.rightMouseDown]) { [unowned self] event in if self.popover.isShown { self.closePopover(event) } @@ -48,7 +48,7 @@ class MainViewController: NSViewController { } - func togglePopover(_ sender: AnyObject?) { + @objc func togglePopover(_ sender: AnyObject?) { if popover.isShown { closePopover(sender) } else { @@ -69,20 +69,20 @@ class MainViewController: NSViewController { eventMonitor?.stop() } - func openGithub() { + @objc func openGithub() { let path = "https://github.com/Chriskuei" let url = URL(string: path)! - NSWorkspace.shared().open(url) + NSWorkspace.shared.open(url) } - func openWeibo() { + @objc func openWeibo() { let path = "https://weibo.com/chenjiangui" let url = URL(string: path)! - NSWorkspace.shared().open(url) + NSWorkspace.shared.open(url) } - func quit() { - NSApplication.shared().terminate(self) + @objc func quit() { + NSApplication.shared.terminate(self) } } diff --git a/Bon/SettingsMenuAction.swift b/Bon/SettingsMenuAction.swift index f136d5e..39042fa 100644 --- a/Bon/SettingsMenuAction.swift +++ b/Bon/SettingsMenuAction.swift @@ -12,7 +12,7 @@ import Foundation class SettingsMenuAction { class func makeSettingsMenu(_ sender: NSView) { - let delegate = NSApplication.shared().delegate as! MainViewController + let delegate = NSApplication.shared.delegate as! MainViewController let menu = NSMenu() diff --git a/Cartfile b/Cartfile index 57e7f10..2baf0ab 100644 --- a/Cartfile +++ b/Cartfile @@ -1 +1 @@ -github "Alamofire/Alamofire" ~> 4.4 +github "Alamofire/Alamofire" ~> 4.5 diff --git a/Cartfile.resolved b/Cartfile.resolved index 97c5688..a8c2ced 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1 +1 @@ -github "Alamofire/Alamofire" "4.4.0" +github "Alamofire/Alamofire" "4.5.1" diff --git a/Carthage/Build/Mac/Alamofire.framework.dSYM/Contents/Info.plist b/Carthage/Build/Mac/Alamofire.framework.dSYM/Contents/Info.plist index d9e4b98..7a61759 100644 --- a/Carthage/Build/Mac/Alamofire.framework.dSYM/Contents/Info.plist +++ b/Carthage/Build/Mac/Alamofire.framework.dSYM/Contents/Info.plist @@ -13,7 +13,7 @@ CFBundleSignature ???? CFBundleShortVersionString - 4.4.0 + 4.5.1 CFBundleVersion 1 diff --git a/Carthage/Build/Mac/Alamofire.framework.dSYM/Contents/Resources/DWARF/Alamofire b/Carthage/Build/Mac/Alamofire.framework.dSYM/Contents/Resources/DWARF/Alamofire index 3ef5d04..0955976 100644 Binary files a/Carthage/Build/Mac/Alamofire.framework.dSYM/Contents/Resources/DWARF/Alamofire and b/Carthage/Build/Mac/Alamofire.framework.dSYM/Contents/Resources/DWARF/Alamofire differ diff --git a/Carthage/Build/Mac/Alamofire.framework/Versions/A/Alamofire b/Carthage/Build/Mac/Alamofire.framework/Versions/A/Alamofire index d938dec..4e095a8 100755 Binary files a/Carthage/Build/Mac/Alamofire.framework/Versions/A/Alamofire and b/Carthage/Build/Mac/Alamofire.framework/Versions/A/Alamofire differ diff --git a/Carthage/Build/Mac/Alamofire.framework/Versions/A/Headers/Alamofire-Swift.h b/Carthage/Build/Mac/Alamofire.framework/Versions/A/Headers/Alamofire-Swift.h index bf8689f..e4ea7fd 100644 --- a/Carthage/Build/Mac/Alamofire.framework/Versions/A/Headers/Alamofire-Swift.h +++ b/Carthage/Build/Mac/Alamofire.framework/Versions/A/Headers/Alamofire-Swift.h @@ -1,7 +1,30 @@ -// Generated by Apple Swift version 3.1 (swiftlang-802.0.48 clang-802.0.38) +// Generated by Apple Swift version 4.0.2 effective-3.2.2 (swiftlang-900.0.69.2 clang-900.0.38) #pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgcc-compat" -#if defined(__has_include) && __has_include() +#if !defined(__has_include) +# define __has_include(x) 0 +#endif +#if !defined(__has_attribute) +# define __has_attribute(x) 0 +#endif +#if !defined(__has_feature) +# define __has_feature(x) 0 +#endif +#if !defined(__has_warning) +# define __has_warning(x) 0 +#endif + +#if __has_attribute(external_source_symbol) +# define SWIFT_STRINGIFY(str) #str +# define SWIFT_MODULE_NAMESPACE_PUSH(module_name) _Pragma(SWIFT_STRINGIFY(clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in=module_name, generated_declaration))), apply_to=any(function, enum, objc_interface, objc_category, objc_protocol)))) +# define SWIFT_MODULE_NAMESPACE_POP _Pragma("clang attribute pop") +#else +# define SWIFT_MODULE_NAMESPACE_PUSH(module_name) +# define SWIFT_MODULE_NAMESPACE_POP +#endif + +#if __has_include() # include #endif @@ -13,7 +36,7 @@ #if !defined(SWIFT_TYPEDEFS) # define SWIFT_TYPEDEFS 1 -# if defined(__has_include) && __has_include() +# if __has_include() # include # elif !defined(__cplusplus) || __cplusplus < 201103L typedef uint_least16_t char16_t; @@ -48,31 +71,36 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); # endif #endif -#if defined(__has_attribute) && __has_attribute(objc_runtime_name) +#if __has_attribute(objc_runtime_name) # define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) #else # define SWIFT_RUNTIME_NAME(X) #endif -#if defined(__has_attribute) && __has_attribute(swift_name) +#if __has_attribute(swift_name) # define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) #else # define SWIFT_COMPILE_NAME(X) #endif -#if defined(__has_attribute) && __has_attribute(objc_method_family) +#if __has_attribute(objc_method_family) # define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) #else # define SWIFT_METHOD_FAMILY(X) #endif -#if defined(__has_attribute) && __has_attribute(noescape) +#if __has_attribute(noescape) # define SWIFT_NOESCAPE __attribute__((noescape)) #else # define SWIFT_NOESCAPE #endif -#if defined(__has_attribute) && __has_attribute(warn_unused_result) +#if __has_attribute(warn_unused_result) # define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #else # define SWIFT_WARN_UNUSED_RESULT #endif +#if __has_attribute(noreturn) +# define SWIFT_NORETURN __attribute__((noreturn)) +#else +# define SWIFT_NORETURN +#endif #if !defined(SWIFT_CLASS_EXTRA) # define SWIFT_CLASS_EXTRA #endif @@ -83,7 +111,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); # define SWIFT_ENUM_EXTRA #endif #if !defined(SWIFT_CLASS) -# if defined(__has_attribute) && __has_attribute(objc_subclassing_restricted) +# if __has_attribute(objc_subclassing_restricted) # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA # define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA # else @@ -102,16 +130,23 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #endif #if !defined(OBJC_DESIGNATED_INITIALIZER) -# if defined(__has_attribute) && __has_attribute(objc_designated_initializer) +# if __has_attribute(objc_designated_initializer) # define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) # else # define OBJC_DESIGNATED_INITIALIZER # endif #endif +#if !defined(SWIFT_ENUM_ATTR) +# if defined(__has_attribute) && __has_attribute(enum_extensibility) +# define SWIFT_ENUM_ATTR __attribute__((enum_extensibility(open))) +# else +# define SWIFT_ENUM_ATTR +# endif +#endif #if !defined(SWIFT_ENUM) -# define SWIFT_ENUM(_type, _name) enum _name : _type _name; enum SWIFT_ENUM_EXTRA _name : _type -# if defined(__has_feature) && __has_feature(generalized_swift_name) -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_EXTRA _name : _type +# define SWIFT_ENUM(_type, _name) enum _name : _type _name; enum SWIFT_ENUM_ATTR SWIFT_ENUM_EXTRA _name : _type +# if __has_feature(generalized_swift_name) +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR SWIFT_ENUM_EXTRA _name : _type # else # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) SWIFT_ENUM(_type, _name) # endif @@ -131,39 +166,36 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #if !defined(SWIFT_DEPRECATED_MSG) # define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) #endif -#if defined(__has_feature) && __has_feature(modules) +#if __has_feature(attribute_diagnose_if_objc) +# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) +#else +# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +#endif +#if __has_feature(modules) @import Foundation; @import ObjectiveC; #endif #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" #pragma clang diagnostic ignored "-Wduplicate-method-arg" -@class NSOperationQueue; -@class NSURLSessionTask; -@class NSURLCredential; +#if __has_warning("-Wpragma-clang-attribute") +# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#endif +#pragma clang diagnostic ignored "-Wunknown-pragmas" +#pragma clang diagnostic ignored "-Wnullability" + +SWIFT_MODULE_NAMESPACE_PUSH("Alamofire") @class NSURLSession; +@class NSURLSessionTask; @class NSHTTPURLResponse; -@class NSInputStream; @class NSURLAuthenticationChallenge; +@class NSURLCredential; +@class NSInputStream; /// The task delegate is responsible for handling all delegate callbacks for the underlying task as well as /// executing all operations attached to the serial operation queue upon task completion. SWIFT_CLASS("_TtC9Alamofire12TaskDelegate") @interface TaskDelegate : NSObject -/// The serial operation queue used to execute all operations after the task completes. -@property (nonatomic, readonly, strong) NSOperationQueue * _Nonnull queue; -/// The data returned by the server. -@property (nonatomic, readonly, copy) NSData * _Nullable data; -/// The error generated throughout the lifecyle of the task. -@property (nonatomic) NSError * _Nullable error; -@property (nonatomic, strong) NSURLSessionTask * _Nullable task; -@property (nonatomic, strong) NSURLCredential * _Nullable credential; -@property (nonatomic, strong) id _Nullable metrics; -- (nonnull instancetype)initWithTask:(NSURLSessionTask * _Nullable)task OBJC_DESIGNATED_INITIALIZER; -- (void)reset; -@property (nonatomic, copy) NSURLRequest * _Nullable (^ _Nullable taskWillPerformHTTPRedirection)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull, NSHTTPURLResponse * _Nonnull, NSURLRequest * _Nonnull); -@property (nonatomic, copy) NSInputStream * _Nullable (^ _Nullable taskNeedNewBodyStream)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull); -@property (nonatomic, copy) void (^ _Nullable taskDidCompleteWithError)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull, NSError * _Nullable); - (void)URLSession:(NSURLSession * _Nonnull)session task:(NSURLSessionTask * _Nonnull)task willPerformHTTPRedirection:(NSHTTPURLResponse * _Nonnull)response newRequest:(NSURLRequest * _Nonnull)request completionHandler:(void (^ _Nonnull)(NSURLRequest * _Nullable))completionHandler; - (void)URLSession:(NSURLSession * _Nonnull)session task:(NSURLSessionTask * _Nonnull)task didReceiveChallenge:(NSURLAuthenticationChallenge * _Nonnull)challenge completionHandler:(void (^ _Nonnull)(NSURLSessionAuthChallengeDisposition, NSURLCredential * _Nullable))completionHandler; - (void)URLSession:(NSURLSession * _Nonnull)session task:(NSURLSessionTask * _Nonnull)task needNewBodyStream:(void (^ _Nonnull)(NSInputStream * _Nullable))completionHandler; @@ -172,23 +204,12 @@ SWIFT_CLASS("_TtC9Alamofire12TaskDelegate") @end @class NSURLSessionDataTask; -@class NSProgress; @class NSURLResponse; @class NSURLSessionDownloadTask; @class NSCachedURLResponse; SWIFT_CLASS("_TtC9Alamofire16DataTaskDelegate") @interface DataTaskDelegate : TaskDelegate -@property (nonatomic, readonly, strong) NSURLSessionDataTask * _Nonnull dataTask; -@property (nonatomic, readonly, copy) NSData * _Nullable data; -@property (nonatomic, strong) NSProgress * _Nonnull progress; -@property (nonatomic, copy) void (^ _Nullable dataStream)(NSData * _Nonnull); -- (nonnull instancetype)initWithTask:(NSURLSessionTask * _Nullable)task OBJC_DESIGNATED_INITIALIZER; -- (void)reset; -@property (nonatomic, copy) NSURLSessionResponseDisposition (^ _Nullable dataTaskDidReceiveResponse)(NSURLSession * _Nonnull, NSURLSessionDataTask * _Nonnull, NSURLResponse * _Nonnull); -@property (nonatomic, copy) void (^ _Nullable dataTaskDidBecomeDownloadTask)(NSURLSession * _Nonnull, NSURLSessionDataTask * _Nonnull, NSURLSessionDownloadTask * _Nonnull); -@property (nonatomic, copy) void (^ _Nullable dataTaskDidReceiveData)(NSURLSession * _Nonnull, NSURLSessionDataTask * _Nonnull, NSData * _Nonnull); -@property (nonatomic, copy) NSCachedURLResponse * _Nullable (^ _Nullable dataTaskWillCacheResponse)(NSURLSession * _Nonnull, NSURLSessionDataTask * _Nonnull, NSCachedURLResponse * _Nonnull); - (void)URLSession:(NSURLSession * _Nonnull)session dataTask:(NSURLSessionDataTask * _Nonnull)dataTask didReceiveResponse:(NSURLResponse * _Nonnull)response completionHandler:(void (^ _Nonnull)(NSURLSessionResponseDisposition))completionHandler; - (void)URLSession:(NSURLSession * _Nonnull)session dataTask:(NSURLSessionDataTask * _Nonnull)dataTask didBecomeDownloadTask:(NSURLSessionDownloadTask * _Nonnull)downloadTask; - (void)URLSession:(NSURLSession * _Nonnull)session dataTask:(NSURLSessionDataTask * _Nonnull)dataTask didReceiveData:(NSData * _Nonnull)data; @@ -198,88 +219,17 @@ SWIFT_CLASS("_TtC9Alamofire16DataTaskDelegate") SWIFT_CLASS("_TtC9Alamofire20DownloadTaskDelegate") @interface DownloadTaskDelegate : TaskDelegate -@property (nonatomic, readonly, strong) NSURLSessionDownloadTask * _Nonnull downloadTask; -@property (nonatomic, strong) NSProgress * _Nonnull progress; -@property (nonatomic, copy) NSData * _Nullable resumeData; -@property (nonatomic, readonly, copy) NSData * _Nullable data; -@property (nonatomic, copy) NSURL * _Nullable temporaryURL; -@property (nonatomic, copy) NSURL * _Nullable destinationURL; -@property (nonatomic, readonly, copy) NSURL * _Nullable fileURL; -- (nonnull instancetype)initWithTask:(NSURLSessionTask * _Nullable)task OBJC_DESIGNATED_INITIALIZER; -- (void)reset; -@property (nonatomic, copy) NSURL * _Nonnull (^ _Nullable downloadTaskDidFinishDownloadingToURL)(NSURLSession * _Nonnull, NSURLSessionDownloadTask * _Nonnull, NSURL * _Nonnull); -@property (nonatomic, copy) void (^ _Nullable downloadTaskDidWriteData)(NSURLSession * _Nonnull, NSURLSessionDownloadTask * _Nonnull, int64_t, int64_t, int64_t); -@property (nonatomic, copy) void (^ _Nullable downloadTaskDidResumeAtOffset)(NSURLSession * _Nonnull, NSURLSessionDownloadTask * _Nonnull, int64_t, int64_t); - (void)URLSession:(NSURLSession * _Nonnull)session downloadTask:(NSURLSessionDownloadTask * _Nonnull)downloadTask didFinishDownloadingToURL:(NSURL * _Nonnull)location; - (void)URLSession:(NSURLSession * _Nonnull)session downloadTask:(NSURLSessionDownloadTask * _Nonnull)downloadTask didWriteData:(int64_t)bytesWritten totalBytesWritten:(int64_t)totalBytesWritten totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite; - (void)URLSession:(NSURLSession * _Nonnull)session downloadTask:(NSURLSessionDownloadTask * _Nonnull)downloadTask didResumeAtOffset:(int64_t)fileOffset expectedTotalBytes:(int64_t)expectedTotalBytes; @end -@interface NSNumber (SWIFT_EXTENSION(Alamofire)) -@end -@class NSURLSessionStreamTask; -@class NSOutputStream; /// Responsible for handling all delegate callbacks for the underlying session. SWIFT_CLASS("_TtC9Alamofire15SessionDelegate") @interface SessionDelegate : NSObject -/// Overrides default behavior for URLSessionDelegate method urlSession(_:didBecomeInvalidWithError:). -@property (nonatomic, copy) void (^ _Nullable sessionDidBecomeInvalidWithError)(NSURLSession * _Nonnull, NSError * _Nullable); -/// Overrides all behavior for URLSessionDelegate method urlSession(_:didReceive:completionHandler:) and requires the caller to call the completionHandler. -@property (nonatomic, copy) void (^ _Nullable sessionDidReceiveChallengeWithCompletion)(NSURLSession * _Nonnull, NSURLAuthenticationChallenge * _Nonnull, SWIFT_NOESCAPE void (^ _Nonnull)(NSURLSessionAuthChallengeDisposition, NSURLCredential * _Nullable)); -/// Overrides default behavior for URLSessionDelegate method urlSessionDidFinishEvents(forBackgroundURLSession:). -@property (nonatomic, copy) void (^ _Nullable sessionDidFinishEventsForBackgroundURLSession)(NSURLSession * _Nonnull); -/// Overrides default behavior for URLSessionTaskDelegate method urlSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:). -@property (nonatomic, copy) NSURLRequest * _Nullable (^ _Nullable taskWillPerformHTTPRedirection)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull, NSHTTPURLResponse * _Nonnull, NSURLRequest * _Nonnull); -/// Overrides all behavior for URLSessionTaskDelegate method urlSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:) and -/// requires the caller to call the completionHandler. -@property (nonatomic, copy) void (^ _Nullable taskWillPerformHTTPRedirectionWithCompletion)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull, NSHTTPURLResponse * _Nonnull, NSURLRequest * _Nonnull, SWIFT_NOESCAPE void (^ _Nonnull)(NSURLRequest * _Nullable)); -/// Overrides all behavior for URLSessionTaskDelegate method urlSession(_:task:didReceive:completionHandler:) and -/// requires the caller to call the completionHandler. -@property (nonatomic, copy) void (^ _Nullable taskDidReceiveChallengeWithCompletion)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull, NSURLAuthenticationChallenge * _Nonnull, SWIFT_NOESCAPE void (^ _Nonnull)(NSURLSessionAuthChallengeDisposition, NSURLCredential * _Nullable)); -/// Overrides default behavior for URLSessionTaskDelegate method urlSession(_:task:needNewBodyStream:). -@property (nonatomic, copy) NSInputStream * _Nullable (^ _Nullable taskNeedNewBodyStream)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull); -/// Overrides all behavior for URLSessionTaskDelegate method urlSession(_:task:needNewBodyStream:) and -/// requires the caller to call the completionHandler. -@property (nonatomic, copy) void (^ _Nullable taskNeedNewBodyStreamWithCompletion)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull, SWIFT_NOESCAPE void (^ _Nonnull)(NSInputStream * _Nullable)); -/// Overrides default behavior for URLSessionTaskDelegate method urlSession(_:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:). -@property (nonatomic, copy) void (^ _Nullable taskDidSendBodyData)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull, int64_t, int64_t, int64_t); -/// Overrides default behavior for URLSessionTaskDelegate method urlSession(_:task:didCompleteWithError:). -@property (nonatomic, copy) void (^ _Nullable taskDidComplete)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull, NSError * _Nullable); -/// Overrides default behavior for URLSessionDataDelegate method urlSession(_:dataTask:didReceive:completionHandler:). -@property (nonatomic, copy) NSURLSessionResponseDisposition (^ _Nullable dataTaskDidReceiveResponse)(NSURLSession * _Nonnull, NSURLSessionDataTask * _Nonnull, NSURLResponse * _Nonnull); -/// Overrides all behavior for URLSessionDataDelegate method urlSession(_:dataTask:didReceive:completionHandler:) and -/// requires caller to call the completionHandler. -@property (nonatomic, copy) void (^ _Nullable dataTaskDidReceiveResponseWithCompletion)(NSURLSession * _Nonnull, NSURLSessionDataTask * _Nonnull, NSURLResponse * _Nonnull, SWIFT_NOESCAPE void (^ _Nonnull)(NSURLSessionResponseDisposition)); -/// Overrides default behavior for URLSessionDataDelegate method urlSession(_:dataTask:didBecome:). -@property (nonatomic, copy) void (^ _Nullable dataTaskDidBecomeDownloadTask)(NSURLSession * _Nonnull, NSURLSessionDataTask * _Nonnull, NSURLSessionDownloadTask * _Nonnull); -/// Overrides default behavior for URLSessionDataDelegate method urlSession(_:dataTask:didReceive:). -@property (nonatomic, copy) void (^ _Nullable dataTaskDidReceiveData)(NSURLSession * _Nonnull, NSURLSessionDataTask * _Nonnull, NSData * _Nonnull); -/// Overrides default behavior for URLSessionDataDelegate method urlSession(_:dataTask:willCacheResponse:completionHandler:). -@property (nonatomic, copy) NSCachedURLResponse * _Nullable (^ _Nullable dataTaskWillCacheResponse)(NSURLSession * _Nonnull, NSURLSessionDataTask * _Nonnull, NSCachedURLResponse * _Nonnull); -/// Overrides all behavior for URLSessionDataDelegate method urlSession(_:dataTask:willCacheResponse:completionHandler:) and -/// requires caller to call the completionHandler. -@property (nonatomic, copy) void (^ _Nullable dataTaskWillCacheResponseWithCompletion)(NSURLSession * _Nonnull, NSURLSessionDataTask * _Nonnull, NSCachedURLResponse * _Nonnull, SWIFT_NOESCAPE void (^ _Nonnull)(NSCachedURLResponse * _Nullable)); -/// Overrides default behavior for URLSessionDownloadDelegate method urlSession(_:downloadTask:didFinishDownloadingTo:). -@property (nonatomic, copy) void (^ _Nullable downloadTaskDidFinishDownloadingToURL)(NSURLSession * _Nonnull, NSURLSessionDownloadTask * _Nonnull, NSURL * _Nonnull); -/// Overrides default behavior for URLSessionDownloadDelegate method urlSession(_:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:). -@property (nonatomic, copy) void (^ _Nullable downloadTaskDidWriteData)(NSURLSession * _Nonnull, NSURLSessionDownloadTask * _Nonnull, int64_t, int64_t, int64_t); -/// Overrides default behavior for URLSessionDownloadDelegate method urlSession(_:downloadTask:didResumeAtOffset:expectedTotalBytes:). -@property (nonatomic, copy) void (^ _Nullable downloadTaskDidResumeAtOffset)(NSURLSession * _Nonnull, NSURLSessionDownloadTask * _Nonnull, int64_t, int64_t); -/// Overrides default behavior for URLSessionStreamDelegate method urlSession(_:readClosedFor:). -@property (nonatomic, copy) void (^ _Nullable streamTaskReadClosed)(NSURLSession * _Nonnull, NSURLSessionStreamTask * _Nonnull); -/// Overrides default behavior for URLSessionStreamDelegate method urlSession(_:writeClosedFor:). -@property (nonatomic, copy) void (^ _Nullable streamTaskWriteClosed)(NSURLSession * _Nonnull, NSURLSessionStreamTask * _Nonnull); -/// Overrides default behavior for URLSessionStreamDelegate method urlSession(_:betterRouteDiscoveredFor:). -@property (nonatomic, copy) void (^ _Nullable streamTaskBetterRouteDiscovered)(NSURLSession * _Nonnull, NSURLSessionStreamTask * _Nonnull); -/// Overrides default behavior for URLSessionStreamDelegate method urlSession(_:streamTask:didBecome:outputStream:). -@property (nonatomic, copy) void (^ _Nullable streamTaskDidBecomeInputAndOutputStreams)(NSURLSession * _Nonnull, NSURLSessionStreamTask * _Nonnull, NSInputStream * _Nonnull, NSOutputStream * _Nonnull); -@property (nonatomic) id _Nullable _streamTaskReadClosed; -@property (nonatomic) id _Nullable _streamTaskWriteClosed; -@property (nonatomic) id _Nullable _streamTaskBetterRouteDiscovered; -@property (nonatomic) id _Nullable _streamTaskDidBecomeInputStream; /// Initializes the SessionDelegate instance. /// /// returns: @@ -358,7 +308,10 @@ SWIFT_CLASS("_TtC9Alamofire15SessionDelegate") - (void)URLSession:(NSURLSession * _Nonnull)session downloadTask:(NSURLSessionDownloadTask * _Nonnull)downloadTask didResumeAtOffset:(int64_t)fileOffset expectedTotalBytes:(int64_t)expectedTotalBytes; @end +@class NSURLSessionStreamTask; +@class NSOutputStream; +SWIFT_AVAILABILITY(tvos,introduced=9.0) SWIFT_AVAILABILITY(macos,introduced=10.11) SWIFT_AVAILABILITY(ios,introduced=9.0) @interface SessionDelegate (SWIFT_EXTENSION(Alamofire)) /// Tells the delegate that the read side of the connection has been closed. /// \param session The session. @@ -505,19 +458,11 @@ SWIFT_CLASS("_TtC9Alamofire15SessionDelegate") -@interface NSURLSession (SWIFT_EXTENSION(Alamofire)) -@end -@class NSURLSessionUploadTask; SWIFT_CLASS("_TtC9Alamofire18UploadTaskDelegate") @interface UploadTaskDelegate : DataTaskDelegate -@property (nonatomic, readonly, strong) NSURLSessionUploadTask * _Nonnull uploadTask; -@property (nonatomic, strong) NSProgress * _Nonnull uploadProgress; -- (nonnull instancetype)initWithTask:(NSURLSessionTask * _Nullable)task OBJC_DESIGNATED_INITIALIZER; -- (void)reset; -@property (nonatomic, copy) void (^ _Nullable taskDidSendBodyData)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull, int64_t, int64_t, int64_t); -- (void)URLSession:(NSURLSession * _Nonnull)session task:(NSURLSessionTask * _Nonnull)task didSendBodyData:(int64_t)bytesSent totalBytesSent:(int64_t)totalBytesSent totalBytesExpectedToSend:(int64_t)totalBytesExpectedToSend; @end +SWIFT_MODULE_NAMESPACE_POP #pragma clang diagnostic pop diff --git a/Carthage/Build/Mac/Alamofire.framework/Versions/A/Headers/Alamofire.h b/Carthage/Build/Mac/Alamofire.framework/Versions/A/Headers/Alamofire.h index 8d45b77..4e651df 100644 --- a/Carthage/Build/Mac/Alamofire.framework/Versions/A/Headers/Alamofire.h +++ b/Carthage/Build/Mac/Alamofire.framework/Versions/A/Headers/Alamofire.h @@ -1,7 +1,7 @@ // // Alamofire.h // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Carthage/Build/Mac/Alamofire.framework/Versions/A/Modules/Alamofire.swiftmodule/x86_64.swiftdoc b/Carthage/Build/Mac/Alamofire.framework/Versions/A/Modules/Alamofire.swiftmodule/x86_64.swiftdoc index 87d4106..6be3fa8 100644 Binary files a/Carthage/Build/Mac/Alamofire.framework/Versions/A/Modules/Alamofire.swiftmodule/x86_64.swiftdoc and b/Carthage/Build/Mac/Alamofire.framework/Versions/A/Modules/Alamofire.swiftmodule/x86_64.swiftdoc differ diff --git a/Carthage/Build/Mac/Alamofire.framework/Versions/A/Modules/Alamofire.swiftmodule/x86_64.swiftmodule b/Carthage/Build/Mac/Alamofire.framework/Versions/A/Modules/Alamofire.swiftmodule/x86_64.swiftmodule index 0b77634..7673fcb 100644 Binary files a/Carthage/Build/Mac/Alamofire.framework/Versions/A/Modules/Alamofire.swiftmodule/x86_64.swiftmodule and b/Carthage/Build/Mac/Alamofire.framework/Versions/A/Modules/Alamofire.swiftmodule/x86_64.swiftmodule differ diff --git a/Carthage/Build/Mac/Alamofire.framework/Versions/A/Modules/module.modulemap b/Carthage/Build/Mac/Alamofire.framework/Versions/A/Modules/module.modulemap index 8096dcc..6148f67 100644 --- a/Carthage/Build/Mac/Alamofire.framework/Versions/A/Modules/module.modulemap +++ b/Carthage/Build/Mac/Alamofire.framework/Versions/A/Modules/module.modulemap @@ -7,4 +7,5 @@ framework module Alamofire { module Alamofire.Swift { header "Alamofire-Swift.h" + requires objc } diff --git a/Carthage/Build/Mac/Alamofire.framework/Versions/A/Resources/Info.plist b/Carthage/Build/Mac/Alamofire.framework/Versions/A/Resources/Info.plist index f6826a8..576c447 100644 --- a/Carthage/Build/Mac/Alamofire.framework/Versions/A/Resources/Info.plist +++ b/Carthage/Build/Mac/Alamofire.framework/Versions/A/Resources/Info.plist @@ -3,7 +3,7 @@ BuildMachineOSBuild - 16E195 + 17B48 CFBundleDevelopmentRegion en CFBundleExecutable @@ -17,7 +17,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 4.4.0 + 4.5.1 CFBundleSignature ???? CFBundleSupportedPlatforms @@ -29,17 +29,17 @@ DTCompiler com.apple.compilers.llvm.clang.1_0 DTPlatformBuild - 8E162 + 9B55 DTPlatformVersion GM DTSDKBuild - 16E185 + 17B41 DTSDKName - macosx10.12 + macosx10.13 DTXcode - 0830 + 0910 DTXcodeBuild - 8E162 + 9B55 UIDeviceFamily 1 diff --git a/Carthage/Build/iOS/Alamofire.framework.dSYM/Contents/Info.plist b/Carthage/Build/iOS/Alamofire.framework.dSYM/Contents/Info.plist index d9e4b98..7a61759 100644 --- a/Carthage/Build/iOS/Alamofire.framework.dSYM/Contents/Info.plist +++ b/Carthage/Build/iOS/Alamofire.framework.dSYM/Contents/Info.plist @@ -13,7 +13,7 @@ CFBundleSignature ???? CFBundleShortVersionString - 4.4.0 + 4.5.1 CFBundleVersion 1 diff --git a/Carthage/Build/iOS/Alamofire.framework.dSYM/Contents/Resources/DWARF/Alamofire b/Carthage/Build/iOS/Alamofire.framework.dSYM/Contents/Resources/DWARF/Alamofire index ed9be52..b1d7a7f 100644 Binary files a/Carthage/Build/iOS/Alamofire.framework.dSYM/Contents/Resources/DWARF/Alamofire and b/Carthage/Build/iOS/Alamofire.framework.dSYM/Contents/Resources/DWARF/Alamofire differ diff --git a/Carthage/Build/iOS/Alamofire.framework/Alamofire b/Carthage/Build/iOS/Alamofire.framework/Alamofire index 2ab1e20..d41b79f 100755 Binary files a/Carthage/Build/iOS/Alamofire.framework/Alamofire and b/Carthage/Build/iOS/Alamofire.framework/Alamofire differ diff --git a/Carthage/Build/iOS/Alamofire.framework/Headers/Alamofire-Swift.h b/Carthage/Build/iOS/Alamofire.framework/Headers/Alamofire-Swift.h index 3c1ed25..034ddaa 100644 --- a/Carthage/Build/iOS/Alamofire.framework/Headers/Alamofire-Swift.h +++ b/Carthage/Build/iOS/Alamofire.framework/Headers/Alamofire-Swift.h @@ -1,7 +1,30 @@ -// Generated by Apple Swift version 3.1 (swiftlang-802.0.48 clang-802.0.38) +// Generated by Apple Swift version 4.0.2 effective-3.2.2 (swiftlang-900.0.69.2 clang-900.0.38) #pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgcc-compat" -#if defined(__has_include) && __has_include() +#if !defined(__has_include) +# define __has_include(x) 0 +#endif +#if !defined(__has_attribute) +# define __has_attribute(x) 0 +#endif +#if !defined(__has_feature) +# define __has_feature(x) 0 +#endif +#if !defined(__has_warning) +# define __has_warning(x) 0 +#endif + +#if __has_attribute(external_source_symbol) +# define SWIFT_STRINGIFY(str) #str +# define SWIFT_MODULE_NAMESPACE_PUSH(module_name) _Pragma(SWIFT_STRINGIFY(clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in=module_name, generated_declaration))), apply_to=any(function, enum, objc_interface, objc_category, objc_protocol)))) +# define SWIFT_MODULE_NAMESPACE_POP _Pragma("clang attribute pop") +#else +# define SWIFT_MODULE_NAMESPACE_PUSH(module_name) +# define SWIFT_MODULE_NAMESPACE_POP +#endif + +#if __has_include() # include #endif @@ -13,7 +36,7 @@ #if !defined(SWIFT_TYPEDEFS) # define SWIFT_TYPEDEFS 1 -# if defined(__has_include) && __has_include() +# if __has_include() # include # elif !defined(__cplusplus) || __cplusplus < 201103L typedef uint_least16_t char16_t; @@ -48,31 +71,36 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); # endif #endif -#if defined(__has_attribute) && __has_attribute(objc_runtime_name) +#if __has_attribute(objc_runtime_name) # define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) #else # define SWIFT_RUNTIME_NAME(X) #endif -#if defined(__has_attribute) && __has_attribute(swift_name) +#if __has_attribute(swift_name) # define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) #else # define SWIFT_COMPILE_NAME(X) #endif -#if defined(__has_attribute) && __has_attribute(objc_method_family) +#if __has_attribute(objc_method_family) # define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) #else # define SWIFT_METHOD_FAMILY(X) #endif -#if defined(__has_attribute) && __has_attribute(noescape) +#if __has_attribute(noescape) # define SWIFT_NOESCAPE __attribute__((noescape)) #else # define SWIFT_NOESCAPE #endif -#if defined(__has_attribute) && __has_attribute(warn_unused_result) +#if __has_attribute(warn_unused_result) # define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #else # define SWIFT_WARN_UNUSED_RESULT #endif +#if __has_attribute(noreturn) +# define SWIFT_NORETURN __attribute__((noreturn)) +#else +# define SWIFT_NORETURN +#endif #if !defined(SWIFT_CLASS_EXTRA) # define SWIFT_CLASS_EXTRA #endif @@ -83,7 +111,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); # define SWIFT_ENUM_EXTRA #endif #if !defined(SWIFT_CLASS) -# if defined(__has_attribute) && __has_attribute(objc_subclassing_restricted) +# if __has_attribute(objc_subclassing_restricted) # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA # define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA # else @@ -102,16 +130,23 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #endif #if !defined(OBJC_DESIGNATED_INITIALIZER) -# if defined(__has_attribute) && __has_attribute(objc_designated_initializer) +# if __has_attribute(objc_designated_initializer) # define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) # else # define OBJC_DESIGNATED_INITIALIZER # endif #endif +#if !defined(SWIFT_ENUM_ATTR) +# if defined(__has_attribute) && __has_attribute(enum_extensibility) +# define SWIFT_ENUM_ATTR __attribute__((enum_extensibility(open))) +# else +# define SWIFT_ENUM_ATTR +# endif +#endif #if !defined(SWIFT_ENUM) -# define SWIFT_ENUM(_type, _name) enum _name : _type _name; enum SWIFT_ENUM_EXTRA _name : _type -# if defined(__has_feature) && __has_feature(generalized_swift_name) -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_EXTRA _name : _type +# define SWIFT_ENUM(_type, _name) enum _name : _type _name; enum SWIFT_ENUM_ATTR SWIFT_ENUM_EXTRA _name : _type +# if __has_feature(generalized_swift_name) +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR SWIFT_ENUM_EXTRA _name : _type # else # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) SWIFT_ENUM(_type, _name) # endif @@ -131,39 +166,36 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #if !defined(SWIFT_DEPRECATED_MSG) # define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) #endif -#if defined(__has_feature) && __has_feature(modules) +#if __has_feature(attribute_diagnose_if_objc) +# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) +#else +# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +#endif +#if __has_feature(modules) @import Foundation; @import ObjectiveC; #endif #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" #pragma clang diagnostic ignored "-Wduplicate-method-arg" -@class NSOperationQueue; -@class NSURLSessionTask; -@class NSURLCredential; +#if __has_warning("-Wpragma-clang-attribute") +# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#endif +#pragma clang diagnostic ignored "-Wunknown-pragmas" +#pragma clang diagnostic ignored "-Wnullability" + +SWIFT_MODULE_NAMESPACE_PUSH("Alamofire") @class NSURLSession; +@class NSURLSessionTask; @class NSHTTPURLResponse; -@class NSInputStream; @class NSURLAuthenticationChallenge; +@class NSURLCredential; +@class NSInputStream; /// The task delegate is responsible for handling all delegate callbacks for the underlying task as well as /// executing all operations attached to the serial operation queue upon task completion. SWIFT_CLASS("_TtC9Alamofire12TaskDelegate") @interface TaskDelegate : NSObject -/// The serial operation queue used to execute all operations after the task completes. -@property (nonatomic, readonly, strong) NSOperationQueue * _Nonnull queue; -/// The data returned by the server. -@property (nonatomic, readonly, copy) NSData * _Nullable data; -/// The error generated throughout the lifecyle of the task. -@property (nonatomic) NSError * _Nullable error; -@property (nonatomic, strong) NSURLSessionTask * _Nullable task; -@property (nonatomic, strong) NSURLCredential * _Nullable credential; -@property (nonatomic, strong) id _Nullable metrics; -- (nonnull instancetype)initWithTask:(NSURLSessionTask * _Nullable)task OBJC_DESIGNATED_INITIALIZER; -- (void)reset; -@property (nonatomic, copy) NSURLRequest * _Nullable (^ _Nullable taskWillPerformHTTPRedirection)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull, NSHTTPURLResponse * _Nonnull, NSURLRequest * _Nonnull); -@property (nonatomic, copy) NSInputStream * _Nullable (^ _Nullable taskNeedNewBodyStream)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull); -@property (nonatomic, copy) void (^ _Nullable taskDidCompleteWithError)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull, NSError * _Nullable); - (void)URLSession:(NSURLSession * _Nonnull)session task:(NSURLSessionTask * _Nonnull)task willPerformHTTPRedirection:(NSHTTPURLResponse * _Nonnull)response newRequest:(NSURLRequest * _Nonnull)request completionHandler:(void (^ _Nonnull)(NSURLRequest * _Nullable))completionHandler; - (void)URLSession:(NSURLSession * _Nonnull)session task:(NSURLSessionTask * _Nonnull)task didReceiveChallenge:(NSURLAuthenticationChallenge * _Nonnull)challenge completionHandler:(void (^ _Nonnull)(NSURLSessionAuthChallengeDisposition, NSURLCredential * _Nullable))completionHandler; - (void)URLSession:(NSURLSession * _Nonnull)session task:(NSURLSessionTask * _Nonnull)task needNewBodyStream:(void (^ _Nonnull)(NSInputStream * _Nullable))completionHandler; @@ -172,23 +204,12 @@ SWIFT_CLASS("_TtC9Alamofire12TaskDelegate") @end @class NSURLSessionDataTask; -@class NSProgress; @class NSURLResponse; @class NSURLSessionDownloadTask; @class NSCachedURLResponse; SWIFT_CLASS("_TtC9Alamofire16DataTaskDelegate") @interface DataTaskDelegate : TaskDelegate -@property (nonatomic, readonly, strong) NSURLSessionDataTask * _Nonnull dataTask; -@property (nonatomic, readonly, copy) NSData * _Nullable data; -@property (nonatomic, strong) NSProgress * _Nonnull progress; -@property (nonatomic, copy) void (^ _Nullable dataStream)(NSData * _Nonnull); -- (nonnull instancetype)initWithTask:(NSURLSessionTask * _Nullable)task OBJC_DESIGNATED_INITIALIZER; -- (void)reset; -@property (nonatomic, copy) NSURLSessionResponseDisposition (^ _Nullable dataTaskDidReceiveResponse)(NSURLSession * _Nonnull, NSURLSessionDataTask * _Nonnull, NSURLResponse * _Nonnull); -@property (nonatomic, copy) void (^ _Nullable dataTaskDidBecomeDownloadTask)(NSURLSession * _Nonnull, NSURLSessionDataTask * _Nonnull, NSURLSessionDownloadTask * _Nonnull); -@property (nonatomic, copy) void (^ _Nullable dataTaskDidReceiveData)(NSURLSession * _Nonnull, NSURLSessionDataTask * _Nonnull, NSData * _Nonnull); -@property (nonatomic, copy) NSCachedURLResponse * _Nullable (^ _Nullable dataTaskWillCacheResponse)(NSURLSession * _Nonnull, NSURLSessionDataTask * _Nonnull, NSCachedURLResponse * _Nonnull); - (void)URLSession:(NSURLSession * _Nonnull)session dataTask:(NSURLSessionDataTask * _Nonnull)dataTask didReceiveResponse:(NSURLResponse * _Nonnull)response completionHandler:(void (^ _Nonnull)(NSURLSessionResponseDisposition))completionHandler; - (void)URLSession:(NSURLSession * _Nonnull)session dataTask:(NSURLSessionDataTask * _Nonnull)dataTask didBecomeDownloadTask:(NSURLSessionDownloadTask * _Nonnull)downloadTask; - (void)URLSession:(NSURLSession * _Nonnull)session dataTask:(NSURLSessionDataTask * _Nonnull)dataTask didReceiveData:(NSData * _Nonnull)data; @@ -198,88 +219,17 @@ SWIFT_CLASS("_TtC9Alamofire16DataTaskDelegate") SWIFT_CLASS("_TtC9Alamofire20DownloadTaskDelegate") @interface DownloadTaskDelegate : TaskDelegate -@property (nonatomic, readonly, strong) NSURLSessionDownloadTask * _Nonnull downloadTask; -@property (nonatomic, strong) NSProgress * _Nonnull progress; -@property (nonatomic, copy) NSData * _Nullable resumeData; -@property (nonatomic, readonly, copy) NSData * _Nullable data; -@property (nonatomic, copy) NSURL * _Nullable temporaryURL; -@property (nonatomic, copy) NSURL * _Nullable destinationURL; -@property (nonatomic, readonly, copy) NSURL * _Nullable fileURL; -- (nonnull instancetype)initWithTask:(NSURLSessionTask * _Nullable)task OBJC_DESIGNATED_INITIALIZER; -- (void)reset; -@property (nonatomic, copy) NSURL * _Nonnull (^ _Nullable downloadTaskDidFinishDownloadingToURL)(NSURLSession * _Nonnull, NSURLSessionDownloadTask * _Nonnull, NSURL * _Nonnull); -@property (nonatomic, copy) void (^ _Nullable downloadTaskDidWriteData)(NSURLSession * _Nonnull, NSURLSessionDownloadTask * _Nonnull, int64_t, int64_t, int64_t); -@property (nonatomic, copy) void (^ _Nullable downloadTaskDidResumeAtOffset)(NSURLSession * _Nonnull, NSURLSessionDownloadTask * _Nonnull, int64_t, int64_t); - (void)URLSession:(NSURLSession * _Nonnull)session downloadTask:(NSURLSessionDownloadTask * _Nonnull)downloadTask didFinishDownloadingToURL:(NSURL * _Nonnull)location; - (void)URLSession:(NSURLSession * _Nonnull)session downloadTask:(NSURLSessionDownloadTask * _Nonnull)downloadTask didWriteData:(int64_t)bytesWritten totalBytesWritten:(int64_t)totalBytesWritten totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite; - (void)URLSession:(NSURLSession * _Nonnull)session downloadTask:(NSURLSessionDownloadTask * _Nonnull)downloadTask didResumeAtOffset:(int64_t)fileOffset expectedTotalBytes:(int64_t)expectedTotalBytes; @end -@interface NSNumber (SWIFT_EXTENSION(Alamofire)) -@end -@class NSURLSessionStreamTask; -@class NSOutputStream; /// Responsible for handling all delegate callbacks for the underlying session. SWIFT_CLASS("_TtC9Alamofire15SessionDelegate") @interface SessionDelegate : NSObject -/// Overrides default behavior for URLSessionDelegate method urlSession(_:didBecomeInvalidWithError:). -@property (nonatomic, copy) void (^ _Nullable sessionDidBecomeInvalidWithError)(NSURLSession * _Nonnull, NSError * _Nullable); -/// Overrides all behavior for URLSessionDelegate method urlSession(_:didReceive:completionHandler:) and requires the caller to call the completionHandler. -@property (nonatomic, copy) void (^ _Nullable sessionDidReceiveChallengeWithCompletion)(NSURLSession * _Nonnull, NSURLAuthenticationChallenge * _Nonnull, SWIFT_NOESCAPE void (^ _Nonnull)(NSURLSessionAuthChallengeDisposition, NSURLCredential * _Nullable)); -/// Overrides default behavior for URLSessionDelegate method urlSessionDidFinishEvents(forBackgroundURLSession:). -@property (nonatomic, copy) void (^ _Nullable sessionDidFinishEventsForBackgroundURLSession)(NSURLSession * _Nonnull); -/// Overrides default behavior for URLSessionTaskDelegate method urlSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:). -@property (nonatomic, copy) NSURLRequest * _Nullable (^ _Nullable taskWillPerformHTTPRedirection)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull, NSHTTPURLResponse * _Nonnull, NSURLRequest * _Nonnull); -/// Overrides all behavior for URLSessionTaskDelegate method urlSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:) and -/// requires the caller to call the completionHandler. -@property (nonatomic, copy) void (^ _Nullable taskWillPerformHTTPRedirectionWithCompletion)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull, NSHTTPURLResponse * _Nonnull, NSURLRequest * _Nonnull, SWIFT_NOESCAPE void (^ _Nonnull)(NSURLRequest * _Nullable)); -/// Overrides all behavior for URLSessionTaskDelegate method urlSession(_:task:didReceive:completionHandler:) and -/// requires the caller to call the completionHandler. -@property (nonatomic, copy) void (^ _Nullable taskDidReceiveChallengeWithCompletion)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull, NSURLAuthenticationChallenge * _Nonnull, SWIFT_NOESCAPE void (^ _Nonnull)(NSURLSessionAuthChallengeDisposition, NSURLCredential * _Nullable)); -/// Overrides default behavior for URLSessionTaskDelegate method urlSession(_:task:needNewBodyStream:). -@property (nonatomic, copy) NSInputStream * _Nullable (^ _Nullable taskNeedNewBodyStream)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull); -/// Overrides all behavior for URLSessionTaskDelegate method urlSession(_:task:needNewBodyStream:) and -/// requires the caller to call the completionHandler. -@property (nonatomic, copy) void (^ _Nullable taskNeedNewBodyStreamWithCompletion)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull, SWIFT_NOESCAPE void (^ _Nonnull)(NSInputStream * _Nullable)); -/// Overrides default behavior for URLSessionTaskDelegate method urlSession(_:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:). -@property (nonatomic, copy) void (^ _Nullable taskDidSendBodyData)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull, int64_t, int64_t, int64_t); -/// Overrides default behavior for URLSessionTaskDelegate method urlSession(_:task:didCompleteWithError:). -@property (nonatomic, copy) void (^ _Nullable taskDidComplete)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull, NSError * _Nullable); -/// Overrides default behavior for URLSessionDataDelegate method urlSession(_:dataTask:didReceive:completionHandler:). -@property (nonatomic, copy) NSURLSessionResponseDisposition (^ _Nullable dataTaskDidReceiveResponse)(NSURLSession * _Nonnull, NSURLSessionDataTask * _Nonnull, NSURLResponse * _Nonnull); -/// Overrides all behavior for URLSessionDataDelegate method urlSession(_:dataTask:didReceive:completionHandler:) and -/// requires caller to call the completionHandler. -@property (nonatomic, copy) void (^ _Nullable dataTaskDidReceiveResponseWithCompletion)(NSURLSession * _Nonnull, NSURLSessionDataTask * _Nonnull, NSURLResponse * _Nonnull, SWIFT_NOESCAPE void (^ _Nonnull)(NSURLSessionResponseDisposition)); -/// Overrides default behavior for URLSessionDataDelegate method urlSession(_:dataTask:didBecome:). -@property (nonatomic, copy) void (^ _Nullable dataTaskDidBecomeDownloadTask)(NSURLSession * _Nonnull, NSURLSessionDataTask * _Nonnull, NSURLSessionDownloadTask * _Nonnull); -/// Overrides default behavior for URLSessionDataDelegate method urlSession(_:dataTask:didReceive:). -@property (nonatomic, copy) void (^ _Nullable dataTaskDidReceiveData)(NSURLSession * _Nonnull, NSURLSessionDataTask * _Nonnull, NSData * _Nonnull); -/// Overrides default behavior for URLSessionDataDelegate method urlSession(_:dataTask:willCacheResponse:completionHandler:). -@property (nonatomic, copy) NSCachedURLResponse * _Nullable (^ _Nullable dataTaskWillCacheResponse)(NSURLSession * _Nonnull, NSURLSessionDataTask * _Nonnull, NSCachedURLResponse * _Nonnull); -/// Overrides all behavior for URLSessionDataDelegate method urlSession(_:dataTask:willCacheResponse:completionHandler:) and -/// requires caller to call the completionHandler. -@property (nonatomic, copy) void (^ _Nullable dataTaskWillCacheResponseWithCompletion)(NSURLSession * _Nonnull, NSURLSessionDataTask * _Nonnull, NSCachedURLResponse * _Nonnull, SWIFT_NOESCAPE void (^ _Nonnull)(NSCachedURLResponse * _Nullable)); -/// Overrides default behavior for URLSessionDownloadDelegate method urlSession(_:downloadTask:didFinishDownloadingTo:). -@property (nonatomic, copy) void (^ _Nullable downloadTaskDidFinishDownloadingToURL)(NSURLSession * _Nonnull, NSURLSessionDownloadTask * _Nonnull, NSURL * _Nonnull); -/// Overrides default behavior for URLSessionDownloadDelegate method urlSession(_:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:). -@property (nonatomic, copy) void (^ _Nullable downloadTaskDidWriteData)(NSURLSession * _Nonnull, NSURLSessionDownloadTask * _Nonnull, int64_t, int64_t, int64_t); -/// Overrides default behavior for URLSessionDownloadDelegate method urlSession(_:downloadTask:didResumeAtOffset:expectedTotalBytes:). -@property (nonatomic, copy) void (^ _Nullable downloadTaskDidResumeAtOffset)(NSURLSession * _Nonnull, NSURLSessionDownloadTask * _Nonnull, int64_t, int64_t); -/// Overrides default behavior for URLSessionStreamDelegate method urlSession(_:readClosedFor:). -@property (nonatomic, copy) void (^ _Nullable streamTaskReadClosed)(NSURLSession * _Nonnull, NSURLSessionStreamTask * _Nonnull); -/// Overrides default behavior for URLSessionStreamDelegate method urlSession(_:writeClosedFor:). -@property (nonatomic, copy) void (^ _Nullable streamTaskWriteClosed)(NSURLSession * _Nonnull, NSURLSessionStreamTask * _Nonnull); -/// Overrides default behavior for URLSessionStreamDelegate method urlSession(_:betterRouteDiscoveredFor:). -@property (nonatomic, copy) void (^ _Nullable streamTaskBetterRouteDiscovered)(NSURLSession * _Nonnull, NSURLSessionStreamTask * _Nonnull); -/// Overrides default behavior for URLSessionStreamDelegate method urlSession(_:streamTask:didBecome:outputStream:). -@property (nonatomic, copy) void (^ _Nullable streamTaskDidBecomeInputAndOutputStreams)(NSURLSession * _Nonnull, NSURLSessionStreamTask * _Nonnull, NSInputStream * _Nonnull, NSOutputStream * _Nonnull); -@property (nonatomic) id _Nullable _streamTaskReadClosed; -@property (nonatomic) id _Nullable _streamTaskWriteClosed; -@property (nonatomic) id _Nullable _streamTaskBetterRouteDiscovered; -@property (nonatomic) id _Nullable _streamTaskDidBecomeInputStream; /// Initializes the SessionDelegate instance. /// /// returns: @@ -362,7 +312,10 @@ SWIFT_CLASS("_TtC9Alamofire15SessionDelegate") - (void)URLSessionDidFinishEventsForBackgroundURLSession:(NSURLSession * _Nonnull)session; @end +@class NSURLSessionStreamTask; +@class NSOutputStream; +SWIFT_AVAILABILITY(tvos,introduced=9.0) SWIFT_AVAILABILITY(macos,introduced=10.11) SWIFT_AVAILABILITY(ios,introduced=9.0) @interface SessionDelegate (SWIFT_EXTENSION(Alamofire)) /// Tells the delegate that the read side of the connection has been closed. /// \param session The session. @@ -509,19 +462,11 @@ SWIFT_CLASS("_TtC9Alamofire15SessionDelegate") -@interface NSURLSession (SWIFT_EXTENSION(Alamofire)) -@end -@class NSURLSessionUploadTask; SWIFT_CLASS("_TtC9Alamofire18UploadTaskDelegate") @interface UploadTaskDelegate : DataTaskDelegate -@property (nonatomic, readonly, strong) NSURLSessionUploadTask * _Nonnull uploadTask; -@property (nonatomic, strong) NSProgress * _Nonnull uploadProgress; -- (nonnull instancetype)initWithTask:(NSURLSessionTask * _Nullable)task OBJC_DESIGNATED_INITIALIZER; -- (void)reset; -@property (nonatomic, copy) void (^ _Nullable taskDidSendBodyData)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull, int64_t, int64_t, int64_t); -- (void)URLSession:(NSURLSession * _Nonnull)session task:(NSURLSessionTask * _Nonnull)task didSendBodyData:(int64_t)bytesSent totalBytesSent:(int64_t)totalBytesSent totalBytesExpectedToSend:(int64_t)totalBytesExpectedToSend; @end +SWIFT_MODULE_NAMESPACE_POP #pragma clang diagnostic pop diff --git a/Carthage/Build/iOS/Alamofire.framework/Headers/Alamofire.h b/Carthage/Build/iOS/Alamofire.framework/Headers/Alamofire.h index 8d45b77..4e651df 100644 --- a/Carthage/Build/iOS/Alamofire.framework/Headers/Alamofire.h +++ b/Carthage/Build/iOS/Alamofire.framework/Headers/Alamofire.h @@ -1,7 +1,7 @@ // // Alamofire.h // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Carthage/Build/iOS/Alamofire.framework/Info.plist b/Carthage/Build/iOS/Alamofire.framework/Info.plist index 9f63858..723cd4f 100644 Binary files a/Carthage/Build/iOS/Alamofire.framework/Info.plist and b/Carthage/Build/iOS/Alamofire.framework/Info.plist differ diff --git a/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm.swiftdoc b/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm.swiftdoc index 7c8a501..7318a11 100644 Binary files a/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm.swiftdoc and b/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm.swiftdoc differ diff --git a/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm.swiftmodule b/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm.swiftmodule index b8ce485..e7c4db8 100644 Binary files a/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm.swiftmodule and b/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm.swiftmodule differ diff --git a/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm64.swiftdoc b/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm64.swiftdoc index 9ad76f4..c5910dd 100644 Binary files a/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm64.swiftdoc and b/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm64.swiftdoc differ diff --git a/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm64.swiftmodule b/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm64.swiftmodule index 38c24b1..aea2e37 100644 Binary files a/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm64.swiftmodule and b/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm64.swiftmodule differ diff --git a/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/i386.swiftdoc b/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/i386.swiftdoc index 2858a1c..6899ec3 100644 Binary files a/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/i386.swiftdoc and b/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/i386.swiftdoc differ diff --git a/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/i386.swiftmodule b/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/i386.swiftmodule index 0c64999..e0e1566 100644 Binary files a/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/i386.swiftmodule and b/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/i386.swiftmodule differ diff --git a/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64.swiftdoc b/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64.swiftdoc index f637c91..3de50ba 100644 Binary files a/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64.swiftdoc and b/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64.swiftdoc differ diff --git a/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64.swiftmodule b/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64.swiftmodule index a0081d0..e3bc144 100644 Binary files a/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64.swiftmodule and b/Carthage/Build/iOS/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64.swiftmodule differ diff --git a/Carthage/Build/iOS/Alamofire.framework/Modules/module.modulemap b/Carthage/Build/iOS/Alamofire.framework/Modules/module.modulemap index 8096dcc..6148f67 100644 --- a/Carthage/Build/iOS/Alamofire.framework/Modules/module.modulemap +++ b/Carthage/Build/iOS/Alamofire.framework/Modules/module.modulemap @@ -7,4 +7,5 @@ framework module Alamofire { module Alamofire.Swift { header "Alamofire-Swift.h" + requires objc } diff --git a/Carthage/Build/tvOS/Alamofire.framework.dSYM/Contents/Info.plist b/Carthage/Build/tvOS/Alamofire.framework.dSYM/Contents/Info.plist index d9e4b98..7a61759 100644 --- a/Carthage/Build/tvOS/Alamofire.framework.dSYM/Contents/Info.plist +++ b/Carthage/Build/tvOS/Alamofire.framework.dSYM/Contents/Info.plist @@ -13,7 +13,7 @@ CFBundleSignature ???? CFBundleShortVersionString - 4.4.0 + 4.5.1 CFBundleVersion 1 diff --git a/Carthage/Build/tvOS/Alamofire.framework.dSYM/Contents/Resources/DWARF/Alamofire b/Carthage/Build/tvOS/Alamofire.framework.dSYM/Contents/Resources/DWARF/Alamofire index 6ee2b20..aac758f 100644 Binary files a/Carthage/Build/tvOS/Alamofire.framework.dSYM/Contents/Resources/DWARF/Alamofire and b/Carthage/Build/tvOS/Alamofire.framework.dSYM/Contents/Resources/DWARF/Alamofire differ diff --git a/Carthage/Build/tvOS/Alamofire.framework/Alamofire b/Carthage/Build/tvOS/Alamofire.framework/Alamofire index 2f53ccb..dfc74ed 100755 Binary files a/Carthage/Build/tvOS/Alamofire.framework/Alamofire and b/Carthage/Build/tvOS/Alamofire.framework/Alamofire differ diff --git a/Carthage/Build/tvOS/Alamofire.framework/Headers/Alamofire-Swift.h b/Carthage/Build/tvOS/Alamofire.framework/Headers/Alamofire-Swift.h index c28cc4b..43abd6b 100644 --- a/Carthage/Build/tvOS/Alamofire.framework/Headers/Alamofire-Swift.h +++ b/Carthage/Build/tvOS/Alamofire.framework/Headers/Alamofire-Swift.h @@ -1,7 +1,30 @@ -// Generated by Apple Swift version 3.1 (swiftlang-802.0.48 clang-802.0.38) +// Generated by Apple Swift version 4.0.2 effective-3.2.2 (swiftlang-900.0.69.2 clang-900.0.38) #pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgcc-compat" -#if defined(__has_include) && __has_include() +#if !defined(__has_include) +# define __has_include(x) 0 +#endif +#if !defined(__has_attribute) +# define __has_attribute(x) 0 +#endif +#if !defined(__has_feature) +# define __has_feature(x) 0 +#endif +#if !defined(__has_warning) +# define __has_warning(x) 0 +#endif + +#if __has_attribute(external_source_symbol) +# define SWIFT_STRINGIFY(str) #str +# define SWIFT_MODULE_NAMESPACE_PUSH(module_name) _Pragma(SWIFT_STRINGIFY(clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in=module_name, generated_declaration))), apply_to=any(function, enum, objc_interface, objc_category, objc_protocol)))) +# define SWIFT_MODULE_NAMESPACE_POP _Pragma("clang attribute pop") +#else +# define SWIFT_MODULE_NAMESPACE_PUSH(module_name) +# define SWIFT_MODULE_NAMESPACE_POP +#endif + +#if __has_include() # include #endif @@ -13,7 +36,7 @@ #if !defined(SWIFT_TYPEDEFS) # define SWIFT_TYPEDEFS 1 -# if defined(__has_include) && __has_include() +# if __has_include() # include # elif !defined(__cplusplus) || __cplusplus < 201103L typedef uint_least16_t char16_t; @@ -48,31 +71,36 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); # endif #endif -#if defined(__has_attribute) && __has_attribute(objc_runtime_name) +#if __has_attribute(objc_runtime_name) # define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) #else # define SWIFT_RUNTIME_NAME(X) #endif -#if defined(__has_attribute) && __has_attribute(swift_name) +#if __has_attribute(swift_name) # define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) #else # define SWIFT_COMPILE_NAME(X) #endif -#if defined(__has_attribute) && __has_attribute(objc_method_family) +#if __has_attribute(objc_method_family) # define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) #else # define SWIFT_METHOD_FAMILY(X) #endif -#if defined(__has_attribute) && __has_attribute(noescape) +#if __has_attribute(noescape) # define SWIFT_NOESCAPE __attribute__((noescape)) #else # define SWIFT_NOESCAPE #endif -#if defined(__has_attribute) && __has_attribute(warn_unused_result) +#if __has_attribute(warn_unused_result) # define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #else # define SWIFT_WARN_UNUSED_RESULT #endif +#if __has_attribute(noreturn) +# define SWIFT_NORETURN __attribute__((noreturn)) +#else +# define SWIFT_NORETURN +#endif #if !defined(SWIFT_CLASS_EXTRA) # define SWIFT_CLASS_EXTRA #endif @@ -83,7 +111,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); # define SWIFT_ENUM_EXTRA #endif #if !defined(SWIFT_CLASS) -# if defined(__has_attribute) && __has_attribute(objc_subclassing_restricted) +# if __has_attribute(objc_subclassing_restricted) # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA # define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA # else @@ -102,16 +130,23 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #endif #if !defined(OBJC_DESIGNATED_INITIALIZER) -# if defined(__has_attribute) && __has_attribute(objc_designated_initializer) +# if __has_attribute(objc_designated_initializer) # define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) # else # define OBJC_DESIGNATED_INITIALIZER # endif #endif +#if !defined(SWIFT_ENUM_ATTR) +# if defined(__has_attribute) && __has_attribute(enum_extensibility) +# define SWIFT_ENUM_ATTR __attribute__((enum_extensibility(open))) +# else +# define SWIFT_ENUM_ATTR +# endif +#endif #if !defined(SWIFT_ENUM) -# define SWIFT_ENUM(_type, _name) enum _name : _type _name; enum SWIFT_ENUM_EXTRA _name : _type -# if defined(__has_feature) && __has_feature(generalized_swift_name) -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_EXTRA _name : _type +# define SWIFT_ENUM(_type, _name) enum _name : _type _name; enum SWIFT_ENUM_ATTR SWIFT_ENUM_EXTRA _name : _type +# if __has_feature(generalized_swift_name) +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR SWIFT_ENUM_EXTRA _name : _type # else # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) SWIFT_ENUM(_type, _name) # endif @@ -131,39 +166,36 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #if !defined(SWIFT_DEPRECATED_MSG) # define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) #endif -#if defined(__has_feature) && __has_feature(modules) +#if __has_feature(attribute_diagnose_if_objc) +# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) +#else +# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +#endif +#if __has_feature(modules) @import Foundation; @import ObjectiveC; #endif #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" #pragma clang diagnostic ignored "-Wduplicate-method-arg" -@class NSOperationQueue; -@class NSURLSessionTask; -@class NSURLCredential; +#if __has_warning("-Wpragma-clang-attribute") +# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#endif +#pragma clang diagnostic ignored "-Wunknown-pragmas" +#pragma clang diagnostic ignored "-Wnullability" + +SWIFT_MODULE_NAMESPACE_PUSH("Alamofire") @class NSURLSession; +@class NSURLSessionTask; @class NSHTTPURLResponse; -@class NSInputStream; @class NSURLAuthenticationChallenge; +@class NSURLCredential; +@class NSInputStream; /// The task delegate is responsible for handling all delegate callbacks for the underlying task as well as /// executing all operations attached to the serial operation queue upon task completion. SWIFT_CLASS("_TtC9Alamofire12TaskDelegate") @interface TaskDelegate : NSObject -/// The serial operation queue used to execute all operations after the task completes. -@property (nonatomic, readonly, strong) NSOperationQueue * _Nonnull queue; -/// The data returned by the server. -@property (nonatomic, readonly, copy) NSData * _Nullable data; -/// The error generated throughout the lifecyle of the task. -@property (nonatomic) NSError * _Nullable error; -@property (nonatomic, strong) NSURLSessionTask * _Nullable task; -@property (nonatomic, strong) NSURLCredential * _Nullable credential; -@property (nonatomic, strong) id _Nullable metrics; -- (nonnull instancetype)initWithTask:(NSURLSessionTask * _Nullable)task OBJC_DESIGNATED_INITIALIZER; -- (void)reset; -@property (nonatomic, copy) NSURLRequest * _Nullable (^ _Nullable taskWillPerformHTTPRedirection)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull, NSHTTPURLResponse * _Nonnull, NSURLRequest * _Nonnull); -@property (nonatomic, copy) NSInputStream * _Nullable (^ _Nullable taskNeedNewBodyStream)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull); -@property (nonatomic, copy) void (^ _Nullable taskDidCompleteWithError)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull, NSError * _Nullable); - (void)URLSession:(NSURLSession * _Nonnull)session task:(NSURLSessionTask * _Nonnull)task willPerformHTTPRedirection:(NSHTTPURLResponse * _Nonnull)response newRequest:(NSURLRequest * _Nonnull)request completionHandler:(void (^ _Nonnull)(NSURLRequest * _Nullable))completionHandler; - (void)URLSession:(NSURLSession * _Nonnull)session task:(NSURLSessionTask * _Nonnull)task didReceiveChallenge:(NSURLAuthenticationChallenge * _Nonnull)challenge completionHandler:(void (^ _Nonnull)(NSURLSessionAuthChallengeDisposition, NSURLCredential * _Nullable))completionHandler; - (void)URLSession:(NSURLSession * _Nonnull)session task:(NSURLSessionTask * _Nonnull)task needNewBodyStream:(void (^ _Nonnull)(NSInputStream * _Nullable))completionHandler; @@ -172,23 +204,12 @@ SWIFT_CLASS("_TtC9Alamofire12TaskDelegate") @end @class NSURLSessionDataTask; -@class NSProgress; @class NSURLResponse; @class NSURLSessionDownloadTask; @class NSCachedURLResponse; SWIFT_CLASS("_TtC9Alamofire16DataTaskDelegate") @interface DataTaskDelegate : TaskDelegate -@property (nonatomic, readonly, strong) NSURLSessionDataTask * _Nonnull dataTask; -@property (nonatomic, readonly, copy) NSData * _Nullable data; -@property (nonatomic, strong) NSProgress * _Nonnull progress; -@property (nonatomic, copy) void (^ _Nullable dataStream)(NSData * _Nonnull); -- (nonnull instancetype)initWithTask:(NSURLSessionTask * _Nullable)task OBJC_DESIGNATED_INITIALIZER; -- (void)reset; -@property (nonatomic, copy) NSURLSessionResponseDisposition (^ _Nullable dataTaskDidReceiveResponse)(NSURLSession * _Nonnull, NSURLSessionDataTask * _Nonnull, NSURLResponse * _Nonnull); -@property (nonatomic, copy) void (^ _Nullable dataTaskDidBecomeDownloadTask)(NSURLSession * _Nonnull, NSURLSessionDataTask * _Nonnull, NSURLSessionDownloadTask * _Nonnull); -@property (nonatomic, copy) void (^ _Nullable dataTaskDidReceiveData)(NSURLSession * _Nonnull, NSURLSessionDataTask * _Nonnull, NSData * _Nonnull); -@property (nonatomic, copy) NSCachedURLResponse * _Nullable (^ _Nullable dataTaskWillCacheResponse)(NSURLSession * _Nonnull, NSURLSessionDataTask * _Nonnull, NSCachedURLResponse * _Nonnull); - (void)URLSession:(NSURLSession * _Nonnull)session dataTask:(NSURLSessionDataTask * _Nonnull)dataTask didReceiveResponse:(NSURLResponse * _Nonnull)response completionHandler:(void (^ _Nonnull)(NSURLSessionResponseDisposition))completionHandler; - (void)URLSession:(NSURLSession * _Nonnull)session dataTask:(NSURLSessionDataTask * _Nonnull)dataTask didBecomeDownloadTask:(NSURLSessionDownloadTask * _Nonnull)downloadTask; - (void)URLSession:(NSURLSession * _Nonnull)session dataTask:(NSURLSessionDataTask * _Nonnull)dataTask didReceiveData:(NSData * _Nonnull)data; @@ -198,88 +219,17 @@ SWIFT_CLASS("_TtC9Alamofire16DataTaskDelegate") SWIFT_CLASS("_TtC9Alamofire20DownloadTaskDelegate") @interface DownloadTaskDelegate : TaskDelegate -@property (nonatomic, readonly, strong) NSURLSessionDownloadTask * _Nonnull downloadTask; -@property (nonatomic, strong) NSProgress * _Nonnull progress; -@property (nonatomic, copy) NSData * _Nullable resumeData; -@property (nonatomic, readonly, copy) NSData * _Nullable data; -@property (nonatomic, copy) NSURL * _Nullable temporaryURL; -@property (nonatomic, copy) NSURL * _Nullable destinationURL; -@property (nonatomic, readonly, copy) NSURL * _Nullable fileURL; -- (nonnull instancetype)initWithTask:(NSURLSessionTask * _Nullable)task OBJC_DESIGNATED_INITIALIZER; -- (void)reset; -@property (nonatomic, copy) NSURL * _Nonnull (^ _Nullable downloadTaskDidFinishDownloadingToURL)(NSURLSession * _Nonnull, NSURLSessionDownloadTask * _Nonnull, NSURL * _Nonnull); -@property (nonatomic, copy) void (^ _Nullable downloadTaskDidWriteData)(NSURLSession * _Nonnull, NSURLSessionDownloadTask * _Nonnull, int64_t, int64_t, int64_t); -@property (nonatomic, copy) void (^ _Nullable downloadTaskDidResumeAtOffset)(NSURLSession * _Nonnull, NSURLSessionDownloadTask * _Nonnull, int64_t, int64_t); - (void)URLSession:(NSURLSession * _Nonnull)session downloadTask:(NSURLSessionDownloadTask * _Nonnull)downloadTask didFinishDownloadingToURL:(NSURL * _Nonnull)location; - (void)URLSession:(NSURLSession * _Nonnull)session downloadTask:(NSURLSessionDownloadTask * _Nonnull)downloadTask didWriteData:(int64_t)bytesWritten totalBytesWritten:(int64_t)totalBytesWritten totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite; - (void)URLSession:(NSURLSession * _Nonnull)session downloadTask:(NSURLSessionDownloadTask * _Nonnull)downloadTask didResumeAtOffset:(int64_t)fileOffset expectedTotalBytes:(int64_t)expectedTotalBytes; @end -@interface NSNumber (SWIFT_EXTENSION(Alamofire)) -@end -@class NSURLSessionStreamTask; -@class NSOutputStream; /// Responsible for handling all delegate callbacks for the underlying session. SWIFT_CLASS("_TtC9Alamofire15SessionDelegate") @interface SessionDelegate : NSObject -/// Overrides default behavior for URLSessionDelegate method urlSession(_:didBecomeInvalidWithError:). -@property (nonatomic, copy) void (^ _Nullable sessionDidBecomeInvalidWithError)(NSURLSession * _Nonnull, NSError * _Nullable); -/// Overrides all behavior for URLSessionDelegate method urlSession(_:didReceive:completionHandler:) and requires the caller to call the completionHandler. -@property (nonatomic, copy) void (^ _Nullable sessionDidReceiveChallengeWithCompletion)(NSURLSession * _Nonnull, NSURLAuthenticationChallenge * _Nonnull, SWIFT_NOESCAPE void (^ _Nonnull)(NSURLSessionAuthChallengeDisposition, NSURLCredential * _Nullable)); -/// Overrides default behavior for URLSessionDelegate method urlSessionDidFinishEvents(forBackgroundURLSession:). -@property (nonatomic, copy) void (^ _Nullable sessionDidFinishEventsForBackgroundURLSession)(NSURLSession * _Nonnull); -/// Overrides default behavior for URLSessionTaskDelegate method urlSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:). -@property (nonatomic, copy) NSURLRequest * _Nullable (^ _Nullable taskWillPerformHTTPRedirection)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull, NSHTTPURLResponse * _Nonnull, NSURLRequest * _Nonnull); -/// Overrides all behavior for URLSessionTaskDelegate method urlSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:) and -/// requires the caller to call the completionHandler. -@property (nonatomic, copy) void (^ _Nullable taskWillPerformHTTPRedirectionWithCompletion)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull, NSHTTPURLResponse * _Nonnull, NSURLRequest * _Nonnull, SWIFT_NOESCAPE void (^ _Nonnull)(NSURLRequest * _Nullable)); -/// Overrides all behavior for URLSessionTaskDelegate method urlSession(_:task:didReceive:completionHandler:) and -/// requires the caller to call the completionHandler. -@property (nonatomic, copy) void (^ _Nullable taskDidReceiveChallengeWithCompletion)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull, NSURLAuthenticationChallenge * _Nonnull, SWIFT_NOESCAPE void (^ _Nonnull)(NSURLSessionAuthChallengeDisposition, NSURLCredential * _Nullable)); -/// Overrides default behavior for URLSessionTaskDelegate method urlSession(_:task:needNewBodyStream:). -@property (nonatomic, copy) NSInputStream * _Nullable (^ _Nullable taskNeedNewBodyStream)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull); -/// Overrides all behavior for URLSessionTaskDelegate method urlSession(_:task:needNewBodyStream:) and -/// requires the caller to call the completionHandler. -@property (nonatomic, copy) void (^ _Nullable taskNeedNewBodyStreamWithCompletion)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull, SWIFT_NOESCAPE void (^ _Nonnull)(NSInputStream * _Nullable)); -/// Overrides default behavior for URLSessionTaskDelegate method urlSession(_:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:). -@property (nonatomic, copy) void (^ _Nullable taskDidSendBodyData)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull, int64_t, int64_t, int64_t); -/// Overrides default behavior for URLSessionTaskDelegate method urlSession(_:task:didCompleteWithError:). -@property (nonatomic, copy) void (^ _Nullable taskDidComplete)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull, NSError * _Nullable); -/// Overrides default behavior for URLSessionDataDelegate method urlSession(_:dataTask:didReceive:completionHandler:). -@property (nonatomic, copy) NSURLSessionResponseDisposition (^ _Nullable dataTaskDidReceiveResponse)(NSURLSession * _Nonnull, NSURLSessionDataTask * _Nonnull, NSURLResponse * _Nonnull); -/// Overrides all behavior for URLSessionDataDelegate method urlSession(_:dataTask:didReceive:completionHandler:) and -/// requires caller to call the completionHandler. -@property (nonatomic, copy) void (^ _Nullable dataTaskDidReceiveResponseWithCompletion)(NSURLSession * _Nonnull, NSURLSessionDataTask * _Nonnull, NSURLResponse * _Nonnull, SWIFT_NOESCAPE void (^ _Nonnull)(NSURLSessionResponseDisposition)); -/// Overrides default behavior for URLSessionDataDelegate method urlSession(_:dataTask:didBecome:). -@property (nonatomic, copy) void (^ _Nullable dataTaskDidBecomeDownloadTask)(NSURLSession * _Nonnull, NSURLSessionDataTask * _Nonnull, NSURLSessionDownloadTask * _Nonnull); -/// Overrides default behavior for URLSessionDataDelegate method urlSession(_:dataTask:didReceive:). -@property (nonatomic, copy) void (^ _Nullable dataTaskDidReceiveData)(NSURLSession * _Nonnull, NSURLSessionDataTask * _Nonnull, NSData * _Nonnull); -/// Overrides default behavior for URLSessionDataDelegate method urlSession(_:dataTask:willCacheResponse:completionHandler:). -@property (nonatomic, copy) NSCachedURLResponse * _Nullable (^ _Nullable dataTaskWillCacheResponse)(NSURLSession * _Nonnull, NSURLSessionDataTask * _Nonnull, NSCachedURLResponse * _Nonnull); -/// Overrides all behavior for URLSessionDataDelegate method urlSession(_:dataTask:willCacheResponse:completionHandler:) and -/// requires caller to call the completionHandler. -@property (nonatomic, copy) void (^ _Nullable dataTaskWillCacheResponseWithCompletion)(NSURLSession * _Nonnull, NSURLSessionDataTask * _Nonnull, NSCachedURLResponse * _Nonnull, SWIFT_NOESCAPE void (^ _Nonnull)(NSCachedURLResponse * _Nullable)); -/// Overrides default behavior for URLSessionDownloadDelegate method urlSession(_:downloadTask:didFinishDownloadingTo:). -@property (nonatomic, copy) void (^ _Nullable downloadTaskDidFinishDownloadingToURL)(NSURLSession * _Nonnull, NSURLSessionDownloadTask * _Nonnull, NSURL * _Nonnull); -/// Overrides default behavior for URLSessionDownloadDelegate method urlSession(_:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:). -@property (nonatomic, copy) void (^ _Nullable downloadTaskDidWriteData)(NSURLSession * _Nonnull, NSURLSessionDownloadTask * _Nonnull, int64_t, int64_t, int64_t); -/// Overrides default behavior for URLSessionDownloadDelegate method urlSession(_:downloadTask:didResumeAtOffset:expectedTotalBytes:). -@property (nonatomic, copy) void (^ _Nullable downloadTaskDidResumeAtOffset)(NSURLSession * _Nonnull, NSURLSessionDownloadTask * _Nonnull, int64_t, int64_t); -/// Overrides default behavior for URLSessionStreamDelegate method urlSession(_:readClosedFor:). -@property (nonatomic, copy) void (^ _Nullable streamTaskReadClosed)(NSURLSession * _Nonnull, NSURLSessionStreamTask * _Nonnull); -/// Overrides default behavior for URLSessionStreamDelegate method urlSession(_:writeClosedFor:). -@property (nonatomic, copy) void (^ _Nullable streamTaskWriteClosed)(NSURLSession * _Nonnull, NSURLSessionStreamTask * _Nonnull); -/// Overrides default behavior for URLSessionStreamDelegate method urlSession(_:betterRouteDiscoveredFor:). -@property (nonatomic, copy) void (^ _Nullable streamTaskBetterRouteDiscovered)(NSURLSession * _Nonnull, NSURLSessionStreamTask * _Nonnull); -/// Overrides default behavior for URLSessionStreamDelegate method urlSession(_:streamTask:didBecome:outputStream:). -@property (nonatomic, copy) void (^ _Nullable streamTaskDidBecomeInputAndOutputStreams)(NSURLSession * _Nonnull, NSURLSessionStreamTask * _Nonnull, NSInputStream * _Nonnull, NSOutputStream * _Nonnull); -@property (nonatomic) id _Nullable _streamTaskReadClosed; -@property (nonatomic) id _Nullable _streamTaskWriteClosed; -@property (nonatomic) id _Nullable _streamTaskBetterRouteDiscovered; -@property (nonatomic) id _Nullable _streamTaskDidBecomeInputStream; /// Initializes the SessionDelegate instance. /// /// returns: @@ -409,7 +359,10 @@ SWIFT_CLASS("_TtC9Alamofire15SessionDelegate") - (void)URLSession:(NSURLSession * _Nonnull)session dataTask:(NSURLSessionDataTask * _Nonnull)dataTask willCacheResponse:(NSCachedURLResponse * _Nonnull)proposedResponse completionHandler:(void (^ _Nonnull)(NSCachedURLResponse * _Nullable))completionHandler; @end +@class NSURLSessionStreamTask; +@class NSOutputStream; +SWIFT_AVAILABILITY(tvos,introduced=9.0) SWIFT_AVAILABILITY(macos,introduced=10.11) SWIFT_AVAILABILITY(ios,introduced=9.0) @interface SessionDelegate (SWIFT_EXTENSION(Alamofire)) /// Tells the delegate that the read side of the connection has been closed. /// \param session The session. @@ -509,19 +462,11 @@ SWIFT_CLASS("_TtC9Alamofire15SessionDelegate") -@interface NSURLSession (SWIFT_EXTENSION(Alamofire)) -@end -@class NSURLSessionUploadTask; SWIFT_CLASS("_TtC9Alamofire18UploadTaskDelegate") @interface UploadTaskDelegate : DataTaskDelegate -@property (nonatomic, readonly, strong) NSURLSessionUploadTask * _Nonnull uploadTask; -@property (nonatomic, strong) NSProgress * _Nonnull uploadProgress; -- (nonnull instancetype)initWithTask:(NSURLSessionTask * _Nullable)task OBJC_DESIGNATED_INITIALIZER; -- (void)reset; -@property (nonatomic, copy) void (^ _Nullable taskDidSendBodyData)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull, int64_t, int64_t, int64_t); -- (void)URLSession:(NSURLSession * _Nonnull)session task:(NSURLSessionTask * _Nonnull)task didSendBodyData:(int64_t)bytesSent totalBytesSent:(int64_t)totalBytesSent totalBytesExpectedToSend:(int64_t)totalBytesExpectedToSend; @end +SWIFT_MODULE_NAMESPACE_POP #pragma clang diagnostic pop diff --git a/Carthage/Build/tvOS/Alamofire.framework/Headers/Alamofire.h b/Carthage/Build/tvOS/Alamofire.framework/Headers/Alamofire.h index 8d45b77..4e651df 100644 --- a/Carthage/Build/tvOS/Alamofire.framework/Headers/Alamofire.h +++ b/Carthage/Build/tvOS/Alamofire.framework/Headers/Alamofire.h @@ -1,7 +1,7 @@ // // Alamofire.h // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Carthage/Build/tvOS/Alamofire.framework/Info.plist b/Carthage/Build/tvOS/Alamofire.framework/Info.plist index 90e5fee..3f880ff 100644 Binary files a/Carthage/Build/tvOS/Alamofire.framework/Info.plist and b/Carthage/Build/tvOS/Alamofire.framework/Info.plist differ diff --git a/Carthage/Build/tvOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm64.swiftdoc b/Carthage/Build/tvOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm64.swiftdoc index f47a5ed..24d8014 100644 Binary files a/Carthage/Build/tvOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm64.swiftdoc and b/Carthage/Build/tvOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm64.swiftdoc differ diff --git a/Carthage/Build/tvOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm64.swiftmodule b/Carthage/Build/tvOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm64.swiftmodule index 236e5fa..ce289b1 100644 Binary files a/Carthage/Build/tvOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm64.swiftmodule and b/Carthage/Build/tvOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm64.swiftmodule differ diff --git a/Carthage/Build/tvOS/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64.swiftdoc b/Carthage/Build/tvOS/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64.swiftdoc index e7d8d38..b8f02b3 100644 Binary files a/Carthage/Build/tvOS/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64.swiftdoc and b/Carthage/Build/tvOS/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64.swiftdoc differ diff --git a/Carthage/Build/tvOS/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64.swiftmodule b/Carthage/Build/tvOS/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64.swiftmodule index 3069f1f..254da1b 100644 Binary files a/Carthage/Build/tvOS/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64.swiftmodule and b/Carthage/Build/tvOS/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64.swiftmodule differ diff --git a/Carthage/Build/tvOS/Alamofire.framework/Modules/module.modulemap b/Carthage/Build/tvOS/Alamofire.framework/Modules/module.modulemap index 8096dcc..6148f67 100644 --- a/Carthage/Build/tvOS/Alamofire.framework/Modules/module.modulemap +++ b/Carthage/Build/tvOS/Alamofire.framework/Modules/module.modulemap @@ -7,4 +7,5 @@ framework module Alamofire { module Alamofire.Swift { header "Alamofire-Swift.h" + requires objc } diff --git a/Carthage/Build/watchOS/Alamofire.framework.dSYM/Contents/Info.plist b/Carthage/Build/watchOS/Alamofire.framework.dSYM/Contents/Info.plist index d9e4b98..7a61759 100644 --- a/Carthage/Build/watchOS/Alamofire.framework.dSYM/Contents/Info.plist +++ b/Carthage/Build/watchOS/Alamofire.framework.dSYM/Contents/Info.plist @@ -13,7 +13,7 @@ CFBundleSignature ???? CFBundleShortVersionString - 4.4.0 + 4.5.1 CFBundleVersion 1 diff --git a/Carthage/Build/watchOS/Alamofire.framework.dSYM/Contents/Resources/DWARF/Alamofire b/Carthage/Build/watchOS/Alamofire.framework.dSYM/Contents/Resources/DWARF/Alamofire index 3c63a27..dae8ee0 100644 Binary files a/Carthage/Build/watchOS/Alamofire.framework.dSYM/Contents/Resources/DWARF/Alamofire and b/Carthage/Build/watchOS/Alamofire.framework.dSYM/Contents/Resources/DWARF/Alamofire differ diff --git a/Carthage/Build/watchOS/Alamofire.framework/Alamofire b/Carthage/Build/watchOS/Alamofire.framework/Alamofire index ecd7e73..01d5a11 100755 Binary files a/Carthage/Build/watchOS/Alamofire.framework/Alamofire and b/Carthage/Build/watchOS/Alamofire.framework/Alamofire differ diff --git a/Carthage/Build/watchOS/Alamofire.framework/Headers/Alamofire-Swift.h b/Carthage/Build/watchOS/Alamofire.framework/Headers/Alamofire-Swift.h index 17a3028..2b1028d 100644 --- a/Carthage/Build/watchOS/Alamofire.framework/Headers/Alamofire-Swift.h +++ b/Carthage/Build/watchOS/Alamofire.framework/Headers/Alamofire-Swift.h @@ -1,7 +1,30 @@ -// Generated by Apple Swift version 3.1 (swiftlang-802.0.48 clang-802.0.38) +// Generated by Apple Swift version 4.0.2 effective-3.2.2 (swiftlang-900.0.69.2 clang-900.0.38) #pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgcc-compat" -#if defined(__has_include) && __has_include() +#if !defined(__has_include) +# define __has_include(x) 0 +#endif +#if !defined(__has_attribute) +# define __has_attribute(x) 0 +#endif +#if !defined(__has_feature) +# define __has_feature(x) 0 +#endif +#if !defined(__has_warning) +# define __has_warning(x) 0 +#endif + +#if __has_attribute(external_source_symbol) +# define SWIFT_STRINGIFY(str) #str +# define SWIFT_MODULE_NAMESPACE_PUSH(module_name) _Pragma(SWIFT_STRINGIFY(clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in=module_name, generated_declaration))), apply_to=any(function, enum, objc_interface, objc_category, objc_protocol)))) +# define SWIFT_MODULE_NAMESPACE_POP _Pragma("clang attribute pop") +#else +# define SWIFT_MODULE_NAMESPACE_PUSH(module_name) +# define SWIFT_MODULE_NAMESPACE_POP +#endif + +#if __has_include() # include #endif @@ -13,7 +36,7 @@ #if !defined(SWIFT_TYPEDEFS) # define SWIFT_TYPEDEFS 1 -# if defined(__has_include) && __has_include() +# if __has_include() # include # elif !defined(__cplusplus) || __cplusplus < 201103L typedef uint_least16_t char16_t; @@ -48,31 +71,36 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); # endif #endif -#if defined(__has_attribute) && __has_attribute(objc_runtime_name) +#if __has_attribute(objc_runtime_name) # define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) #else # define SWIFT_RUNTIME_NAME(X) #endif -#if defined(__has_attribute) && __has_attribute(swift_name) +#if __has_attribute(swift_name) # define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) #else # define SWIFT_COMPILE_NAME(X) #endif -#if defined(__has_attribute) && __has_attribute(objc_method_family) +#if __has_attribute(objc_method_family) # define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) #else # define SWIFT_METHOD_FAMILY(X) #endif -#if defined(__has_attribute) && __has_attribute(noescape) +#if __has_attribute(noescape) # define SWIFT_NOESCAPE __attribute__((noescape)) #else # define SWIFT_NOESCAPE #endif -#if defined(__has_attribute) && __has_attribute(warn_unused_result) +#if __has_attribute(warn_unused_result) # define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #else # define SWIFT_WARN_UNUSED_RESULT #endif +#if __has_attribute(noreturn) +# define SWIFT_NORETURN __attribute__((noreturn)) +#else +# define SWIFT_NORETURN +#endif #if !defined(SWIFT_CLASS_EXTRA) # define SWIFT_CLASS_EXTRA #endif @@ -83,7 +111,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); # define SWIFT_ENUM_EXTRA #endif #if !defined(SWIFT_CLASS) -# if defined(__has_attribute) && __has_attribute(objc_subclassing_restricted) +# if __has_attribute(objc_subclassing_restricted) # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA # define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA # else @@ -102,16 +130,23 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #endif #if !defined(OBJC_DESIGNATED_INITIALIZER) -# if defined(__has_attribute) && __has_attribute(objc_designated_initializer) +# if __has_attribute(objc_designated_initializer) # define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) # else # define OBJC_DESIGNATED_INITIALIZER # endif #endif +#if !defined(SWIFT_ENUM_ATTR) +# if defined(__has_attribute) && __has_attribute(enum_extensibility) +# define SWIFT_ENUM_ATTR __attribute__((enum_extensibility(open))) +# else +# define SWIFT_ENUM_ATTR +# endif +#endif #if !defined(SWIFT_ENUM) -# define SWIFT_ENUM(_type, _name) enum _name : _type _name; enum SWIFT_ENUM_EXTRA _name : _type -# if defined(__has_feature) && __has_feature(generalized_swift_name) -# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_EXTRA _name : _type +# define SWIFT_ENUM(_type, _name) enum _name : _type _name; enum SWIFT_ENUM_ATTR SWIFT_ENUM_EXTRA _name : _type +# if __has_feature(generalized_swift_name) +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR SWIFT_ENUM_EXTRA _name : _type # else # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) SWIFT_ENUM(_type, _name) # endif @@ -131,39 +166,36 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #if !defined(SWIFT_DEPRECATED_MSG) # define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) #endif -#if defined(__has_feature) && __has_feature(modules) +#if __has_feature(attribute_diagnose_if_objc) +# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) +#else +# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +#endif +#if __has_feature(modules) @import Foundation; @import ObjectiveC; #endif #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" #pragma clang diagnostic ignored "-Wduplicate-method-arg" -@class NSOperationQueue; -@class NSURLSessionTask; -@class NSURLCredential; +#if __has_warning("-Wpragma-clang-attribute") +# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#endif +#pragma clang diagnostic ignored "-Wunknown-pragmas" +#pragma clang diagnostic ignored "-Wnullability" + +SWIFT_MODULE_NAMESPACE_PUSH("Alamofire") @class NSURLSession; +@class NSURLSessionTask; @class NSHTTPURLResponse; -@class NSInputStream; @class NSURLAuthenticationChallenge; +@class NSURLCredential; +@class NSInputStream; /// The task delegate is responsible for handling all delegate callbacks for the underlying task as well as /// executing all operations attached to the serial operation queue upon task completion. SWIFT_CLASS("_TtC9Alamofire12TaskDelegate") @interface TaskDelegate : NSObject -/// The serial operation queue used to execute all operations after the task completes. -@property (nonatomic, readonly, strong) NSOperationQueue * _Nonnull queue; -/// The data returned by the server. -@property (nonatomic, readonly, copy) NSData * _Nullable data; -/// The error generated throughout the lifecyle of the task. -@property (nonatomic) NSError * _Nullable error; -@property (nonatomic, strong) NSURLSessionTask * _Nullable task; -@property (nonatomic, strong) NSURLCredential * _Nullable credential; -@property (nonatomic, strong) id _Nullable metrics; -- (nonnull instancetype)initWithTask:(NSURLSessionTask * _Nullable)task OBJC_DESIGNATED_INITIALIZER; -- (void)reset; -@property (nonatomic, copy) NSURLRequest * _Nullable (^ _Nullable taskWillPerformHTTPRedirection)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull, NSHTTPURLResponse * _Nonnull, NSURLRequest * _Nonnull); -@property (nonatomic, copy) NSInputStream * _Nullable (^ _Nullable taskNeedNewBodyStream)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull); -@property (nonatomic, copy) void (^ _Nullable taskDidCompleteWithError)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull, NSError * _Nullable); - (void)URLSession:(NSURLSession * _Nonnull)session task:(NSURLSessionTask * _Nonnull)task willPerformHTTPRedirection:(NSHTTPURLResponse * _Nonnull)response newRequest:(NSURLRequest * _Nonnull)request completionHandler:(void (^ _Nonnull)(NSURLRequest * _Nullable))completionHandler; - (void)URLSession:(NSURLSession * _Nonnull)session task:(NSURLSessionTask * _Nonnull)task didReceiveChallenge:(NSURLAuthenticationChallenge * _Nonnull)challenge completionHandler:(void (^ _Nonnull)(NSURLSessionAuthChallengeDisposition, NSURLCredential * _Nullable))completionHandler; - (void)URLSession:(NSURLSession * _Nonnull)session task:(NSURLSessionTask * _Nonnull)task needNewBodyStream:(void (^ _Nonnull)(NSInputStream * _Nullable))completionHandler; @@ -172,23 +204,12 @@ SWIFT_CLASS("_TtC9Alamofire12TaskDelegate") @end @class NSURLSessionDataTask; -@class NSProgress; @class NSURLResponse; @class NSURLSessionDownloadTask; @class NSCachedURLResponse; SWIFT_CLASS("_TtC9Alamofire16DataTaskDelegate") @interface DataTaskDelegate : TaskDelegate -@property (nonatomic, readonly, strong) NSURLSessionDataTask * _Nonnull dataTask; -@property (nonatomic, readonly, copy) NSData * _Nullable data; -@property (nonatomic, strong) NSProgress * _Nonnull progress; -@property (nonatomic, copy) void (^ _Nullable dataStream)(NSData * _Nonnull); -- (nonnull instancetype)initWithTask:(NSURLSessionTask * _Nullable)task OBJC_DESIGNATED_INITIALIZER; -- (void)reset; -@property (nonatomic, copy) NSURLSessionResponseDisposition (^ _Nullable dataTaskDidReceiveResponse)(NSURLSession * _Nonnull, NSURLSessionDataTask * _Nonnull, NSURLResponse * _Nonnull); -@property (nonatomic, copy) void (^ _Nullable dataTaskDidBecomeDownloadTask)(NSURLSession * _Nonnull, NSURLSessionDataTask * _Nonnull, NSURLSessionDownloadTask * _Nonnull); -@property (nonatomic, copy) void (^ _Nullable dataTaskDidReceiveData)(NSURLSession * _Nonnull, NSURLSessionDataTask * _Nonnull, NSData * _Nonnull); -@property (nonatomic, copy) NSCachedURLResponse * _Nullable (^ _Nullable dataTaskWillCacheResponse)(NSURLSession * _Nonnull, NSURLSessionDataTask * _Nonnull, NSCachedURLResponse * _Nonnull); - (void)URLSession:(NSURLSession * _Nonnull)session dataTask:(NSURLSessionDataTask * _Nonnull)dataTask didReceiveResponse:(NSURLResponse * _Nonnull)response completionHandler:(void (^ _Nonnull)(NSURLSessionResponseDisposition))completionHandler; - (void)URLSession:(NSURLSession * _Nonnull)session dataTask:(NSURLSessionDataTask * _Nonnull)dataTask didBecomeDownloadTask:(NSURLSessionDownloadTask * _Nonnull)downloadTask; - (void)URLSession:(NSURLSession * _Nonnull)session dataTask:(NSURLSessionDataTask * _Nonnull)dataTask didReceiveData:(NSData * _Nonnull)data; @@ -198,74 +219,17 @@ SWIFT_CLASS("_TtC9Alamofire16DataTaskDelegate") SWIFT_CLASS("_TtC9Alamofire20DownloadTaskDelegate") @interface DownloadTaskDelegate : TaskDelegate -@property (nonatomic, readonly, strong) NSURLSessionDownloadTask * _Nonnull downloadTask; -@property (nonatomic, strong) NSProgress * _Nonnull progress; -@property (nonatomic, copy) NSData * _Nullable resumeData; -@property (nonatomic, readonly, copy) NSData * _Nullable data; -@property (nonatomic, copy) NSURL * _Nullable temporaryURL; -@property (nonatomic, copy) NSURL * _Nullable destinationURL; -@property (nonatomic, readonly, copy) NSURL * _Nullable fileURL; -- (nonnull instancetype)initWithTask:(NSURLSessionTask * _Nullable)task OBJC_DESIGNATED_INITIALIZER; -- (void)reset; -@property (nonatomic, copy) NSURL * _Nonnull (^ _Nullable downloadTaskDidFinishDownloadingToURL)(NSURLSession * _Nonnull, NSURLSessionDownloadTask * _Nonnull, NSURL * _Nonnull); -@property (nonatomic, copy) void (^ _Nullable downloadTaskDidWriteData)(NSURLSession * _Nonnull, NSURLSessionDownloadTask * _Nonnull, int64_t, int64_t, int64_t); -@property (nonatomic, copy) void (^ _Nullable downloadTaskDidResumeAtOffset)(NSURLSession * _Nonnull, NSURLSessionDownloadTask * _Nonnull, int64_t, int64_t); - (void)URLSession:(NSURLSession * _Nonnull)session downloadTask:(NSURLSessionDownloadTask * _Nonnull)downloadTask didFinishDownloadingToURL:(NSURL * _Nonnull)location; - (void)URLSession:(NSURLSession * _Nonnull)session downloadTask:(NSURLSessionDownloadTask * _Nonnull)downloadTask didWriteData:(int64_t)bytesWritten totalBytesWritten:(int64_t)totalBytesWritten totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite; - (void)URLSession:(NSURLSession * _Nonnull)session downloadTask:(NSURLSessionDownloadTask * _Nonnull)downloadTask didResumeAtOffset:(int64_t)fileOffset expectedTotalBytes:(int64_t)expectedTotalBytes; @end -@interface NSNumber (SWIFT_EXTENSION(Alamofire)) -@end /// Responsible for handling all delegate callbacks for the underlying session. SWIFT_CLASS("_TtC9Alamofire15SessionDelegate") @interface SessionDelegate : NSObject -/// Overrides default behavior for URLSessionDelegate method urlSession(_:didBecomeInvalidWithError:). -@property (nonatomic, copy) void (^ _Nullable sessionDidBecomeInvalidWithError)(NSURLSession * _Nonnull, NSError * _Nullable); -/// Overrides all behavior for URLSessionDelegate method urlSession(_:didReceive:completionHandler:) and requires the caller to call the completionHandler. -@property (nonatomic, copy) void (^ _Nullable sessionDidReceiveChallengeWithCompletion)(NSURLSession * _Nonnull, NSURLAuthenticationChallenge * _Nonnull, SWIFT_NOESCAPE void (^ _Nonnull)(NSURLSessionAuthChallengeDisposition, NSURLCredential * _Nullable)); -/// Overrides default behavior for URLSessionDelegate method urlSessionDidFinishEvents(forBackgroundURLSession:). -@property (nonatomic, copy) void (^ _Nullable sessionDidFinishEventsForBackgroundURLSession)(NSURLSession * _Nonnull); -/// Overrides default behavior for URLSessionTaskDelegate method urlSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:). -@property (nonatomic, copy) NSURLRequest * _Nullable (^ _Nullable taskWillPerformHTTPRedirection)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull, NSHTTPURLResponse * _Nonnull, NSURLRequest * _Nonnull); -/// Overrides all behavior for URLSessionTaskDelegate method urlSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:) and -/// requires the caller to call the completionHandler. -@property (nonatomic, copy) void (^ _Nullable taskWillPerformHTTPRedirectionWithCompletion)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull, NSHTTPURLResponse * _Nonnull, NSURLRequest * _Nonnull, SWIFT_NOESCAPE void (^ _Nonnull)(NSURLRequest * _Nullable)); -/// Overrides all behavior for URLSessionTaskDelegate method urlSession(_:task:didReceive:completionHandler:) and -/// requires the caller to call the completionHandler. -@property (nonatomic, copy) void (^ _Nullable taskDidReceiveChallengeWithCompletion)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull, NSURLAuthenticationChallenge * _Nonnull, SWIFT_NOESCAPE void (^ _Nonnull)(NSURLSessionAuthChallengeDisposition, NSURLCredential * _Nullable)); -/// Overrides default behavior for URLSessionTaskDelegate method urlSession(_:task:needNewBodyStream:). -@property (nonatomic, copy) NSInputStream * _Nullable (^ _Nullable taskNeedNewBodyStream)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull); -/// Overrides all behavior for URLSessionTaskDelegate method urlSession(_:task:needNewBodyStream:) and -/// requires the caller to call the completionHandler. -@property (nonatomic, copy) void (^ _Nullable taskNeedNewBodyStreamWithCompletion)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull, SWIFT_NOESCAPE void (^ _Nonnull)(NSInputStream * _Nullable)); -/// Overrides default behavior for URLSessionTaskDelegate method urlSession(_:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:). -@property (nonatomic, copy) void (^ _Nullable taskDidSendBodyData)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull, int64_t, int64_t, int64_t); -/// Overrides default behavior for URLSessionTaskDelegate method urlSession(_:task:didCompleteWithError:). -@property (nonatomic, copy) void (^ _Nullable taskDidComplete)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull, NSError * _Nullable); -/// Overrides default behavior for URLSessionDataDelegate method urlSession(_:dataTask:didReceive:completionHandler:). -@property (nonatomic, copy) NSURLSessionResponseDisposition (^ _Nullable dataTaskDidReceiveResponse)(NSURLSession * _Nonnull, NSURLSessionDataTask * _Nonnull, NSURLResponse * _Nonnull); -/// Overrides all behavior for URLSessionDataDelegate method urlSession(_:dataTask:didReceive:completionHandler:) and -/// requires caller to call the completionHandler. -@property (nonatomic, copy) void (^ _Nullable dataTaskDidReceiveResponseWithCompletion)(NSURLSession * _Nonnull, NSURLSessionDataTask * _Nonnull, NSURLResponse * _Nonnull, SWIFT_NOESCAPE void (^ _Nonnull)(NSURLSessionResponseDisposition)); -/// Overrides default behavior for URLSessionDataDelegate method urlSession(_:dataTask:didBecome:). -@property (nonatomic, copy) void (^ _Nullable dataTaskDidBecomeDownloadTask)(NSURLSession * _Nonnull, NSURLSessionDataTask * _Nonnull, NSURLSessionDownloadTask * _Nonnull); -/// Overrides default behavior for URLSessionDataDelegate method urlSession(_:dataTask:didReceive:). -@property (nonatomic, copy) void (^ _Nullable dataTaskDidReceiveData)(NSURLSession * _Nonnull, NSURLSessionDataTask * _Nonnull, NSData * _Nonnull); -/// Overrides default behavior for URLSessionDataDelegate method urlSession(_:dataTask:willCacheResponse:completionHandler:). -@property (nonatomic, copy) NSCachedURLResponse * _Nullable (^ _Nullable dataTaskWillCacheResponse)(NSURLSession * _Nonnull, NSURLSessionDataTask * _Nonnull, NSCachedURLResponse * _Nonnull); -/// Overrides all behavior for URLSessionDataDelegate method urlSession(_:dataTask:willCacheResponse:completionHandler:) and -/// requires caller to call the completionHandler. -@property (nonatomic, copy) void (^ _Nullable dataTaskWillCacheResponseWithCompletion)(NSURLSession * _Nonnull, NSURLSessionDataTask * _Nonnull, NSCachedURLResponse * _Nonnull, SWIFT_NOESCAPE void (^ _Nonnull)(NSCachedURLResponse * _Nullable)); -/// Overrides default behavior for URLSessionDownloadDelegate method urlSession(_:downloadTask:didFinishDownloadingTo:). -@property (nonatomic, copy) void (^ _Nullable downloadTaskDidFinishDownloadingToURL)(NSURLSession * _Nonnull, NSURLSessionDownloadTask * _Nonnull, NSURL * _Nonnull); -/// Overrides default behavior for URLSessionDownloadDelegate method urlSession(_:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:). -@property (nonatomic, copy) void (^ _Nullable downloadTaskDidWriteData)(NSURLSession * _Nonnull, NSURLSessionDownloadTask * _Nonnull, int64_t, int64_t, int64_t); -/// Overrides default behavior for URLSessionDownloadDelegate method urlSession(_:downloadTask:didResumeAtOffset:expectedTotalBytes:). -@property (nonatomic, copy) void (^ _Nullable downloadTaskDidResumeAtOffset)(NSURLSession * _Nonnull, NSURLSessionDownloadTask * _Nonnull, int64_t, int64_t); /// Initializes the SessionDelegate instance. /// /// returns: @@ -325,30 +289,6 @@ SWIFT_CLASS("_TtC9Alamofire15SessionDelegate") @end -@interface SessionDelegate (SWIFT_EXTENSION(Alamofire)) -/// Tells the delegate that the session has been invalidated. -/// \param session The session object that was invalidated. -/// -/// \param error The error that caused invalidation, or nil if the invalidation was explicit. -/// -- (void)URLSession:(NSURLSession * _Nonnull)session didBecomeInvalidWithError:(NSError * _Nullable)error; -/// Requests credentials from the delegate in response to a session-level authentication request from the -/// remote server. -/// \param session The session containing the task that requested authentication. -/// -/// \param challenge An object that contains the request for authentication. -/// -/// \param completionHandler A handler that your delegate method must call providing the disposition -/// and credential. -/// -- (void)URLSession:(NSURLSession * _Nonnull)session didReceiveChallenge:(NSURLAuthenticationChallenge * _Nonnull)challenge completionHandler:(void (^ _Nonnull)(NSURLSessionAuthChallengeDisposition, NSURLCredential * _Nullable))completionHandler; -/// Tells the delegate that all messages enqueued for a session have been delivered. -/// \param session The session that no longer has any outstanding requests. -/// -- (void)URLSessionDidFinishEventsForBackgroundURLSession:(NSURLSession * _Nonnull)session; -@end - - @interface SessionDelegate (SWIFT_EXTENSION(Alamofire)) /// Tells the delegate that the data task received the initial reply (headers) from the server. /// \param session The session containing the data task that received an initial reply. @@ -396,6 +336,30 @@ SWIFT_CLASS("_TtC9Alamofire15SessionDelegate") @end +@interface SessionDelegate (SWIFT_EXTENSION(Alamofire)) +/// Tells the delegate that the session has been invalidated. +/// \param session The session object that was invalidated. +/// +/// \param error The error that caused invalidation, or nil if the invalidation was explicit. +/// +- (void)URLSession:(NSURLSession * _Nonnull)session didBecomeInvalidWithError:(NSError * _Nullable)error; +/// Requests credentials from the delegate in response to a session-level authentication request from the +/// remote server. +/// \param session The session containing the task that requested authentication. +/// +/// \param challenge An object that contains the request for authentication. +/// +/// \param completionHandler A handler that your delegate method must call providing the disposition +/// and credential. +/// +- (void)URLSession:(NSURLSession * _Nonnull)session didReceiveChallenge:(NSURLAuthenticationChallenge * _Nonnull)challenge completionHandler:(void (^ _Nonnull)(NSURLSessionAuthChallengeDisposition, NSURLCredential * _Nullable))completionHandler; +/// Tells the delegate that all messages enqueued for a session have been delivered. +/// \param session The session that no longer has any outstanding requests. +/// +- (void)URLSessionDidFinishEventsForBackgroundURLSession:(NSURLSession * _Nonnull)session; +@end + + @interface SessionDelegate (SWIFT_EXTENSION(Alamofire)) /// Tells the delegate that the remote server requested an HTTP redirect. /// \param session The session containing the task whose request resulted in a redirect. @@ -454,19 +418,11 @@ SWIFT_CLASS("_TtC9Alamofire15SessionDelegate") -@interface NSURLSession (SWIFT_EXTENSION(Alamofire)) -@end -@class NSURLSessionUploadTask; SWIFT_CLASS("_TtC9Alamofire18UploadTaskDelegate") @interface UploadTaskDelegate : DataTaskDelegate -@property (nonatomic, readonly, strong) NSURLSessionUploadTask * _Nonnull uploadTask; -@property (nonatomic, strong) NSProgress * _Nonnull uploadProgress; -- (nonnull instancetype)initWithTask:(NSURLSessionTask * _Nullable)task OBJC_DESIGNATED_INITIALIZER; -- (void)reset; -@property (nonatomic, copy) void (^ _Nullable taskDidSendBodyData)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull, int64_t, int64_t, int64_t); -- (void)URLSession:(NSURLSession * _Nonnull)session task:(NSURLSessionTask * _Nonnull)task didSendBodyData:(int64_t)bytesSent totalBytesSent:(int64_t)totalBytesSent totalBytesExpectedToSend:(int64_t)totalBytesExpectedToSend; @end +SWIFT_MODULE_NAMESPACE_POP #pragma clang diagnostic pop diff --git a/Carthage/Build/watchOS/Alamofire.framework/Headers/Alamofire.h b/Carthage/Build/watchOS/Alamofire.framework/Headers/Alamofire.h index 8d45b77..4e651df 100644 --- a/Carthage/Build/watchOS/Alamofire.framework/Headers/Alamofire.h +++ b/Carthage/Build/watchOS/Alamofire.framework/Headers/Alamofire.h @@ -1,7 +1,7 @@ // // Alamofire.h // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Carthage/Build/watchOS/Alamofire.framework/Info.plist b/Carthage/Build/watchOS/Alamofire.framework/Info.plist index 4180b18..6945850 100644 Binary files a/Carthage/Build/watchOS/Alamofire.framework/Info.plist and b/Carthage/Build/watchOS/Alamofire.framework/Info.plist differ diff --git a/Carthage/Build/watchOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm.swiftdoc b/Carthage/Build/watchOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm.swiftdoc index 3e49680..3506576 100644 Binary files a/Carthage/Build/watchOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm.swiftdoc and b/Carthage/Build/watchOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm.swiftdoc differ diff --git a/Carthage/Build/watchOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm.swiftmodule b/Carthage/Build/watchOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm.swiftmodule index 37656e0..362f9be 100644 Binary files a/Carthage/Build/watchOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm.swiftmodule and b/Carthage/Build/watchOS/Alamofire.framework/Modules/Alamofire.swiftmodule/arm.swiftmodule differ diff --git a/Carthage/Build/watchOS/Alamofire.framework/Modules/Alamofire.swiftmodule/i386.swiftdoc b/Carthage/Build/watchOS/Alamofire.framework/Modules/Alamofire.swiftmodule/i386.swiftdoc index e6b67fd..5881a2c 100644 Binary files a/Carthage/Build/watchOS/Alamofire.framework/Modules/Alamofire.swiftmodule/i386.swiftdoc and b/Carthage/Build/watchOS/Alamofire.framework/Modules/Alamofire.swiftmodule/i386.swiftdoc differ diff --git a/Carthage/Build/watchOS/Alamofire.framework/Modules/Alamofire.swiftmodule/i386.swiftmodule b/Carthage/Build/watchOS/Alamofire.framework/Modules/Alamofire.swiftmodule/i386.swiftmodule index e6be17f..f160a74 100644 Binary files a/Carthage/Build/watchOS/Alamofire.framework/Modules/Alamofire.swiftmodule/i386.swiftmodule and b/Carthage/Build/watchOS/Alamofire.framework/Modules/Alamofire.swiftmodule/i386.swiftmodule differ diff --git a/Carthage/Build/watchOS/Alamofire.framework/Modules/module.modulemap b/Carthage/Build/watchOS/Alamofire.framework/Modules/module.modulemap index 8096dcc..6148f67 100644 --- a/Carthage/Build/watchOS/Alamofire.framework/Modules/module.modulemap +++ b/Carthage/Build/watchOS/Alamofire.framework/Modules/module.modulemap @@ -7,4 +7,5 @@ framework module Alamofire { module Alamofire.Swift { header "Alamofire-Swift.h" + requires objc } diff --git a/Carthage/Checkouts/Alamofire/.swift-version b/Carthage/Checkouts/Alamofire/.swift-version index 9f55b2c..a3ec5a4 100644 --- a/Carthage/Checkouts/Alamofire/.swift-version +++ b/Carthage/Checkouts/Alamofire/.swift-version @@ -1 +1 @@ -3.0 +3.2 diff --git a/Carthage/Checkouts/Alamofire/.travis.yml b/Carthage/Checkouts/Alamofire/.travis.yml index a79a308..7e24fe2 100644 --- a/Carthage/Checkouts/Alamofire/.travis.yml +++ b/Carthage/Checkouts/Alamofire/.travis.yml @@ -1,5 +1,8 @@ language: objective-c -osx_image: xcode8 +osx_image: xcode8.3 +branches: + only: + - master env: global: - LC_CTYPE=en_US.UTF-8 @@ -9,23 +12,19 @@ env: - MACOS_FRAMEWORK_SCHEME="Alamofire macOS" - TVOS_FRAMEWORK_SCHEME="Alamofire tvOS" - WATCHOS_FRAMEWORK_SCHEME="Alamofire watchOS" - - IOS_SDK=iphonesimulator10.0 - - MACOS_SDK=macosx10.12 - - TVOS_SDK=appletvsimulator10.0 - - WATCHOS_SDK=watchsimulator3.0 - EXAMPLE_SCHEME="iOS Example" matrix: - - DESTINATION="OS=3.0,name=Apple Watch - 42mm" SCHEME="$WATCHOS_FRAMEWORK_SCHEME" SDK="$WATCHOS_SDK" RUN_TESTS="NO" BUILD_EXAMPLE="NO" POD_LINT="NO" - - DESTINATION="OS=2.0,name=Apple Watch - 42mm" SCHEME="$WATCHOS_FRAMEWORK_SCHEME" SDK="$WATCHOS_SDK" RUN_TESTS="NO" BUILD_EXAMPLE="NO" POD_LINT="NO" + - DESTINATION="OS=3.2,name=Apple Watch - 42mm" SCHEME="$WATCHOS_FRAMEWORK_SCHEME" RUN_TESTS="NO" BUILD_EXAMPLE="NO" POD_LINT="NO" + - DESTINATION="OS=2.0,name=Apple Watch - 42mm" SCHEME="$WATCHOS_FRAMEWORK_SCHEME" RUN_TESTS="NO" BUILD_EXAMPLE="NO" POD_LINT="NO" - - DESTINATION="OS=10.0,name=iPhone 7 Plus" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="YES" - - DESTINATION="OS=9.0,name=iPhone 6" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" - - DESTINATION="OS=8.1,name=iPhone 4S" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" + - DESTINATION="OS=10.3.1,name=iPhone 7 Plus" SCHEME="$IOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="YES" + - DESTINATION="OS=9.0,name=iPhone 6" SCHEME="$IOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" + - DESTINATION="OS=8.1,name=iPhone 4S" SCHEME="$IOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" - - DESTINATION="OS=10.0,name=Apple TV 1080p" SCHEME="$TVOS_FRAMEWORK_SCHEME" SDK="$TVOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO" - - DESTINATION="OS=9.0,name=Apple TV 1080p" SCHEME="$TVOS_FRAMEWORK_SCHEME" SDK="$TVOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO" + - DESTINATION="OS=10.2,name=Apple TV 1080p" SCHEME="$TVOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO" + - DESTINATION="OS=9.0,name=Apple TV 1080p" SCHEME="$TVOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO" - - DESTINATION="arch=x86_64" SCHEME="$MACOS_FRAMEWORK_SCHEME" SDK="$MACOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO" + - DESTINATION="arch=x86_64" SCHEME="$MACOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO" before_install: - gem install cocoapods --pre --no-rdoc --no-ri --no-document --quiet script: @@ -35,21 +34,21 @@ script: # Build Framework in Debug and Run Tests if specified - if [ $RUN_TESTS == "YES" ]; then - xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO ENABLE_TESTABILITY=YES test | xcpretty; + xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO ENABLE_TESTABILITY=YES test | xcpretty; else - xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty; + xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty; fi # Build Framework in Release and Run Tests if specified - if [ $RUN_TESTS == "YES" ]; then - xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Release ONLY_ACTIVE_ARCH=NO ENABLE_TESTABILITY=YES test | xcpretty; + xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -destination "$DESTINATION" -configuration Release ONLY_ACTIVE_ARCH=NO ENABLE_TESTABILITY=YES test | xcpretty; else - xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Release ONLY_ACTIVE_ARCH=NO build | xcpretty; + xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -destination "$DESTINATION" -configuration Release ONLY_ACTIVE_ARCH=NO build | xcpretty; fi # Build Example in Debug if specified - if [ $BUILD_EXAMPLE == "YES" ]; then - xcodebuild -workspace "$WORKSPACE" -scheme "$EXAMPLE_SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty; + xcodebuild -workspace "$WORKSPACE" -scheme "$EXAMPLE_SCHEME" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty; fi # Run `pod lib lint` if specified diff --git a/Carthage/Checkouts/Alamofire/Alamofire.podspec b/Carthage/Checkouts/Alamofire/Alamofire.podspec index 7efae67..b5a16a8 100644 --- a/Carthage/Checkouts/Alamofire/Alamofire.podspec +++ b/Carthage/Checkouts/Alamofire/Alamofire.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'Alamofire' - s.version = '4.4.0' + s.version = '4.5.1' s.license = 'MIT' s.summary = 'Elegant HTTP Networking in Swift' s.homepage = 'https://github.com/Alamofire/Alamofire' diff --git a/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/project.pbxproj b/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/project.pbxproj index 864d82f..b028837 100644 --- a/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/project.pbxproj +++ b/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/project.pbxproj @@ -57,8 +57,6 @@ 4C43669C1D7BB93D00C38AAD /* DispatchQueue+Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C43669A1D7BB93D00C38AAD /* DispatchQueue+Alamofire.swift */; }; 4C43669D1D7BB93D00C38AAD /* DispatchQueue+Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C43669A1D7BB93D00C38AAD /* DispatchQueue+Alamofire.swift */; }; 4C43669E1D7BB93D00C38AAD /* DispatchQueue+Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C43669A1D7BB93D00C38AAD /* DispatchQueue+Alamofire.swift */; }; - 4C4CBE7B1BAF700C0024D659 /* String+AlamofireTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C4CBE7A1BAF700C0024D659 /* String+AlamofireTests.swift */; }; - 4C4CBE7C1BAF700C0024D659 /* String+AlamofireTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C4CBE7A1BAF700C0024D659 /* String+AlamofireTests.swift */; }; 4C574E6A1C67D207000B3128 /* Timeline.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C574E691C67D207000B3128 /* Timeline.swift */; }; 4C574E6B1C67D207000B3128 /* Timeline.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C574E691C67D207000B3128 /* Timeline.swift */; }; 4C574E6C1C67D207000B3128 /* Timeline.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C574E691C67D207000B3128 /* Timeline.swift */; }; @@ -121,7 +119,6 @@ 4C743D331C22772F00BCB23E /* valid-dns-name.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C521B535F540017E0BF /* valid-dns-name.cer */; }; 4C743D341C22772F00BCB23E /* valid-uri.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C531B535F540017E0BF /* valid-uri.cer */; }; 4C80F9F81BB730EF001B46D2 /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0B62501BB1001C009302D3 /* Response.swift */; }; - 4C80F9F91BB730F6001B46D2 /* String+AlamofireTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C4CBE7A1BAF700C0024D659 /* String+AlamofireTests.swift */; }; 4C811F8D1B51856D00E0F59A /* ServerTrustPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C811F8C1B51856D00E0F59A /* ServerTrustPolicy.swift */; }; 4C811F8E1B51856D00E0F59A /* ServerTrustPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C811F8C1B51856D00E0F59A /* ServerTrustPolicy.swift */; }; 4C9DCE781CB1BCE2003E6463 /* SessionDelegateTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C9DCE771CB1BCE2003E6463 /* SessionDelegateTests.swift */; }; @@ -288,6 +285,8 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 316250E41F00ABE900E207A6 /* ISSUE_TEMPLATE.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = ISSUE_TEMPLATE.md; sourceTree = ""; }; + 316250E51F00ACD000E207A6 /* PULL_REQUEST_TEMPLATE.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = PULL_REQUEST_TEMPLATE.md; sourceTree = ""; }; 31ED52E61D73889D00199085 /* AFError+AlamofireTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "AFError+AlamofireTests.swift"; sourceTree = ""; }; 4C0B58381B747A4400C0B99C /* ResponseSerializationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ResponseSerializationTests.swift; sourceTree = ""; }; 4C0B62501BB1001C009302D3 /* Response.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Response.swift; sourceTree = ""; }; @@ -304,7 +303,6 @@ 4C3D00531C66A63000D1F709 /* NetworkReachabilityManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworkReachabilityManager.swift; sourceTree = ""; }; 4C3D00571C66A8B900D1F709 /* NetworkReachabilityManagerTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworkReachabilityManagerTests.swift; sourceTree = ""; }; 4C43669A1D7BB93D00C38AAD /* DispatchQueue+Alamofire.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "DispatchQueue+Alamofire.swift"; sourceTree = ""; }; - 4C4CBE7A1BAF700C0024D659 /* String+AlamofireTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+AlamofireTests.swift"; sourceTree = ""; }; 4C574E691C67D207000B3128 /* Timeline.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Timeline.swift; sourceTree = ""; }; 4C811F8C1B51856D00E0F59A /* ServerTrustPolicy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ServerTrustPolicy.swift; sourceTree = ""; }; 4C812C3A1B535F220017E0BF /* alamofire-root-ca.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = "alamofire-root-ca.cer"; path = "alamofire.org/alamofire-root-ca.cer"; sourceTree = ""; }; @@ -320,6 +318,9 @@ 4C812C521B535F540017E0BF /* valid-dns-name.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = "valid-dns-name.cer"; path = "alamofire.org/valid-dns-name.cer"; sourceTree = ""; }; 4C812C531B535F540017E0BF /* valid-uri.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = "valid-uri.cer"; path = "alamofire.org/valid-uri.cer"; sourceTree = ""; }; 4C9DCE771CB1BCE2003E6463 /* SessionDelegateTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SessionDelegateTests.swift; sourceTree = ""; }; + 4C9E88371F5FB3B0000BEC61 /* Alamofire 2.0 Migration Guide.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = "Alamofire 2.0 Migration Guide.md"; path = "Documentation/Alamofire 2.0 Migration Guide.md"; sourceTree = ""; }; + 4C9E88381F5FB3B0000BEC61 /* Alamofire 3.0 Migration Guide.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = "Alamofire 3.0 Migration Guide.md"; path = "Documentation/Alamofire 3.0 Migration Guide.md"; sourceTree = ""; }; + 4C9E88391F5FB3B0000BEC61 /* Alamofire 4.0 Migration Guide.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = "Alamofire 4.0 Migration Guide.md"; path = "Documentation/Alamofire 4.0 Migration Guide.md"; sourceTree = ""; }; 4CA028C41B7466C500C84163 /* ResultTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ResultTests.swift; sourceTree = ""; }; 4CB928281C66BFBC00CE5F08 /* Notifications.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Notifications.swift; sourceTree = ""; }; 4CCB20681D4549E000C64D5B /* expired.badssl.com-leaf.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = "expired.badssl.com-leaf.cer"; sourceTree = ""; }; @@ -332,6 +333,12 @@ 4CDE2C421AF89F0900BABAE5 /* Validation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Validation.swift; sourceTree = ""; }; 4CDE2C451AF89FF300BABAE5 /* ResponseSerialization.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ResponseSerialization.swift; sourceTree = ""; }; 4CE2724E1AF88FB500F1D59A /* ParameterEncoding.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ParameterEncoding.swift; sourceTree = ""; }; + 4CE292311EF4A393008DA555 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; + 4CE292321EF4A393008DA555 /* CHANGELOG.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = CHANGELOG.md; sourceTree = ""; }; + 4CE292331EF4A393008DA555 /* CONTRIBUTING.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = CONTRIBUTING.md; sourceTree = ""; }; + 4CE292391EF4B12B008DA555 /* Alamofire.podspec */ = {isa = PBXFileReference; lastKnownFileType = text; path = Alamofire.podspec; sourceTree = ""; }; + 4CE2923A1EF4B12B008DA555 /* Package.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = ""; }; + 4CF3B4281F5FC7900075BE59 /* LICENSE */ = {isa = PBXFileReference; lastKnownFileType = text; path = LICENSE; sourceTree = ""; }; 4CF626EF1BA7CB3E0011A099 /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 4CF626F81BA7CB3E0011A099 /* Alamofire tvOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Alamofire tvOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 4CFB028F1D7CF28F0056F249 /* FileManager+AlamofireTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "FileManager+AlamofireTests.swift"; sourceTree = ""; }; @@ -554,7 +561,6 @@ children = ( 31ED52E61D73889D00199085 /* AFError+AlamofireTests.swift */, 4CFB028F1D7CF28F0056F249 /* FileManager+AlamofireTests.swift */, - 4C4CBE7A1BAF700C0024D659 /* String+AlamofireTests.swift */, ); name = Extensions; sourceTree = ""; @@ -569,6 +575,16 @@ name = alamofire.org; sourceTree = ""; }; + 4C9E88361F5FB39F000BEC61 /* Migration Guides */ = { + isa = PBXGroup; + children = ( + 4C9E88371F5FB3B0000BEC61 /* Alamofire 2.0 Migration Guide.md */, + 4C9E88381F5FB3B0000BEC61 /* Alamofire 3.0 Migration Guide.md */, + 4C9E88391F5FB3B0000BEC61 /* Alamofire 4.0 Migration Guide.md */, + ); + name = "Migration Guides"; + sourceTree = ""; + }; 4CCB20671D4549E000C64D5B /* expired.badssl.com */ = { isa = PBXGroup; children = ( @@ -609,6 +625,29 @@ name = Features; sourceTree = ""; }; + 4CE292301EF4A386008DA555 /* Documentation */ = { + isa = PBXGroup; + children = ( + 4CE292321EF4A393008DA555 /* CHANGELOG.md */, + 4CE292331EF4A393008DA555 /* CONTRIBUTING.md */, + 316250E41F00ABE900E207A6 /* ISSUE_TEMPLATE.md */, + 316250E51F00ACD000E207A6 /* PULL_REQUEST_TEMPLATE.md */, + 4CE292311EF4A393008DA555 /* README.md */, + 4C9E88361F5FB39F000BEC61 /* Migration Guides */, + ); + name = Documentation; + sourceTree = ""; + }; + 4CE292381EF4B116008DA555 /* Deployment */ = { + isa = PBXGroup; + children = ( + 4CE292391EF4B12B008DA555 /* Alamofire.podspec */, + 4CF3B4281F5FC7900075BE59 /* LICENSE */, + 4CE2923A1EF4B12B008DA555 /* Package.swift */, + ); + name = Deployment; + sourceTree = ""; + }; 4CFB02E81D7D2FA20056F249 /* Responses */ = { isa = PBXGroup; children = ( @@ -667,6 +706,8 @@ F8111E2919A95C8B0040E7D1 = { isa = PBXGroup; children = ( + 4CE292381EF4B116008DA555 /* Deployment */, + 4CE292301EF4A386008DA555 /* Documentation */, F8111E3519A95C8B0040E7D1 /* Source */, F8111E3F19A95C8B0040E7D1 /* Tests */, F8111E3419A95C8B0040E7D1 /* Products */, @@ -905,7 +946,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0700; - LastUpgradeCheck = 0820; + LastUpgradeCheck = 0900; ORGANIZATIONNAME = Alamofire; TargetAttributes = { 4CCB207C1D45563900C64D5B = { @@ -913,31 +954,31 @@ }; 4CF626EE1BA7CB3E0011A099 = { CreatedOnToolsVersion = 7.1; - LastSwiftMigration = 0800; + LastSwiftMigration = 0900; }; 4CF626F71BA7CB3E0011A099 = { CreatedOnToolsVersion = 7.1; - LastSwiftMigration = 0800; + LastSwiftMigration = 0900; }; 4DD67C0A1A5C55C900ED2280 = { CreatedOnToolsVersion = 6.1.1; - LastSwiftMigration = 0800; + LastSwiftMigration = 0900; ProvisioningStyle = Manual; }; E4202FCD1B667AA100C997FB = { - LastSwiftMigration = 0800; + LastSwiftMigration = 0900; }; F8111E3219A95C8B0040E7D1 = { CreatedOnToolsVersion = 6.0; - LastSwiftMigration = 0800; + LastSwiftMigration = 0900; }; F8111E3D19A95C8B0040E7D1 = { CreatedOnToolsVersion = 6.0; - LastSwiftMigration = 0800; + LastSwiftMigration = 0900; }; F829C6B11A7A94F100A2CD59 = { CreatedOnToolsVersion = 6.1.1; - LastSwiftMigration = 0800; + LastSwiftMigration = 0900; }; }; }; @@ -1169,7 +1210,6 @@ 4CF627211BA7CC240011A099 /* TLSEvaluationTests.swift in Sources */, 4CF627221BA7CC240011A099 /* UploadTests.swift in Sources */, 4C9DCE7A1CB1BCE2003E6463 /* SessionDelegateTests.swift in Sources */, - 4C80F9F91BB730F6001B46D2 /* String+AlamofireTests.swift in Sources */, 4CF6271E1BA7CC240011A099 /* MultipartFormDataTests.swift in Sources */, 31ED52EA1D73891C00199085 /* AFError+AlamofireTests.swift in Sources */, 4CF627201BA7CC240011A099 /* ServerTrustPolicyTests.swift in Sources */, @@ -1269,7 +1309,6 @@ 4C33A1431B52089C00873DFF /* ServerTrustPolicyTests.swift in Sources */, 4C341BBA1B1A865A00C1B34D /* CacheTests.swift in Sources */, 4C9DCE781CB1BCE2003E6463 /* SessionDelegateTests.swift in Sources */, - 4C4CBE7B1BAF700C0024D659 /* String+AlamofireTests.swift in Sources */, 4CA028C51B7466C500C84163 /* ResultTests.swift in Sources */, 31ED52E81D73891B00199085 /* AFError+AlamofireTests.swift in Sources */, 4CCFA79A1B2BE71600B6F460 /* URLProtocolTests.swift in Sources */, @@ -1297,7 +1336,6 @@ 4C33A1441B52089C00873DFF /* ServerTrustPolicyTests.swift in Sources */, 4C341BBB1B1A865A00C1B34D /* CacheTests.swift in Sources */, 4C9DCE791CB1BCE2003E6463 /* SessionDelegateTests.swift in Sources */, - 4C4CBE7C1BAF700C0024D659 /* String+AlamofireTests.swift in Sources */, 4CA028C61B7466C500C84163 /* ResultTests.swift in Sources */, 31ED52E91D73891C00199085 /* AFError+AlamofireTests.swift in Sources */, 4CCFA79B1B2BE71600B6F460 /* URLProtocolTests.swift in Sources */, @@ -1355,8 +1393,6 @@ 4CF627001BA7CB3E0011A099 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - BITCODE_GENERATION_MODE = marker; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -1375,8 +1411,6 @@ 4CF627011BA7CB3E0011A099 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - BITCODE_GENERATION_MODE = bitcode; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -1396,7 +1430,6 @@ isa = XCBuildConfiguration; buildSettings = { APPLICATION_EXTENSION_API_ONLY = NO; - GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = Tests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.alamofire.Alamofire-tvOSTests"; @@ -1409,7 +1442,6 @@ isa = XCBuildConfiguration; buildSettings = { APPLICATION_EXTENSION_API_ONLY = NO; - GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = Tests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.alamofire.Alamofire-tvOSTests"; @@ -1421,19 +1453,12 @@ 4DD67C1F1A5C55C900ED2280 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - BITCODE_GENERATION_MODE = marker; CODE_SIGN_IDENTITY = ""; - COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; - DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_VERSION = A; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); INFOPLIST_FILE = Source/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; @@ -1447,11 +1472,8 @@ 4DD67C201A5C55C900ED2280 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - BITCODE_GENERATION_MODE = bitcode; CODE_SIGN_IDENTITY = ""; - COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; - DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; @@ -1469,17 +1491,13 @@ E4202FDE1B667AA100C997FB /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - BITCODE_GENERATION_MODE = marker; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = Source/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULE_NAME = ""; PRODUCT_BUNDLE_IDENTIFIER = org.alamofire.Alamofire; PRODUCT_NAME = Alamofire; SDKROOT = watchos; @@ -1491,17 +1509,13 @@ E4202FDF1B667AA100C997FB /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - BITCODE_GENERATION_MODE = bitcode; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = Source/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULE_NAME = ""; PRODUCT_BUNDLE_IDENTIFIER = org.alamofire.Alamofire; PRODUCT_NAME = Alamofire; SDKROOT = watchos; @@ -1519,14 +1533,22 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_UNDEFINED_BEHAVIOR_SANITIZER_INTEGER = YES; + CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -1557,6 +1579,7 @@ ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_SWIFT3_OBJC_INFERENCE = Off; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; TVOS_DEPLOYMENT_TARGET = 9.0; @@ -1575,14 +1598,22 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_UNDEFINED_BEHAVIOR_SANITIZER_INTEGER = YES; + CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -1605,6 +1636,7 @@ MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_SWIFT3_OBJC_INFERENCE = Off; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; TVOS_DEPLOYMENT_TARGET = 9.0; @@ -1618,8 +1650,6 @@ F8111E4719A95C8B0040E7D1 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - BITCODE_GENERATION_MODE = marker; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -1629,6 +1659,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = org.alamofire.Alamofire; PRODUCT_NAME = Alamofire; + SDKROOT = iphoneos; SKIP_INSTALL = YES; }; name = Debug; @@ -1636,8 +1667,6 @@ F8111E4819A95C8B0040E7D1 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - BITCODE_GENERATION_MODE = bitcode; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -1647,6 +1676,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = org.alamofire.Alamofire; PRODUCT_NAME = Alamofire; + SDKROOT = iphoneos; SKIP_INSTALL = YES; }; name = Release; @@ -1655,16 +1685,11 @@ isa = XCBuildConfiguration; buildSettings = { APPLICATION_EXTENSION_API_ONLY = NO; - DEVELOPMENT_TEAM = ""; - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); INFOPLIST_FILE = Tests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; }; name = Debug; }; @@ -1672,12 +1697,11 @@ isa = XCBuildConfiguration; buildSettings = { APPLICATION_EXTENSION_API_ONLY = NO; - DEVELOPMENT_TEAM = ""; - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = Tests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; }; name = Release; }; @@ -1686,15 +1710,6 @@ buildSettings = { APPLICATION_EXTENSION_API_ONLY = NO; CODE_SIGN_IDENTITY = ""; - COMBINE_HIDPI_IMAGES = YES; - FRAMEWORK_SEARCH_PATHS = ( - "$(DEVELOPER_FRAMEWORKS_DIR)", - "$(inherited)", - ); - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); INFOPLIST_FILE = Tests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; @@ -1708,11 +1723,6 @@ buildSettings = { APPLICATION_EXTENSION_API_ONLY = NO; CODE_SIGN_IDENTITY = ""; - COMBINE_HIDPI_IMAGES = YES; - FRAMEWORK_SEARCH_PATHS = ( - "$(DEVELOPER_FRAMEWORKS_DIR)", - "$(inherited)", - ); INFOPLIST_FILE = Tests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; diff --git a/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire iOS.xcscheme b/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire iOS.xcscheme index e19922d..ea18a45 100644 --- a/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire iOS.xcscheme +++ b/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire iOS.xcscheme @@ -1,6 +1,6 @@ @@ -36,6 +37,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/xcshareddata/xcschemes/Cleanup Whitespace.xcscheme b/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/xcshareddata/xcschemes/Cleanup Whitespace.xcscheme index 180a97e..a8115ad 100644 --- a/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/xcshareddata/xcschemes/Cleanup Whitespace.xcscheme +++ b/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/xcshareddata/xcschemes/Cleanup Whitespace.xcscheme @@ -1,6 +1,6 @@ @@ -36,6 +37,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/Carthage/Checkouts/Alamofire/CHANGELOG.md b/Carthage/Checkouts/Alamofire/CHANGELOG.md index ab0e866..cf703af 100644 --- a/Carthage/Checkouts/Alamofire/CHANGELOG.md +++ b/Carthage/Checkouts/Alamofire/CHANGELOG.md @@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file. `Alamofire` adheres to [Semantic Versioning](http://semver.org/). #### 4.x Releases +- `4.5.x` Releases - [4.5.0](#450) | [4.5.1](#451) - `4.4.x` Releases - [4.4.0](#440) - `4.3.x` Releases - [4.3.0](#430) - `4.2.x` Releases - [4.2.0](#420) @@ -31,6 +32,127 @@ All notable changes to this project will be documented in this file. --- +## [4.5.1](https://github.com/Alamofire/Alamofire/releases/tag/4.5.1) +Released on 2017-09-06. All issues associated with this milestone can be found using this +[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A4.5.1). + +#### Added +- GitHub templates for issues and pull requests. + - Added by [Jon Shier](https://github.com/jshier) in Pull Request + [#2179](https://github.com/Alamofire/Alamofire/pull/2179). +- Jazzy docs for the release to work with GitHub Pages. + - Added by [Aaron McTavish](https://github.com/aamctustwo) in Pull Request + [#2250](https://github.com/Alamofire/Alamofire/pull/2250). +- Dash support for Jazzy docs. + - Added by [Jon Shier](https://github.com/jshier). + +#### Updated +- The project to work with Xcode 9 beta 6 on Swift 3.2 and 4.0. + - Updated by [Jon Shier](https://github.com/jshier) in Pull Request + [#2198](https://github.com/Alamofire/Alamofire/pull/2198). +- The Travis CI config to work with Xcode 9 beta 6. + - Updated by [Jon Shier](https://github.com/jshier). +- The cURL representation logic to no longer force unwrap `URLCredential` values. + - Updated by [Andrey Chernoprudov](https://github.com/achernoprudov) in Pull Request + [#2184](https://github.com/Alamofire/Alamofire/pull/2184). +- The radars section of the README to split out open vs. resolved radars. + - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request + [#2263](https://github.com/Alamofire/Alamofire/pull/2263). +- The installation section of the README to use the current version. + - Updated by [Kim de Vos](https://github.com/kimdv) in Pull Request + [#2266](https://github.com/Alamofire/Alamofire/pull/2266). + +#### Fixed +- Issue in `TaskDelegate` where task access was not thread safe. + - Fixed by [Jon Shier](https://github.com/jshier) in Pull Request + [#2190](https://github.com/Alamofire/Alamofire/pull/2190). +- Issue in AF 4 migration guide where supported iOS versions was incorrect. + - Fixed by [Antoine Cœur](https://github.com/Coeur) in Pull Request + [#2212](https://github.com/Alamofire/Alamofire/pull/2212). +- Issue in README sample code where PNG representation API was incorrect. + - Fixed by [Andy Ron](https://github.com/andyRon) in Pull Request + [#2244](https://github.com/Alamofire/Alamofire/pull/2244). +- Swift 3.2+ API warnings for `substring` APIs. + - Fixed by [htinlinn](https://github.com/htinlinn) in Pull Request + [#2240](https://github.com/Alamofire/Alamofire/pull/2240). + +## [4.5.0](https://github.com/Alamofire/Alamofire/releases/tag/4.5.0) +Released on 2017-06-16. All issues associated with this milestone can be found using this +[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A4.5.0). + +#### Added +- Missing `@escaping` annotation for session delegate closures. + - Added by [Alexey Aleshkov](https://github.com/djmadcat) in Pull Request + [#1951](https://github.com/Alamofire/Alamofire/pull/1951). +- New `mapError`, `flatMapError`, `withValue`, `withError`, `ifSuccess`, and `ifFailure` APIs to `Result`. + - Added by [Jon Shier](https://github.com/jshier) in Pull Request + [#2135](https://github.com/Alamofire/Alamofire/pull/2135). + +#### Updated +- The Travis config file to Xcode 8.3. + - Updated by [Jon Shier](https://github.com/jshier) in Pull Request + [#2059](https://github.com/Alamofire/Alamofire/pull/2059). +- Response serialization implementation to use separate internal variable. + - Updated by [Eunju Amy Sohn](https://github.com/EJSohn) in Pull Request + [#2125](https://github.com/Alamofire/Alamofire/pull/2125). +- `SessionDelegate` internal implementation by removing redundant optional unwrap. + - Updated by [Boris Dušek](https://github.com/dusek) in Pull Request + [#2056](https://github.com/Alamofire/Alamofire/pull/2056). +- The `debugPrintable` implementation of `Request` to use `curl -v` instead of `curl -i` to be more verbose. + - Updated by [Simon Warta](https://github.com/webmaster128) in Pull Request + [#2070](https://github.com/Alamofire/Alamofire/pull/2070). +- The `MultipartFormData` contentType property to be mutable. + - Updated by [Eric Desa](https://github.com/ericdesa) in Pull Request + [#2072](https://github.com/Alamofire/Alamofire/pull/2072). +- Travis CI yaml file to enable watchOS 3.2 builds. + - Updated by [Jon Shier](https://github.com/jshier) in Pull Request + [#2135](https://github.com/Alamofire/Alamofire/pull/2135). +- Alamofire to build with Xcode 9 with Swift 3.2 and 4.0 in addition to Xcode 8.3 and Swift 3.1. + - Updated by [Jon Shier](https://github.com/jshier) in Pull Request + [#2163](https://github.com/Alamofire/Alamofire/pull/2163). + +#### Removed +- Custom string extension no longer needed in the test suite. + - Removed by [Nicholas Maccharoli](https://github.com/Nirma) in Pull Request + [#1994](https://github.com/Alamofire/Alamofire/pull/1994). + +#### Fixed +- Issue in the `URLProtocolTestCase` where HTTP header capitalization was wrong due to httpbin.org change. + - Fixed by [Natascha Fadeeva](https://github.com/Tanaschita) in Pull Request + [#2025](https://github.com/Alamofire/Alamofire/pull/2025). +- Issues and typos throughout the README documentation and sample code and source code docstrings. + - Fixed by + [Raphael R.](https://github.com/reitzig), + [helloyako](https://github.com/helloyako), + [DongHyuk Kim](https://github.com/sss989870), + [Bas Broek](https://github.com/BasThomas), + [Jorge Lucena](https://github.com/jorgifumi), + [MasahitoMizogaki](https://github.com/MMizogaki), + [José Manuel Sánchez](https://github.com/buscarini), + [SabinLee](https://github.com/SabinLee), + [Mat Trudel](https://github.com/mtrudel), + [Wolfgang Lutz](https://github.com/Lutzifer), and + [Christian Noon](https://github.com/cnoon) in Pull Requests + [#1995](https://github.com/Alamofire/Alamofire/pull/1995), + [#1997](https://github.com/Alamofire/Alamofire/pull/1997), + [#1998](https://github.com/Alamofire/Alamofire/pull/1998), + [#2022](https://github.com/Alamofire/Alamofire/pull/2022), + [#2031](https://github.com/Alamofire/Alamofire/pull/2031), + [#2035](https://github.com/Alamofire/Alamofire/pull/2035), + [#2080](https://github.com/Alamofire/Alamofire/pull/2080), + [#2081](https://github.com/Alamofire/Alamofire/pull/2081), + [#2092](https://github.com/Alamofire/Alamofire/pull/2092), + [#2095](https://github.com/Alamofire/Alamofire/pull/2095), + [#2104](https://github.com/Alamofire/Alamofire/pull/2104). +- Several warnings in the test suite related to Xcode 8.3. + - Fixed by [Jon Shier](https://github.com/jshier) in Pull Request + [#2057](https://github.com/Alamofire/Alamofire/pull/2057). +- Issue where reachability calculation incorrectly reported `.reachable` status with [`.connectionRequired`, `.isWWAN`] combination. + - Fixed by [Marco Santarossa](https://github.com/MarcoSantarossa) in Pull Request + [#2060](https://github.com/Alamofire/Alamofire/pull/2060). + +--- + ## [4.4.0](https://github.com/Alamofire/Alamofire/releases/tag/4.4.0) Released on 2017-02-26. All issues associated with this milestone can be found using this [filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A4.4.0). @@ -743,7 +865,7 @@ Released on 2016-03-23. All issues associated with this milestone can be found u [#1099](https://github.com/Alamofire/Alamofire/pull/1099). #### Updated -- The `User-Agent` header implementation to use more aggresive type-safety checks. +- The `User-Agent` header implementation to use more aggressive type-safety checks. - Updated by [Christian Noon](https://github.com/cnoon) in regards to Issue [#1100](https://github.com/Alamofire/Alamofire/issues/1100). - All shared response serializers to accept a custom queue for execution. diff --git a/Carthage/Checkouts/Alamofire/Documentation/Alamofire 4.0 Migration Guide.md b/Carthage/Checkouts/Alamofire/Documentation/Alamofire 4.0 Migration Guide.md index 6a175ec..2902dc6 100644 --- a/Carthage/Checkouts/Alamofire/Documentation/Alamofire 4.0 Migration Guide.md +++ b/Carthage/Checkouts/Alamofire/Documentation/Alamofire 4.0 Migration Guide.md @@ -28,7 +28,7 @@ This guide is provided in order to ease the transition of existing applications - Xcode 8.1+ - Swift 3.0+ -For those of you that would like to use Alamofire on iOS 8 or macOS 10.9, please use the latest tagged 3.x release which supports both Swift 2.2 and 2.3. +For those of you that would like to use Alamofire on macOS 10.9, please use the latest tagged 3.x release which supports both Swift 2.2 and 2.3. ## Benefits of Upgrading @@ -699,7 +699,7 @@ Alamofire.download(urlString).responseData { response in } ``` -> We'll cover the `DownloadResponse` type in more detail in the [Reponse Serializers](#response-serializers) section. +> We'll cover the `DownloadResponse` type in more detail in the [Response Serializers](#response-serializers) section. #### Download Options diff --git a/Carthage/Checkouts/Alamofire/Example/Source/AppDelegate.swift b/Carthage/Checkouts/Alamofire/Example/Source/AppDelegate.swift index 63b1744..3e8f12f 100644 --- a/Carthage/Checkouts/Alamofire/Example/Source/AppDelegate.swift +++ b/Carthage/Checkouts/Alamofire/Example/Source/AppDelegate.swift @@ -1,7 +1,7 @@ // // AppDelegate.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Carthage/Checkouts/Alamofire/Example/Source/DetailViewController.swift b/Carthage/Checkouts/Alamofire/Example/Source/DetailViewController.swift index 90f47be..342b244 100644 --- a/Carthage/Checkouts/Alamofire/Example/Source/DetailViewController.swift +++ b/Carthage/Checkouts/Alamofire/Example/Source/DetailViewController.swift @@ -1,7 +1,7 @@ // // DetailViewController.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Carthage/Checkouts/Alamofire/Example/Source/MasterViewController.swift b/Carthage/Checkouts/Alamofire/Example/Source/MasterViewController.swift index ae29480..1a134ff 100644 --- a/Carthage/Checkouts/Alamofire/Example/Source/MasterViewController.swift +++ b/Carthage/Checkouts/Alamofire/Example/Source/MasterViewController.swift @@ -1,7 +1,7 @@ // // MasterViewController.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Carthage/Checkouts/Alamofire/Example/iOS Example.xcodeproj/project.pbxproj b/Carthage/Checkouts/Alamofire/Example/iOS Example.xcodeproj/project.pbxproj index 9ca6f0e..3c1704b 100644 --- a/Carthage/Checkouts/Alamofire/Example/iOS Example.xcodeproj/project.pbxproj +++ b/Carthage/Checkouts/Alamofire/Example/iOS Example.xcodeproj/project.pbxproj @@ -163,8 +163,7 @@ 4C6D2C7F1C67EFE100846168 /* MasterViewController.swift */, F8111E0819A951050040E7D1 /* Supporting Files */, ); - name = Source; - path = Example; + path = Source; sourceTree = ""; }; F8111E0819A951050040E7D1 /* Supporting Files */ = { @@ -206,12 +205,12 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0720; - LastUpgradeCheck = 0800; + LastUpgradeCheck = 0900; ORGANIZATIONNAME = Alamofire; TargetAttributes = { F8111E0419A951050040E7D1 = { CreatedOnToolsVersion = 6.0; - LastSwiftMigration = 0800; + LastSwiftMigration = 0900; }; }; }; @@ -344,14 +343,20 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -375,12 +380,13 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; MACOSX_DEPLOYMENT_TARGET = 10.11; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_SWIFT3_OBJC_INFERENCE = Off; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; TVOS_DEPLOYMENT_TARGET = 9.0; @@ -396,14 +402,20 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -420,10 +432,12 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; MACOSX_DEPLOYMENT_TARGET = 10.11; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_SWIFT3_OBJC_INFERENCE = Off; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; TVOS_DEPLOYMENT_TARGET = 9.0; @@ -437,14 +451,10 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - CLANG_ENABLE_MODULES = YES; INFOPLIST_FILE = Resources/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.alamofire.iOS-Example"; PRODUCT_NAME = "iOS Example"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; }; name = Debug; }; @@ -453,14 +463,10 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - CLANG_ENABLE_MODULES = YES; INFOPLIST_FILE = Resources/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.alamofire.iOS-Example"; PRODUCT_NAME = "iOS Example"; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.0; }; name = Release; }; diff --git a/Carthage/Checkouts/Alamofire/Example/iOS Example.xcodeproj/xcshareddata/xcschemes/iOS Example.xcscheme b/Carthage/Checkouts/Alamofire/Example/iOS Example.xcodeproj/xcshareddata/xcschemes/iOS Example.xcscheme index e6e1593..a322c5a 100644 --- a/Carthage/Checkouts/Alamofire/Example/iOS Example.xcodeproj/xcshareddata/xcschemes/iOS Example.xcscheme +++ b/Carthage/Checkouts/Alamofire/Example/iOS Example.xcodeproj/xcshareddata/xcschemes/iOS Example.xcscheme @@ -1,6 +1,6 @@ CocoaPods 1.1.0+ is required to build Alamofire 4.0.0+. +> CocoaPods 1.1+ is required to build Alamofire 4.0+. To integrate Alamofire into your Xcode project using CocoaPods, specify it in your `Podfile`: @@ -94,7 +94,7 @@ platform :ios, '10.0' use_frameworks! target '' do - pod 'Alamofire', '~> 4.4' + pod 'Alamofire', '~> 4.5' end ``` @@ -118,7 +118,7 @@ $ brew install carthage To integrate Alamofire into your Xcode project using Carthage, specify it in your `Cartfile`: ```ogdl -github "Alamofire/Alamofire" ~> 4.4 +github "Alamofire/Alamofire" ~> 4.5 ``` Run `carthage update` to build the framework and drag the built `Alamofire.framework` into your Xcode project. @@ -137,21 +137,21 @@ dependencies: [ ### Manually -If you prefer not to use either of the aforementioned dependency managers, you can integrate Alamofire into your project manually. +If you prefer not to use any of the aforementioned dependency managers, you can integrate Alamofire into your project manually. #### Embedded Framework - Open up Terminal, `cd` into your top-level project directory, and run the following command "if" your project is not initialized as a git repository: ```bash -$ git init -``` + $ git init + ``` - Add Alamofire as a git [submodule](http://git-scm.com/docs/git-submodule) by running the following command: ```bash -$ git submodule add https://github.com/Alamofire/Alamofire.git -``` + $ git submodule add https://github.com/Alamofire/Alamofire.git + ``` - Open the new `Alamofire` folder, and drag the `Alamofire.xcodeproj` into the Project Navigator of your application's Xcode project. @@ -191,13 +191,16 @@ Handling the `Response` of a `Request` made in Alamofire involves chaining a res ```swift Alamofire.request("https://httpbin.org/get").responseJSON { response in - print(response.request) // original URL request - print(response.response) // HTTP URL response - print(response.data) // server data - print(response.result) // result of response serialization + print("Request: \(String(describing: response.request))") // original url request + print("Response: \(String(describing: response.response))") // http url response + print("Result: \(response.result)") // response serialization result + + if let json = response.result.value { + print("JSON: \(json)") // serialized json response + } - if let JSON = response.result.value { - print("JSON: \(JSON)") + if let data = response.data, let utf8Text = String(data: data, encoding: .utf8) { + print("Data: \(utf8Text)") // original server data as UTF8 string } } ``` @@ -243,7 +246,7 @@ func responsePropertyList( None of the response handlers perform any validation of the `HTTPURLResponse` it gets back from the server. -> For example, response status codes in the `400..<499` and `500..<599` ranges do NOT automatically trigger an `Error`. Alamofire uses [Response Validation](#response-validation) method chaining to achieve this. +> For example, response status codes in the `400..<500` and `500..<600` ranges do NOT automatically trigger an `Error`. Alamofire uses [Response Validation](#response-validation) method chaining to achieve this. #### Response Handler @@ -345,18 +348,18 @@ Alamofire.request("https://httpbin.org/get") .validate(statusCode: 200..<300) .validate(contentType: ["application/json"]) .responseData { response in - switch response.result { - case .success: - print("Validation Successful") - case .failure(let error): - print(error) - } + switch response.result { + case .success: + print("Validation Successful") + case .failure(let error): + print(error) + } } ``` #### Automatic Validation -Automatically validates status code within `200...299` range, and that the `Content-Type` header of the response matches the `Accept` header of the request, if one is provided. +Automatically validates status code within `200..<300` range, and that the `Content-Type` header of the response matches the `Accept` header of the request, if one is provided. ```swift Alamofire.request("https://httpbin.org/get").validate().responseJSON { response in @@ -491,7 +494,7 @@ struct JSONStringArrayEncoding: ParameterEncoding { } func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { - var urlRequest = urlRequest.urlRequest + var urlRequest = try urlRequest.asURLRequest() let data = try JSONSerialization.data(withJSONObject: array, options: []) @@ -612,9 +615,9 @@ Requests made in Alamofire that fetch data from a server can download the data i ```swift Alamofire.download("https://httpbin.org/image/png").responseData { response in - if let data = response.result.value { - let image = UIImage(data: data) - } + if let data = response.result.value { + let image = UIImage(data: data) + } } ``` @@ -629,8 +632,8 @@ You can also provide a `DownloadFileDestination` closure to move the file from t ```swift let destination: DownloadRequest.DownloadFileDestination = { _, _ in - let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] - let fileURL = documentsURL.appendPathComponent("pig.png") + let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] + let fileURL = documentsURL.appendingPathComponent("pig.png") return (fileURL, [.removePreviousFile, .createIntermediateDirectories]) } @@ -638,16 +641,16 @@ let destination: DownloadRequest.DownloadFileDestination = { _, _ in Alamofire.download(urlString, to: destination).response { response in print(response) - if response.error == nil, let imagePath = response.destinationURL?.path { - let image = UIImage(contentsOfFile: imagePath) - } + if response.error == nil, let imagePath = response.destinationURL?.path { + let image = UIImage(contentsOfFile: imagePath) + } } ``` You can also use the suggested download destination API. ```swift -let destination = DownloadRequest.suggestedDownloadDestination(directory: .documentDirectory) +let destination = DownloadRequest.suggestedDownloadDestination(for: .documentDirectory) Alamofire.download("https://httpbin.org/image/png", to: destination) ``` @@ -661,9 +664,9 @@ Alamofire.download("https://httpbin.org/image/png") print("Download Progress: \(progress.fractionCompleted)") } .responseData { response in - if let data = response.result.value { - let image = UIImage(data: data) - } + if let data = response.result.value { + let image = UIImage(data: data) + } } ``` @@ -677,9 +680,9 @@ Alamofire.download("https://httpbin.org/image/png") print("Download Progress: \(progress.fractionCompleted)") } .responseData { response in - if let data = response.result.value { - let image = UIImage(data: data) - } + if let data = response.result.value { + let image = UIImage(data: data) + } } ``` @@ -691,34 +694,34 @@ If a `DownloadRequest` is cancelled or interrupted, the underlying URL session m ```swift class ImageRequestor { - private var resumeData: Data? - private var image: UIImage? + private var resumeData: Data? + private var image: UIImage? func fetchImage(completion: (UIImage?) -> Void) { - guard image == nil else { completion(image) ; return } + guard image == nil else { completion(image) ; return } - let destination: DownloadRequest.DownloadFileDestination = { _, _ in - let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] - let fileURL = documentsURL.appendPathComponent("pig.png") + let destination: DownloadRequest.DownloadFileDestination = { _, _ in + let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] + let fileURL = documentsURL.appendingPathComponent("pig.png") - return (fileURL, [.removePreviousFile, .createIntermediateDirectories]) - } + return (fileURL, [.removePreviousFile, .createIntermediateDirectories]) + } - let request: DownloadRequest + let request: DownloadRequest if let resumeData = resumeData { - request = Alamofire.download(resumingWith: resumeData) - } else { - request = Alamofire.download("https://httpbin.org/image/png") + request = Alamofire.download(resumingWith: resumeData) + } else { + request = Alamofire.download("https://httpbin.org/image/png") } request.responseData { response in - switch response.result { - case .success(let data): - self.image = UIImage(data: data) - case .failure: - self.resumeData = response.resumeData - } + switch response.result { + case .success(let data): + self.image = UIImage(data: data) + case .failure: + self.resumeData = response.resumeData + } } } } @@ -733,7 +736,7 @@ When sending relatively small amounts of data to a server using JSON or URL enco #### Uploading Data ```swift -let imageData = UIPNGRepresentation(image)! +let imageData = UIImagePNGRepresentation(image)! Alamofire.upload(imageData, to: "https://httpbin.org/post").responseJSON { response in debugPrint(response) @@ -816,7 +819,7 @@ In iOS and tvOS 10 and macOS 10.12, Apple introduced the new [URLSessionTaskMetr ```swift Alamofire.request("https://httpbin.org/get").responseJSON { response in - print(response.metrics) + print(response.metrics) } ``` @@ -824,8 +827,8 @@ It's important to note that these APIs are only available on iOS and tvOS 10 and ```swift Alamofire.request("https://httpbin.org/get").responseJSON { response in - if #available(iOS 10.0. *) { - print(response.metrics) + if #available(iOS 10.0, *) { + print(response.metrics) } } ``` @@ -854,10 +857,10 @@ Outputs: ```bash $ curl -i \ - -H "User-Agent: Alamofire/4.0.0" \ - -H "Accept-Encoding: gzip;q=1.0, compress;q=0.5" \ - -H "Accept-Language: en;q=1.0,fr;q=0.9,de;q=0.8,zh-Hans;q=0.7,zh-Hant;q=0.6,ja;q=0.5" \ - "https://httpbin.org/get?foo=bar" + -H "User-Agent: Alamofire/4.0.0" \ + -H "Accept-Encoding: gzip;q=1.0, compress;q=0.5" \ + -H "Accept-Language: en;q=1.0,fr;q=0.9,de;q=0.8,zh-Hans;q=0.7,zh-Hant;q=0.6,ja;q=0.5" \ + "https://httpbin.org/get?foo=bar" ``` --- @@ -1183,20 +1186,20 @@ The `RequestAdapter` protocol allows each `Request` made on a `SessionManager` t ```swift class AccessTokenAdapter: RequestAdapter { - private let accessToken: String + private let accessToken: String - init(accessToken: String) { - self.accessToken = accessToken - } + init(accessToken: String) { + self.accessToken = accessToken + } - func adapt(_ urlRequest: URLRequest) throws -> URLRequest { - var urlRequest = urlRequest + func adapt(_ urlRequest: URLRequest) throws -> URLRequest { + var urlRequest = urlRequest if let urlString = urlRequest.url?.absoluteString, urlString.hasPrefix("https://httpbin.org") { - urlRequest.setValue("Bearer " + accessToken, forHTTPHeaderField: "Authorization") - } + urlRequest.setValue("Bearer " + accessToken, forHTTPHeaderField: "Authorization") + } - return urlRequest + return urlRequest } } ``` @@ -1414,7 +1417,7 @@ func loadUser(completionHandler: @escaping (DataResponse) -> Void) -> Alam } loadUser { response in - if let user = userResponse.value { + if let user = response.value { print("User: { username: \(user.username), name: \(user.name) }") } } @@ -1749,24 +1752,24 @@ If you run into this problem (high probability with self-signed certificates), y ```xml - NSAppTransportSecurity - - NSExceptionDomains - - example.com - - NSExceptionAllowsInsecureHTTPLoads - - NSExceptionRequiresForwardSecrecy - - NSIncludesSubdomains - - - NSTemporaryExceptionMinimumTLSVersion - TLSv1.2 - - - + NSAppTransportSecurity + + NSExceptionDomains + + example.com + + NSExceptionAllowsInsecureHTTPLoads + + NSExceptionRequiresForwardSecrecy + + NSIncludesSubdomains + + + NSTemporaryExceptionMinimumTLSVersion + TLSv1.2 + + + ``` @@ -1809,10 +1812,15 @@ There are some important things to remember when using network reachability to d The following radars have some effect on the current implementation of Alamofire. - [`rdar://21349340`](http://www.openradar.me/radar?id=5517037090635776) - Compiler throwing warning due to toll-free bridging issue in test case -- [`rdar://26761490`](http://www.openradar.me/radar?id=5010235949318144) - Swift string interpolation causing memory leak with common usage - `rdar://26870455` - Background URL Session Configurations do not work in the simulator - `rdar://26849668` - Some URLProtocol APIs do not properly handle `URLRequest` +## Resolved Radars + +The following radars have been resolved over time after being filed against the Alamofire project. + +- [`rdar://26761490`](http://www.openradar.me/radar?id=5010235949318144) - Swift string interpolation causing memory leak with common usage (Resolved on 9/1/17 in Xcode 9 beta 6). + ## FAQ ### What's the origin of the name Alamofire? @@ -1851,4 +1859,4 @@ The community adoption of the ASF libraries has been amazing. We are greatly hum ## License -Alamofire is released under the MIT license. See LICENSE for details. +Alamofire is released under the MIT license. [See LICENSE](https://github.com/Alamofire/Alamofire/blob/master/LICENSE) for details. diff --git a/Carthage/Checkouts/Alamofire/Source/AFError.swift b/Carthage/Checkouts/Alamofire/Source/AFError.swift index f047695..585ae14 100644 --- a/Carthage/Checkouts/Alamofire/Source/AFError.swift +++ b/Carthage/Checkouts/Alamofire/Source/AFError.swift @@ -1,7 +1,7 @@ // // AFError.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Carthage/Checkouts/Alamofire/Source/Alamofire.h b/Carthage/Checkouts/Alamofire/Source/Alamofire.h index 8d45b77..4e651df 100644 --- a/Carthage/Checkouts/Alamofire/Source/Alamofire.h +++ b/Carthage/Checkouts/Alamofire/Source/Alamofire.h @@ -1,7 +1,7 @@ // // Alamofire.h // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Carthage/Checkouts/Alamofire/Source/Alamofire.swift b/Carthage/Checkouts/Alamofire/Source/Alamofire.swift index 86d54d8..e971613 100644 --- a/Carthage/Checkouts/Alamofire/Source/Alamofire.swift +++ b/Carthage/Checkouts/Alamofire/Source/Alamofire.swift @@ -1,7 +1,7 @@ // // Alamofire.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -53,7 +53,7 @@ extension URL: URLConvertible { } extension URLComponents: URLConvertible { - /// Returns a URL if `url` is not nil, otherise throws an `Error`. + /// Returns a URL if `url` is not nil, otherwise throws an `Error`. /// /// - throws: An `AFError.invalidURL` if `url` is `nil`. /// diff --git a/Carthage/Checkouts/Alamofire/Source/DispatchQueue+Alamofire.swift b/Carthage/Checkouts/Alamofire/Source/DispatchQueue+Alamofire.swift index 78e214e..9031395 100644 --- a/Carthage/Checkouts/Alamofire/Source/DispatchQueue+Alamofire.swift +++ b/Carthage/Checkouts/Alamofire/Source/DispatchQueue+Alamofire.swift @@ -1,7 +1,7 @@ // // DispatchQueue+Alamofire.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Carthage/Checkouts/Alamofire/Source/Info-tvOS.plist b/Carthage/Checkouts/Alamofire/Source/Info-tvOS.plist index f2ae323..995b1b2 100644 --- a/Carthage/Checkouts/Alamofire/Source/Info-tvOS.plist +++ b/Carthage/Checkouts/Alamofire/Source/Info-tvOS.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 4.4.0 + 4.5.1 CFBundleSignature ???? CFBundleVersion diff --git a/Carthage/Checkouts/Alamofire/Source/Info.plist b/Carthage/Checkouts/Alamofire/Source/Info.plist index 45e086c..3050683 100644 --- a/Carthage/Checkouts/Alamofire/Source/Info.plist +++ b/Carthage/Checkouts/Alamofire/Source/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 4.4.0 + 4.5.1 CFBundleSignature ???? CFBundleVersion diff --git a/Carthage/Checkouts/Alamofire/Source/MultipartFormData.swift b/Carthage/Checkouts/Alamofire/Source/MultipartFormData.swift index 6d0d556..ba02d24 100644 --- a/Carthage/Checkouts/Alamofire/Source/MultipartFormData.swift +++ b/Carthage/Checkouts/Alamofire/Source/MultipartFormData.swift @@ -1,7 +1,7 @@ // // MultipartFormData.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -92,7 +92,7 @@ open class MultipartFormData { // MARK: - Properties /// The `Content-Type` header value containing the boundary used to generate the `multipart/form-data`. - open var contentType: String { return "multipart/form-data; boundary=\(boundary)" } + open lazy var contentType: String = "multipart/form-data; boundary=\(self.boundary)" /// The content length of all body parts used to generate the `multipart/form-data` not including the boundaries. public var contentLength: UInt64 { return bodyParts.reduce(0) { $0 + $1.bodyContentLength } } diff --git a/Carthage/Checkouts/Alamofire/Source/NetworkReachabilityManager.swift b/Carthage/Checkouts/Alamofire/Source/NetworkReachabilityManager.swift index 888818d..cdb5a02 100644 --- a/Carthage/Checkouts/Alamofire/Source/NetworkReachabilityManager.swift +++ b/Carthage/Checkouts/Alamofire/Source/NetworkReachabilityManager.swift @@ -1,7 +1,7 @@ // // NetworkReachabilityManager.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -182,21 +182,24 @@ public class NetworkReachabilityManager { // MARK: - Internal - Network Reachability Status func networkReachabilityStatusForFlags(_ flags: SCNetworkReachabilityFlags) -> NetworkReachabilityStatus { - guard flags.contains(.reachable) else { return .notReachable } + guard isNetworkReachable(with: flags) else { return .notReachable } - var networkStatus: NetworkReachabilityStatus = .notReachable + var networkStatus: NetworkReachabilityStatus = .reachable(.ethernetOrWiFi) - if !flags.contains(.connectionRequired) { networkStatus = .reachable(.ethernetOrWiFi) } + #if os(iOS) + if flags.contains(.isWWAN) { networkStatus = .reachable(.wwan) } + #endif - if flags.contains(.connectionOnDemand) || flags.contains(.connectionOnTraffic) { - if !flags.contains(.interventionRequired) { networkStatus = .reachable(.ethernetOrWiFi) } - } + return networkStatus + } - #if os(iOS) - if flags.contains(.isWWAN) { networkStatus = .reachable(.wwan) } - #endif + func isNetworkReachable(with flags: SCNetworkReachabilityFlags) -> Bool { + let isReachable = flags.contains(.reachable) + let needsConnection = flags.contains(.connectionRequired) + let canConnectAutomatically = flags.contains(.connectionOnDemand) || flags.contains(.connectionOnTraffic) + let canConnectWithoutUserInteraction = canConnectAutomatically && !flags.contains(.interventionRequired) - return networkStatus + return isReachable && (!needsConnection || canConnectWithoutUserInteraction) } } diff --git a/Carthage/Checkouts/Alamofire/Source/Notifications.swift b/Carthage/Checkouts/Alamofire/Source/Notifications.swift index 81f6e37..df41505 100644 --- a/Carthage/Checkouts/Alamofire/Source/Notifications.swift +++ b/Carthage/Checkouts/Alamofire/Source/Notifications.swift @@ -1,7 +1,7 @@ // // Notifications.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Carthage/Checkouts/Alamofire/Source/ParameterEncoding.swift b/Carthage/Checkouts/Alamofire/Source/ParameterEncoding.swift index 242f6a8..dabb562 100644 --- a/Carthage/Checkouts/Alamofire/Source/ParameterEncoding.swift +++ b/Carthage/Checkouts/Alamofire/Source/ParameterEncoding.swift @@ -1,7 +1,7 @@ // // ParameterEncoding.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -223,9 +223,9 @@ public struct URLEncoding: ParameterEncoding { let endIndex = string.index(index, offsetBy: batchSize, limitedBy: string.endIndex) ?? string.endIndex let range = startIndex.. String { - var components = ["$ curl -i"] + var components = ["$ curl -v"] guard let request = self.request, let url = request.url, @@ -293,11 +293,12 @@ extension Request: CustomDebugStringConvertible { if let credentials = credentialStorage.credentials(for: protectionSpace)?.values { for credential in credentials { - components.append("-u \(credential.user!):\(credential.password!)") + guard let user = credential.user, let password = credential.password else { continue } + components.append("-u \(user):\(password)") } } else { - if let credential = delegate.credential { - components.append("-u \(credential.user!):\(credential.password!)") + if let credential = delegate.credential, let user = credential.user, let password = credential.password { + components.append("-u \(user):\(password)") } } } @@ -308,7 +309,12 @@ extension Request: CustomDebugStringConvertible { let cookies = cookieStorage.cookies(for: url), !cookies.isEmpty { let string = cookies.reduce("") { $0 + "\($1.name)=\($1.value);" } + + #if swift(>=3.2) + components.append("-b \"\(string[..: DownloadResponseSerializerProto extension Request { var timeline: Timeline { + let requestStartTime = self.startTime ?? CFAbsoluteTimeGetCurrent() let requestCompletedTime = self.endTime ?? CFAbsoluteTimeGetCurrent() let initialResponseTime = self.delegate.initialResponseTime ?? requestCompletedTime return Timeline( - requestStartTime: self.startTime ?? CFAbsoluteTimeGetCurrent(), + requestStartTime: requestStartTime, initialResponseTime: initialResponseTime, requestCompletedTime: requestCompletedTime, serializationCompletedTime: CFAbsoluteTimeGetCurrent() diff --git a/Carthage/Checkouts/Alamofire/Source/Result.swift b/Carthage/Checkouts/Alamofire/Source/Result.swift index c13b1fc..bbd3c61 100644 --- a/Carthage/Checkouts/Alamofire/Source/Result.swift +++ b/Carthage/Checkouts/Alamofire/Source/Result.swift @@ -1,7 +1,7 @@ // // Result.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -162,7 +162,7 @@ extension Result { /// try print(noInt.unwrap()) /// // Throws error /// - /// - parameter transform: A closure that takes the success value of the result instance. + /// - parameter transform: A closure that takes the success value of the `Result` instance. /// /// - returns: A `Result` containing the result of the given closure. If this instance is a failure, returns the /// same failure. @@ -200,4 +200,101 @@ extension Result { return .failure(error) } } + + /// Evaluates the specified closure when the `Result` is a failure, passing the unwrapped error as a parameter. + /// + /// Use the `mapError` function with a closure that does not throw. For example: + /// + /// let possibleData: Result = .failure(someError) + /// let withMyError: Result = possibleData.mapError { MyError.error($0) } + /// + /// - Parameter transform: A closure that takes the error of the instance. + /// - Returns: A `Result` instance containing the result of the transform. If this instance is a success, returns + /// the same instance. + public func mapError(_ transform: (Error) -> T) -> Result { + switch self { + case .failure(let error): + return .failure(transform(error)) + case .success: + return self + } + } + + /// Evaluates the specified closure when the `Result` is a failure, passing the unwrapped error as a parameter. + /// + /// Use the `flatMapError` function with a closure that may throw an error. For example: + /// + /// let possibleData: Result = .success(Data(...)) + /// let possibleObject = possibleData.flatMapError { + /// try someFailableFunction(taking: $0) + /// } + /// + /// - Parameter transform: A throwing closure that takes the error of the instance. + /// + /// - Returns: A `Result` instance containing the result of the transform. If this instance is a success, returns + /// the same instance. + public func flatMapError(_ transform: (Error) throws -> T) -> Result { + switch self { + case .failure(let error): + do { + return try .failure(transform(error)) + } catch { + return .failure(error) + } + case .success: + return self + } + } + + /// Evaluates the specified closure when the `Result` is a success, passing the unwrapped value as a parameter. + /// + /// Use the `withValue` function to evaluate the passed closure without modifying the `Result` instance. + /// + /// - Parameter closure: A closure that takes the success value of this instance. + /// - Returns: This `Result` instance, unmodified. + @discardableResult + public func withValue(_ closure: (Value) -> Void) -> Result { + if case let .success(value) = self { closure(value) } + + return self + } + + /// Evaluates the specified closure when the `Result` is a failure, passing the unwrapped error as a parameter. + /// + /// Use the `withError` function to evaluate the passed closure without modifying the `Result` instance. + /// + /// - Parameter closure: A closure that takes the success value of this instance. + /// - Returns: This `Result` instance, unmodified. + @discardableResult + public func withError(_ closure: (Error) -> Void) -> Result { + if case let .failure(error) = self { closure(error) } + + return self + } + + /// Evaluates the specified closure when the `Result` is a success. + /// + /// Use the `ifSuccess` function to evaluate the passed closure without modifying the `Result` instance. + /// + /// - Parameter closure: A `Void` closure. + /// - Returns: This `Result` instance, unmodified. + @discardableResult + public func ifSuccess(_ closure: () -> Void) -> Result { + if isSuccess { closure() } + + return self + } + + /// Evaluates the specified closure when the `Result` is a failure. + /// + /// Use the `ifFailure` function to evaluate the passed closure without modifying the `Result` instance. + /// + /// - Parameter closure: A `Void` closure. + /// - Returns: This `Result` instance, unmodified. + @discardableResult + public func ifFailure(_ closure: () -> Void) -> Result { + if isFailure { closure() } + + return self + } } diff --git a/Carthage/Checkouts/Alamofire/Source/ServerTrustPolicy.swift b/Carthage/Checkouts/Alamofire/Source/ServerTrustPolicy.swift index 9c0e7c8..1ad3530 100644 --- a/Carthage/Checkouts/Alamofire/Source/ServerTrustPolicy.swift +++ b/Carthage/Checkouts/Alamofire/Source/ServerTrustPolicy.swift @@ -1,7 +1,7 @@ // // ServerTrustPolicy.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Carthage/Checkouts/Alamofire/Source/SessionDelegate.swift b/Carthage/Checkouts/Alamofire/Source/SessionDelegate.swift index 27ad881..d38c253 100644 --- a/Carthage/Checkouts/Alamofire/Source/SessionDelegate.swift +++ b/Carthage/Checkouts/Alamofire/Source/SessionDelegate.swift @@ -1,7 +1,7 @@ // // SessionDelegate.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -36,7 +36,7 @@ open class SessionDelegate: NSObject { open var sessionDidReceiveChallenge: ((URLSession, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? /// Overrides all behavior for URLSessionDelegate method `urlSession(_:didReceive:completionHandler:)` and requires the caller to call the `completionHandler`. - open var sessionDidReceiveChallengeWithCompletion: ((URLSession, URLAuthenticationChallenge, (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) -> Void)? + open var sessionDidReceiveChallengeWithCompletion: ((URLSession, URLAuthenticationChallenge, @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) -> Void)? /// Overrides default behavior for URLSessionDelegate method `urlSessionDidFinishEvents(forBackgroundURLSession:)`. open var sessionDidFinishEventsForBackgroundURLSession: ((URLSession) -> Void)? @@ -48,21 +48,21 @@ open class SessionDelegate: NSObject { /// Overrides all behavior for URLSessionTaskDelegate method `urlSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:)` and /// requires the caller to call the `completionHandler`. - open var taskWillPerformHTTPRedirectionWithCompletion: ((URLSession, URLSessionTask, HTTPURLResponse, URLRequest, (URLRequest?) -> Void) -> Void)? + open var taskWillPerformHTTPRedirectionWithCompletion: ((URLSession, URLSessionTask, HTTPURLResponse, URLRequest, @escaping (URLRequest?) -> Void) -> Void)? /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:didReceive:completionHandler:)`. open var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? /// Overrides all behavior for URLSessionTaskDelegate method `urlSession(_:task:didReceive:completionHandler:)` and /// requires the caller to call the `completionHandler`. - open var taskDidReceiveChallengeWithCompletion: ((URLSession, URLSessionTask, URLAuthenticationChallenge, (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) -> Void)? + open var taskDidReceiveChallengeWithCompletion: ((URLSession, URLSessionTask, URLAuthenticationChallenge, @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) -> Void)? /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:needNewBodyStream:)`. open var taskNeedNewBodyStream: ((URLSession, URLSessionTask) -> InputStream?)? /// Overrides all behavior for URLSessionTaskDelegate method `urlSession(_:task:needNewBodyStream:)` and /// requires the caller to call the `completionHandler`. - open var taskNeedNewBodyStreamWithCompletion: ((URLSession, URLSessionTask, (InputStream?) -> Void) -> Void)? + open var taskNeedNewBodyStreamWithCompletion: ((URLSession, URLSessionTask, @escaping (InputStream?) -> Void) -> Void)? /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:)`. open var taskDidSendBodyData: ((URLSession, URLSessionTask, Int64, Int64, Int64) -> Void)? @@ -77,7 +77,7 @@ open class SessionDelegate: NSObject { /// Overrides all behavior for URLSessionDataDelegate method `urlSession(_:dataTask:didReceive:completionHandler:)` and /// requires caller to call the `completionHandler`. - open var dataTaskDidReceiveResponseWithCompletion: ((URLSession, URLSessionDataTask, URLResponse, (URLSession.ResponseDisposition) -> Void) -> Void)? + open var dataTaskDidReceiveResponseWithCompletion: ((URLSession, URLSessionDataTask, URLResponse, @escaping (URLSession.ResponseDisposition) -> Void) -> Void)? /// Overrides default behavior for URLSessionDataDelegate method `urlSession(_:dataTask:didBecome:)`. open var dataTaskDidBecomeDownloadTask: ((URLSession, URLSessionDataTask, URLSessionDownloadTask) -> Void)? @@ -90,7 +90,7 @@ open class SessionDelegate: NSObject { /// Overrides all behavior for URLSessionDataDelegate method `urlSession(_:dataTask:willCacheResponse:completionHandler:)` and /// requires caller to call the `completionHandler`. - open var dataTaskWillCacheResponseWithCompletion: ((URLSession, URLSessionDataTask, CachedURLResponse, (CachedURLResponse?) -> Void) -> Void)? + open var dataTaskWillCacheResponseWithCompletion: ((URLSession, URLSessionDataTask, CachedURLResponse, @escaping (CachedURLResponse?) -> Void) -> Void)? // MARK: URLSessionDownloadDelegate Overrides @@ -462,8 +462,8 @@ extension SessionDelegate: URLSessionTaskDelegate { // Determine whether an error has occurred var error: Error? = error - if let taskDelegate = self[task]?.delegate, taskDelegate.error != nil { - error = taskDelegate.error + if request.delegate.error != nil { + error = request.delegate.error } /// If an error occurred and the retrier is set, asynchronously ask the retrier if the request diff --git a/Carthage/Checkouts/Alamofire/Source/SessionManager.swift b/Carthage/Checkouts/Alamofire/Source/SessionManager.swift index 450f750..9bd8b54 100644 --- a/Carthage/Checkouts/Alamofire/Source/SessionManager.swift +++ b/Carthage/Checkouts/Alamofire/Source/SessionManager.swift @@ -1,7 +1,7 @@ // // SessionManager.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Carthage/Checkouts/Alamofire/Source/TaskDelegate.swift b/Carthage/Checkouts/Alamofire/Source/TaskDelegate.swift index d4fd216..0607758 100644 --- a/Carthage/Checkouts/Alamofire/Source/TaskDelegate.swift +++ b/Carthage/Checkouts/Alamofire/Source/TaskDelegate.swift @@ -1,7 +1,7 @@ // // TaskDelegate.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -40,17 +40,30 @@ open class TaskDelegate: NSObject { public var error: Error? var task: URLSessionTask? { - didSet { reset() } + set { + taskLock.lock(); defer { taskLock.unlock() } + _task = newValue + } + get { + taskLock.lock(); defer { taskLock.unlock() } + return _task + } } var initialResponseTime: CFAbsoluteTime? var credential: URLCredential? var metrics: AnyObject? // URLSessionTaskMetrics + private var _task: URLSessionTask? { + didSet { reset() } + } + + private let taskLock = NSLock() + // MARK: Lifecycle init(task: URLSessionTask?) { - self.task = task + _task = task self.queue = { let operationQueue = OperationQueue() diff --git a/Carthage/Checkouts/Alamofire/Source/Timeline.swift b/Carthage/Checkouts/Alamofire/Source/Timeline.swift index 1440989..c5dabd1 100644 --- a/Carthage/Checkouts/Alamofire/Source/Timeline.swift +++ b/Carthage/Checkouts/Alamofire/Source/Timeline.swift @@ -1,7 +1,7 @@ // // Timeline.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Carthage/Checkouts/Alamofire/Source/Validation.swift b/Carthage/Checkouts/Alamofire/Source/Validation.swift index c405d02..989ac20 100644 --- a/Carthage/Checkouts/Alamofire/Source/Validation.swift +++ b/Carthage/Checkouts/Alamofire/Source/Validation.swift @@ -1,7 +1,7 @@ // // Validation.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -48,7 +48,13 @@ extension Request { init?(_ string: String) { let components: [String] = { let stripped = string.trimmingCharacters(in: .whitespacesAndNewlines) + + #if swift(>=3.2) + let split = stripped[..<(stripped.range(of: ";")?.lowerBound ?? stripped.endIndex)] + #else let split = stripped.substring(to: stripped.range(of: ";")?.lowerBound ?? stripped.endIndex) + #endif + return split.components(separatedBy: "/") }() diff --git a/Carthage/Checkouts/Alamofire/Tests/AFError+AlamofireTests.swift b/Carthage/Checkouts/Alamofire/Tests/AFError+AlamofireTests.swift index 11bcf28..c66a590 100644 --- a/Carthage/Checkouts/Alamofire/Tests/AFError+AlamofireTests.swift +++ b/Carthage/Checkouts/Alamofire/Tests/AFError+AlamofireTests.swift @@ -1,7 +1,7 @@ // // AFError+AlamofireTests.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Carthage/Checkouts/Alamofire/Tests/AuthenticationTests.swift b/Carthage/Checkouts/Alamofire/Tests/AuthenticationTests.swift index b04b94f..4c77d32 100644 --- a/Carthage/Checkouts/Alamofire/Tests/AuthenticationTests.swift +++ b/Carthage/Checkouts/Alamofire/Tests/AuthenticationTests.swift @@ -1,7 +1,7 @@ // // AuthenticationTests.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Carthage/Checkouts/Alamofire/Tests/BaseTestCase.swift b/Carthage/Checkouts/Alamofire/Tests/BaseTestCase.swift index c3ee100..17263aa 100644 --- a/Carthage/Checkouts/Alamofire/Tests/BaseTestCase.swift +++ b/Carthage/Checkouts/Alamofire/Tests/BaseTestCase.swift @@ -1,7 +1,7 @@ // // BaseTestCase.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Carthage/Checkouts/Alamofire/Tests/CacheTests.swift b/Carthage/Checkouts/Alamofire/Tests/CacheTests.swift index f9cbe1a..aacf2ed 100644 --- a/Carthage/Checkouts/Alamofire/Tests/CacheTests.swift +++ b/Carthage/Checkouts/Alamofire/Tests/CacheTests.swift @@ -1,7 +1,7 @@ // // CacheTests.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Carthage/Checkouts/Alamofire/Tests/DownloadTests.swift b/Carthage/Checkouts/Alamofire/Tests/DownloadTests.swift index 1d7cb36..b3cdc8d 100644 --- a/Carthage/Checkouts/Alamofire/Tests/DownloadTests.swift +++ b/Carthage/Checkouts/Alamofire/Tests/DownloadTests.swift @@ -1,7 +1,7 @@ // // DownloadTests.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Carthage/Checkouts/Alamofire/Tests/FileManager+AlamofireTests.swift b/Carthage/Checkouts/Alamofire/Tests/FileManager+AlamofireTests.swift index 18777c1..13f7c21 100644 --- a/Carthage/Checkouts/Alamofire/Tests/FileManager+AlamofireTests.swift +++ b/Carthage/Checkouts/Alamofire/Tests/FileManager+AlamofireTests.swift @@ -1,7 +1,7 @@ // // FileManager+AlamofireTests.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Carthage/Checkouts/Alamofire/Tests/MultipartFormDataTests.swift b/Carthage/Checkouts/Alamofire/Tests/MultipartFormDataTests.swift index 53c3067..cfe091c 100644 --- a/Carthage/Checkouts/Alamofire/Tests/MultipartFormDataTests.swift +++ b/Carthage/Checkouts/Alamofire/Tests/MultipartFormDataTests.swift @@ -1,7 +1,7 @@ // // MultipartFormDataTests.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -794,7 +794,7 @@ class MultipartFormDataWriteEncodedDataToDiskTestCase: BaseTestCase { class MultipartFormDataFailureTestCase: BaseTestCase { func testThatAppendingFileBodyPartWithInvalidLastPathComponentReturnsError() { // Given - let fileURL = NSURL(string: "") as! URL + let fileURL = NSURL(string: "")! as URL let multipartFormData = MultipartFormData() multipartFormData.append(fileURL, withName: "empty_data") diff --git a/Carthage/Checkouts/Alamofire/Tests/NetworkReachabilityManagerTests.swift b/Carthage/Checkouts/Alamofire/Tests/NetworkReachabilityManagerTests.swift index 013a583..3fc62da 100644 --- a/Carthage/Checkouts/Alamofire/Tests/NetworkReachabilityManagerTests.swift +++ b/Carthage/Checkouts/Alamofire/Tests/NetworkReachabilityManagerTests.swift @@ -1,7 +1,7 @@ // // NetworkReachabilityManagerTests.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -162,10 +162,22 @@ class NetworkReachabilityManagerTestCase: BaseTestCase { XCTAssertEqual(networkReachabilityStatus, .notReachable) } + func testThatManagerReturnsNotReachableStatusWhenConnectionIsRequired() { + // Given + let manager = NetworkReachabilityManager() + let flags: SCNetworkReachabilityFlags = [.reachable, .connectionRequired] + + // When + let networkReachabilityStatus = manager?.networkReachabilityStatusForFlags(flags) + + // Then + XCTAssertEqual(networkReachabilityStatus, .notReachable) + } + func testThatManagerReturnsNotReachableStatusWhenInterventionIsRequired() { // Given let manager = NetworkReachabilityManager() - let flags: SCNetworkReachabilityFlags = [.reachable, .connectionRequired, .connectionOnDemand, .interventionRequired] + let flags: SCNetworkReachabilityFlags = [.reachable, .connectionRequired, .interventionRequired] // When let networkReachabilityStatus = manager?.networkReachabilityStatusForFlags(flags) @@ -222,5 +234,17 @@ class NetworkReachabilityManagerTestCase: BaseTestCase { // Then XCTAssertEqual(networkReachabilityStatus, .reachable(.wwan)) } + + func testThatManagerReturnsNotReachableOnWWANStatusWhenIsWWANAndConnectionIsRequired() { + // Given + let manager = NetworkReachabilityManager() + let flags: SCNetworkReachabilityFlags = [.reachable, .isWWAN, .connectionRequired] + + // When + let networkReachabilityStatus = manager?.networkReachabilityStatusForFlags(flags) + + // Then + XCTAssertEqual(networkReachabilityStatus, .notReachable) + } #endif } diff --git a/Carthage/Checkouts/Alamofire/Tests/ParameterEncodingTests.swift b/Carthage/Checkouts/Alamofire/Tests/ParameterEncodingTests.swift index 34213bf..b15bae3 100644 --- a/Carthage/Checkouts/Alamofire/Tests/ParameterEncodingTests.swift +++ b/Carthage/Checkouts/Alamofire/Tests/ParameterEncodingTests.swift @@ -1,7 +1,7 @@ // // ParameterEncodingTests.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -506,7 +506,7 @@ class URLParameterEncodingTestCase: ParameterEncodingTestCase { // Given let repeatedCount = 2_000 let url = URL(string: "https://example.com/movies")! - let parameters = ["chinese": String(count: repeatedCount, repeatedString: "一二三四五六七八九十")] + let parameters = ["chinese": String(repeating: "一二三四五六七八九十", count: repeatedCount)] // When let urlRequest = try encoding.encode(URLRequest(url: url), with: parameters) diff --git a/Carthage/Checkouts/Alamofire/Tests/RequestTests.swift b/Carthage/Checkouts/Alamofire/Tests/RequestTests.swift index 51c9456..ce54936 100644 --- a/Carthage/Checkouts/Alamofire/Tests/RequestTests.swift +++ b/Carthage/Checkouts/Alamofire/Tests/RequestTests.swift @@ -1,7 +1,7 @@ // // RequestTests.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -382,7 +382,7 @@ class RequestResponseTestCase: BaseTestCase { // MARK: - extension Request { - fileprivate func preValidate(operation: @escaping (Void) -> Void) -> Self { + fileprivate func preValidate(operation: @escaping () -> Void) -> Self { delegate.queue.addOperation { operation() } @@ -390,7 +390,7 @@ extension Request { return self } - fileprivate func postValidate(operation: @escaping (Void) -> Void) -> Self { + fileprivate func postValidate(operation: @escaping () -> Void) -> Self { delegate.queue.addOperation { operation() } @@ -524,7 +524,7 @@ class RequestDebugDescriptionTestCase: BaseTestCase { let components = cURLCommandComponents(for: request) // Then - XCTAssertEqual(components[0..<3], ["$", "curl", "-i"]) + XCTAssertEqual(components[0..<3], ["$", "curl", "-v"]) XCTAssertFalse(components.contains("-X")) XCTAssertEqual(components.last, "\"\(urlString)\"") } @@ -539,7 +539,7 @@ class RequestDebugDescriptionTestCase: BaseTestCase { let components = cURLCommandComponents(for: request) // Then - XCTAssertEqual(components[0..<3], ["$", "curl", "-i"]) + XCTAssertEqual(components[0..<3], ["$", "curl", "-v"]) XCTAssertFalse(components.contains("-X")) XCTAssertEqual(components.last, "\"\(urlString)\"") @@ -558,7 +558,7 @@ class RequestDebugDescriptionTestCase: BaseTestCase { let components = cURLCommandComponents(for: request) // Then - XCTAssertEqual(components[0..<3], ["$", "curl", "-i"]) + XCTAssertEqual(components[0..<3], ["$", "curl", "-v"]) XCTAssertEqual(components[3..<5], ["-X", "POST"]) XCTAssertEqual(components.last, "\"\(urlString)\"") } @@ -578,7 +578,7 @@ class RequestDebugDescriptionTestCase: BaseTestCase { let components = cURLCommandComponents(for: request) // Then - XCTAssertEqual(components[0..<3], ["$", "curl", "-i"]) + XCTAssertEqual(components[0..<3], ["$", "curl", "-v"]) XCTAssertEqual(components[3..<5], ["-X", "POST"]) XCTAssertNotNil(request.debugDescription.range(of: "-H \"Content-Type: application/json\"")) @@ -609,7 +609,7 @@ class RequestDebugDescriptionTestCase: BaseTestCase { let components = cURLCommandComponents(for: request) // Then - XCTAssertEqual(components[0..<3], ["$", "curl", "-i"]) + XCTAssertEqual(components[0..<3], ["$", "curl", "-v"]) XCTAssertEqual(components[3..<5], ["-X", "POST"]) XCTAssertEqual(components.last, "\"\(urlString)\"") XCTAssertEqual(components[5..<6], ["-b"]) @@ -671,7 +671,7 @@ class RequestDebugDescriptionTestCase: BaseTestCase { debugPrint(request!) // Then - XCTAssertEqual(components[0..<3], ["$", "curl", "-i"]) + XCTAssertEqual(components[0..<3], ["$", "curl", "-v"]) XCTAssertTrue(components.contains("-X")) XCTAssertEqual(components.last, "\"\(urlString)\"") diff --git a/Carthage/Checkouts/Alamofire/Tests/ResponseSerializationTests.swift b/Carthage/Checkouts/Alamofire/Tests/ResponseSerializationTests.swift index 2cdc748..104b1c2 100644 --- a/Carthage/Checkouts/Alamofire/Tests/ResponseSerializationTests.swift +++ b/Carthage/Checkouts/Alamofire/Tests/ResponseSerializationTests.swift @@ -1,7 +1,7 @@ // // ResponseSerializationTests.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Carthage/Checkouts/Alamofire/Tests/ResponseTests.swift b/Carthage/Checkouts/Alamofire/Tests/ResponseTests.swift index 3a84837..86a5f1a 100644 --- a/Carthage/Checkouts/Alamofire/Tests/ResponseTests.swift +++ b/Carthage/Checkouts/Alamofire/Tests/ResponseTests.swift @@ -1,7 +1,7 @@ // // ResponseTests.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -272,13 +272,14 @@ class ResponseJSONTestCase: BaseTestCase { XCTAssertNotNil(response?.data) XCTAssertEqual(response?.result.isSuccess, true) - if #available(iOS 10.0, macOS 10.12, tvOS 10.0, *) { + if #available(iOS 10.0, macOS 10.12, tvOS 10.0, watchOS 3.0, *) { XCTAssertNotNil(response?.metrics) } - // The `as NSString` cast is necessary due to a compiler bug. See the following rdar for more info. - // - https://openradar.appspot.com/radar?id=5517037090635776 - if let args = (response?.result.value as AnyObject?)?["args" as NSString] as? [String: String] { + if + let responseDictionary = response?.result.value as? [String: Any], + let args = responseDictionary["args"] as? [String: String] + { XCTAssertEqual(args, ["foo": "bar"], "args should match parameters") } else { XCTFail("args should not be nil") @@ -311,9 +312,10 @@ class ResponseJSONTestCase: BaseTestCase { XCTAssertNotNil(response?.metrics) } - // The `as NSString` cast is necessary due to a compiler bug. See the following rdar for more info. - // - https://openradar.appspot.com/radar?id=5517037090635776 - if let form = (response?.result.value as AnyObject?)?["form" as NSString] as? [String: String] { + if + let responseDictionary = response?.result.value as? [String: Any], + let form = responseDictionary["form"] as? [String: String] + { XCTAssertEqual(form, ["foo": "bar"], "form should match parameters") } else { XCTFail("form should not be nil") diff --git a/Carthage/Checkouts/Alamofire/Tests/ResultTests.swift b/Carthage/Checkouts/Alamofire/Tests/ResultTests.swift index c8d2435..d43c5ba 100644 --- a/Carthage/Checkouts/Alamofire/Tests/ResultTests.swift +++ b/Carthage/Checkouts/Alamofire/Tests/ResultTests.swift @@ -1,7 +1,7 @@ // // ResultTests.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -152,8 +152,8 @@ class ResultTestCase: BaseTestCase { let value = "success value" // When - let result1 = Result(value: { value }) // syntax 1 - let result2 = Result { value } // syntax 2 + let result1 = Result(value: { value }) + let result2 = Result { value } // Then for result in [result1, result2] { @@ -167,8 +167,8 @@ class ResultTestCase: BaseTestCase { struct ResultError: Error {} // When - let result1 = Result(value: { throw ResultError() }) // syntax 1 - let result2 = Result { throw ResultError() } // syntax 2 + let result1 = Result(value: { throw ResultError() }) + let result2 = Result { throw ResultError() } // Then for result in [result1, result2] { @@ -180,11 +180,14 @@ class ResultTestCase: BaseTestCase { // MARK: - Unwrap Tests func testThatUnwrapReturnsSuccessValue() { - // Given, When + // Given let result = Result.success("success value") + // When + let unwrappedValue = try? result.unwrap() + // Then - XCTAssertEqual(try result.unwrap(), "success value") + XCTAssertEqual(unwrappedValue, "success value") } func testThatUnwrapThrowsFailureError() { @@ -246,7 +249,7 @@ class ResultTestCase: BaseTestCase { } func testThatFlatMapCatchesTransformationError() { - // Given, When + // Given struct TransformError: Error {} let result = Result.success("success value") @@ -262,7 +265,7 @@ class ResultTestCase: BaseTestCase { } func testThatFlatMapPreservesFailureError() { - // Given, When + // Given struct ResultError: Error {} struct TransformError: Error {} let result = Result.failure(ResultError()) @@ -277,4 +280,204 @@ class ResultTestCase: BaseTestCase { XCTFail("flatMap should preserve the failure error") } } + + // MARK: - Error Mapping Tests + + func testMapErrorTransformsErrorValue() { + // Given + struct ResultError: Error {} + struct OtherError: Error { let error: Error } + let result: Result = .failure(ResultError()) + + // When + let mappedResult = result.mapError { OtherError(error: $0) } + + // Then + if let error = mappedResult.error { + XCTAssertTrue(error is OtherError) + } else { + XCTFail("mapError should transform error value") + } + } + + func testMapErrorPreservesSuccessError() { + // Given + struct ResultError: Error {} + struct OtherError: Error { let error: Error } + let result: Result = .success("success") + + // When + let mappedResult = result.mapError { OtherError(error: $0) } + + // Then + XCTAssertEqual(mappedResult.value, "success") + } + + func testFlatMapErrorTransformsErrorValue() { + // Given + struct ResultError: Error {} + struct OtherError: Error { let error: Error } + let result: Result = .failure(ResultError()) + + // When + let mappedResult = result.flatMapError { OtherError(error: $0) } + + // Then + if let error = mappedResult.error { + XCTAssertTrue(error is OtherError) + } else { + XCTFail("mapError should transform error value") + } + } + + func testFlatMapErrorCapturesThrownError() { + // Given + struct ResultError: Error {} + struct OtherError: Error { + let error: Error + init(error: Error) throws { throw ThrownError() } + } + struct ThrownError: Error {} + let result: Result = .failure(ResultError()) + + // When + let mappedResult = result.flatMapError { try OtherError(error: $0) } + + // Then + if let error = mappedResult.error { + XCTAssertTrue(error is ThrownError) + } else { + XCTFail("mapError should capture thrown error value") + } + } + + // MARK: - With Value or Error Tests + + func testWithValueExecutesWhenSuccess() { + // Given + let result: Result = .success("success") + var string = "failure" + + // When + result.withValue { string = $0 } + + // Then + XCTAssertEqual(string, "success") + } + + func testWithValueDoesNotExecutesWhenFailure() { + // Given + struct ResultError: Error {} + let result: Result = .failure(ResultError()) + var string = "failure" + + // When + result.withValue { string = $0 } + + // Then + XCTAssertEqual(string, "failure") + } + + func testWithErrorExecutesWhenFailure() { + // Given + struct ResultError: Error {} + let result: Result = .failure(ResultError()) + var string = "success" + + // When + result.withError { string = "\(type(of: $0))" } + + // Then + #if swift(>=3.2) + XCTAssertEqual(string, "ResultError #1") + #else + XCTAssertEqual(string, "(ResultError #1)") + #endif + } + + func testWithErrorDoesNotExecuteWhenSuccess() { + // Given + let result: Result = .success("success") + var string = "success" + + // When + result.withError { string = "\(type(of: $0))" } + + // Then + XCTAssertEqual(string, "success") + } + + // MARK: - If Success or Failure Tests + + func testIfSuccessExecutesWhenSuccess() { + // Given + let result: Result = .success("success") + var string = "failure" + + // When + result.ifSuccess { string = "success" } + + // Then + XCTAssertEqual(string, "success") + } + + func testIfSuccessDoesNotExecutesWhenFailure() { + // Given + struct ResultError: Error {} + let result: Result = .failure(ResultError()) + var string = "failure" + + // When + result.ifSuccess { string = "success" } + + // Then + XCTAssertEqual(string, "failure") + } + + func testIfFailureExecutesWhenFailure() { + // Given + struct ResultError: Error {} + let result: Result = .failure(ResultError()) + var string = "success" + + // When + result.ifFailure { string = "failure" } + + // Then + XCTAssertEqual(string, "failure") + } + + func testIfFailureDoesNotExecuteWhenSuccess() { + // Given + let result: Result = .success("success") + var string = "success" + + // When + result.ifFailure { string = "failure" } + + // Then + XCTAssertEqual(string, "success") + } + + // MARK: - Functional Chaining Tests + + func testFunctionalMethodsCanBeChained() { + // Given + struct ResultError: Error {} + let result: Result = .success("first") + var string = "first" + var success = false + + // When + let endResult = result + .map { _ in "second" } + .flatMap { _ in "third" } + .withValue { if $0 == "third" { string = "fourth" } } + .ifSuccess { success = true } + + // Then + XCTAssertEqual(endResult.value, "third") + XCTAssertEqual(string, "fourth") + XCTAssertTrue(success) + } } diff --git a/Carthage/Checkouts/Alamofire/Tests/ServerTrustPolicyTests.swift b/Carthage/Checkouts/Alamofire/Tests/ServerTrustPolicyTests.swift index b19eb69..4afe411 100644 --- a/Carthage/Checkouts/Alamofire/Tests/ServerTrustPolicyTests.swift +++ b/Carthage/Checkouts/Alamofire/Tests/ServerTrustPolicyTests.swift @@ -1,7 +1,7 @@ // // MultipartFormDataTests.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Carthage/Checkouts/Alamofire/Tests/SessionDelegateTests.swift b/Carthage/Checkouts/Alamofire/Tests/SessionDelegateTests.swift index f63421d..4f1fbce 100644 --- a/Carthage/Checkouts/Alamofire/Tests/SessionDelegateTests.swift +++ b/Carthage/Checkouts/Alamofire/Tests/SessionDelegateTests.swift @@ -1,7 +1,7 @@ // // SessionDelegateTests.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/Carthage/Checkouts/Alamofire/Tests/SessionManagerTests.swift b/Carthage/Checkouts/Alamofire/Tests/SessionManagerTests.swift index 9278af7..c06b93f 100644 --- a/Carthage/Checkouts/Alamofire/Tests/SessionManagerTests.swift +++ b/Carthage/Checkouts/Alamofire/Tests/SessionManagerTests.swift @@ -1,7 +1,7 @@ // // SessionManagerTests.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -787,12 +787,12 @@ class SessionManagerConfigurationHeadersTestCase: BaseTestCase { // Given, When, Then executeAuthorizationHeaderTest(for: .ephemeral) } - -// ⚠️ This test has been removed as a result of rdar://26870455 in Xcode 8 Seed 1 -// func testThatBackgroundConfigurationHeadersAreSentWithRequest() { -// // Given, When, Then -// executeAuthorizationHeaderTest(for: .background) -// } +#if os(macOS) + func testThatBackgroundConfigurationHeadersAreSentWithRequest() { + // Given, When, Then + executeAuthorizationHeaderTest(for: .background) + } +#endif private func executeAuthorizationHeaderTest(for type: ConfigurationType) { // Given @@ -840,10 +840,9 @@ class SessionManagerConfigurationHeadersTestCase: BaseTestCase { XCTAssertNotNil(response.data, "data should not be nil") XCTAssertTrue(response.result.isSuccess, "result should be a success") - // The `as NSString` cast is necessary due to a compiler bug. See the following rdar for more info. - // - https://openradar.appspot.com/radar?id=5517037090635776 if - let headers = (response.result.value as AnyObject?)?["headers" as NSString] as? [String: String], + let response = response.result.value as? [String: Any], + let headers = response["headers"] as? [String: String], let authorization = headers["Authorization"] { XCTAssertEqual(authorization, "Bearer 123456", "authorization header value does not match") diff --git a/Carthage/Checkouts/Alamofire/Tests/TLSEvaluationTests.swift b/Carthage/Checkouts/Alamofire/Tests/TLSEvaluationTests.swift index 3b2f01f..eac62a6 100644 --- a/Carthage/Checkouts/Alamofire/Tests/TLSEvaluationTests.swift +++ b/Carthage/Checkouts/Alamofire/Tests/TLSEvaluationTests.swift @@ -1,7 +1,7 @@ // // TLSEvaluationTests.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -109,7 +109,7 @@ class TLSEvaluationExpiredLeafCertificateTestCase: BaseTestCase { if let error = error as? URLError { XCTAssertEqual(error.code, .serverCertificateUntrusted) - } else if let error = error as? NSError { + } else if let error = error as NSError? { XCTAssertEqual(error.domain, kCFErrorDomainCFNetwork as String) XCTAssertEqual(error.code, Int(CFNetworkErrors.cfErrorHTTPSProxyConnectionFailure.rawValue)) } else { diff --git a/Carthage/Checkouts/Alamofire/Tests/URLProtocolTests.swift b/Carthage/Checkouts/Alamofire/Tests/URLProtocolTests.swift index 9153a88..674b894 100644 --- a/Carthage/Checkouts/Alamofire/Tests/URLProtocolTests.swift +++ b/Carthage/Checkouts/Alamofire/Tests/URLProtocolTests.swift @@ -1,7 +1,7 @@ // // URLProtocolTests.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -92,15 +92,15 @@ class ProxyURLProtocol: URLProtocol { // MARK: - -extension ProxyURLProtocol: URLSessionDelegate { +extension ProxyURLProtocol: URLSessionDataDelegate { // MARK: NSURLSessionDelegate - func URLSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceiveData data: Data) { + func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) { client?.urlProtocol(self, didLoad: data) } - func URLSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) { + func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) { if let response = task.response { client?.urlProtocol(self, didReceive: response, cacheStoragePolicy: .notAllowed) } @@ -123,7 +123,7 @@ class URLProtocolTestCase: BaseTestCase { let configuration: URLSessionConfiguration = { let configuration = URLSessionConfiguration.default configuration.protocolClasses = [ProxyURLProtocol.self] - configuration.httpAdditionalHeaders = ["session-configuration-header": "foo"] + configuration.httpAdditionalHeaders = ["Session-Configuration-Header": "foo"] return configuration }() @@ -141,7 +141,7 @@ class URLProtocolTestCase: BaseTestCase { var urlRequest = URLRequest(url: url) urlRequest.httpMethod = HTTPMethod.get.rawValue - urlRequest.setValue("foobar", forHTTPHeaderField: "request-header") + urlRequest.setValue("foobar", forHTTPHeaderField: "Request-Header") let expectation = self.expectation(description: "GET request should succeed") @@ -163,13 +163,13 @@ class URLProtocolTestCase: BaseTestCase { XCTAssertNil(response?.error) if let headers = response?.response?.allHeaderFields as? [String: String] { - XCTAssertEqual(headers["request-header"], "foobar") + XCTAssertEqual(headers["Request-Header"], "foobar") // Configuration headers are only passed in on iOS 9.0+ if #available(iOS 9.0, *) { - XCTAssertEqual(headers["session-configuration-header"], "foo") + XCTAssertEqual(headers["Session-Configuration-Header"], "foo") } else { - XCTAssertNil(headers["session-configuration-header"]) + XCTAssertNil(headers["Session-Configuration-Header"]) } } else { XCTFail("headers should not be nil") diff --git a/Carthage/Checkouts/Alamofire/Tests/UploadTests.swift b/Carthage/Checkouts/Alamofire/Tests/UploadTests.swift index 9d345ee..ecaf9a7 100644 --- a/Carthage/Checkouts/Alamofire/Tests/UploadTests.swift +++ b/Carthage/Checkouts/Alamofire/Tests/UploadTests.swift @@ -1,7 +1,7 @@ // // UploadTests.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -533,69 +533,69 @@ class UploadMultipartFormDataTestCase: BaseTestCase { } } -// ⚠️ This test has been removed as a result of rdar://26870455 in Xcode 8 Seed 1 -// func testThatUploadingMultipartFormDataOnBackgroundSessionWritesDataToFileToAvoidCrash() { -// // Given -// let manager: SessionManager = { -// let identifier = "org.alamofire.uploadtests.\(UUID().uuidString)" -// let configuration = URLSessionConfiguration.background(withIdentifier: identifier) -// -// return SessionManager(configuration: configuration, serverTrustPolicyManager: nil) -// }() -// -// let urlString = "https://httpbin.org/post" -// let french = "français".data(using: .utf8, allowLossyConversion: false)! -// let japanese = "日本語".data(using: .utf8, allowLossyConversion: false)! -// -// let expectation = self.expectation(description: "multipart form data upload should succeed") -// -// var request: URLRequest? -// var response: HTTPURLResponse? -// var data: Data? -// var error: Error? -// var streamingFromDisk: Bool? -// -// // When -// manager.upload( -// multipartFormData: { multipartFormData in -// multipartFormData.append(french, withName: "french") -// multipartFormData.append(japanese, withName: "japanese") -// }, -// to: urlString, -// withMethod: .post, -// encodingCompletion: { result in -// switch result { -// case let .success(upload, uploadStreamingFromDisk, _): -// streamingFromDisk = uploadStreamingFromDisk -// -// upload.response { responseRequest, responseResponse, responseData, responseError in -// request = responseRequest -// response = responseResponse -// data = responseData -// error = responseError -// -// expectation.fulfill() -// } -// case .failure: -// expectation.fulfill() -// } -// } -// ) -// -// waitForExpectations(timeout: timeout, handler: nil) -// -// // Then -// XCTAssertNotNil(request, "request should not be nil") -// XCTAssertNotNil(response, "response should not be nil") -// XCTAssertNotNil(data, "data should not be nil") -// XCTAssertNil(error, "error should be nil") -// -// if let streamingFromDisk = streamingFromDisk { -// XCTAssertTrue(streamingFromDisk, "streaming from disk should be true") -// } else { -// XCTFail("streaming from disk should not be nil") -// } -// } +#if os(macOS) + func testThatUploadingMultipartFormDataOnBackgroundSessionWritesDataToFileToAvoidCrash() { + // Given + let manager: SessionManager = { + let identifier = "org.alamofire.uploadtests.\(UUID().uuidString)" + let configuration = URLSessionConfiguration.background(withIdentifier: identifier) + + return SessionManager(configuration: configuration, serverTrustPolicyManager: nil) + }() + + let urlString = "https://httpbin.org/post" + let french = "français".data(using: .utf8, allowLossyConversion: false)! + let japanese = "日本語".data(using: .utf8, allowLossyConversion: false)! + + let expectation = self.expectation(description: "multipart form data upload should succeed") + + var request: URLRequest? + var response: HTTPURLResponse? + var data: Data? + var error: Error? + var streamingFromDisk: Bool? + + // When + manager.upload( + multipartFormData: { multipartFormData in + multipartFormData.append(french, withName: "french") + multipartFormData.append(japanese, withName: "japanese") + }, + to: urlString, + encodingCompletion: { result in + switch result { + case let .success(upload, uploadStreamingFromDisk, _): + streamingFromDisk = uploadStreamingFromDisk + + upload.response { defaultResponse in + request = defaultResponse.request + response = defaultResponse.response + data = defaultResponse.data + error = defaultResponse.error + + expectation.fulfill() + } + case .failure: + expectation.fulfill() + } + } + ) + + waitForExpectations(timeout: timeout, handler: nil) + + // Then + XCTAssertNotNil(request, "request should not be nil") + XCTAssertNotNil(response, "response should not be nil") + XCTAssertNotNil(data, "data should not be nil") + XCTAssertNil(error, "error should be nil") + + if let streamingFromDisk = streamingFromDisk { + XCTAssertTrue(streamingFromDisk, "streaming from disk should be true") + } else { + XCTFail("streaming from disk should not be nil") + } + } +#endif // MARK: Combined Test Execution diff --git a/Carthage/Checkouts/Alamofire/Tests/ValidationTests.swift b/Carthage/Checkouts/Alamofire/Tests/ValidationTests.swift index 0c2e1c3..530c6a5 100644 --- a/Carthage/Checkouts/Alamofire/Tests/ValidationTests.swift +++ b/Carthage/Checkouts/Alamofire/Tests/ValidationTests.swift @@ -1,7 +1,7 @@ // // ValidationTests.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -158,8 +158,8 @@ class ContentTypeValidationTestCase: BaseTestCase { // When Alamofire.request(urlString) .validate(contentType: ["application/json"]) - .validate(contentType: ["application/json;charset=utf8"]) - .validate(contentType: ["application/json;q=0.8;charset=utf8"]) + .validate(contentType: ["application/json; charset=utf-8"]) + .validate(contentType: ["application/json; q=0.8; charset=utf-8"]) .response { resp in requestError = resp.error expectation1.fulfill() @@ -167,8 +167,8 @@ class ContentTypeValidationTestCase: BaseTestCase { Alamofire.download(urlString) .validate(contentType: ["application/json"]) - .validate(contentType: ["application/json;charset=utf8"]) - .validate(contentType: ["application/json;q=0.8;charset=utf8"]) + .validate(contentType: ["application/json; charset=utf-8"]) + .validate(contentType: ["application/json; q=0.8; charset=utf-8"]) .response { resp in downloadError = resp.error expectation2.fulfill()