uiscreen Questions

4

I am trying to find out PPI(Pixels Per Inch) in iOS. I couldn't find any direct way to query this like we do for display size UIScreen.mainScreen().bounds There is a way to do it by multiplying...
Durwin asked 14/4, 2016 at 9:29

15

Solved

In Objective-C we can get device width and height by using following code : CGRect sizeRect = [UIScreen mainScreen].applicationFrame float width = sizeRect.size.width float height = sizeRect.size...
Thermit asked 6/6, 2014 at 15:0

4

Solved

Is there any way to disable the screen recording? or is is possible through a configuration profile? or any third party library is available?
Argol asked 21/12, 2018 at 7:1

6

How can I detect whether a user has an iPhone 6 Plus in standard or zoomed mode? Is this possible? I've tried [UIScreen mainScreen].scale and it reports 3.0 in both cases.
Lid asked 20/9, 2014 at 18:55

12

Solved

How to get the iPhone screen size to give calculation?
Haviland asked 3/9, 2010 at 12:2

6

Solved

So I created a new project with the latest version of XCode and tried to log the screen size of my app (to determine the device type for UI). I ran the following code from my iPhone 5: NSLog(@"%f"...
Hemelytron asked 10/2, 2014 at 3:13

7

I am using this code to capture a screenshot and to save it to the photo album. -(void)TakeScreenshotAndSaveToPhotoAlbum { UIWindow *window = [UIApplication sharedApplication].keyWindow; if ([[...
Outage asked 14/12, 2011 at 16:55

2

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 CarPla...
Stonehenge asked 25/7, 2017 at 11:1

1

Solved

I wanted to create a project without any storyboards. I have deleted the Main and LaunchScreen storyboards. As usual I added to my applicationDidFinishLaunchingWithOptions: window = UIWindow(f...
Jansson asked 29/1, 2019 at 19:0

1

Solved

I noticed something weird: if I delete all launch images/storyboards from an iOS app project, then UIScreen.main.bounds shrink to 320x480, regardless of an actual screen size. My question is: do I...
Posthaste asked 18/1, 2018 at 17:50

1

Solved

iOS 11 has new feature which enables users to record their screen, I want to disable only VIDEO recording when i am playing video in my application keeping screen record enabled. For example. I a...
Pessimist asked 21/9, 2017 at 6:3

1

Solved

I have to check if my device has changed orientation in iOS 8+. My approach is: override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { super...
Poised asked 14/3, 2017 at 9:49

2

In sample logs posted in this question, the results are identical. Does anyone know if there is meant to be a logical difference between the two? Even Apple's description is confusing. Here is the...
Affirmatory asked 16/9, 2014 at 14:46

3

I am learning how to create an iOS app without Interface Builder (i.e. storyboards, xibs, etc.). Below is the basic app delegate class I am working with. The problem is that when displayed the UIWi...
Decarbonize asked 7/8, 2016 at 19:26

2

Solved

I would like to adjust the iPhone's main screen brightness in code using Swift. I know in Objective-C it can be done by: [[UIScreen mainScreen] setBrightness:0.5]; How do I do this in Swift?
Luthern asked 17/6, 2014 at 13:7

1

I am trying to cover status bar with my own view and to do that I calculcate frame for my view by doing something like that (also after rotation): UIScreen *screen = [UIScreen mainScreen]; CGRect ...
Dichlorodifluoromethane asked 23/7, 2015 at 8:5

2

Solved

Why do I see in some sample code from Apple (such as PhotoScroller) that I should do the following in loadView: CGRect frame = [[UIScreen mainScreen] bounds]; instead of CGRect frame = [[UIScr...
Tuft asked 25/6, 2010 at 17:40

14

Does iOS SDK provides an easy way to check if the currentDevice has an high-resolution display (retina) ? The best way I've found to do it now is : if ([[UIScreen mainScreen] respondsToSelector:...
Cogitable asked 17/8, 2010 at 15:32

2

Problem is, my reading app has a button that puts it into dark theme mode. The brightness gets reduced by 10%. When the user returns to the normal mode, it is set back to the remembered brightness....
Delrio asked 6/2, 2013 at 0:20

18

Solved

I ran the following code in both iOS 7 and iOS 8: UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; BOOL landscape = (orientation == UIInterfaceOrienta...
Stepp asked 10/6, 2014 at 20:35

3

Solved

I have a feature in my app (a metronome app for musicians) to dim the screen in order to save on battery life. To set the brightness, I am using: [UIScreen mainScreen].brightness = 0.1; I am sav...
Divan asked 29/2, 2012 at 23:30

4

I am using HDMI cable to take output of my iPad screen to a TV. if i keep the iPad in landscape mode the output on TV shows in landscape mode. and if i rotate it to portrait output on TV changes to...
Philipps asked 26/2, 2014 at 14:17

1

I'm trying to get an image of the entire screen as the user sees it. The following code should work however it will only work in the simulator. What do I have to do to get this to work on a device ...
Looseleaf asked 6/1, 2015 at 11:7

2

Solved

I have an app that was created prior to the new iPhone 5 retina widescreen device. Now i am trying to support this high definition widescreen. I adjust the main ViewController and the main window ...
Celt asked 20/7, 2013 at 11:51

2

Solved

At the moment I'm trying to create an application to adjust the device's brightness. In iOS5, there is the new brightness property for mainScreen that allows you to set the screen brightness. I'm u...
Deserved asked 26/10, 2011 at 9:30

© 2022 - 2024 — McMap. All rights reserved.