This repository has been archived by the owner on Aug 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
434 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// GYAPIPlatformInfoResponse.h | ||
// Glassfy | ||
// | ||
// Created by Luca Garbolino on 12/04/22. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#import "GYAPIBaseResponse.h" | ||
@class GYPlatformInfo; | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface GYAPIPlatformInfoResponse : GYAPIBaseResponse | ||
@property(nonatomic, strong) NSArray<GYPlatformInfo*> *info; | ||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// | ||
// GYAPIPlatformInfoResponse.m | ||
// Glassfy | ||
// | ||
// Created by Luca Garbolino on 12/04/22. | ||
// | ||
|
||
#import "GYAPIPlatformInfoResponse.h" | ||
#import "GYPlatformInfo+Private.h" | ||
|
||
@implementation GYAPIPlatformInfoResponse | ||
- (instancetype _Nullable)initWithObject:(NSDictionary *)obj error:(NSError **)error | ||
{ | ||
self = [super initWithObject:obj error:error]; | ||
if (error && *error) { | ||
return self; | ||
} | ||
|
||
if (self) { | ||
NSMutableArray<GYPlatformInfo*> *platformsInfo = [NSMutableArray array]; | ||
if ([obj[@"info"] isKindOfClass:NSArray.class]) { | ||
NSArray *infoJSON = obj[@"info"]; | ||
for (NSDictionary *platformInfoJSON in infoJSON) { | ||
if (![platformInfoJSON isKindOfClass:NSDictionary.class]) { | ||
continue; | ||
} | ||
|
||
GYPlatformInfo *platformInfo = [[GYPlatformInfo alloc] initWithObject:platformInfoJSON error:nil]; | ||
if (platformInfo) { | ||
[platformsInfo addObject:platformInfo]; | ||
} | ||
} | ||
} | ||
self.info = platformsInfo; | ||
} | ||
return self; | ||
} | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.