Search Your Question

Difference between network location and gps location.

Ans : 

Network location usually refers to cellular location, or wifi location. They are less accurate then GPS (Global Positioning System - satellite based) location. When the app cannot obtain GPS location (probably because the target device is inside a building), the less accurate network location is obtained and uploaded to the map page.



Which method called when I click on next, done button of keyboard?

Ans : textFieldShouldReturn


func textFieldShouldReturn(_ textField: UITextField) -> Bool {
     return false
}

What are UITextField delegate methods?

Ans : 

Copy from Apple Developer Site : Link


Managing Editing

func textFieldShouldBeginEditing(UITextField) -> Bool
Asks the delegate if editing should begin in the specified text field.
func textFieldDidBeginEditing(UITextField)
Tells the delegate that editing began in the specified text field.
func textFieldShouldEndEditing(UITextField) -> Bool
Asks the delegate if editing should stop in the specified text field. 
func textFieldDidEndEditing(UITextField, reason: UITextField.DidEndEditingReason)
Tells the delegate that editing stopped for the specified text field.
func textFieldDidEndEditing(UITextField)
Tells the delegate that editing stopped for the specified text field.
enum UITextField.DidEndEditingReason
Constants indicating the reason why editing ended in a text field.

Editing the Text Field’s Text

func textFieldShouldClear(UITextField) -> Bool
Asks the delegate if the text field’s current contents should be removed.
func textFieldShouldReturn(UITextField) -> Bool
Asks the delegate if the text field should process the pressing of the return button.

What is NSZombie?

Ans : 

It's a memory debugging aid. Specifically, when you set NSZombieEnabled then whenever an object reaches retain count 0, rather than being deallocated it morphs itself into an NSZombie instance. Whenever such a zombie receives a message, it logs a warning rather than crashing or behaving in an unpredictable way. As such, you can debug subtle over-release/autorelease problems without advanced tools or painstaking needle in haystack searches.

The name is a fairly obvious play on the fact that objects are normally considered "dead" when they reach retain count 0. With this setting, they continue to exist in a strange half-life - neither living, nor quite dead. Much like real zombies, except they eat rather fewer brains.


Enlist different background modes

Ans : 

There are different background modes provided from apple and we can see them under Signing & Capabilities > + Capability (New) > Background Mode

Switch on background mode and select which is required in our project.

Background Modes in iOS



  1. Audio, AirPlay and Picture in Picture
  2. Location updates
  3. Void over IP
  4. External accessory communication
  5. Uses Bluetooth LE accessories
  6. Acts as a Bluetooth LE accessory
  7. Background fetch
  8. Remote notifications
  9. Background processing


For tutorial, I recommended raywanderlich.com article