Updated to "instancetype" type

This commit is contained in:
Pierre-Olivier Latour
2014-04-07 23:45:33 -07:00
parent 3401206279
commit e26c9b76ea
20 changed files with 84 additions and 83 deletions
+12 -12
View File
@@ -28,19 +28,19 @@
#import "GCDWebServerResponse.h"
@interface GCDWebServerDataResponse : GCDWebServerResponse
+ (GCDWebServerDataResponse*)responseWithData:(NSData*)data contentType:(NSString*)type;
- (id)initWithData:(NSData*)data contentType:(NSString*)type;
+ (instancetype)responseWithData:(NSData*)data contentType:(NSString*)type;
- (instancetype)initWithData:(NSData*)data contentType:(NSString*)type;
@end
@interface GCDWebServerDataResponse (Extensions)
+ (GCDWebServerDataResponse*)responseWithText:(NSString*)text;
+ (GCDWebServerDataResponse*)responseWithHTML:(NSString*)html;
+ (GCDWebServerDataResponse*)responseWithHTMLTemplate:(NSString*)path variables:(NSDictionary*)variables;
+ (GCDWebServerDataResponse*)responseWithJSONObject:(id)object;
+ (GCDWebServerDataResponse*)responseWithJSONObject:(id)object contentType:(NSString*)type;
- (id)initWithText:(NSString*)text; // Encodes using UTF-8
- (id)initWithHTML:(NSString*)html; // Encodes using UTF-8
- (id)initWithHTMLTemplate:(NSString*)path variables:(NSDictionary*)variables; // Simple template system that replaces all occurences of "%variable%" with corresponding value (encodes using UTF-8)
- (id)initWithJSONObject:(id)object;
- (id)initWithJSONObject:(id)object contentType:(NSString*)type;
+ (instancetype)responseWithText:(NSString*)text;
+ (instancetype)responseWithHTML:(NSString*)html;
+ (instancetype)responseWithHTMLTemplate:(NSString*)path variables:(NSDictionary*)variables;
+ (instancetype)responseWithJSONObject:(id)object;
+ (instancetype)responseWithJSONObject:(id)object contentType:(NSString*)type;
- (instancetype)initWithText:(NSString*)text; // Encodes using UTF-8
- (instancetype)initWithHTML:(NSString*)html; // Encodes using UTF-8
- (instancetype)initWithHTMLTemplate:(NSString*)path variables:(NSDictionary*)variables; // Simple template system that replaces all occurences of "%variable%" with corresponding value (encodes using UTF-8)
- (instancetype)initWithJSONObject:(id)object;
- (instancetype)initWithJSONObject:(id)object contentType:(NSString*)type;
@end