Use of undelcared identifier 'UIUserInterfaceIdiomMac' [iOS]
See original GitHub issueSummary
I’m facing Intent Redirection issue that discussed here. Someone has created PR to resolve that issue, hopefully. But, that PR had not been released as official release version. So, I point react-native-device-info
on package.json
to master
branch of this repo to get that changes.
Unfortunately, I got this error below when I built my app.
Duplicate case value 'UIUserInterfaceIdiomPad'
---
Use of undeclared identifier 'UIUserInterfaceIdiomMac'; did you mean 'UIUserInterfaceIdiomPad'?
Replace 'UIUserInterfaceIdiomMac' with 'UIUserInterfaceIdiomPad'
on RNDeviceInfo.m
- (DeviceType) getDeviceType
{
switch ([[UIDevice currentDevice] userInterfaceIdiom]) {
case UIUserInterfaceIdiomPhone: return DeviceTypeHandset;
case UIUserInterfaceIdiomPad: return TARGET_OS_MACCATALYST ? DeviceTypeDesktop : DeviceTypeTablet;
case UIUserInterfaceIdiomTV: return DeviceTypeTv;
case UIUserInterfaceIdiomMac: return DeviceTypeDesktop;
default: return DeviceTypeUnknown;
}
}
This issue didn’t appear on 7.3.1 version. Seems, it was related to this changes https://github.com/react-native-device-info/react-native-device-info/pull/1137
Version | master https://github.com/react-native-device-info/react-native-device-info/commit/9f286d724be1041ec4816c677ff2fff713115f07 |
Affected OS | iOS |
Xcode Version | 11.7 |
Variant | debug |
OS Version | ? |
Current behavior
Failed to build
Expected behavior
Succeed to build
Issue Analytics
- State:
- Created 3 years ago
- Comments:18
Top Results From Across the Web
"use of undeclared identifier" error in Objective-C
You need to declare navController outside the if statement: - (BOOL)application:(UIApplication *)application ...
Read more >Use of undeclared identifier | Apple Developer Forums
I'm working on an objective c based macos project for years, containing numerous Objective C classes. Someone any idea?
Read more >Ios – “use of undeclared identifier” error in Objective-C
I have been following a tutorial about parsing json with Xcode but have come across issues that i cant resolve. I suspect they...
Read more >[Solved]-How to determine device type from Swift? (OS X or iOS)-swift
I you are using "Scale interface to Match iPad, you cannot use UIDevice.current.userInterfaceIdiom , because it will return an .iPad value.
Read more >Detect current device with UIUserInterfaceIdiom in Swift
To detect current device with iOS/Swift we can use UserInterfaceIdiom. It is an enum in swift, which tells which device is being used....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I did not say exactly this, probably RN is compatible with XCode 12, but not all dependencies are up to date. When i tried to migrate my production project month ago there were couple of annoying XCode-related issues with compilation to different targets(XC 12 is not backward compatible) and I almost sure not all of them are sorted out. So my point was that requirement to upgrade to XC 12 is breaking change for some not-hello-world projects.
Thanks once again for prompt reaction!
Interesting, for me was the opposite, I needed Xcode 12 immediately in order to continue submitting to App Store because we were touching APIs that had ios14-specific requirements. But that’s software - everyone’s situation is different. Good luck with your project!