@@ -20,12 +20,12 @@ @implementation NXOAuth2AccessToken
20
20
21
21
#pragma mark Lifecycle
22
22
23
- + (id )tokenWithResponseBody : (NSString *)theResponseBody ;
23
+ + (instancetype )tokenWithResponseBody : (NSString *)theResponseBody ;
24
24
{
25
25
return [self tokenWithResponseBody: theResponseBody tokenType: nil ];
26
26
}
27
27
28
- + (id )tokenWithResponseBody : (NSString *)theResponseBody tokenType : (NSString *)tokenType ;
28
+ + (instancetype )tokenWithResponseBody : (NSString *)theResponseBody tokenType : (NSString *)tokenType ;
29
29
{
30
30
NSDictionary *jsonDict = nil ;
31
31
Class jsonSerializationClass = NSClassFromString (@" NSJSONSerialization" );
@@ -78,20 +78,20 @@ + (id)tokenWithResponseBody:(NSString *)theResponseBody tokenType:(NSString *)to
78
78
tokenType: tokenType];
79
79
}
80
80
81
- - (id )initWithAccessToken : (NSString *)anAccessToken ;
81
+ - (instancetype )initWithAccessToken : (NSString *)anAccessToken ;
82
82
{
83
83
return [self initWithAccessToken: anAccessToken refreshToken: nil expiresAt: nil ];
84
84
}
85
85
86
- - (id )initWithAccessToken : (NSString *)anAccessToken refreshToken : (NSString *)aRefreshToken expiresAt : (NSDate *)anExpiryDate ;
86
+ - (instancetype )initWithAccessToken : (NSString *)anAccessToken refreshToken : (NSString *)aRefreshToken expiresAt : (NSDate *)anExpiryDate ;
87
87
{
88
88
return [[[self class ] alloc ] initWithAccessToken: anAccessToken
89
89
refreshToken: aRefreshToken
90
90
expiresAt: anExpiryDate
91
91
scope: nil ];
92
92
}
93
93
94
- - (id )initWithAccessToken : (NSString *)anAccessToken refreshToken : (NSString *)aRefreshToken expiresAt : (NSDate *)anExpiryDate scope : (NSSet *)aScope ;
94
+ - (instancetype )initWithAccessToken : (NSString *)anAccessToken refreshToken : (NSString *)aRefreshToken expiresAt : (NSDate *)anExpiryDate scope : (NSSet *)aScope ;
95
95
{
96
96
return [[[self class ] alloc ] initWithAccessToken: anAccessToken
97
97
refreshToken: aRefreshToken
@@ -100,7 +100,7 @@ - (id)initWithAccessToken:(NSString *)anAccessToken refreshToken:(NSString *)aRe
100
100
responseBody: nil ];
101
101
}
102
102
103
- - (id )initWithAccessToken : (NSString *)anAccessToken refreshToken : (NSString *)aRefreshToken expiresAt : (NSDate *)anExpiryDate scope : (NSSet *)aScope responseBody : (NSString *)aResponseBody ;
103
+ - (instancetype )initWithAccessToken : (NSString *)anAccessToken refreshToken : (NSString *)aRefreshToken expiresAt : (NSDate *)anExpiryDate scope : (NSSet *)aScope responseBody : (NSString *)aResponseBody ;
104
104
{
105
105
return [[[self class ] alloc ] initWithAccessToken: anAccessToken
106
106
refreshToken: aRefreshToken
@@ -110,7 +110,7 @@ - (id)initWithAccessToken:(NSString *)anAccessToken refreshToken:(NSString *)aRe
110
110
tokenType: nil ];
111
111
}
112
112
113
- - (id )initWithAccessToken : (NSString *)anAccessToken refreshToken : (NSString *)aRefreshToken expiresAt : (NSDate *)anExpiryDate scope : (NSSet *)aScope responseBody : (NSString *)aResponseBody tokenType : (NSString *)aTokenType
113
+ - (instancetype )initWithAccessToken : (NSString *)anAccessToken refreshToken : (NSString *)aRefreshToken expiresAt : (NSDate *)anExpiryDate scope : (NSSet *)aScope responseBody : (NSString *)aResponseBody tokenType : (NSString *)aTokenType
114
114
{
115
115
// a token object without an actual token is not what we want!
116
116
NSAssert1 (anAccessToken, @" No token from token response: %@ " , aResponseBody);
@@ -191,7 +191,7 @@ - (void)encodeWithCoder:(NSCoder *)aCoder
191
191
}
192
192
}
193
193
194
- - (id )initWithCoder : (NSCoder *)aDecoder
194
+ - (instancetype )initWithCoder : (NSCoder *)aDecoder
195
195
{
196
196
NSString *decodedAccessToken = [aDecoder decodeObjectForKey: @" accessToken" ];
197
197
@@ -224,7 +224,7 @@ + (NSString *)serviceNameWithProvider:(NSString *)provider;
224
224
225
225
#if TARGET_OS_IPHONE
226
226
227
- + (id )tokenFromDefaultKeychainWithServiceProviderName : (NSString *)provider ;
227
+ + (instancetype )tokenFromDefaultKeychainWithServiceProviderName : (NSString *)provider ;
228
228
{
229
229
NSString *serviceName = [[self class ] serviceNameWithProvider: provider];
230
230
NSDictionary *result = nil ;
@@ -273,7 +273,7 @@ - (void)removeFromDefaultKeychainWithServiceProviderName:(NSString *)provider;
273
273
274
274
#else
275
275
276
- + (id )tokenFromDefaultKeychainWithServiceProviderName : (NSString *)provider ;
276
+ + (instancetype )tokenFromDefaultKeychainWithServiceProviderName : (NSString *)provider ;
277
277
{
278
278
NSString *serviceName = [[self class ] serviceNameWithProvider: provider];
279
279
0 commit comments