Questions tagged [uidevice]

The UIDevice class provides a singleton instance representing the current device. From this instance you can obtain information about the device such as assigned name, device model, and operating-system name and version. Available in iOS 2.0 and later

UIDevice instance is used to detect changes in the device’s characteristics, such as physical orientation. You get the current orientation using the orientation property or receive change notifications by registering for the UIDeviceOrientationDidChangeNotification notification. Before using either of these techniques to get orientation data, you must enable data delivery using the beginGeneratingDeviceOrientationNotifications method.

When you no longer need to track the device orientation, call the endGeneratingDeviceOrientationNotifications method to disable the delivery of notifications.

Source: UIDevice Class reference

Related tag:

Related SO Questions:

174 questions
9
votes
3 answers

How to detect if any external libraries are calling [UIDevice currentDevice] uniqueIdentifier]?

So, since Apple is now rejecting apps that access UDID, on our company's current project, we need to eliminate all APIs that make a call to this property: [[UIDevice currentDevice] uniqueIdentifier] We have eliminated all the calls in our own code,…
Colin Basnett
  • 4,052
  • 2
  • 30
  • 49
8
votes
1 answer

Can't get playInputClick working

I read a lot of documentations and topics about playing keyboard clicks, but I can't get it to work in my app... I designed a custom keyboard (as a UIView subview), which adopts the UIInputViewAudioFeedback protocol, and returns YES for the…
Thomas Albert
  • 275
  • 1
  • 10
8
votes
5 answers

UIDevice currentDevice's "orientation" always null

As per the title. Calling [[UIDevice currentDevice] BeginGeneratingDeviceOrientationNotifications] has no effect. DidRotateToInterfaceOrientation etc events are working fine, but I need to be able to poll the device orientation arbitrarily. How can…
8
votes
3 answers

How do I detect which iOS device my user is using?

I'm searching for a way to detect the device my app is running on. I am not interested in software version. I searched many questions but none of them (surprisingly) satisfy my needs for following reasons: Solution 1: NSString *deviceType =…
Murat Ögat
  • 1,342
  • 2
  • 14
  • 24
6
votes
6 answers

get list of installed applications on iphone objective-c

I have an application that needs to get the list of installed (other, maybe third party) applications on the device. How can it be done? Or can it be done at all?
Oleg
  • 1,383
  • 4
  • 19
  • 35
6
votes
4 answers

Where should i put the function?

I created a function which checks whether the iPhone is charging or not using UIDevice. Where should I call the function so that it monitors the status throughout the app session? The Function is called "connectivityStatus", at present it's in…
Hari
  • 63
  • 1
  • 4
6
votes
2 answers

Cygwin equivalent of Linux /dev/sda, /dev/sdb etc

On Linux, I can access a hard drive as /dev/sdX. This ignores any partition tables, file systems, etc, and just accesses the drive block by block. What is the equivalent in Cygwin? I already searched Google, but could not find anything that…
rsteward
  • 1,146
  • 2
  • 8
  • 9
6
votes
1 answer

UIDevice does not work in swift 2.0

I try to use following code to get my device information: UIDevice.currentDevice().systemVersion But I got an error as bellow shown: Use of unresolved identifier UIDevice
fcbflying
  • 693
  • 1
  • 7
  • 23
5
votes
1 answer

Retrieving the serial number from the device

How do we get the serial number of the device through objective C? I want to retrieve the iPod/iPhone/iPad serial number from within my application.
Abhinav
  • 37,684
  • 43
  • 191
  • 309
5
votes
2 answers

How to get correct battery level and battery status-ios?

Always [myDevice batteryLevel] returning -1 and [myDevice batterystate]returning 0(entering into Default case). How can i get the correct values?.Can anyone please help me to solve this?.Below is my code.(Always Printing batteryLeft as "-100%" and…
Murali Krishna
  • 167
  • 4
  • 17
5
votes
0 answers

identifierForVendor returns the same identifier even if I removed all the applications for the same vendors

I'm experimenting a little with the identifierForVendor API. As per the doc The value in this property remains the same while the app (or another app from the same vendor) is installed on the iOS device. The value changes when the user deletes…
Lorenzo B
  • 33,216
  • 24
  • 116
  • 190
4
votes
1 answer

Prevent the iOS proximity sensor from turning the screen black

I've seen this question asked a couple of times but nobody has answered it - in fact it might be impossible, but I was wondering if there was a way to prevent the screen from going black when the proximityState changes on the iPhone? I have…
startuprob
  • 1,917
  • 5
  • 30
  • 45
4
votes
4 answers

How can I get the real device's orientation?

All, When i locked the screen orientation,i want use [[UIDevice currentDevice] orientation] to get screen's orientation ,but it always return UIDeviceOrientationPortrait, so, question is how can i get the real Device's orientation. thank you very…
Yue Zhang
  • 201
  • 4
  • 14
4
votes
0 answers

identifierForVendor crash as EXC_BAD_ACCESS

I have hit that issue not very frequently and all version of hit issues are more than IOS 11. This is one of crash log: OS Version: iPhone OS 11.1.2 (15B202) Baseband Version: n/a Report Version: 104 Exception Type: EXC_BAD_ACCESS…
crayfish
  • 41
  • 1
4
votes
2 answers

Does two device will have the same 'UUID'

In my iOS app, I have to restrict the user to use iOS app per device. To do this I found a solution that we can use the identifierForVendor method of UUID (Universally Unique Identifier) which will generate a unique ID to uniquely identify an app on…
Kirti Nikam
  • 2,166
  • 2
  • 22
  • 43
1
2
3
11 12