mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-28 20:25:33 +08:00
Apple TV support 1: existing Objective C code should compile for tvOS
Summary: First commit for Apple TV support: changes to existing Objective-C code so that it will compile correctly for tvOS. Closes https://github.com/facebook/react-native/pull/9649 Differential Revision: D3916021 Pulled By: javache fbshipit-source-id: 34acc9daf3efff835ffe38c43ba5d4098a02c830
This commit is contained in:
committed by
Facebook Github Bot 5
parent
339531065f
commit
d368ebfab2
@@ -493,31 +493,6 @@ BOOL RCTForceTouchAvailable(void)
|
||||
(RCTKeyWindow() ?: [UIView new]).traitCollection.forceTouchCapability == UIForceTouchCapabilityAvailable;
|
||||
}
|
||||
|
||||
UIAlertView *__nullable RCTAlertView(NSString *title,
|
||||
NSString *__nullable message,
|
||||
id __nullable delegate,
|
||||
NSString *__nullable cancelButtonTitle,
|
||||
NSArray<NSString *> *__nullable otherButtonTitles)
|
||||
{
|
||||
if (RCTRunningInAppExtension()) {
|
||||
RCTLogError(@"RCTAlertView is unavailable when running in an app extension");
|
||||
return nil;
|
||||
}
|
||||
|
||||
UIAlertView *alertView = [UIAlertView new];
|
||||
alertView.title = title;
|
||||
alertView.message = message;
|
||||
alertView.delegate = delegate;
|
||||
if (cancelButtonTitle != nil) {
|
||||
[alertView addButtonWithTitle:cancelButtonTitle];
|
||||
alertView.cancelButtonIndex = 0;
|
||||
}
|
||||
for (NSString *buttonTitle in otherButtonTitles) {
|
||||
[alertView addButtonWithTitle:buttonTitle];
|
||||
}
|
||||
return alertView;
|
||||
}
|
||||
|
||||
NSError *RCTErrorWithMessage(NSString *message)
|
||||
{
|
||||
NSDictionary<NSString *, id> *errorInfo = @{NSLocalizedDescriptionKey: message};
|
||||
|
||||
Reference in New Issue
Block a user