MobileEntityLogo.png

Hi.

Welcome to the best online resource for IOS & Android tutorials.

How to get IOS device information

How to get IOS device information

Their is a UIDevice component that is part of UIKit, and SwiftUI that allows us to do all the functionality we will be going over today. I have written a simple SwiftUI app to demonstrate what UIDevice can do. I am sure that it can do a lot more than what I am showing you today, however I hope this will give you an idea on how to get the information you need.

Simulator Screen Shot - iPhone 11 Pro Max - 2020-05-31 at 13.57.30.png

As you can see we can get some useful information from just some simple code. To access this information you have to use UIDevice.current to retrieve any of these values. Some values require you to convert from float to string which is quite simple. Below is a line of code to retrieve the device model just so you can get a feel for how to retrieve device info.

Screen Shot 2020-05-31 at 1.44.13 PM.png

As you can see we can get the device model with a simple line of code, however you can also retrieve the localized model by changing model to localizedModel. Now I will show you the entire code so you can see how I retrieved the entire list shown above.

Screen Shot 2020-05-31 at 1.56.44 PM.png

Some items as you can see require logic such as device orientation, however it isn’t that complicated to create custom actions in your codebase based on device state. You can do this in UIKit and SwiftUI.

Creating a Coverflow like UI, and pulling iTunes Data

Creating a Coverflow like UI, and pulling iTunes Data

WWDC 2020 Wishlist

WWDC 2020 Wishlist

0