diff --git a/MASFoundation.xcodeproj/project.pbxproj b/MASFoundation.xcodeproj/project.pbxproj index 8304e6f0..ccaa6dac 100644 --- a/MASFoundation.xcodeproj/project.pbxproj +++ b/MASFoundation.xcodeproj/project.pbxproj @@ -94,45 +94,8 @@ A46F49BC1C2F5FC500A4C370 /* fmemopen.h in Headers */ = {isa = PBXBuildFile; fileRef = A46F491E1C2F5FC500A4C370 /* fmemopen.h */; }; A46F49C11C2F5FC500A4C370 /* MASIKeyChainStore.h in Headers */ = {isa = PBXBuildFile; fileRef = A46F49251C2F5FC500A4C370 /* MASIKeyChainStore.h */; }; A46F49C21C2F5FC500A4C370 /* MASIKeyChainStore.m in Sources */ = {isa = PBXBuildFile; fileRef = A46F49261C2F5FC500A4C370 /* MASIKeyChainStore.m */; }; - A46F49C41C2F5FC500A4C370 /* MASIHTTPRequestOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = A46F49291C2F5FC500A4C370 /* MASIHTTPRequestOperation.h */; }; - A46F49C51C2F5FC500A4C370 /* MASIHTTPRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = A46F492A1C2F5FC500A4C370 /* MASIHTTPRequestOperation.m */; }; - A46F49C61C2F5FC500A4C370 /* MASIHTTPRequestOperationManager.h in Headers */ = {isa = PBXBuildFile; fileRef = A46F492B1C2F5FC500A4C370 /* MASIHTTPRequestOperationManager.h */; }; - A46F49C71C2F5FC500A4C370 /* MASIHTTPRequestOperationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = A46F492C1C2F5FC500A4C370 /* MASIHTTPRequestOperationManager.m */; }; - A46F49C81C2F5FC500A4C370 /* MASIHTTPSessionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = A46F492D1C2F5FC500A4C370 /* MASIHTTPSessionManager.h */; }; - A46F49C91C2F5FC500A4C370 /* MASIHTTPSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = A46F492E1C2F5FC500A4C370 /* MASIHTTPSessionManager.m */; }; - A46F49CA1C2F5FC500A4C370 /* MASINetworkActivityLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = A46F492F1C2F5FC500A4C370 /* MASINetworkActivityLogger.h */; }; - A46F49CB1C2F5FC500A4C370 /* MASINetworkActivityLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = A46F49301C2F5FC500A4C370 /* MASINetworkActivityLogger.m */; }; - A46F49CC1C2F5FC500A4C370 /* MASINetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = A46F49311C2F5FC500A4C370 /* MASINetworking.h */; }; - A46F49CD1C2F5FC500A4C370 /* MASINetworkReachabilityManager.h in Headers */ = {isa = PBXBuildFile; fileRef = A46F49321C2F5FC500A4C370 /* MASINetworkReachabilityManager.h */; }; - A46F49CE1C2F5FC500A4C370 /* MASINetworkReachabilityManager.m in Sources */ = {isa = PBXBuildFile; fileRef = A46F49331C2F5FC500A4C370 /* MASINetworkReachabilityManager.m */; }; - A46F49CF1C2F5FC500A4C370 /* MASISecurityPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = A46F49341C2F5FC500A4C370 /* MASISecurityPolicy.h */; }; - A46F49D01C2F5FC500A4C370 /* MASISecurityPolicy.m in Sources */ = {isa = PBXBuildFile; fileRef = A46F49351C2F5FC500A4C370 /* MASISecurityPolicy.m */; }; - A46F49D11C2F5FC500A4C370 /* MASIURLConnectionOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = A46F49361C2F5FC500A4C370 /* MASIURLConnectionOperation.h */; }; - A46F49D21C2F5FC500A4C370 /* MASIURLConnectionOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = A46F49371C2F5FC500A4C370 /* MASIURLConnectionOperation.m */; }; - A46F49D31C2F5FC500A4C370 /* MASIURLRequestSerialization.h in Headers */ = {isa = PBXBuildFile; fileRef = A46F49381C2F5FC500A4C370 /* MASIURLRequestSerialization.h */; }; - A46F49D41C2F5FC500A4C370 /* MASIURLRequestSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = A46F49391C2F5FC500A4C370 /* MASIURLRequestSerialization.m */; }; - A46F49D51C2F5FC500A4C370 /* MASIURLResponseSerialization.h in Headers */ = {isa = PBXBuildFile; fileRef = A46F493A1C2F5FC500A4C370 /* MASIURLResponseSerialization.h */; }; - A46F49D61C2F5FC500A4C370 /* MASIURLResponseSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = A46F493B1C2F5FC500A4C370 /* MASIURLResponseSerialization.m */; }; - A46F49D71C2F5FC500A4C370 /* MASIURLSessionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = A46F493C1C2F5FC500A4C370 /* MASIURLSessionManager.h */; }; - A46F49D81C2F5FC500A4C370 /* MASIURLSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = A46F493D1C2F5FC500A4C370 /* MASIURLSessionManager.m */; }; - A46F49D91C2F5FC500A4C370 /* MASINetworkActivityIndicatorManager.h in Headers */ = {isa = PBXBuildFile; fileRef = A46F493F1C2F5FC500A4C370 /* MASINetworkActivityIndicatorManager.h */; }; - A46F49DA1C2F5FC500A4C370 /* MASINetworkActivityIndicatorManager.m in Sources */ = {isa = PBXBuildFile; fileRef = A46F49401C2F5FC500A4C370 /* MASINetworkActivityIndicatorManager.m */; }; - A46F49DB1C2F5FC500A4C370 /* UIActivityIndicatorView+MASINetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = A46F49411C2F5FC500A4C370 /* UIActivityIndicatorView+MASINetworking.h */; }; - A46F49DC1C2F5FC500A4C370 /* UIActivityIndicatorView+MASINetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = A46F49421C2F5FC500A4C370 /* UIActivityIndicatorView+MASINetworking.m */; }; - A46F49DD1C2F5FC500A4C370 /* UIAlertView+MASINetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = A46F49431C2F5FC500A4C370 /* UIAlertView+MASINetworking.h */; }; - A46F49DE1C2F5FC500A4C370 /* UIAlertView+MASINetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = A46F49441C2F5FC500A4C370 /* UIAlertView+MASINetworking.m */; }; - A46F49DF1C2F5FC500A4C370 /* UIButton+MASINetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = A46F49451C2F5FC500A4C370 /* UIButton+MASINetworking.h */; }; - A46F49E01C2F5FC500A4C370 /* UIButton+MASINetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = A46F49461C2F5FC500A4C370 /* UIButton+MASINetworking.m */; }; - A46F49E11C2F5FC500A4C370 /* UIImage+MASINetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = A46F49471C2F5FC500A4C370 /* UIImage+MASINetworking.h */; }; A46F49E21C2F5FC500A4C370 /* UIImageView+MASINetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = A46F49481C2F5FC500A4C370 /* UIImageView+MASINetworking.h */; }; A46F49E31C2F5FC500A4C370 /* UIImageView+MASINetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = A46F49491C2F5FC500A4C370 /* UIImageView+MASINetworking.m */; }; - A46F49E41C2F5FC500A4C370 /* UIKit+MASINetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = A46F494A1C2F5FC500A4C370 /* UIKit+MASINetworking.h */; }; - A46F49E51C2F5FC500A4C370 /* UIProgressView+MASINetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = A46F494B1C2F5FC500A4C370 /* UIProgressView+MASINetworking.h */; }; - A46F49E61C2F5FC500A4C370 /* UIProgressView+MASINetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = A46F494C1C2F5FC500A4C370 /* UIProgressView+MASINetworking.m */; }; - A46F49E71C2F5FC500A4C370 /* UIRefreshControl+MASINetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = A46F494D1C2F5FC500A4C370 /* UIRefreshControl+MASINetworking.h */; }; - A46F49E81C2F5FC500A4C370 /* UIRefreshControl+MASINetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = A46F494E1C2F5FC500A4C370 /* UIRefreshControl+MASINetworking.m */; }; - A46F49E91C2F5FC500A4C370 /* UIWebView+MASINetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = A46F494F1C2F5FC500A4C370 /* UIWebView+MASINetworking.h */; }; - A46F49EA1C2F5FC500A4C370 /* UIWebView+MASINetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = A46F49501C2F5FC500A4C370 /* UIWebView+MASINetworking.m */; }; A46F49F31C2F5FC500A4C370 /* MASIOrderedDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = A46F495B1C2F5FC500A4C370 /* MASIOrderedDictionary.h */; }; A46F49F41C2F5FC500A4C370 /* MASIOrderedDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = A46F495C1C2F5FC500A4C370 /* MASIOrderedDictionary.m */; }; A47332CF1BBC61F50002A492 /* NSData+MASPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = A47332CD1BBC61F50002A492 /* NSData+MASPrivate.h */; }; @@ -364,6 +327,15 @@ CBD25B151E7A0A9200DFB47F /* MF_Base64Additions.m in Sources */ = {isa = PBXBuildFile; fileRef = CBD25B131E7A0A9200DFB47F /* MF_Base64Additions.m */; }; CBFA70F41F1ED5D6006D025D /* MASSecurityPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = CBFA70F21F1ED5D6006D025D /* MASSecurityPolicy.h */; }; CBFA70F51F1ED5D6006D025D /* MASSecurityPolicy.m in Sources */ = {isa = PBXBuildFile; fileRef = CBFA70F31F1ED5D6006D025D /* MASSecurityPolicy.m */; }; + E3662A3723DEE503007A76A1 /* MASIHTTPRequestOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = E3662A3523DEE502007A76A1 /* MASIHTTPRequestOperation.h */; }; + E3662A3823DEE503007A76A1 /* MASIHTTPRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = E3662A3623DEE502007A76A1 /* MASIHTTPRequestOperation.m */; }; + E3662A3B23DEE52C007A76A1 /* MASIURLResponseSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = E3662A3923DEE52B007A76A1 /* MASIURLResponseSerialization.m */; }; + E3662A3C23DEE52C007A76A1 /* MASIURLResponseSerialization.h in Headers */ = {isa = PBXBuildFile; fileRef = E3662A3A23DEE52B007A76A1 /* MASIURLResponseSerialization.h */; }; + E3662A3F23DEE557007A76A1 /* MASISecurityPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = E3662A3D23DEE557007A76A1 /* MASISecurityPolicy.h */; }; + E3662A4023DEE557007A76A1 /* MASISecurityPolicy.m in Sources */ = {isa = PBXBuildFile; fileRef = E3662A3E23DEE557007A76A1 /* MASISecurityPolicy.m */; }; + E3662A4223DEE5A4007A76A1 /* MASINetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = E3662A4123DEE5A4007A76A1 /* MASINetworking.h */; }; + E3662A4523DEE5C8007A76A1 /* MASIURLConnectionOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = E3662A4323DEE5C8007A76A1 /* MASIURLConnectionOperation.m */; }; + E3662A4623DEE5C8007A76A1 /* MASIURLConnectionOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = E3662A4423DEE5C8007A76A1 /* MASIURLConnectionOperation.h */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -477,45 +449,8 @@ A46F49251C2F5FC500A4C370 /* MASIKeyChainStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MASIKeyChainStore.h; sourceTree = ""; }; A46F49261C2F5FC500A4C370 /* MASIKeyChainStore.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MASIKeyChainStore.m; sourceTree = ""; }; A46F49281C2F5FC500A4C370 /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = ""; }; - A46F49291C2F5FC500A4C370 /* MASIHTTPRequestOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MASIHTTPRequestOperation.h; sourceTree = ""; }; - A46F492A1C2F5FC500A4C370 /* MASIHTTPRequestOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MASIHTTPRequestOperation.m; sourceTree = ""; }; - A46F492B1C2F5FC500A4C370 /* MASIHTTPRequestOperationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MASIHTTPRequestOperationManager.h; sourceTree = ""; }; - A46F492C1C2F5FC500A4C370 /* MASIHTTPRequestOperationManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MASIHTTPRequestOperationManager.m; sourceTree = ""; }; - A46F492D1C2F5FC500A4C370 /* MASIHTTPSessionManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MASIHTTPSessionManager.h; sourceTree = ""; }; - A46F492E1C2F5FC500A4C370 /* MASIHTTPSessionManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MASIHTTPSessionManager.m; sourceTree = ""; }; - A46F492F1C2F5FC500A4C370 /* MASINetworkActivityLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MASINetworkActivityLogger.h; sourceTree = ""; }; - A46F49301C2F5FC500A4C370 /* MASINetworkActivityLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MASINetworkActivityLogger.m; sourceTree = ""; }; - A46F49311C2F5FC500A4C370 /* MASINetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MASINetworking.h; sourceTree = ""; }; - A46F49321C2F5FC500A4C370 /* MASINetworkReachabilityManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MASINetworkReachabilityManager.h; sourceTree = ""; }; - A46F49331C2F5FC500A4C370 /* MASINetworkReachabilityManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MASINetworkReachabilityManager.m; sourceTree = ""; }; - A46F49341C2F5FC500A4C370 /* MASISecurityPolicy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MASISecurityPolicy.h; sourceTree = ""; }; - A46F49351C2F5FC500A4C370 /* MASISecurityPolicy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MASISecurityPolicy.m; sourceTree = ""; }; - A46F49361C2F5FC500A4C370 /* MASIURLConnectionOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MASIURLConnectionOperation.h; sourceTree = ""; }; - A46F49371C2F5FC500A4C370 /* MASIURLConnectionOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MASIURLConnectionOperation.m; sourceTree = ""; }; - A46F49381C2F5FC500A4C370 /* MASIURLRequestSerialization.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MASIURLRequestSerialization.h; sourceTree = ""; }; - A46F49391C2F5FC500A4C370 /* MASIURLRequestSerialization.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MASIURLRequestSerialization.m; sourceTree = ""; }; - A46F493A1C2F5FC500A4C370 /* MASIURLResponseSerialization.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MASIURLResponseSerialization.h; sourceTree = ""; }; - A46F493B1C2F5FC500A4C370 /* MASIURLResponseSerialization.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MASIURLResponseSerialization.m; sourceTree = ""; }; - A46F493C1C2F5FC500A4C370 /* MASIURLSessionManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MASIURLSessionManager.h; sourceTree = ""; }; - A46F493D1C2F5FC500A4C370 /* MASIURLSessionManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MASIURLSessionManager.m; sourceTree = ""; }; - A46F493F1C2F5FC500A4C370 /* MASINetworkActivityIndicatorManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MASINetworkActivityIndicatorManager.h; sourceTree = ""; }; - A46F49401C2F5FC500A4C370 /* MASINetworkActivityIndicatorManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MASINetworkActivityIndicatorManager.m; sourceTree = ""; }; - A46F49411C2F5FC500A4C370 /* UIActivityIndicatorView+MASINetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIActivityIndicatorView+MASINetworking.h"; sourceTree = ""; }; - A46F49421C2F5FC500A4C370 /* UIActivityIndicatorView+MASINetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIActivityIndicatorView+MASINetworking.m"; sourceTree = ""; }; - A46F49431C2F5FC500A4C370 /* UIAlertView+MASINetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIAlertView+MASINetworking.h"; sourceTree = ""; }; - A46F49441C2F5FC500A4C370 /* UIAlertView+MASINetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIAlertView+MASINetworking.m"; sourceTree = ""; }; - A46F49451C2F5FC500A4C370 /* UIButton+MASINetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIButton+MASINetworking.h"; sourceTree = ""; }; - A46F49461C2F5FC500A4C370 /* UIButton+MASINetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIButton+MASINetworking.m"; sourceTree = ""; }; - A46F49471C2F5FC500A4C370 /* UIImage+MASINetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+MASINetworking.h"; sourceTree = ""; }; A46F49481C2F5FC500A4C370 /* UIImageView+MASINetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImageView+MASINetworking.h"; sourceTree = ""; }; A46F49491C2F5FC500A4C370 /* UIImageView+MASINetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImageView+MASINetworking.m"; sourceTree = ""; }; - A46F494A1C2F5FC500A4C370 /* UIKit+MASINetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIKit+MASINetworking.h"; sourceTree = ""; }; - A46F494B1C2F5FC500A4C370 /* UIProgressView+MASINetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIProgressView+MASINetworking.h"; sourceTree = ""; }; - A46F494C1C2F5FC500A4C370 /* UIProgressView+MASINetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIProgressView+MASINetworking.m"; sourceTree = ""; }; - A46F494D1C2F5FC500A4C370 /* UIRefreshControl+MASINetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIRefreshControl+MASINetworking.h"; sourceTree = ""; }; - A46F494E1C2F5FC500A4C370 /* UIRefreshControl+MASINetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIRefreshControl+MASINetworking.m"; sourceTree = ""; }; - A46F494F1C2F5FC500A4C370 /* UIWebView+MASINetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIWebView+MASINetworking.h"; sourceTree = ""; }; - A46F49501C2F5FC500A4C370 /* UIWebView+MASINetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIWebView+MASINetworking.m"; sourceTree = ""; }; A46F495A1C2F5FC500A4C370 /* LICENCE.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = LICENCE.md; sourceTree = ""; }; A46F495B1C2F5FC500A4C370 /* MASIOrderedDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MASIOrderedDictionary.h; sourceTree = ""; }; A46F495C1C2F5FC500A4C370 /* MASIOrderedDictionary.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MASIOrderedDictionary.m; sourceTree = ""; }; @@ -752,6 +687,15 @@ CBD25B131E7A0A9200DFB47F /* MF_Base64Additions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MF_Base64Additions.m; sourceTree = ""; }; CBFA70F21F1ED5D6006D025D /* MASSecurityPolicy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MASSecurityPolicy.h; sourceTree = ""; }; CBFA70F31F1ED5D6006D025D /* MASSecurityPolicy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MASSecurityPolicy.m; sourceTree = ""; }; + E3662A3523DEE502007A76A1 /* MASIHTTPRequestOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MASIHTTPRequestOperation.h; sourceTree = ""; }; + E3662A3623DEE502007A76A1 /* MASIHTTPRequestOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MASIHTTPRequestOperation.m; sourceTree = ""; }; + E3662A3923DEE52B007A76A1 /* MASIURLResponseSerialization.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MASIURLResponseSerialization.m; sourceTree = ""; }; + E3662A3A23DEE52B007A76A1 /* MASIURLResponseSerialization.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MASIURLResponseSerialization.h; sourceTree = ""; }; + E3662A3D23DEE557007A76A1 /* MASISecurityPolicy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MASISecurityPolicy.h; sourceTree = ""; }; + E3662A3E23DEE557007A76A1 /* MASISecurityPolicy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MASISecurityPolicy.m; sourceTree = ""; }; + E3662A4123DEE5A4007A76A1 /* MASINetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MASINetworking.h; sourceTree = ""; }; + E3662A4323DEE5C8007A76A1 /* MASIURLConnectionOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MASIURLConnectionOperation.m; sourceTree = ""; }; + E3662A4423DEE5C8007A76A1 /* MASIURLConnectionOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MASIURLConnectionOperation.h; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -972,28 +916,16 @@ A46F49271C2F5FC500A4C370 /* MASINetworking */ = { isa = PBXGroup; children = ( + E3662A4423DEE5C8007A76A1 /* MASIURLConnectionOperation.h */, + E3662A4323DEE5C8007A76A1 /* MASIURLConnectionOperation.m */, + E3662A4123DEE5A4007A76A1 /* MASINetworking.h */, + E3662A3D23DEE557007A76A1 /* MASISecurityPolicy.h */, + E3662A3E23DEE557007A76A1 /* MASISecurityPolicy.m */, + E3662A3A23DEE52B007A76A1 /* MASIURLResponseSerialization.h */, + E3662A3923DEE52B007A76A1 /* MASIURLResponseSerialization.m */, + E3662A3523DEE502007A76A1 /* MASIHTTPRequestOperation.h */, + E3662A3623DEE502007A76A1 /* MASIHTTPRequestOperation.m */, A46F49281C2F5FC500A4C370 /* LICENSE */, - A46F49291C2F5FC500A4C370 /* MASIHTTPRequestOperation.h */, - A46F492A1C2F5FC500A4C370 /* MASIHTTPRequestOperation.m */, - A46F492B1C2F5FC500A4C370 /* MASIHTTPRequestOperationManager.h */, - A46F492C1C2F5FC500A4C370 /* MASIHTTPRequestOperationManager.m */, - A46F492D1C2F5FC500A4C370 /* MASIHTTPSessionManager.h */, - A46F492E1C2F5FC500A4C370 /* MASIHTTPSessionManager.m */, - A46F492F1C2F5FC500A4C370 /* MASINetworkActivityLogger.h */, - A46F49301C2F5FC500A4C370 /* MASINetworkActivityLogger.m */, - A46F49311C2F5FC500A4C370 /* MASINetworking.h */, - A46F49321C2F5FC500A4C370 /* MASINetworkReachabilityManager.h */, - A46F49331C2F5FC500A4C370 /* MASINetworkReachabilityManager.m */, - A46F49341C2F5FC500A4C370 /* MASISecurityPolicy.h */, - A46F49351C2F5FC500A4C370 /* MASISecurityPolicy.m */, - A46F49361C2F5FC500A4C370 /* MASIURLConnectionOperation.h */, - A46F49371C2F5FC500A4C370 /* MASIURLConnectionOperation.m */, - A46F49381C2F5FC500A4C370 /* MASIURLRequestSerialization.h */, - A46F49391C2F5FC500A4C370 /* MASIURLRequestSerialization.m */, - A46F493A1C2F5FC500A4C370 /* MASIURLResponseSerialization.h */, - A46F493B1C2F5FC500A4C370 /* MASIURLResponseSerialization.m */, - A46F493C1C2F5FC500A4C370 /* MASIURLSessionManager.h */, - A46F493D1C2F5FC500A4C370 /* MASIURLSessionManager.m */, A46F493E1C2F5FC500A4C370 /* UIKit+MASINetworking */, ); path = MASINetworking; @@ -1002,24 +934,8 @@ A46F493E1C2F5FC500A4C370 /* UIKit+MASINetworking */ = { isa = PBXGroup; children = ( - A46F493F1C2F5FC500A4C370 /* MASINetworkActivityIndicatorManager.h */, - A46F49401C2F5FC500A4C370 /* MASINetworkActivityIndicatorManager.m */, - A46F49411C2F5FC500A4C370 /* UIActivityIndicatorView+MASINetworking.h */, - A46F49421C2F5FC500A4C370 /* UIActivityIndicatorView+MASINetworking.m */, - A46F49431C2F5FC500A4C370 /* UIAlertView+MASINetworking.h */, - A46F49441C2F5FC500A4C370 /* UIAlertView+MASINetworking.m */, - A46F49451C2F5FC500A4C370 /* UIButton+MASINetworking.h */, - A46F49461C2F5FC500A4C370 /* UIButton+MASINetworking.m */, - A46F49471C2F5FC500A4C370 /* UIImage+MASINetworking.h */, A46F49481C2F5FC500A4C370 /* UIImageView+MASINetworking.h */, A46F49491C2F5FC500A4C370 /* UIImageView+MASINetworking.m */, - A46F494A1C2F5FC500A4C370 /* UIKit+MASINetworking.h */, - A46F494B1C2F5FC500A4C370 /* UIProgressView+MASINetworking.h */, - A46F494C1C2F5FC500A4C370 /* UIProgressView+MASINetworking.m */, - A46F494D1C2F5FC500A4C370 /* UIRefreshControl+MASINetworking.h */, - A46F494E1C2F5FC500A4C370 /* UIRefreshControl+MASINetworking.m */, - A46F494F1C2F5FC500A4C370 /* UIWebView+MASINetworking.h */, - A46F49501C2F5FC500A4C370 /* UIWebView+MASINetworking.m */, ); path = "UIKit+MASINetworking"; sourceTree = ""; @@ -1589,7 +1505,6 @@ CBD25B0B1E78C47C00DFB47F /* JWT.h in Headers */, CBD25B091E78C47C00DFB47F /* JWTCoding.h in Headers */, CB6491F71FE9DAF300281288 /* MQTTSessionManager.h in Headers */, - A46F49D91C2F5FC500A4C370 /* MASINetworkActivityIndicatorManager.h in Headers */, A42D02E01C0E223600AA1F11 /* MASAuthenticationProviders.h in Headers */, CBD25AEA1E78C47C00DFB47F /* JWTAlgorithmDataHolder.h in Headers */, CBBA9A8020742BA800BB307F /* MASNetworkReachability.h in Headers */, @@ -1605,8 +1520,8 @@ CB6491F91FE9DAF300281288 /* MQTTSessionSynchron.h in Headers */, CBD25AF51E78C47C00DFB47F /* JWTCryptoKeyExtractor.h in Headers */, CB2357921F0EF53600D4C420 /* MASURLSessionManager.h in Headers */, - A46F49CA1C2F5FC500A4C370 /* MASINetworkActivityLogger.h in Headers */, A4E340F91B9E9F2000883AD3 /* MAS.h in Headers */, + E3662A4223DEE5A4007A76A1 /* MASINetworking.h in Headers */, CBD25AF31E78C47C00DFB47F /* JWTCryptoKey.h in Headers */, CB6492031FE9DAF300281288 /* MQTTStrict.h in Headers */, A4831AFD1BD1A917007B4AE6 /* MASUser+MASPrivate.h in Headers */, @@ -1614,14 +1529,13 @@ CB9B1210210949E1008A2075 /* MASASN1Object.h in Headers */, CBD25AEE1E78C47C00DFB47F /* JWTAlgorithmHSBase.h in Headers */, A46F49E21C2F5FC500A4C370 /* UIImageView+MASINetworking.h in Headers */, - A46F49D71C2F5FC500A4C370 /* MASIURLSessionManager.h in Headers */, CBD25B0F1E78C47C00DFB47F /* JWTErrorDescription.h in Headers */, CBD25AFD1E78C47C00DFB47F /* JWTClaimsSetSerializer.h in Headers */, A4831AA91BD1A551007B4AE6 /* MASApplication.h in Headers */, CBD25AF01E78C47C00DFB47F /* JWTAlgorithmRSBase.h in Headers */, CB6491EE1FE9DAF300281288 /* MQTTMessage.h in Headers */, - A46F49D51C2F5FC500A4C370 /* MASIURLResponseSerialization.h in Headers */, CBD25AF91E78C47C00DFB47F /* JWTClaim.h in Headers */, + E3662A4623DEE5C8007A76A1 /* MASIURLConnectionOperation.h in Headers */, 107389FD1C7119E800B7E87E /* MASMQTTHelper.h in Headers */, A46F49C11C2F5FC500A4C370 /* MASIKeyChainStore.h in Headers */, CB6491DC1FE9DAF300281288 /* ForegroundReconnection.h in Headers */, @@ -1641,33 +1555,28 @@ CB6491EA1FE9DAF300281288 /* MQTTInMemoryPersistence.h in Headers */, 10E0279F1F72B10100EAB103 /* RNCryptor.h in Headers */, A4831AAF1BD1A551007B4AE6 /* MASDevice.h in Headers */, - A46F49D31C2F5FC500A4C370 /* MASIURLRequestSerialization.h in Headers */, A4831AB11BD1A551007B4AE6 /* MASFile.h in Headers */, 699570E22060650400017244 /* MASNotifications.h in Headers */, C858D6B52398FC5400963763 /* MASDataTask+MASPrivate.h in Headers */, 1059D3761B61AA3800223267 /* MASFoundation.h in Headers */, A898EF6B2182D3DF00CF291B /* NSURLSession+MASPrivate.h in Headers */, - A46F49CD1C2F5FC500A4C370 /* MASINetworkReachabilityManager.h in Headers */, CBAFD2501F2BD48B0034DF02 /* MASSecurityConfiguration+MASPrivate.h in Headers */, CB23579A1F100EC400D4C420 /* MASSessionDataTaskOperation.h in Headers */, A4831AB31BD1A551007B4AE6 /* MASObject.h in Headers */, + E3662A3F23DEE557007A76A1 /* MASISecurityPolicy.h in Headers */, CBD25AF71E78C47C00DFB47F /* JWTCryptoSecurity.h in Headers */, CB58986B1F183E0A005C1E82 /* MASAuthValidationOperation.h in Headers */, A4831AB51BD1A551007B4AE6 /* MASUser.h in Headers */, A46F49F31C2F5FC500A4C370 /* MASIOrderedDictionary.h in Headers */, A42D02E41C0E240800AA1F11 /* MASAuthenticationProviders+MASPrivate.h in Headers */, - A46F49E11C2F5FC500A4C370 /* UIImage+MASINetworking.h in Headers */, CB3173E01F1FFF2C00C85E47 /* MASNetworkMonitor.h in Headers */, A4150EE71BF16E5B00037E27 /* MASFileService.h in Headers */, - A46F49C41C2F5FC500A4C370 /* MASIHTTPRequestOperation.h in Headers */, C8C32B1822D88BF100D64DF0 /* MASPostFormURLRequest.h in Headers */, - A46F49E51C2F5FC500A4C370 /* UIProgressView+MASINetworking.h in Headers */, A4150E711BF1643900037E27 /* NSMutableURLRequest+MASPrivate.h in Headers */, A46F49BC1C2F5FC500A4C370 /* fmemopen.h in Headers */, A4831AF21BD1A8AA007B4AE6 /* MASConfiguration+MASPrivate.h in Headers */, CBD25AE61E78C47C00DFB47F /* JWTAlgorithmNone.h in Headers */, A4150EFB1BF16EE200037E27 /* MASKeyChainService.h in Headers */, - A46F49C61C2F5FC500A4C370 /* MASIHTTPRequestOperationManager.h in Headers */, CB1EE31C2009895A0056F24A /* MASMQTTForegroundReconnection.h in Headers */, CB6491E51FE9DAF300281288 /* MQTTClient.h in Headers */, CB6491FF1FE9DAF300281288 /* MQTTSSLSecurityPolicyEncoder.h in Headers */, @@ -1676,27 +1585,20 @@ CB6491F51FE9DAF300281288 /* MQTTSessionLegacy.h in Headers */, 1046618E1C0ABDDE00A2A03C /* MASGroup.h in Headers */, A4831AFA1BD1A8E8007B4AE6 /* MASFile+MASPrivate.h in Headers */, - A46F49E71C2F5FC500A4C370 /* UIRefreshControl+MASINetworking.h in Headers */, CB9B1215210949E1008A2075 /* MASDERCertificate.h in Headers */, A450BC0B1BE1570C0030491F /* NSNotificationCenter+MASPrivate.h in Headers */, 107389F91C7118F800B7E87E /* MASMQTTMessage.h in Headers */, - A46F49DD1C2F5FC500A4C370 /* UIAlertView+MASINetworking.h in Headers */, - A46F49E41C2F5FC500A4C370 /* UIKit+MASINetworking.h in Headers */, A458A9881C03897100440464 /* MASModelService.h in Headers */, CBD25B071E78C47C00DFB47F /* JWTCoding+VersionTwo.h in Headers */, CB6491E61FE9DAF300281288 /* MQTTCoreDataPersistence.h in Headers */, - A46F49E91C2F5FC500A4C370 /* UIWebView+MASINetworking.h in Headers */, CBD25B0E1E78C47C00DFB47F /* JWTDeprecations.h in Headers */, A421571B1BF863480034BDC9 /* MASServiceRegistry.h in Headers */, A4150E6F1BF1643900037E27 /* MASIJSONResponseSerializer+MASPrivate.h in Headers */, CB6491E41FE9DAF300281288 /* MQTTClient-Prefix.pch in Headers */, A4150EFD1BF16EE200037E27 /* MASSecurityService.h in Headers */, - A46F49CC1C2F5FC500A4C370 /* MASINetworking.h in Headers */, - A46F49DF1C2F5FC500A4C370 /* UIButton+MASINetworking.h in Headers */, 107389F71C7118F800B7E87E /* MASMQTTClient.h in Headers */, CB2A4051209A732500F988AA /* MASOTPMultiFactorAuthenticator.h in Headers */, CB1907F31C1794FC00A5EF16 /* MASAccess.h in Headers */, - A46F49CF1C2F5FC500A4C370 /* MASISecurityPolicy.h in Headers */, A4831AEE1BD1A87C007B4AE6 /* MASAuthenticationProvider+MASPrivate.h in Headers */, A4831AEC1BD1A87C007B4AE6 /* MASApplication+MASPrivate.h in Headers */, CB5E4C741C1D26BA001B3B8A /* MASPatchURLRequest.h in Headers */, @@ -1705,8 +1607,6 @@ CB5E4C701C1D250D001B3B8A /* MASPutURLRequest.h in Headers */, CB6491DE1FE9DAF300281288 /* MQTTCFSocketDecoder.h in Headers */, CB9975461EDF5799006CEBB1 /* MASAuthCredentials+MASPrivate.h in Headers */, - A46F49D11C2F5FC500A4C370 /* MASIURLConnectionOperation.h in Headers */, - A46F49C81C2F5FC500A4C370 /* MASIHTTPSessionManager.h in Headers */, A4F671321BAFC345000E2223 /* NSString+MASPrivate.h in Headers */, CBD25AE31E78C47C00DFB47F /* JWTAlgorithm.h in Headers */, CB64920B1FE9DAF300281288 /* Timer.h in Headers */, @@ -1717,7 +1617,6 @@ CB5E4C681C1D21FB001B3B8A /* MASPostURLRequest.h in Headers */, A4150ED41BF16D9A00037E27 /* MASNetworkingService.h in Headers */, CB2357961F0EFDEA00D4C420 /* MASSessionTaskOperation.h in Headers */, - A46F49DB1C2F5FC500A4C370 /* UIActivityIndicatorView+MASINetworking.h in Headers */, 10E027A41F72B10100EAB103 /* RNDecryptor.h in Headers */, 10738A001C711A2000B7E87E /* MASMQTTConstants.h in Headers */, A4E340EB1B9E9F2000883AD3 /* MASConstantsPrivate.h in Headers */, @@ -1731,6 +1630,7 @@ CB9975561EDF5986006CEBB1 /* MASAuthCredentialsClientCredentials.h in Headers */, A4150ED91BF16DBE00037E27 /* MASLocationService.h in Headers */, 10E027A61F72B10100EAB103 /* RNEncryptor.h in Headers */, + E3662A3723DEE503007A76A1 /* MASIHTTPRequestOperation.h in Headers */, CB6491E01FE9DAF300281288 /* MQTTCFSocketEncoder.h in Headers */, CBD25AFB1E78C47C00DFB47F /* JWTClaimsSet.h in Headers */, CB6491F11FE9DAF300281288 /* MQTTProperties.h in Headers */, @@ -1739,6 +1639,7 @@ CBD25B011E78C47C00DFB47F /* JWTCoding+ResultTypes.h in Headers */, A4831AF61BD1A8CA007B4AE6 /* MASDevice+MASPrivate.h in Headers */, A42A86A01BBDA27F00AE98AC /* NSError+MASPrivate.h in Headers */, + E3662A3C23DEE52C007A76A1 /* MASIURLResponseSerialization.h in Headers */, 699570E62062FF1300017244 /* MASError.h in Headers */, A47332CF1BBC61F50002A492 /* NSData+MASPrivate.h in Headers */, A43BEBB21BE34D7700842522 /* CLLocationManager+MASPrivate.h in Headers */, @@ -1797,8 +1698,7 @@ TargetAttributes = { 1059D36F1B61AA3700223267 = { CreatedOnToolsVersion = 6.4; - DevelopmentTeam = 2JJZ96P8P5; - ProvisioningStyle = Automatic; + ProvisioningStyle = Manual; }; 1059D37A1B61AA3800223267 = { CreatedOnToolsVersion = 6.4; @@ -1901,11 +1801,9 @@ CB64920A1FE9DAF300281288 /* ReconnectTimer.m in Sources */, 10E027A01F72B10100EAB103 /* RNCryptor.m in Sources */, CBAFD24D1F2BD46C0034DF02 /* MASSecurityConfiguration.m in Sources */, - A46F49EA1C2F5FC500A4C370 /* UIWebView+MASINetworking.m in Sources */, CB6491E11FE9DAF300281288 /* MQTTCFSocketEncoder.m in Sources */, A4150EDA1BF16DBE00037E27 /* MASLocationService.m in Sources */, A4150E721BF1643900037E27 /* NSMutableURLRequest+MASPrivate.m in Sources */, - A46F49E01C2F5FC500A4C370 /* UIButton+MASINetworking.m in Sources */, A4831AB61BD1A551007B4AE6 /* MASUser.m in Sources */, 10E027A51F72B10100EAB103 /* RNDecryptor.m in Sources */, A4E340FA1B9E9F2000883AD3 /* MAS.m in Sources */, @@ -1913,7 +1811,6 @@ CB6491DF1FE9DAF300281288 /* MQTTCFSocketDecoder.m in Sources */, CB6491F81FE9DAF300281288 /* MQTTSessionManager.m in Sources */, CBD25B021E78C47C00DFB47F /* JWTCoding+ResultTypes.m in Sources */, - A46F49DE1C2F5FC500A4C370 /* UIAlertView+MASINetworking.m in Sources */, CB6492041FE9DAF300281288 /* MQTTStrict.m in Sources */, 699570E32060650400017244 /* MASNotifications.m in Sources */, A4150EFC1BF16EE200037E27 /* MASKeyChainService.m in Sources */, @@ -1921,7 +1818,6 @@ C81CC3D11FC2EFBB0058718E /* UIAlertController+MAS.m in Sources */, CBD25AED1E78C47C00DFB47F /* JWTAlgorithmDataHolderChain.m in Sources */, A898EF6C2182D3DF00CF291B /* NSURLSession+MASPrivate.m in Sources */, - A46F49DA1C2F5FC500A4C370 /* MASINetworkActivityIndicatorManager.m in Sources */, A4831AAE1BD1A551007B4AE6 /* MASConfiguration.m in Sources */, CBA3EB2F1E945F2400E64D9D /* MASClaims.m in Sources */, CB9B1212210949E1008A2075 /* MASDERCertificate.m in Sources */, @@ -1933,12 +1829,9 @@ 5BD3E7E420630FC900A151C7 /* MASConstants.m in Sources */, A47332D01BBC61F50002A492 /* NSData+MASPrivate.m in Sources */, CBAFD2511F2BD48B0034DF02 /* MASSecurityConfiguration+MASPrivate.m in Sources */, - A46F49C91C2F5FC500A4C370 /* MASIHTTPSessionManager.m in Sources */, - A46F49C71C2F5FC500A4C370 /* MASIHTTPRequestOperationManager.m in Sources */, CB6492061FE9DAF300281288 /* MQTTTransport.m in Sources */, CB2A4049209A341A00F988AA /* MASMultiFactorHandler.m in Sources */, CB6491E31FE9DAF300281288 /* MQTTCFSocketTransport.m in Sources */, - A46F49D21C2F5FC500A4C370 /* MASIURLConnectionOperation.m in Sources */, A419B3A21C176259008DC88C /* NSData+MAS.m in Sources */, 1046618F1C0ABDDE00A2A03C /* MASGroup.m in Sources */, CB6491FE1FE9DAF300281288 /* MQTTSSLSecurityPolicyDecoder.m in Sources */, @@ -1954,10 +1847,10 @@ CB6491F41FE9DAF300281288 /* MQTTSession.m in Sources */, CB6491ED1FE9DAF300281288 /* MQTTLog.m in Sources */, 107389FA1C7118F800B7E87E /* MASMQTTMessage.m in Sources */, - A46F49DC1C2F5FC500A4C370 /* UIActivityIndicatorView+MASINetworking.m in Sources */, A4150ED51BF16D9A00037E27 /* MASNetworkingService.m in Sources */, CB64920C1FE9DAF300281288 /* Timer.m in Sources */, A4F671331BAFC345000E2223 /* NSString+MASPrivate.m in Sources */, + E3662A4523DEE5C8007A76A1 /* MASIURLConnectionOperation.m in Sources */, CBD25AFE1E78C47C00DFB47F /* JWTClaimsSetSerializer.m in Sources */, A42D02E51C0E240800AA1F11 /* MASAuthenticationProviders+MASPrivate.m in Sources */, CBD25AF41E78C47C00DFB47F /* JWTCryptoKey.m in Sources */, @@ -1977,13 +1870,11 @@ A42D02E11C0E223600AA1F11 /* MASAuthenticationProviders.m in Sources */, CB5E4C691C1D21FB001B3B8A /* MASPostURLRequest.m in Sources */, A47F126D1C1D6B4B0008E3F2 /* MASURLRequest.m in Sources */, - A46F49D01C2F5FC500A4C370 /* MASISecurityPolicy.m in Sources */, A4831AF31BD1A8AA007B4AE6 /* MASConfiguration+MASPrivate.m in Sources */, CB58986C1F183E0A005C1E82 /* MASAuthValidationOperation.m in Sources */, A43BEBB31BE34D7700842522 /* CLLocationManager+MASPrivate.m in Sources */, A4831AAA1BD1A551007B4AE6 /* MASApplication.m in Sources */, CBD25AF61E78C47C00DFB47F /* JWTCryptoKeyExtractor.m in Sources */, - A46F49C51C2F5FC500A4C370 /* MASIHTTPRequestOperation.m in Sources */, A4150E701BF1643900037E27 /* MASIJSONResponseSerializer+MASPrivate.m in Sources */, A417BA521BF033C300EC9BCB /* CLLocation+MASPrivate.m in Sources */, C81CC3CD1FC2EA190058718E /* MASBrowserBasedAuthentication.m in Sources */, @@ -1993,26 +1884,25 @@ CB5E4C651C1D1B56001B3B8A /* MASGetURLRequest.m in Sources */, C8C32B1922D88BF100D64DF0 /* MASPostFormURLRequest.m in Sources */, CB6491FA1FE9DAF300281288 /* MQTTSessionSynchron.m in Sources */, + E3662A4023DEE557007A76A1 /* MASISecurityPolicy.m in Sources */, A4831AB01BD1A551007B4AE6 /* MASDevice.m in Sources */, CBD25B001E78C47C00DFB47F /* JWTClaimsSetVerifier.m in Sources */, C8B1700C238FD1A7007BB903 /* MASDataTask.m in Sources */, A46F49E31C2F5FC500A4C370 /* UIImageView+MASINetworking.m in Sources */, + E3662A3823DEE503007A76A1 /* MASIHTTPRequestOperation.m in Sources */, A421571C1BF863480034BDC9 /* MASServiceRegistry.m in Sources */, CBD25AEB1E78C47C00DFB47F /* JWTAlgorithmDataHolder.m in Sources */, - A46F49D41C2F5FC500A4C370 /* MASIURLRequestSerialization.m in Sources */, CB3173E11F1FFF2C00C85E47 /* MASNetworkMonitor.m in Sources */, CB23579B1F100EC400D4C420 /* MASSessionDataTaskOperation.m in Sources */, A898EF632182D30A00CF291B /* MASJWTService.m in Sources */, CB6491EB1FE9DAF300281288 /* MQTTInMemoryPersistence.m in Sources */, A458A9891C03897100440464 /* MASModelService.m in Sources */, - A46F49D81C2F5FC500A4C370 /* MASIURLSessionManager.m in Sources */, CBD25B0D1E78C47C00DFB47F /* JWTBase64Coder.m in Sources */, CB9B1214210949E1008A2075 /* MASASN1Decoder.m in Sources */, CB6491F61FE9DAF300281288 /* MQTTSessionLegacy.m in Sources */, A4831AF71BD1A8CA007B4AE6 /* MASDevice+MASPrivate.m in Sources */, CB6491EF1FE9DAF300281288 /* MQTTMessage.m in Sources */, CB9975431EDF5761006CEBB1 /* MASAuthCredentials.m in Sources */, - A46F49E61C2F5FC500A4C370 /* UIProgressView+MASINetworking.m in Sources */, CB2357931F0EF53600D4C420 /* MASURLSessionManager.m in Sources */, CB9B1213210949E1008A2075 /* MASASN1Object.m in Sources */, A4150EE81BF16E5B00037E27 /* MASFileService.m in Sources */, @@ -2024,22 +1914,19 @@ A4831AFF1BD1A922007B4AE6 /* MASUser+MASPrivate.m in Sources */, CBA3EB331E94634C00E64D9D /* MASClaims+MASPrivate.m in Sources */, CB5E4C751C1D26BA001B3B8A /* MASPatchURLRequest.m in Sources */, - A46F49CB1C2F5FC500A4C370 /* MASINetworkActivityLogger.m in Sources */, A46F49BB1C2F5FC500A4C370 /* fmemopen.c in Sources */, CB6491FC1FE9DAF300281288 /* MQTTSSLSecurityPolicy.m in Sources */, + E3662A3B23DEE52C007A76A1 /* MASIURLResponseSerialization.m in Sources */, 69B7DF6B1F9675600056DD3A /* MASRequestBuilder.m in Sources */, CBBA9A8120742BA800BB307F /* MASNetworkReachability.m in Sources */, A4150EFE1BF16EE200037E27 /* MASSecurityService.m in Sources */, A46F49C21C2F5FC500A4C370 /* MASIKeyChainStore.m in Sources */, - A46F49D61C2F5FC500A4C370 /* MASIURLResponseSerialization.m in Sources */, CB1907F91C17950700A5EF16 /* MASAccessService.m in Sources */, CBD25B0A1E78C47C00DFB47F /* JWTCoding.m in Sources */, CBD25B101E78C47C00DFB47F /* JWTErrorDescription.m in Sources */, A888437F2327858D0005F502 /* MASNetworkConfiguration.m in Sources */, CB5E4C6D1C1D2467001B3B8A /* MASDeleteURLRequest.m in Sources */, - A46F49CE1C2F5FC500A4C370 /* MASINetworkReachabilityManager.m in Sources */, A4831AEF1BD1A87C007B4AE6 /* MASAuthenticationProvider+MASPrivate.m in Sources */, - A46F49E81C2F5FC500A4C370 /* UIRefreshControl+MASINetworking.m in Sources */, CB6491DD1FE9DAF300281288 /* ForegroundReconnection.m in Sources */, CB1EE31D2009895A0056F24A /* MASMQTTForegroundReconnection.m in Sources */, CB6491F21FE9DAF300281288 /* MQTTProperties.m in Sources */, @@ -2162,7 +2049,7 @@ buildSettings = { CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CODE_SIGN_STYLE = Automatic; + CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = 2.0.10; DEAD_CODE_STRIPPING = YES; DEFINES_MODULE = YES; @@ -2211,7 +2098,7 @@ buildSettings = { CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CODE_SIGN_STYLE = Automatic; + CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = 2.0.10; DEAD_CODE_STRIPPING = YES; DEFINES_MODULE = YES; diff --git a/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/MASINetworkActivityIndicatorManager.h b/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/MASINetworkActivityIndicatorManager.h deleted file mode 100755 index c64b0794..00000000 --- a/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/MASINetworkActivityIndicatorManager.h +++ /dev/null @@ -1,80 +0,0 @@ -// MASINetworkActivityIndicatorManager.h -// Copyright (c) 2011–2015 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 -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import - -#import - -#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - `MASINetworkActivityIndicatorManager` manages the state of the network activity indicator in the status bar. When enabled, it will listen for notifications indicating that a network request operation has started or finished, and start or stop animating the indicator accordingly. The number of active requests is incremented and decremented much like a stack or a semaphore, and the activity indicator will animate so long as that number is greater than zero. - - You should enable the shared instance of `MASINetworkActivityIndicatorManager` when your application finishes launching. In `AppDelegate application:didFinishLaunchingWithOptions:` you can do so with the following code: - - [[MASINetworkActivityIndicatorManager sharedManager] setEnabled:YES]; - - By setting `enabled` to `YES` for `sharedManager`, the network activity indicator will show and hide automatically as requests start and finish. You should not ever need to call `incrementActivityCount` or `decrementActivityCount` yourself. - - See the Apple Human Interface Guidelines section about the Network Activity Indicator for more information: - http://developer.apple.com/library/iOS/#documentation/UserExperience/Conceptual/MobileHIG/UIElementGuidelines/UIElementGuidelines.html#//apple_ref/doc/uid/TP40006556-CH13-SW44 - */ -NS_EXTENSION_UNAVAILABLE_IOS("Use view controller based solutions where appropriate instead.") -@interface MASINetworkActivityIndicatorManager : NSObject - -/** - A Boolean value indicating whether the manager is enabled. - - If YES, the manager will change status bar network activity indicator according to network operation notifications it receives. The default value is NO. - */ -@property (nonatomic, assign, getter = isEnabled) BOOL enabled; - -/** - A Boolean value indicating whether the network activity indicator is currently displayed in the status bar. - */ -@property (readonly, nonatomic, assign) BOOL isNetworkActivityIndicatorVisible; - -/** - Returns the shared network activity indicator manager object for the system. - - @return The systemwide network activity indicator manager. - */ -+ (instancetype)sharedManager; - -/** - Increments the number of active network requests. If this number was zero before incrementing, this will start animating the status bar network activity indicator. - */ -- (void)incrementActivityCount; - -/** - Decrements the number of active network requests. If this number becomes zero after decrementing, this will stop animating the status bar network activity indicator. - */ -- (void)decrementActivityCount; - -@end - -NS_ASSUME_NONNULL_END - -#endif diff --git a/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/MASINetworkActivityIndicatorManager.m b/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/MASINetworkActivityIndicatorManager.m deleted file mode 100755 index fd598f95..00000000 --- a/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/MASINetworkActivityIndicatorManager.m +++ /dev/null @@ -1,170 +0,0 @@ -// MASINetworkActivityIndicatorManager.m -// Copyright (c) 2011–2015 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 -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import "MASINetworkActivityIndicatorManager.h" - -#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) - -#import "MASIHTTPRequestOperation.h" - -#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 -#import "MASIURLSessionManager.h" -#endif - -static NSTimeInterval const kMASINetworkActivityIndicatorInvisibilityDelay = 0.17; - -static NSURLRequest * MASINetworkRequestFromNotification(NSNotification *notification) { - if ([[notification object] isKindOfClass:[MASIURLConnectionOperation class]]) { - return [(MASIURLConnectionOperation *)[notification object] request]; - } - -#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 - if ([[notification object] respondsToSelector:@selector(originalRequest)]) { - return [(NSURLSessionTask *)[notification object] originalRequest]; - } -#endif - - return nil; -} - -@interface MASINetworkActivityIndicatorManager () -@property (readwrite, nonatomic, assign) NSInteger activityCount; -@property (readwrite, nonatomic, strong) NSTimer *activityIndicatorVisibilityTimer; -@property (readonly, nonatomic, getter = isNetworkActivityIndicatorVisible) BOOL networkActivityIndicatorVisible; - -- (void)updateNetworkActivityIndicatorVisibility; -- (void)updateNetworkActivityIndicatorVisibilityDelayed; -@end - -@implementation MASINetworkActivityIndicatorManager -@dynamic networkActivityIndicatorVisible; - -+ (instancetype)sharedManager { - static MASINetworkActivityIndicatorManager *_sharedManager = nil; - static dispatch_once_t oncePredicate; - dispatch_once(&oncePredicate, ^{ - _sharedManager = [[self alloc] init]; - }); - - return _sharedManager; -} - -+ (NSSet *)keyPathsForValuesAffectingIsNetworkActivityIndicatorVisible { - return [NSSet setWithObject:@"activityCount"]; -} - -- (id)init { - self = [super init]; - if (!self) { - return nil; - } - - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidStart:) name:MASINetworkingOperationDidStartNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidFinish:) name:MASINetworkingOperationDidFinishNotification object:nil]; - -#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidStart:) name:MASINetworkingTaskDidResumeNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidFinish:) name:MASINetworkingTaskDidSuspendNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidFinish:) name:MASINetworkingTaskDidCompleteNotification object:nil]; -#endif - - return self; -} - -- (void)dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; - - [_activityIndicatorVisibilityTimer invalidate]; -} - -- (void)updateNetworkActivityIndicatorVisibilityDelayed { - if (self.enabled) { - // Delay hiding of activity indicator for a short interval, to avoid flickering - if (![self isNetworkActivityIndicatorVisible]) { - [self.activityIndicatorVisibilityTimer invalidate]; - self.activityIndicatorVisibilityTimer = [NSTimer timerWithTimeInterval:kMASINetworkActivityIndicatorInvisibilityDelay target:self selector:@selector(updateNetworkActivityIndicatorVisibility) userInfo:nil repeats:NO]; - [[NSRunLoop mainRunLoop] addTimer:self.activityIndicatorVisibilityTimer forMode:NSRunLoopCommonModes]; - } else { - [self performSelectorOnMainThread:@selector(updateNetworkActivityIndicatorVisibility) withObject:nil waitUntilDone:NO modes:@[NSRunLoopCommonModes]]; - } - } -} - -- (BOOL)isNetworkActivityIndicatorVisible { - return self.activityCount > 0; -} - -- (void)updateNetworkActivityIndicatorVisibility { - [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:[self isNetworkActivityIndicatorVisible]]; -} - -- (void)setActivityCount:(NSInteger)activityCount { - @synchronized(self) { - _activityCount = activityCount; - } - - dispatch_async(dispatch_get_main_queue(), ^{ - [self updateNetworkActivityIndicatorVisibilityDelayed]; - }); -} - -- (void)incrementActivityCount { - [self willChangeValueForKey:@"activityCount"]; - @synchronized(self) { - _activityCount++; - } - [self didChangeValueForKey:@"activityCount"]; - - dispatch_async(dispatch_get_main_queue(), ^{ - [self updateNetworkActivityIndicatorVisibilityDelayed]; - }); -} - -- (void)decrementActivityCount { - [self willChangeValueForKey:@"activityCount"]; - @synchronized(self) { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wgnu" - _activityCount = MAX(_activityCount - 1, 0); -#pragma clang diagnostic pop - } - [self didChangeValueForKey:@"activityCount"]; - - dispatch_async(dispatch_get_main_queue(), ^{ - [self updateNetworkActivityIndicatorVisibilityDelayed]; - }); -} - -- (void)networkRequestDidStart:(NSNotification *)notification { - if ([MASINetworkRequestFromNotification(notification) URL]) { - [self incrementActivityCount]; - } -} - -- (void)networkRequestDidFinish:(NSNotification *)notification { - if ([MASINetworkRequestFromNotification(notification) URL]) { - [self decrementActivityCount]; - } -} - -@end - -#endif diff --git a/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/UIActivityIndicatorView+MASINetworking.h b/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/UIActivityIndicatorView+MASINetworking.h deleted file mode 100755 index b3aa5c22..00000000 --- a/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/UIActivityIndicatorView+MASINetworking.h +++ /dev/null @@ -1,63 +0,0 @@ -// UIActivityIndicatorView+MASINetworking.h -// Copyright (c) 2011–2015 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 -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import - -#import - -#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) - -#import - -@class MASIURLConnectionOperation; - -/** - This category adds methods to the UIKit framework's `UIActivityIndicatorView` class. The methods in this category provide support for automatically starting and stopping animation depending on the loading state of a request operation or session task. - */ -@interface UIActivityIndicatorView (MASINetworking) - -///---------------------------------- -/// @name Animating for Session Tasks -///---------------------------------- - -/** - Binds the animating state to the state of the specified task. - - @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled. - */ -#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 -- (void)setAnimatingWithStateOfTask:(nullable NSURLSessionTask *)task; -#endif - -///--------------------------------------- -/// @name Animating for Request Operations -///--------------------------------------- - -/** - Binds the animating state to the execution state of the specified operation. - - @param operation The operation. If `nil`, automatic updating from any previously specified operation will be disabled. - */ -- (void)setAnimatingWithStateOfOperation:(nullable MASIURLConnectionOperation *)operation; - -@end - -#endif diff --git a/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/UIActivityIndicatorView+MASINetworking.m b/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/UIActivityIndicatorView+MASINetworking.m deleted file mode 100755 index 2e93af8b..00000000 --- a/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/UIActivityIndicatorView+MASINetworking.m +++ /dev/null @@ -1,171 +0,0 @@ -// UIActivityIndicatorView+MASINetworking.m -// Copyright (c) 2011–2015 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 -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import "UIActivityIndicatorView+MASINetworking.h" -#import - -#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) - -#import "MASIHTTPRequestOperation.h" - -#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 -#import "MASIURLSessionManager.h" -#endif - -@interface AFActivityIndicatorViewNotificationObserver : NSObject -@property (readonly, nonatomic, weak) UIActivityIndicatorView *activityIndicatorView; -- (instancetype)initWithActivityIndicatorView:(UIActivityIndicatorView *)activityIndicatorView; - -#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 -- (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task; -#endif -- (void)setAnimatingWithStateOfOperation:(MASIURLConnectionOperation *)operation; - -@end - -@implementation UIActivityIndicatorView (MASINetworking) - -- (AFActivityIndicatorViewNotificationObserver *)af_notificationObserver { - AFActivityIndicatorViewNotificationObserver *notificationObserver = objc_getAssociatedObject(self, @selector(af_notificationObserver)); - if (notificationObserver == nil) { - notificationObserver = [[AFActivityIndicatorViewNotificationObserver alloc] initWithActivityIndicatorView:self]; - objc_setAssociatedObject(self, @selector(af_notificationObserver), notificationObserver, OBJC_ASSOCIATION_RETAIN_NONATOMIC); - } - return notificationObserver; -} - -#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 -- (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task { - [[self af_notificationObserver] setAnimatingWithStateOfTask:task]; -} -#endif - -- (void)setAnimatingWithStateOfOperation:(MASIURLConnectionOperation *)operation { - [[self af_notificationObserver] setAnimatingWithStateOfOperation:operation]; -} - -@end - -@implementation AFActivityIndicatorViewNotificationObserver - -- (instancetype)initWithActivityIndicatorView:(UIActivityIndicatorView *)activityIndicatorView -{ - self = [super init]; - if (self) { - _activityIndicatorView = activityIndicatorView; - } - return self; -} - -#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 -- (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task { - NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; - - [notificationCenter removeObserver:self name:MASINetworkingTaskDidResumeNotification object:nil]; - [notificationCenter removeObserver:self name:MASINetworkingTaskDidSuspendNotification object:nil]; - [notificationCenter removeObserver:self name:MASINetworkingTaskDidCompleteNotification object:nil]; - - if (task) { - if (task.state != NSURLSessionTaskStateCompleted) { - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wreceiver-is-weak" -#pragma clang diagnostic ignored "-Warc-repeated-use-of-weak" - if (task.state == NSURLSessionTaskStateRunning) { - [self.activityIndicatorView startAnimating]; - } else { - [self.activityIndicatorView stopAnimating]; - } -#pragma clang diagnostic pop - - [notificationCenter addObserver:self selector:@selector(af_startAnimating) name:MASINetworkingTaskDidResumeNotification object:task]; - [notificationCenter addObserver:self selector:@selector(af_stopAnimating) name:MASINetworkingTaskDidCompleteNotification object:task]; - [notificationCenter addObserver:self selector:@selector(af_stopAnimating) name:MASINetworkingTaskDidSuspendNotification object:task]; - } - } -} -#endif - -#pragma mark - - -- (void)setAnimatingWithStateOfOperation:(MASIURLConnectionOperation *)operation { - NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; - - [notificationCenter removeObserver:self name:MASINetworkingOperationDidStartNotification object:nil]; - [notificationCenter removeObserver:self name:MASINetworkingOperationDidFinishNotification object:nil]; - - if (operation) { - if (![operation isFinished]) { - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wreceiver-is-weak" -#pragma clang diagnostic ignored "-Warc-repeated-use-of-weak" - if ([operation isExecuting]) { - [self.activityIndicatorView startAnimating]; - } else { - [self.activityIndicatorView stopAnimating]; - } -#pragma clang diagnostic pop - - [notificationCenter addObserver:self selector:@selector(af_startAnimating) name:MASINetworkingOperationDidStartNotification object:operation]; - [notificationCenter addObserver:self selector:@selector(af_stopAnimating) name:MASINetworkingOperationDidFinishNotification object:operation]; - } - } -} - -#pragma mark - - -- (void)af_startAnimating { - dispatch_async(dispatch_get_main_queue(), ^{ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wreceiver-is-weak" - [self.activityIndicatorView startAnimating]; -#pragma clang diagnostic pop - }); -} - -- (void)af_stopAnimating { - dispatch_async(dispatch_get_main_queue(), ^{ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wreceiver-is-weak" - [self.activityIndicatorView stopAnimating]; -#pragma clang diagnostic pop - }); -} - -#pragma mark - - -- (void)dealloc { - NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; - -#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 - [notificationCenter removeObserver:self name:MASINetworkingTaskDidCompleteNotification object:nil]; - [notificationCenter removeObserver:self name:MASINetworkingTaskDidResumeNotification object:nil]; - [notificationCenter removeObserver:self name:MASINetworkingTaskDidSuspendNotification object:nil]; -#endif - - [notificationCenter removeObserver:self name:MASINetworkingOperationDidStartNotification object:nil]; - [notificationCenter removeObserver:self name:MASINetworkingOperationDidFinishNotification object:nil]; -} - -@end - -#endif diff --git a/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/UIAlertView+MASINetworking.h b/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/UIAlertView+MASINetworking.h deleted file mode 100755 index 2adfb1b7..00000000 --- a/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/UIAlertView+MASINetworking.h +++ /dev/null @@ -1,99 +0,0 @@ -// UIAlertView+MASINetworking.h -// Copyright (c) 2011–2015 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 -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import - -#import - -#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) - -#import - -NS_ASSUME_NONNULL_BEGIN - -@class MASIURLConnectionOperation; - -/** - This category adds methods to the UIKit framework's `UIAlertView` class. The methods in this category provide support for automatically showing an alert if a session task or request operation finishes with an error. Alert title and message are filled from the corresponding `localizedDescription` & `localizedRecoverySuggestion` or `localizedFailureReason` of the error. - */ -@interface UIAlertView (MASINetworking) - -///------------------------------------- -/// @name Showing Alert for Session Task -///------------------------------------- - -/** - Shows an alert view with the error of the specified session task, if any. - - @param task The session task. - @param delegate The alert view delegate. - */ -#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 -+ (void)showAlertViewForTaskWithErrorOnCompletion:(NSURLSessionTask *)task - delegate:(nullable id)delegate NS_EXTENSION_UNAVAILABLE_IOS("Not available in app extensions."); -#endif - -/** - Shows an alert view with the error of the specified session task, if any, with a custom cancel button title and other button titles. - - @param task The session task. - @param delegate The alert view delegate. - @param cancelButtonTitle The title of the cancel button or nil if there is no cancel button. Using this argument is equivalent to setting the cancel button index to the value returned by invoking addButtonWithTitle: specifying this title. - @param otherButtonTitles The title of another button. Using this argument is equivalent to invoking addButtonWithTitle: with this title to add more buttons. Too many buttons can cause the alert view to scroll. For guidelines on the best ways to use an alert in an app, see "Temporary Views". Titles of additional buttons to add to the receiver, terminated with `nil`. - */ -#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 -+ (void)showAlertViewForTaskWithErrorOnCompletion:(NSURLSessionTask *)task - delegate:(nullable id)delegate - cancelButtonTitle:(nullable NSString *)cancelButtonTitle - otherButtonTitles:(nullable NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION NS_EXTENSION_UNAVAILABLE_IOS("Not available in app extensions."); -#endif - -///------------------------------------------ -/// @name Showing Alert for Request Operation -///------------------------------------------ - -/** - Shows an alert view with the error of the specified request operation, if any. - - @param operation The request operation. - @param delegate The alert view delegate. - */ -+ (void)showAlertViewForRequestOperationWithErrorOnCompletion:(MASIURLConnectionOperation *)operation - delegate:(nullable id)delegate NS_EXTENSION_UNAVAILABLE_IOS("Not available in app extensions."); - -/** - Shows an alert view with the error of the specified request operation, if any, with a custom cancel button title and other button titles. - - @param operation The request operation. - @param delegate The alert view delegate. - @param cancelButtonTitle The title of the cancel button or nil if there is no cancel button. Using this argument is equivalent to setting the cancel button index to the value returned by invoking addButtonWithTitle: specifying this title. - @param otherButtonTitles The title of another button. Using this argument is equivalent to invoking addButtonWithTitle: with this title to add more buttons. Too many buttons can cause the alert view to scroll. For guidelines on the best ways to use an alert in an app, see "Temporary Views". Titles of additional buttons to add to the receiver, terminated with `nil`. - */ -+ (void)showAlertViewForRequestOperationWithErrorOnCompletion:(MASIURLConnectionOperation *)operation - delegate:(nullable id)delegate - cancelButtonTitle:(nullable NSString *)cancelButtonTitle - otherButtonTitles:(nullable NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION NS_EXTENSION_UNAVAILABLE_IOS("Not available in app extensions."); - -@end - -NS_ASSUME_NONNULL_END - -#endif diff --git a/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/UIAlertView+MASINetworking.m b/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/UIAlertView+MASINetworking.m deleted file mode 100755 index 92751a74..00000000 --- a/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/UIAlertView+MASINetworking.m +++ /dev/null @@ -1,141 +0,0 @@ -// UIAlertView+MASINetworking.m -// Copyright (c) 2011–2015 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 -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import "UIAlertView+MASINetworking.h" - -#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) - -#import "MASIURLConnectionOperation.h" - -#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 -#import "MASIURLSessionManager.h" -#endif - -static void AFGetAlertViewTitleAndMessageFromError(NSError *error, NSString * __autoreleasing *title, NSString * __autoreleasing *message) { - if (error.localizedDescription && (error.localizedRecoverySuggestion || error.localizedFailureReason)) { - *title = error.localizedDescription; - - if (error.localizedRecoverySuggestion) { - *message = error.localizedRecoverySuggestion; - } else { - *message = error.localizedFailureReason; - } - } else if (error.localizedDescription) { - *title = NSLocalizedStringFromTable(@"Error", @"MASINetworking", @"Fallback Error Description"); - *message = error.localizedDescription; - } else { - *title = NSLocalizedStringFromTable(@"Error", @"MASINetworking", @"Fallback Error Description"); - *message = [NSString stringWithFormat:NSLocalizedStringFromTable(@"%@ Error: %ld", @"MASINetworking", @"Fallback Error Failure Reason Format"), error.domain, (long)error.code]; - } -} - -@implementation UIAlertView (MASINetworking) - -#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 -+ (void)showAlertViewForTaskWithErrorOnCompletion:(NSURLSessionTask *)task - delegate:(id)delegate -{ - [self showAlertViewForTaskWithErrorOnCompletion:task delegate:delegate cancelButtonTitle:NSLocalizedStringFromTable(@"Dismiss", @"MASINetworking", @"UIAlertView Cancel Button Title") otherButtonTitles:nil, nil]; -} - -+ (void)showAlertViewForTaskWithErrorOnCompletion:(NSURLSessionTask *)task - delegate:(id)delegate - cancelButtonTitle:(NSString *)cancelButtonTitle - otherButtonTitles:(NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION -{ - NSMutableArray *mutableOtherTitles = [NSMutableArray array]; - va_list otherButtonTitleList; - va_start(otherButtonTitleList, otherButtonTitles); - { - for (NSString *otherButtonTitle = otherButtonTitles; otherButtonTitle != nil; otherButtonTitle = va_arg(otherButtonTitleList, NSString *)) { - [mutableOtherTitles addObject:otherButtonTitle]; - } - } - va_end(otherButtonTitleList); - - __block __weak id observer = [[NSNotificationCenter defaultCenter] addObserverForName:MASINetworkingTaskDidCompleteNotification object:task queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notification) { - NSError *error = notification.userInfo[MASINetworkingTaskDidCompleteErrorKey]; - if (error) { - NSString *title, *message; - AFGetAlertViewTitleAndMessageFromError(error, &title, &message); - - UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:nil message:nil delegate:delegate cancelButtonTitle:cancelButtonTitle otherButtonTitles:nil, nil]; - for (NSString *otherButtonTitle in mutableOtherTitles) { - [alertView addButtonWithTitle:otherButtonTitle]; - } - [alertView setTitle:title]; - [alertView setMessage:message]; - [alertView show]; - } - - [[NSNotificationCenter defaultCenter] removeObserver:observer]; - }]; -} -#endif - -#pragma mark - - -+ (void)showAlertViewForRequestOperationWithErrorOnCompletion:(MASIURLConnectionOperation *)operation - delegate:(id)delegate -{ - [self showAlertViewForRequestOperationWithErrorOnCompletion:operation delegate:delegate cancelButtonTitle:NSLocalizedStringFromTable(@"Dismiss", @"MASINetworking", @"UIAlertView Cancel Button Title") otherButtonTitles:nil, nil]; -} - -+ (void)showAlertViewForRequestOperationWithErrorOnCompletion:(MASIURLConnectionOperation *)operation - delegate:(id)delegate - cancelButtonTitle:(NSString *)cancelButtonTitle - otherButtonTitles:(NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION -{ - NSMutableArray *mutableOtherTitles = [NSMutableArray array]; - va_list otherButtonTitleList; - va_start(otherButtonTitleList, otherButtonTitles); - { - for (NSString *otherButtonTitle = otherButtonTitles; otherButtonTitle != nil; otherButtonTitle = va_arg(otherButtonTitleList, NSString *)) { - [mutableOtherTitles addObject:otherButtonTitle]; - } - } - va_end(otherButtonTitleList); - - __block __weak id observer = [[NSNotificationCenter defaultCenter] addObserverForName:MASINetworkingOperationDidFinishNotification object:operation queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notification) { - - if (notification.object && [notification.object isKindOfClass:[MASIURLConnectionOperation class]]) { - NSError *error = [(MASIURLConnectionOperation *)notification.object error]; - if (error) { - NSString *title, *message; - AFGetAlertViewTitleAndMessageFromError(error, &title, &message); - - UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:nil message:nil delegate:delegate cancelButtonTitle:cancelButtonTitle otherButtonTitles:nil, nil]; - for (NSString *otherButtonTitle in mutableOtherTitles) { - [alertView addButtonWithTitle:otherButtonTitle]; - } - [alertView setTitle:title]; - [alertView setMessage:message]; - [alertView show]; - } - } - - [[NSNotificationCenter defaultCenter] removeObserver:observer]; - }]; -} - -@end - -#endif diff --git a/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/UIButton+MASINetworking.h b/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/UIButton+MASINetworking.h deleted file mode 100755 index 98835e63..00000000 --- a/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/UIButton+MASINetworking.h +++ /dev/null @@ -1,186 +0,0 @@ -// UIButton+MASINetworking.h -// Copyright (c) 2011–2015 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 -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import - -#import - -#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) - -#import - -NS_ASSUME_NONNULL_BEGIN - -@protocol MASIURLResponseSerialization, MASIImageCache; - -/** - This category adds methods to the UIKit framework's `UIButton` class. The methods in this category provide support for loading remote images and background images asynchronously from a URL. - - @warning Compound values for control `state` (such as `UIControlStateHighlighted | UIControlStateDisabled`) are unsupported. - */ -@interface UIButton (MASINetworking) - -///---------------------------- -/// @name Accessing Image Cache -///---------------------------- - -/** - The image cache used to improve image loading performance on scroll views. By default, `UIButton` will use the `sharedImageCache` of `UIImageView`. - */ -+ (id )sharedImageCache; - -/** - Set the cache used for image loading. - - @param imageCache The image cache. - */ -+ (void)setSharedImageCache:(__nullable id )imageCache; - -///------------------------------------ -/// @name Accessing Response Serializer -///------------------------------------ - -/** - The response serializer used to create an image representation from the server response and response data. By default, this is an instance of `MASIImageResponseSerializer`. - - @discussion Subclasses of `MASIImageResponseSerializer` could be used to perform post-processing, such as color correction, face detection, or other effects. See https://github.com/MASINetworking/AFCoreImageSerializer - */ -@property (nonatomic, strong) id imageResponseSerializer; - -///-------------------- -/// @name Setting Image -///-------------------- - -/** - Asynchronously downloads an image from the specified URL, and sets it as the image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled. - - If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. - - @param state The control state. - @param url The URL used for the image request. - */ -- (void)setImageForState:(UIControlState)state - withURL:(NSURL *)url; - -/** - Asynchronously downloads an image from the specified URL, and sets it as the image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled. - - If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. - - @param state The control state. - @param url The URL used for the image request. - @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the button will not change its image until the image request finishes. - */ -- (void)setImageForState:(UIControlState)state - withURL:(NSURL *)url - placeholderImage:(nullable UIImage *)placeholderImage; - -/** - Asynchronously downloads an image from the specified URL request, and sets it as the image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled. - - If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. - - If a success block is specified, it is the responsibility of the block to set the image of the button before returning. If no success block is specified, the default behavior of setting the image with `setImage:forState:` is applied. - - @param state The control state. - @param urlRequest The URL request used for the image request. - @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the button will not change its image until the image request finishes. - @param success A block to be executed when the image request operation finishes successfully. This block has no return value and takes two arguments: the server response and the image. If the image was returned from cache, the response parameter will be `nil`. - @param failure A block object to be executed when the image request operation finishes unsuccessfully, or that finishes successfully. This block has no return value and takes a single argument: the error that occurred. - */ -- (void)setImageForState:(UIControlState)state - withURLRequest:(NSURLRequest *)urlRequest - placeholderImage:(nullable UIImage *)placeholderImage - success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * __nullable response, UIImage *image))success - failure:(nullable void (^)(NSError *error))failure; - - -///------------------------------- -/// @name Setting Background Image -///------------------------------- - -/** - Asynchronously downloads an image from the specified URL, and sets it as the background image for the specified state once the request is finished. Any previous background image request for the receiver will be cancelled. - - If the background image is cached locally, the background image is set immediately, otherwise the specified placeholder background image will be set immediately, and then the remote background image will be set once the request is finished. - - @param state The control state. - @param url The URL used for the background image request. - */ -- (void)setBackgroundImageForState:(UIControlState)state - withURL:(NSURL *)url; - -/** - Asynchronously downloads an image from the specified URL, and sets it as the background image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled. - - If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. - - @param state The control state. - @param url The URL used for the background image request. - @param placeholderImage The background image to be set initially, until the background image request finishes. If `nil`, the button will not change its background image until the background image request finishes. - */ -- (void)setBackgroundImageForState:(UIControlState)state - withURL:(NSURL *)url - placeholderImage:(nullable UIImage *)placeholderImage; - -/** - Asynchronously downloads an image from the specified URL request, and sets it as the image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled. - - If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. - - If a success block is specified, it is the responsibility of the block to set the image of the button before returning. If no success block is specified, the default behavior of setting the image with `setBackgroundImage:forState:` is applied. - - @param state The control state. - @param urlRequest The URL request used for the image request. - @param placeholderImage The background image to be set initially, until the background image request finishes. If `nil`, the button will not change its background image until the background image request finishes. - @param success A block to be executed when the image request operation finishes successfully. This block has no return value and takes two arguments: the server response and the image. If the image was returned from cache, the response parameter will be `nil`. - @param failure A block object to be executed when the image request operation finishes unsuccessfully, or that finishes successfully. This block has no return value and takes a single argument: the error that occurred. - */ -- (void)setBackgroundImageForState:(UIControlState)state - withURLRequest:(NSURLRequest *)urlRequest - placeholderImage:(nullable UIImage *)placeholderImage - success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * __nullable response, UIImage *image))success - failure:(nullable void (^)(NSError *error))failure; - - -///------------------------------ -/// @name Canceling Image Loading -///------------------------------ - -/** - Cancels any executing image operation for the specified control state of the receiver, if one exists. - - @param state The control state. - */ -- (void)cancelImageRequestOperationForState:(UIControlState)state; - -/** - Cancels any executing background image operation for the specified control state of the receiver, if one exists. - - @param state The control state. - */ -- (void)cancelBackgroundImageRequestOperationForState:(UIControlState)state; - -@end - -NS_ASSUME_NONNULL_END - -#endif diff --git a/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/UIButton+MASINetworking.m b/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/UIButton+MASINetworking.m deleted file mode 100755 index c0c2a1af..00000000 --- a/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/UIButton+MASINetworking.m +++ /dev/null @@ -1,293 +0,0 @@ -// UIButton+MASINetworking.m -// Copyright (c) 2011–2015 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 -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import "UIButton+MASINetworking.h" - -#import - -#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) - -#import "MASIURLResponseSerialization.h" -#import "MASIHTTPRequestOperation.h" - -#import "UIImageView+MASINetworking.h" - -@interface UIButton (_MASINetworking) -@end - -@implementation UIButton (_MASINetworking) - -+ (NSOperationQueue *)af_sharedImageRequestOperationQueue { - static NSOperationQueue *_af_sharedImageRequestOperationQueue = nil; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - _af_sharedImageRequestOperationQueue = [[NSOperationQueue alloc] init]; - _af_sharedImageRequestOperationQueue.maxConcurrentOperationCount = NSOperationQueueDefaultMaxConcurrentOperationCount; - }); - - return _af_sharedImageRequestOperationQueue; -} - -#pragma mark - - -static char MASIImageRequestOperationNormal; -static char MASIImageRequestOperationHighlighted; -static char MASIImageRequestOperationSelected; -static char MASIImageRequestOperationDisabled; - -static const char * af_imageRequestOperationKeyForState(UIControlState state) { - switch (state) { - case UIControlStateHighlighted: - return &MASIImageRequestOperationHighlighted; - case UIControlStateSelected: - return &MASIImageRequestOperationSelected; - case UIControlStateDisabled: - return &MASIImageRequestOperationDisabled; - case UIControlStateNormal: - default: - return &MASIImageRequestOperationNormal; - } -} - -- (MASIHTTPRequestOperation *)af_imageRequestOperationForState:(UIControlState)state { - return (MASIHTTPRequestOperation *)objc_getAssociatedObject(self, af_imageRequestOperationKeyForState(state)); -} - -- (void)af_setImageRequestOperation:(MASIHTTPRequestOperation *)imageRequestOperation - forState:(UIControlState)state -{ - objc_setAssociatedObject(self, af_imageRequestOperationKeyForState(state), imageRequestOperation, OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} - -#pragma mark - - -static char AFBackgroundImageRequestOperationNormal; -static char AFBackgroundImageRequestOperationHighlighted; -static char AFBackgroundImageRequestOperationSelected; -static char AFBackgroundImageRequestOperationDisabled; - -static const char * af_backgroundImageRequestOperationKeyForState(UIControlState state) { - switch (state) { - case UIControlStateHighlighted: - return &AFBackgroundImageRequestOperationHighlighted; - case UIControlStateSelected: - return &AFBackgroundImageRequestOperationSelected; - case UIControlStateDisabled: - return &AFBackgroundImageRequestOperationDisabled; - case UIControlStateNormal: - default: - return &AFBackgroundImageRequestOperationNormal; - } -} - -- (MASIHTTPRequestOperation *)af_backgroundImageRequestOperationForState:(UIControlState)state { - return (MASIHTTPRequestOperation *)objc_getAssociatedObject(self, af_backgroundImageRequestOperationKeyForState(state)); -} - -- (void)af_setBackgroundImageRequestOperation:(MASIHTTPRequestOperation *)imageRequestOperation - forState:(UIControlState)state -{ - objc_setAssociatedObject(self, af_backgroundImageRequestOperationKeyForState(state), imageRequestOperation, OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} - -@end - -#pragma mark - - -@implementation UIButton (MASINetworking) - -+ (id )sharedImageCache { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wgnu" - return objc_getAssociatedObject(self, @selector(sharedImageCache)) ?: [UIImageView sharedImageCache]; -#pragma clang diagnostic pop -} - -+ (void)setSharedImageCache:(__nullable id )imageCache { - objc_setAssociatedObject(self, @selector(sharedImageCache), imageCache, OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} - -#pragma mark - - -- (id )imageResponseSerializer { - static id _af_defaultImageResponseSerializer = nil; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - _af_defaultImageResponseSerializer = [MASIImageResponseSerializer serializer]; - }); - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wgnu" - return objc_getAssociatedObject(self, @selector(imageResponseSerializer)) ?: _af_defaultImageResponseSerializer; -#pragma clang diagnostic pop -} - -- (void)setImageResponseSerializer:(id )serializer { - objc_setAssociatedObject(self, @selector(imageResponseSerializer), serializer, OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} - -#pragma mark - - -- (void)setImageForState:(UIControlState)state - withURL:(NSURL *)url -{ - [self setImageForState:state withURL:url placeholderImage:nil]; -} - -- (void)setImageForState:(UIControlState)state - withURL:(NSURL *)url - placeholderImage:(UIImage *)placeholderImage -{ - NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; - [request addValue:@"image/*" forHTTPHeaderField:@"Accept"]; - - [self setImageForState:state withURLRequest:request placeholderImage:placeholderImage success:nil failure:nil]; -} - -- (void)setImageForState:(UIControlState)state - withURLRequest:(NSURLRequest *)urlRequest - placeholderImage:(UIImage *)placeholderImage - success:(void (^)(NSURLRequest *request, NSHTTPURLResponse * __nullable response, UIImage *image))success - failure:(void (^)(NSError *error))failure -{ - [self cancelImageRequestOperationForState:state]; - - UIImage *cachedImage = [[[self class] sharedImageCache] cachedImageForRequest:urlRequest]; - if (cachedImage) { - if (success) { - success(urlRequest, nil, cachedImage); - } else { - [self setImage:cachedImage forState:state]; - } - - [self af_setImageRequestOperation:nil forState:state]; - } else { - if (placeholderImage) { - [self setImage:placeholderImage forState:state]; - } - - __weak __typeof(self)weakSelf = self; - MASIHTTPRequestOperation *imageRequestOperation = [[MASIHTTPRequestOperation alloc] initWithRequest:urlRequest]; - imageRequestOperation.responseSerializer = self.imageResponseSerializer; - [imageRequestOperation setCompletionBlockWithSuccess:^(MASIHTTPRequestOperation *operation, id responseObject) { - __strong __typeof(weakSelf)strongSelf = weakSelf; - if ([[urlRequest URL] isEqual:[operation.request URL]]) { - if (success) { - success(operation.request, operation.response, responseObject); - } else if (responseObject) { - [strongSelf setImage:responseObject forState:state]; - } - } - [[[strongSelf class] sharedImageCache] cacheImage:responseObject forRequest:urlRequest]; - } failure:^(MASIHTTPRequestOperation *operation, NSError *error) { - if ([[urlRequest URL] isEqual:[operation.request URL]]) { - if (failure) { - failure(error); - } - } - }]; - - [self af_setImageRequestOperation:imageRequestOperation forState:state]; - [[[self class] af_sharedImageRequestOperationQueue] addOperation:imageRequestOperation]; - } -} - -#pragma mark - - -- (void)setBackgroundImageForState:(UIControlState)state - withURL:(NSURL *)url -{ - [self setBackgroundImageForState:state withURL:url placeholderImage:nil]; -} - -- (void)setBackgroundImageForState:(UIControlState)state - withURL:(NSURL *)url - placeholderImage:(UIImage *)placeholderImage -{ - NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; - [request addValue:@"image/*" forHTTPHeaderField:@"Accept"]; - - [self setBackgroundImageForState:state withURLRequest:request placeholderImage:placeholderImage success:nil failure:nil]; -} - -- (void)setBackgroundImageForState:(UIControlState)state - withURLRequest:(NSURLRequest *)urlRequest - placeholderImage:(UIImage *)placeholderImage - success:(void (^)(NSURLRequest *request, NSHTTPURLResponse * __nullable response, UIImage *image))success - failure:(void (^)(NSError *error))failure -{ - [self cancelBackgroundImageRequestOperationForState:state]; - - UIImage *cachedImage = [[[self class] sharedImageCache] cachedImageForRequest:urlRequest]; - if (cachedImage) { - if (success) { - success(urlRequest, nil, cachedImage); - } else { - [self setBackgroundImage:cachedImage forState:state]; - } - - [self af_setBackgroundImageRequestOperation:nil forState:state]; - } else { - if (placeholderImage) { - [self setBackgroundImage:placeholderImage forState:state]; - } - - __weak __typeof(self)weakSelf = self; - MASIHTTPRequestOperation *backgroundImageRequestOperation = [[MASIHTTPRequestOperation alloc] initWithRequest:urlRequest]; - backgroundImageRequestOperation.responseSerializer = self.imageResponseSerializer; - [backgroundImageRequestOperation setCompletionBlockWithSuccess:^(MASIHTTPRequestOperation *operation, id responseObject) { - __strong __typeof(weakSelf)strongSelf = weakSelf; - if ([[urlRequest URL] isEqual:[operation.request URL]]) { - if (success) { - success(operation.request, operation.response, responseObject); - } else if (responseObject) { - [strongSelf setBackgroundImage:responseObject forState:state]; - } - } - [[[strongSelf class] sharedImageCache] cacheImage:responseObject forRequest:urlRequest]; - } failure:^(MASIHTTPRequestOperation *operation, NSError *error) { - if ([[urlRequest URL] isEqual:[operation.request URL]]) { - if (failure) { - failure(error); - } - } - }]; - - [self af_setBackgroundImageRequestOperation:backgroundImageRequestOperation forState:state]; - [[[self class] af_sharedImageRequestOperationQueue] addOperation:backgroundImageRequestOperation]; - } -} - -#pragma mark - - -- (void)cancelImageRequestOperationForState:(UIControlState)state { - [[self af_imageRequestOperationForState:state] cancel]; - [self af_setImageRequestOperation:nil forState:state]; -} - -- (void)cancelBackgroundImageRequestOperationForState:(UIControlState)state { - [[self af_backgroundImageRequestOperationForState:state] cancel]; - [self af_setBackgroundImageRequestOperation:nil forState:state]; -} - -@end - -#endif diff --git a/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/UIImage+MASINetworking.h b/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/UIImage+MASINetworking.h deleted file mode 100755 index accabbd6..00000000 --- a/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/UIImage+MASINetworking.h +++ /dev/null @@ -1,35 +0,0 @@ -// -// UIImage+MASINetworking.h -// -// -// Created by Paulo Ferreira on 08/07/15. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) - -#import - -@interface UIImage (MASINetworking) - -+ (UIImage*) safeImageWithData:(NSData*)data; - -@end - -#endif diff --git a/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/UIKit+MASINetworking.h b/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/UIKit+MASINetworking.h deleted file mode 100755 index 35f6d886..00000000 --- a/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/UIKit+MASINetworking.h +++ /dev/null @@ -1,39 +0,0 @@ -// UIKit+MASINetworking.h -// -// Copyright (c) 2013 MASINetworking (http://afnetworking.com/) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#if TARGET_OS_IOS -#import - -#ifndef _UIKIT_AFNETWORKING_ - #define _UIKIT_AFNETWORKING_ - - #import "MASINetworkActivityIndicatorManager.h" - - #import "UIActivityIndicatorView+MASINetworking.h" - #import "UIAlertView+MASINetworking.h" - #import "UIButton+MASINetworking.h" - #import "UIImageView+MASINetworking.h" - #import "UIProgressView+MASINetworking.h" - #import "UIRefreshControl+MASINetworking.h" - #import "UIWebView+MASINetworking.h" -#endif /* _UIKIT_AFNETWORKING_ */ -#endif diff --git a/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/UIProgressView+MASINetworking.h b/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/UIProgressView+MASINetworking.h deleted file mode 100755 index 0202450e..00000000 --- a/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/UIProgressView+MASINetworking.h +++ /dev/null @@ -1,91 +0,0 @@ -// UIProgressView+MASINetworking.h -// Copyright (c) 2011–2015 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 -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import - -#import - -#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) - -#import - -NS_ASSUME_NONNULL_BEGIN - -@class MASIURLConnectionOperation; - -/** - This category adds methods to the UIKit framework's `UIProgressView` class. The methods in this category provide support for binding the progress to the upload and download progress of a session task or request operation. - */ -@interface UIProgressView (MASINetworking) - -///------------------------------------ -/// @name Setting Session Task Progress -///------------------------------------ - -/** - Binds the progress to the upload progress of the specified session task. - - @param task The session task. - @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. - */ -#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 -- (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task - animated:(BOOL)animated; -#endif - -/** - Binds the progress to the download progress of the specified session task. - - @param task The session task. - @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. - */ -#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 -- (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task - animated:(BOOL)animated; -#endif - -///------------------------------------ -/// @name Setting Session Task Progress -///------------------------------------ - -/** - Binds the progress to the upload progress of the specified request operation. - - @param operation The request operation. - @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. - */ -- (void)setProgressWithUploadProgressOfOperation:(MASIURLConnectionOperation *)operation - animated:(BOOL)animated; - -/** - Binds the progress to the download progress of the specified request operation. - - @param operation The request operation. - @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. - */ -- (void)setProgressWithDownloadProgressOfOperation:(MASIURLConnectionOperation *)operation - animated:(BOOL)animated; - -@end - -NS_ASSUME_NONNULL_END - -#endif diff --git a/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/UIProgressView+MASINetworking.m b/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/UIProgressView+MASINetworking.m deleted file mode 100755 index bd16b2c9..00000000 --- a/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/UIProgressView+MASINetworking.m +++ /dev/null @@ -1,182 +0,0 @@ -// UIProgressView+MASINetworking.m -// Copyright (c) 2011–2015 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 -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import "UIProgressView+MASINetworking.h" - -#import - -#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) - -#import "MASIURLConnectionOperation.h" - -#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 -#import "MASIURLSessionManager.h" -#endif - -static void * AFTaskCountOfBytesSentContext = &AFTaskCountOfBytesSentContext; -static void * AFTaskCountOfBytesReceivedContext = &AFTaskCountOfBytesReceivedContext; - -@interface MASIURLConnectionOperation (_UIProgressView) -@property (readwrite, nonatomic, copy) void (^uploadProgress)(NSUInteger bytes, long long totalBytes, long long totalBytesExpected); -@property (readwrite, nonatomic, assign, setter = af_setUploadProgressAnimated:) BOOL af_uploadProgressAnimated; - -@property (readwrite, nonatomic, copy) void (^downloadProgress)(NSUInteger bytes, long long totalBytes, long long totalBytesExpected); -@property (readwrite, nonatomic, assign, setter = af_setDownloadProgressAnimated:) BOOL af_downloadProgressAnimated; -@end - -@implementation MASIURLConnectionOperation (_UIProgressView) -@dynamic uploadProgress; // Implemented in MASIURLConnectionOperation -@dynamic af_uploadProgressAnimated; - -@dynamic downloadProgress; // Implemented in MASIURLConnectionOperation -@dynamic af_downloadProgressAnimated; -@end - -#pragma mark - - -@implementation UIProgressView (MASINetworking) - -- (BOOL)af_uploadProgressAnimated { - return [(NSNumber *)objc_getAssociatedObject(self, @selector(af_uploadProgressAnimated)) boolValue]; -} - -- (void)af_setUploadProgressAnimated:(BOOL)animated { - objc_setAssociatedObject(self, @selector(af_uploadProgressAnimated), @(animated), OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} - -- (BOOL)af_downloadProgressAnimated { - return [(NSNumber *)objc_getAssociatedObject(self, @selector(af_downloadProgressAnimated)) boolValue]; -} - -- (void)af_setDownloadProgressAnimated:(BOOL)animated { - objc_setAssociatedObject(self, @selector(af_downloadProgressAnimated), @(animated), OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} - -#pragma mark - - -#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 -- (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task - animated:(BOOL)animated -{ - [task addObserver:self forKeyPath:@"state" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesSentContext]; - [task addObserver:self forKeyPath:@"countOfBytesSent" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesSentContext]; - - [self af_setUploadProgressAnimated:animated]; -} - -- (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task - animated:(BOOL)animated -{ - [task addObserver:self forKeyPath:@"state" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesReceivedContext]; - [task addObserver:self forKeyPath:@"countOfBytesReceived" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesReceivedContext]; - - [self af_setDownloadProgressAnimated:animated]; -} -#endif - -#pragma mark - - -- (void)setProgressWithUploadProgressOfOperation:(MASIURLConnectionOperation *)operation - animated:(BOOL)animated -{ - __weak __typeof(self)weakSelf = self; - void (^original)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite) = [operation.uploadProgress copy]; - [operation setUploadProgressBlock:^(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite) { - if (original) { - original(bytesWritten, totalBytesWritten, totalBytesExpectedToWrite); - } - - dispatch_async(dispatch_get_main_queue(), ^{ - if (totalBytesExpectedToWrite > 0) { - __strong __typeof(weakSelf)strongSelf = weakSelf; - [strongSelf setProgress:(totalBytesWritten / (totalBytesExpectedToWrite * 1.0f)) animated:animated]; - } - }); - }]; -} - -- (void)setProgressWithDownloadProgressOfOperation:(MASIURLConnectionOperation *)operation - animated:(BOOL)animated -{ - __weak __typeof(self)weakSelf = self; - void (^original)(NSUInteger bytesRead, long long totalBytesRead, long long totalBytesExpectedToRead) = [operation.downloadProgress copy]; - [operation setDownloadProgressBlock:^(NSUInteger bytesRead, long long totalBytesRead, long long totalBytesExpectedToRead) { - if (original) { - original(bytesRead, totalBytesRead, totalBytesExpectedToRead); - } - - dispatch_async(dispatch_get_main_queue(), ^{ - if (totalBytesExpectedToRead > 0) { - __strong __typeof(weakSelf)strongSelf = weakSelf; - [strongSelf setProgress:(totalBytesRead / (totalBytesExpectedToRead * 1.0f)) animated:animated]; - } - }); - }]; -} - -#pragma mark - NSKeyValueObserving - -- (void)observeValueForKeyPath:(NSString *)keyPath - ofObject:(id)object - change:(__unused NSDictionary *)change - context:(void *)context -{ -#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 - if (context == AFTaskCountOfBytesSentContext || context == AFTaskCountOfBytesReceivedContext) { - if ([keyPath isEqualToString:NSStringFromSelector(@selector(countOfBytesSent))]) { - if ([object countOfBytesExpectedToSend] > 0) { - dispatch_async(dispatch_get_main_queue(), ^{ - [self setProgress:[object countOfBytesSent] / ([object countOfBytesExpectedToSend] * 1.0f) animated:self.af_uploadProgressAnimated]; - }); - } - } - - if ([keyPath isEqualToString:NSStringFromSelector(@selector(countOfBytesReceived))]) { - if ([object countOfBytesExpectedToReceive] > 0) { - dispatch_async(dispatch_get_main_queue(), ^{ - [self setProgress:[object countOfBytesReceived] / ([object countOfBytesExpectedToReceive] * 1.0f) animated:self.af_downloadProgressAnimated]; - }); - } - } - - if ([keyPath isEqualToString:NSStringFromSelector(@selector(state))]) { - if ([(NSURLSessionTask *)object state] == NSURLSessionTaskStateCompleted) { - @try { - [object removeObserver:self forKeyPath:NSStringFromSelector(@selector(state))]; - - if (context == AFTaskCountOfBytesSentContext) { - [object removeObserver:self forKeyPath:NSStringFromSelector(@selector(countOfBytesSent))]; - } - - if (context == AFTaskCountOfBytesReceivedContext) { - [object removeObserver:self forKeyPath:NSStringFromSelector(@selector(countOfBytesReceived))]; - } - } - @catch (NSException * __unused exception) {} - } - } - } -#endif -} - -@end - -#endif diff --git a/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/UIRefreshControl+MASINetworking.h b/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/UIRefreshControl+MASINetworking.h deleted file mode 100755 index 60be2d6f..00000000 --- a/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/UIRefreshControl+MASINetworking.h +++ /dev/null @@ -1,68 +0,0 @@ -// UIRefreshControl+MASINetworking.m -// -// Copyright (c) 2014 MASINetworking (http://afnetworking.com) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import - -#import - -#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) - -#import - -NS_ASSUME_NONNULL_BEGIN - -@class MASIURLConnectionOperation; - -/** - This category adds methods to the UIKit framework's `UIRefreshControl` class. The methods in this category provide support for automatically beginning and ending refreshing depending on the loading state of a request operation or session task. - */ -@interface UIRefreshControl (MASINetworking) - -///----------------------------------- -/// @name Refreshing for Session Tasks -///----------------------------------- - -/** - Binds the refreshing state to the state of the specified task. - - @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled. - */ -#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 -- (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task; -#endif - -///---------------------------------------- -/// @name Refreshing for Request Operations -///---------------------------------------- - -/** - Binds the refreshing state to the execution state of the specified operation. - - @param operation The operation. If `nil`, automatic updating from any previously specified operation will be disabled. - */ -- (void)setRefreshingWithStateOfOperation:(MASIURLConnectionOperation *)operation; - -@end - -NS_ASSUME_NONNULL_END - -#endif diff --git a/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/UIRefreshControl+MASINetworking.m b/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/UIRefreshControl+MASINetworking.m deleted file mode 100755 index 00f96503..00000000 --- a/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/UIRefreshControl+MASINetworking.m +++ /dev/null @@ -1,166 +0,0 @@ -// UIRefreshControl+MASINetworking.m -// -// Copyright (c) 2014 MASINetworking (http://afnetworking.com) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import "UIRefreshControl+MASINetworking.h" -#import - -#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) - -#import "MASIHTTPRequestOperation.h" - -#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 -#import "MASIURLSessionManager.h" -#endif - -@interface AFRefreshControlNotificationObserver : NSObject -@property (readonly, nonatomic, weak) UIRefreshControl *refreshControl; -- (instancetype)initWithActivityRefreshControl:(UIRefreshControl *)refreshControl; - -#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 -- (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task; -#endif -- (void)setRefreshingWithStateOfOperation:(MASIURLConnectionOperation *)operation; - -@end - -@implementation UIRefreshControl (MASINetworking) - -- (AFRefreshControlNotificationObserver *)af_notificationObserver { - AFRefreshControlNotificationObserver *notificationObserver = objc_getAssociatedObject(self, @selector(af_notificationObserver)); - if (notificationObserver == nil) { - notificationObserver = [[AFRefreshControlNotificationObserver alloc] initWithActivityRefreshControl:self]; - objc_setAssociatedObject(self, @selector(af_notificationObserver), notificationObserver, OBJC_ASSOCIATION_RETAIN_NONATOMIC); - } - return notificationObserver; -} - -#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 -- (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task { - [[self af_notificationObserver] setRefreshingWithStateOfTask:task]; -} -#endif - -- (void)setRefreshingWithStateOfOperation:(MASIURLConnectionOperation *)operation { - [[self af_notificationObserver] setRefreshingWithStateOfOperation:operation]; -} - -@end - -@implementation AFRefreshControlNotificationObserver - -- (instancetype)initWithActivityRefreshControl:(UIRefreshControl *)refreshControl -{ - self = [super init]; - if (self) { - _refreshControl = refreshControl; - } - return self; -} - -#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 -- (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task { - NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; - - [notificationCenter removeObserver:self name:MASINetworkingTaskDidResumeNotification object:nil]; - [notificationCenter removeObserver:self name:MASINetworkingTaskDidSuspendNotification object:nil]; - [notificationCenter removeObserver:self name:MASINetworkingTaskDidCompleteNotification object:nil]; - - if (task) { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wreceiver-is-weak" -#pragma clang diagnostic ignored "-Warc-repeated-use-of-weak" - if (task.state == NSURLSessionTaskStateRunning) { - [self.refreshControl beginRefreshing]; - - [notificationCenter addObserver:self selector:@selector(af_beginRefreshing) name:MASINetworkingTaskDidResumeNotification object:task]; - [notificationCenter addObserver:self selector:@selector(af_endRefreshing) name:MASINetworkingTaskDidCompleteNotification object:task]; - [notificationCenter addObserver:self selector:@selector(af_endRefreshing) name:MASINetworkingTaskDidSuspendNotification object:task]; - } else { - [self.refreshControl endRefreshing]; - } -#pragma clang diagnostic pop - } -} -#endif - -- (void)setRefreshingWithStateOfOperation:(MASIURLConnectionOperation *)operation { - NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; - - [notificationCenter removeObserver:self name:MASINetworkingOperationDidStartNotification object:nil]; - [notificationCenter removeObserver:self name:MASINetworkingOperationDidFinishNotification object:nil]; - - if (operation) { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wreceiver-is-weak" -#pragma clang diagnostic ignored "-Warc-repeated-use-of-weak" - if (![operation isFinished]) { - if ([operation isExecuting]) { - [self.refreshControl beginRefreshing]; - } else { - [self.refreshControl endRefreshing]; - } - - [notificationCenter addObserver:self selector:@selector(af_beginRefreshing) name:MASINetworkingOperationDidStartNotification object:operation]; - [notificationCenter addObserver:self selector:@selector(af_endRefreshing) name:MASINetworkingOperationDidFinishNotification object:operation]; - } -#pragma clang diagnostic pop - } -} - -#pragma mark - - -- (void)af_beginRefreshing { - dispatch_async(dispatch_get_main_queue(), ^{ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wreceiver-is-weak" - [self.refreshControl beginRefreshing]; -#pragma clang diagnostic pop - }); -} - -- (void)af_endRefreshing { - dispatch_async(dispatch_get_main_queue(), ^{ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wreceiver-is-weak" - [self.refreshControl endRefreshing]; -#pragma clang diagnostic pop - }); -} - -#pragma mark - - -- (void)dealloc { - NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; - -#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 - [notificationCenter removeObserver:self name:MASINetworkingTaskDidCompleteNotification object:nil]; - [notificationCenter removeObserver:self name:MASINetworkingTaskDidResumeNotification object:nil]; - [notificationCenter removeObserver:self name:MASINetworkingTaskDidSuspendNotification object:nil]; -#endif - - [notificationCenter removeObserver:self name:MASINetworkingOperationDidStartNotification object:nil]; - [notificationCenter removeObserver:self name:MASINetworkingOperationDidFinishNotification object:nil]; -} - -@end - -#endif diff --git a/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/UIWebView+MASINetworking.h b/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/UIWebView+MASINetworking.h deleted file mode 100755 index a326ef64..00000000 --- a/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/UIWebView+MASINetworking.h +++ /dev/null @@ -1,86 +0,0 @@ -// UIWebView+MASINetworking.h -// Copyright (c) 2011–2015 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 -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import - -#import - -#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) - -#import - -NS_ASSUME_NONNULL_BEGIN - -@class MASIHTTPRequestSerializer, MASIHTTPResponseSerializer; -@protocol MASIURLRequestSerialization, MASIURLResponseSerialization; - -/** - This category adds methods to the UIKit framework's `UIWebView` class. The methods in this category provide increased control over the request cycle, including progress monitoring and success / failure handling. - - @discussion When using these category methods, make sure to assign `delegate` for the web view, which implements `–webView:shouldStartLoadWithRequest:navigationType:` appropriately. This allows for tapped links to be loaded through MASINetworking, and can ensure that `canGoBack` & `canGoForward` update their values correctly. - */ -@interface UIWebView (MASINetworking) - -/** - The request serializer used to serialize requests made with the `-loadRequest:...` category methods. By default, this is an instance of `MASIHTTPRequestSerializer`. - */ -@property (nonatomic, strong) MASIHTTPRequestSerializer * requestSerializer; - -/** - The response serializer used to serialize responses made with the `-loadRequest:...` category methods. By default, this is an instance of `MASIHTTPResponseSerializer`. - */ -@property (nonatomic, strong) MASIHTTPResponseSerializer * responseSerializer; - -/** - Asynchronously loads the specified request. - - @param request A URL request identifying the location of the content to load. This must not be `nil`. - @param progress A block object to be called when an undetermined number of bytes have been downloaded from the server. This block has no return value and takes three arguments: the number of bytes read since the last time the download progress block was called, the total bytes read, and the total bytes expected to be read during the request, as initially determined by the expected content size of the `NSHTTPURLResponse` object. This block may be called multiple times, and will execute on the main thread. - @param success A block object to be executed when the request finishes loading successfully. This block returns the HTML string to be loaded by the web view, and takes two arguments: the response, and the response string. - @param failure A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a single argument: the error that occurred. - */ -- (void)loadRequest:(NSURLRequest *)request - progress:(nullable void (^)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite))progress - success:(nullable NSString * (^)(NSHTTPURLResponse *response, NSString *HTML))success - failure:(nullable void (^)(NSError *error))failure; - -/** - Asynchronously loads the data associated with a particular request with a specified MIME type and text encoding. - - @param request A URL request identifying the location of the content to load. This must not be `nil`. - @param MIMEType The MIME type of the content. Defaults to the content type of the response if not specified. - @param textEncodingName The IANA encoding name, as in `utf-8` or `utf-16`. Defaults to the response text encoding if not specified. - @param progress A block object to be called when an undetermined number of bytes have been downloaded from the server. This block has no return value and takes three arguments: the number of bytes read since the last time the download progress block was called, the total bytes read, and the total bytes expected to be read during the request, as initially determined by the expected content size of the `NSHTTPURLResponse` object. This block may be called multiple times, and will execute on the main thread. - @param success A block object to be executed when the request finishes loading successfully. This block returns the data to be loaded by the web view and takes two arguments: the response, and the downloaded data. - @param failure A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a single argument: the error that occurred. - */ -- (void)loadRequest:(NSURLRequest *)request - MIMEType:(nullable NSString *)MIMEType - textEncodingName:(nullable NSString *)textEncodingName - progress:(nullable void (^)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite))progress - success:(nullable NSData * (^)(NSHTTPURLResponse *response, NSData *data))success - failure:(nullable void (^)(NSError *error))failure; - -@end - -NS_ASSUME_NONNULL_END - -#endif diff --git a/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/UIWebView+MASINetworking.m b/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/UIWebView+MASINetworking.m deleted file mode 100755 index 7ce7e89d..00000000 --- a/MASFoundation/Vendor/MASINetworking/UIKit+MASINetworking/UIWebView+MASINetworking.m +++ /dev/null @@ -1,159 +0,0 @@ -// UIWebView+MASINetworking.m -// Copyright (c) 2011–2015 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 -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import "UIWebView+MASINetworking.h" - -#import - -#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) - -#import "MASIHTTPRequestOperation.h" -#import "MASIURLResponseSerialization.h" -#import "MASIURLRequestSerialization.h" - -@interface UIWebView (_MASINetworking) -@property (readwrite, nonatomic, strong, setter = af_setHTTPRequestOperation:) MASIHTTPRequestOperation *af_HTTPRequestOperation; -@end - -@implementation UIWebView (_MASINetworking) - -- (MASIHTTPRequestOperation *)af_HTTPRequestOperation { - return (MASIHTTPRequestOperation *)objc_getAssociatedObject(self, @selector(af_HTTPRequestOperation)); -} - -- (void)af_setHTTPRequestOperation:(MASIHTTPRequestOperation *)operation { - objc_setAssociatedObject(self, @selector(af_HTTPRequestOperation), operation, OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} - -@end - -#pragma mark - - -@implementation UIWebView (MASINetworking) - -- (MASIHTTPRequestSerializer *)requestSerializer { - static MASIHTTPRequestSerializer *_af_defaultRequestSerializer = nil; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - _af_defaultRequestSerializer = [MASIHTTPRequestSerializer serializer]; - }); - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wgnu" - return objc_getAssociatedObject(self, @selector(requestSerializer)) ?: _af_defaultRequestSerializer; -#pragma clang diagnostic pop -} - -- (void)setRequestSerializer:(MASIHTTPRequestSerializer *)requestSerializer { - objc_setAssociatedObject(self, @selector(requestSerializer), requestSerializer, OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} - -- (MASIHTTPResponseSerializer *)responseSerializer { - static MASIHTTPResponseSerializer *_af_defaultResponseSerializer = nil; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - _af_defaultResponseSerializer = [MASIHTTPResponseSerializer serializer]; - }); - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wgnu" - return objc_getAssociatedObject(self, @selector(responseSerializer)) ?: _af_defaultResponseSerializer; -#pragma clang diagnostic pop -} - -- (void)setResponseSerializer:(MASIHTTPResponseSerializer *)responseSerializer { - objc_setAssociatedObject(self, @selector(responseSerializer), responseSerializer, OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} - -#pragma mark - - -- (void)loadRequest:(NSURLRequest *)request - progress:(void (^)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite))progress - success:(NSString * (^)(NSHTTPURLResponse *response, NSString *HTML))success - failure:(void (^)(NSError *error))failure -{ - [self loadRequest:request MIMEType:nil textEncodingName:nil progress:progress success:^NSData *(NSHTTPURLResponse *response, NSData *data) { - NSStringEncoding stringEncoding = NSUTF8StringEncoding; - if (response.textEncodingName) { - CFStringEncoding encoding = CFStringConvertIANACharSetNameToEncoding((CFStringRef)response.textEncodingName); - if (encoding != kCFStringEncodingInvalidId) { - stringEncoding = CFStringConvertEncodingToNSStringEncoding(encoding); - } - } - - NSString *string = [[NSString alloc] initWithData:data encoding:stringEncoding]; - if (success) { - string = success(response, string); - } - - return [string dataUsingEncoding:stringEncoding]; - } failure:failure]; -} - -- (void)loadRequest:(NSURLRequest *)request - MIMEType:(NSString *)MIMEType - textEncodingName:(NSString *)textEncodingName - progress:(void (^)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite))progress - success:(NSData * (^)(NSHTTPURLResponse *response, NSData *data))success - failure:(void (^)(NSError *error))failure -{ - NSParameterAssert(request); - - if (self.af_HTTPRequestOperation) { - [self.af_HTTPRequestOperation cancel]; - } - - request = [self.requestSerializer requestBySerializingRequest:request withParameters:nil error:nil]; - - self.af_HTTPRequestOperation = [[MASIHTTPRequestOperation alloc] initWithRequest:request]; - self.af_HTTPRequestOperation.responseSerializer = self.responseSerializer; - - __weak __typeof(self)weakSelf = self; - [self.af_HTTPRequestOperation setDownloadProgressBlock:progress]; - [self.af_HTTPRequestOperation setCompletionBlockWithSuccess:^(MASIHTTPRequestOperation *operation, id __unused responseObject) { - NSData *data = success ? success(operation.response, operation.responseData) : operation.responseData; - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wgnu" - __strong __typeof(weakSelf) strongSelf = weakSelf; - [strongSelf loadData:data MIMEType:(MIMEType ?: [operation.response MIMEType]) textEncodingName:(textEncodingName ?: [operation.response textEncodingName]) baseURL:[operation.response URL]]; - - if ([strongSelf.delegate respondsToSelector:@selector(webViewDidFinishLoad:)]) { - [strongSelf.delegate webViewDidFinishLoad:strongSelf]; - } - -#pragma clang diagnostic pop - } failure:^(MASIHTTPRequestOperation * __unused operation, NSError *error) { - if (failure) { - failure(error); - } - }]; - - [self.af_HTTPRequestOperation start]; - - if ([self.delegate respondsToSelector:@selector(webViewDidStartLoad:)]) { - [self.delegate webViewDidStartLoad:self]; - } -} - -@end - -#endif