A UIScreen object contains the bounding rectangle of the device’s entire screen. When setting up your application’s user interface, you should use the properties of this object to get the recommended frame rectangles for your application’s window.
Questions tagged [uiscreen]
153 questions
2
votes
0 answers
How to stop Screen Recording in App Swift 4
I have one code for detected if user try to screen recorder now I want to stop recording that's mean the red part in left side is stoped
here is my code for detecting now how can I stop recording automatically or dismiss recording in isCaptured ==…

MidDev
- 182
- 1
- 15
2
votes
1 answer
Unable to get a screenshot on iOS using the snapshotViewAfterScreenUpdates: method of UIScreen
I'm trying to get a screenshot image in my iOS app. The screenshot must have everything on the screen, including the status bar, so solutions such as this does not work for me. I tried the following:
override func viewDidLoad() {
…

ycsun
- 1,825
- 1
- 13
- 21
2
votes
0 answers
Correct way to create CADisplayLink: UIScreen vs. init()
There are 2 ways to get CADisplayLink in iOS. The direct one is to use initializer:
let displaylink = CADisplayLink(target: self,
selector: #selector(step))
Returns a new display link.
This way is used in Apple's…

kelin
- 11,323
- 6
- 67
- 104
2
votes
1 answer
Does a width of 44 pixels equate to the same physical size for all devices?
I work based on the screen size of an iPhone 6 that is 1136x750 pixels at 326 ppi. I'm more concerned about the physical size of the buttons (for some reason) rather than their digital sizes.
If a button that has a width of 44 pixels on the iPhone 6…

Vulkan
- 1,004
- 16
- 44
2
votes
1 answer
UIScreen mainScreen in Xcode 8
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…

Sergey Kuzukov
- 61
- 5
2
votes
3 answers
UIScreen bounds smaller than expected on external screen
I want to place content on an external screen (for now a MacBook Pro using Air Server) in full screen, with a screen on a tablet.
I am using an example from https://github.com/quellish/AirPlayStoryboards - which is great. However, I am finding that…

Tony Hematite
- 149
- 3
- 14
2
votes
1 answer
Detect if screen brightness adjustment is set to automatic
I would like to get something like a Boolean to tell if the user set the Auto-Brightness feature of the iPhone on/off. Is this even possible?
I thought it would be explained somewhere here - in UIScreen - currentMode but it seems that it isn't.

Bergrebell
- 4,263
- 4
- 40
- 53
2
votes
3 answers
Orientation lock for iPhone only
I have designed UI for my iOS app with wAny hRegular setting.
Now orientation works fine in iPad. But when app is running on iPhone, orientation gives a blank white screen.
Is there any way such that I can lock orientation in iPhones only and…

Abin Baby
- 586
- 6
- 17
2
votes
5 answers
What is the use of UIScreen property in UIWindow?
I was looking at the UIWindow class reference and there I found the UIScreen property which defaults to [UIScreen mainScreen]
@property(nonatomic,retain) UIScreen *screen NS_AVAILABLE_IOS(3_2);
// default is [UIScreen mainScreen]. changing the…

vinay
- 73
- 1
- 4
2
votes
3 answers
Autorotate issues with second UIScreen on iOS8.0 (and 8.1)
My app drives a second screen (external monitor) but I'm seeing some 'odd' things with regards to rotation (things that don't happen on iOS7)
If I launch the app (and connect the second screen) in landscape orientation then hit the home button to…

Scotty
- 2,019
- 1
- 20
- 31
2
votes
1 answer
[UIScreen mainScreen].scale always returns 2 for Non-Retina iPads
Using xcode 5.1.1 with ios 7.1 to build a iPhone only app.
When running this app on any non-retina device (ipad mini, simulator, ipad 2), [UIScreen mainScreen].scale always returns 2 leaving me with no way to detect if I'm on a retina screen.
This…

Isaac Paul
- 1,959
- 2
- 15
- 20
2
votes
3 answers
Possible crash when loadNibNamed on jailbreak devices [UIDeviceRGBColor superview]: unrecognized selector
My code looks like this:
CGRect screenRect = [[UIScreen mainScreen] bounds];
SomeView *infoView;
if(screenRect.size.height != 568.0){
// iPhone 5/5s users crash in the next line
infoView = [[[NSBundle mainBundle] loadNibNamed:@"SomeViews"…

benck
- 2,034
- 1
- 22
- 31
2
votes
1 answer
iOS - Apple TV - Detect show on Apple TV programmatically
How can i detect showing on Apple TV?
I've tried already to detect num of screens:
[[UIScreen screens] count]
But it remains on 1.
I've tried also to listen to an event:
[[NSNotificationCenter defaultCenter] addObserver:self
…

gran33
- 12,421
- 9
- 48
- 76
2
votes
1 answer
Setting UIScreen's mode / resolution
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;
…

sgleser87
- 235
- 1
- 3
- 11
2
votes
2 answers
Why [UIScreen mainScreen].bounds] is not returning full screen size?
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 XIB files so that they are set to Autolayout. I can…

AlvinfromDiaspar
- 6,611
- 13
- 75
- 140