- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 201 Articles for IOS

Updated on 07-Aug-2019 13:59:26
It is very important to know when user is pressing home key as it puts the application to background, here we will be seeing how to identify or get a call when user presses home key.In you AppDelegate.swift, there are delegates methods.Open your AppDelegate.swift and in applicationWillResignActive(_ application: UIApplication) and applicationDidEnterBackground(_ application: UIApplication), write print statement and put a breakpoint as shown.Run the application, once the app is launch tap the home button, applicationWillResignActive will be called and then applicationDidEnterBackground. 
Updated on 07-Aug-2019 13:58:48
There will be instance where you might get a requirement to control / manipulate width and height the Alert while developing iOS application. If you’re not familiar with the same, it can trouble you.Here we will be seeing how to control the width and height of default alert box, For controlling the height and width we will be using NSLayoutConstraint.To read more about UIAlertController refer − https://developer.apple.com/documentation/uikit/uialertcontrollerIn this, we will be creating a new project where we will have a button, on tapping that button we will show alert with custom message.Step 1 − Open Xcode → New Project → Single ... Read More 
Updated on 30-Jul-2019 22:30:26
When most apps have no touches as user input for a short period, the system puts the device into a "sleep” state where the screen dims. This is done for the purposes of conserving power.Preventing iOS Device from going to sleep is easy, navigate to your Settings → Display & Brightness → Autolock, select never.This will never lock your screen.If you’re developing an iOS Application and you’re required to implement this feature, you should use isidletimerdisabled provided by apple, to read more about it https://developer.apple.com/documentation/uikit/uiapplication/1623070-isidletimerdisabledIn your viewDidLoad method write the following line of code to prevent the device from going to ... Read More 
Updated on 30-Jul-2019 22:30:26
As an iOS developer one should know how to manipulate with text field and it’s operation, Apple has already provided UITextFieldDelegate protocol.To read more about it https://developer.apple.com/documentation/uikit/uitextfielddelegateYou may have seen may application where forms are involved, and you see number of characters you’re entering when you type specially on the forms where characters are restricted to certain count.In this post we’re going to see the same how to display the character count, when you type in TextField.Step 1 − Open Xcode → New Project → Single View Application → Let’s name it “TextFieldCount”Step 2 − Open Main.storyboard and add TextField and ... Read More 
Updated on 30-Jul-2019 22:30:26
Before we see where and how to use static variable, let us first understand, What is static variable in swift?Static VariableStatic variables are those variables whose values are shared among all the instance or object of a class. When we define any variable as static, it gets attached to a class rather than an object. The memory for the static variable will be allocation during the class loading time.Let us understand above figure, we have a class Sample and it has two object s1 and s2. You see s1 and s2 both have their variable “a” separately but they have ... Read More 
Updated on 30-Jul-2019 22:30:26
Setting border for image view is easy, In this post we will see how to set Border for an Image View in iOS.Let’s get started.Step 1 − Open Xcode → New Project → Single View Application → Let’s name it “BorderToImage”We will create an image view and a button in our storyboard on tap of button we will add border to image view. We could do the same in viewDidLoad but to see the difference we’re doing this.Step 2 − In Main.storyboard add an image view and a button as shown below.Step 3 − Create @IBOutlet for image and name ... Read More 
Updated on 30-Jul-2019 22:30:26
User can turn on or turn off mobile data from settings of an iOS device, but it’s practically not possible to disable or enable the same programmatically. It is only possible if you jailbroke an iOS device.. Apple does not allow any apps developer to access wifi or Bluetooth.There are some private API’s which may aid this but eventually result in app rejection from the app store. 
Updated on 30-Jul-2019 22:30:26
Understanding how to play audio and video in iOS is very important, as almost every application has audio and video these days. From your gaming application to social media to your music player and so on.In this post, we will be seeing how to play audio and video file using Swift.So let’s get started.Step 1 − Open Xcode → New Project → Single View Application → Let’s name it “AudioVideo”.Step 2 − Open Main.storyboard and add three buttons and name them as shown below.Step 3 − Create @IBOutlet for three buttons and name it to stop, playButton and video button, ... Read More 
Updated on 30-Jul-2019 22:30:26
Almost all the application uses location services, thus having complete understanding on location is necessary. In this post we will be seeing how to get current location’s latitude and longitude.For this we will be using CLLocationManager, you can read more about it herehttps://developer.apple.com/documentation/corelocation/cllocationmanagerWe will be developing a sample application where we will print user’s latitude and longitude on viewDidLoad method, alternatively you can print on tap of a button also on UILabel as per need.So let’s get started, Step 1 − Open Xcode → New Projecr → Single View Application → Let’s name it “Location”Step 2 − Open info.plist file ... Read More 
Updated on 30-Jul-2019 22:30:26
Every app needs a beautiful and memorable icon that attracts attention in the App Store and stands out on the Home screen. Your icon is the first opportunity to communicate, at a glance, your app’s purpose. It also appears throughout the system, such as in Settings and search results.Here we will be seeing how we can set icon for iOS Application but before that we should make sure and understand that Every app must supply small icons for use on the Home screen and throughout the system once your app is installed, as well as a larger icon for display ... Read More Advertisements