mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2026-06-15 21:21:45 +00:00
Refactor new macOS code to reduce #ifs, increase shared code, and fix warnings
This commit is contained in:
@@ -16,16 +16,13 @@
|
||||
self.statusMessage = @"App asset has no status message";
|
||||
self.statusCode = -1;
|
||||
}
|
||||
- (OSImage*) getImage {
|
||||
#if TARGET_OS_IPHONE
|
||||
- (UIImage*) getImage {
|
||||
UIImage* appImage = [[UIImage alloc] initWithData:self.data];
|
||||
OSImage* appImage = [[OSImage alloc] initWithData:self.data];
|
||||
#else
|
||||
OSImage* appImage = nil;
|
||||
#endif
|
||||
return appImage;
|
||||
}
|
||||
#else
|
||||
- (NSImage*) getImage {
|
||||
return nil;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@@ -19,11 +19,7 @@ static const int MAX_ATTEMPTS = 5;
|
||||
|
||||
- (void) main {
|
||||
|
||||
#if TARGET_OS_IPHONE
|
||||
UIImage* appImage = nil;
|
||||
#else
|
||||
NSImage* appImage = nil;
|
||||
#endif
|
||||
OSImage* appImage = nil;
|
||||
|
||||
int attempts = 0;
|
||||
while (![self isCancelled] && appImage == nil && attempts++ < MAX_ATTEMPTS) {
|
||||
|
||||
Reference in New Issue
Block a user