mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2026-06-17 06:01:13 +00:00
Refactor new macOS code to reduce #ifs, increase shared code, and fix warnings
This commit is contained in:
@@ -22,20 +22,12 @@
|
||||
// HACK: Avoid calling [UIApplication delegate] off the UI thread to keep
|
||||
// Main Thread Checker happy.
|
||||
if ([NSThread isMainThread]) {
|
||||
#if TARGET_OS_IPHONE
|
||||
_appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
|
||||
#else
|
||||
_appDelegate = (AppDelegate *)[[NSApplication sharedApplication] delegate];
|
||||
#endif
|
||||
_appDelegate = (AppDelegate *)[[OSApplication sharedApplication] delegate];
|
||||
|
||||
}
|
||||
else {
|
||||
dispatch_sync(dispatch_get_main_queue(), ^{
|
||||
#if TARGET_OS_IPHONE
|
||||
_appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
|
||||
#else
|
||||
_appDelegate = (AppDelegate *)[[NSApplication sharedApplication] delegate];
|
||||
#endif
|
||||
_appDelegate = (AppDelegate *)[[OSApplication sharedApplication] delegate];
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user