Accessing `shared` variable of `UIApplication` from inside `share extension` in Swift
问题 I need to execute my host app from inside an extension. In Objective-C I've used this: // Get "UIApplication" class name through ASCII Character codes. NSString *className = [[NSString alloc] initWithData:[NSData dataWithBytes:(unsigned char []){0x55, 0x49, 0x41, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E} length:13] encoding:NSASCIIStringEncoding]; if (NSClassFromString(className)) { // A different way to call [UIApplication sharedApplication] id object = [NSClassFromString