NSURLConnection: expose NSURLConnectionDelegate as a protocol

Currently, NSURLConnectionDelegate methods were defined as a category of
an NSObject. The same definitions were copied over to a new
NSURLConnectionDelegate protocol, introduced in OSX 10.7.
This commit is contained in:
Daniel Ferreira 2017-06-21 10:02:44 +10:00 committed by Ivan Vučica
parent 8bd630f004
commit e2831f34c1

View file

@ -142,7 +142,19 @@ extern "C" {
* </item>
* </list>
*/
#if OS_API_VERSION(MAC_OS_X_VERSION_10_7,GS_API_LATEST) && GS_API_VERSION(11300,GS_API_LATEST)
@protocol NSURLConnectionDelegate <NSObject>
#if GS_PROTOCOLS_HAVE_OPTIONAL
@optional
#else
@end
@interface NSObject (NSURLConnectionDelegate)
#endif
#else
@interface NSObject (NSURLConnectionDelegate)
#endif
/**
* Instructs the delegate that authentication for challenge has
@ -211,11 +223,8 @@ extern "C" {
- (NSURLRequest *) connection: (NSURLConnection *)connection
willSendRequest: (NSURLRequest *)request
redirectResponse: (NSURLResponse *)response;
@end
/**
* An interface to perform synchronous loading of URL requests.
*/