uiscreen

UIScreen mainScreen in Xcode 8

て烟熏妆下的殇ゞ 提交于 2019-12-06 10:50:17
问题 We have a problem with iOS SDK in Xcode 8. We use method [UIScreen mainScreen] in our project. This method is available from iOS 2.0. But when we built product in Xcode 8 and submited it for review, app was rejected. Surprise: in the new SDK ( Xcode 8 GM ) this method marked as “ available from iOS 10.0 ”. In other words - now iOS 9 identifies [UIScreen mainScreen] as “ non-public API ”. Perhaps this is Apple’s bug. Our question: 1) We want to continue using this method. 2) We want to support

Adding a CarPlay UI

你说的曾经没有我的故事 提交于 2019-12-06 01:49:11
问题 I am working on my current iPhone audio app to be supported in CarPlay. I already got approved by Apple and received the development entitlement, and watched the video "Enabling Your App for CarPlay"(https://developer.apple.com/videos/play/wwdc2017/719/). In the video there is a piece of Swift code demonstrating how to add CarPlay UI: func updateCarWindow() { guard let screen = UIScreen.screens.first(where: { $0.traitCollection.userInterfaceIdiom == .carPlay }) else { // CarPlay is not

Setting UIScreen's mode / resolution

十年热恋 提交于 2019-12-04 17:24:35
I have to set the external UIScreen's mode to run with the resolution 1024x768. First I search if the screen supports this resolution: if ([[UIScreen screens] count] > 1){ CGSize size1024; size1024.height = 0; size1024.width = 0; UIScreenMode *screenMode1024 = nil; UIScreen *secondScreen = [[UIScreen screens] objectAtIndex:1]; for(int i = 0; i < [[secondScreen availableModes] count]; i++) { UIScreenMode *current = [[[[UIScreen screens] objectAtIndex:1] availableModes] objectAtIndex: i]; if (current.size.width == 1024.0 && current.size.height == 768.0) { size1024 = current.size; screenMode1024

UIScreen mainScreen in Xcode 8

坚强是说给别人听的谎言 提交于 2019-12-04 16:52:35
We have a problem with iOS SDK in Xcode 8. We use method [UIScreen mainScreen] in our project. This method is available from iOS 2.0. But when we built product in Xcode 8 and submited it for review, app was rejected. Surprise: in the new SDK ( Xcode 8 GM ) this method marked as “ available from iOS 10.0 ”. In other words - now iOS 9 identifies [UIScreen mainScreen] as “ non-public API ”. Perhaps this is Apple’s bug. Our question: 1) We want to continue using this method. 2) We want to support iOS 8 and iOS 9. 3) We want to use Xcode 8. Is that possible? Class properties are an Objective-C

Adding a CarPlay UI

[亡魂溺海] 提交于 2019-12-04 05:21:22
I am working on my current iPhone audio app to be supported in CarPlay. I already got approved by Apple and received the development entitlement, and watched the video "Enabling Your App for CarPlay"( https://developer.apple.com/videos/play/wwdc2017/719/ ). In the video there is a piece of Swift code demonstrating how to add CarPlay UI: func updateCarWindow() { guard let screen = UIScreen.screens.first(where: { $0.traitCollection.userInterfaceIdiom == .carPlay }) else { // CarPlay is not connected self.carWindow = nil; return } // CarPlay is connected let carWindow = UIWindow(frame: screen

How to get iOS device screen height and width [duplicate]

六眼飞鱼酱① 提交于 2019-12-03 15:06:13
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: IPhone/IPad: How to get screen width programmatically? How to get orientation-dependent height and width of the screen? Accounting for the various iOS devices and orientations, what is the simplest approach to getting the current screen resolution, including height and width? 回答1: UIScreen is your friend here. CGRect screenRect = [[UIScreen mainScreen] bounds]; CGFloat screenWidth = screenRect.size.width;

How to get iPhone screen size programmatically? [duplicate]

喜你入骨 提交于 2019-12-03 06:09:42
This question already has answers here : How to get screen size using code on iOS? (11 answers) Possible Duplicate: How to get screen size using code? NSLog(@"Top Left View : Width %f height%f",self.topLeftView.frame.size.width,self.topLeftView.frame.size.height); I have dragged the "View" from object library and put it on xib file. But what if I want to get the screen size to check whether its iphone 4,iPhone 3 or iphone 5 or any iOS Device. So that I can arrange other views accordingly. Midhun MP You can use: CGsize screenSize = [[[UIScreen mainScreen] bounds] size]; CGFloat widthOfScreen =

How to get iOS device screen height and width [duplicate]

女生的网名这么多〃 提交于 2019-12-03 05:47:59
Possible Duplicate: IPhone/IPad: How to get screen width programmatically? How to get orientation-dependent height and width of the screen? Accounting for the various iOS devices and orientations, what is the simplest approach to getting the current screen resolution, including height and width? UIScreen is your friend here. CGRect screenRect = [[UIScreen mainScreen] bounds]; CGFloat screenWidth = screenRect.size.width; CGFloat screenHeight = screenRect.size.height; CGRect screenBounds = [[UIScreen mainScreen] bounds]; That will give you the entire screen's resolution in points, so it would

Airplay on new Apple TV (3rd gen.) for second screen not at 1080p

谁说胖子不能爱 提交于 2019-12-02 01:08:21
问题 I am working on an app that uses Airplay mirroring for a second display that has different content to the iPad itself. I'm using an iPad3 and ATV3 (i.e. released March 2012) attached to an LCD capable of 1920x1080 via HDMI. With Airplay mirroring, the second screen's UIScreen is available through [UIScreen screens] array. I was able to get rid of the black borders by setting overscanCompensation to 3 but I can only display a 1280x720 image. The monitor is working at 1920x1080 (i.e. checked in

Airplay on new Apple TV (3rd gen.) for second screen not at 1080p

大兔子大兔子 提交于 2019-12-01 22:09:12
I am working on an app that uses Airplay mirroring for a second display that has different content to the iPad itself. I'm using an iPad3 and ATV3 (i.e. released March 2012) attached to an LCD capable of 1920x1080 via HDMI. With Airplay mirroring, the second screen's UIScreen is available through [UIScreen screens] array. I was able to get rid of the black borders by setting overscanCompensation to 3 but I can only display a 1280x720 image. The monitor is working at 1920x1080 (i.e. checked in its menu, set to "Just Scan", and the rest of Apple TV interface is at 1080p). When I return the