Parsing JSON into Swift Objects directly

Parsing JSON data in into swift objects have become super easy with Swift 4 JSONDecoder.Given below is a simple example which hits a Api and parses the JSON data directly to student object.We are assuming that we have a JSON response which has same keys as names of properties. import UIKit struct Student:Decodable{// property name should be … Read more

App Transport Security basics

App Transport Security (ATS)  is a network security feature on Apple platforms and is enabled by default. It ensures that applications implement industry standard security without known weaknesses and ensures data integrity and privacy. The purpose of App Transport Security is to improve sense of security in end users by ensuring that no accidental network … Read more

Swift Interview Questions and Answers

This article is meant to be a guide. Target is to evolve it to a exhaustive list of swift questions and answers with your support. Given below are few of the most common questions asked in swift interview straight from swift docs, which according to me is a must read for any one trying to develop some skills in swift.Questions are added on last page.

Important swift questions you should know

Question 1.  How to declare constant in swift?

Answer: Constant are declared using let keyword and once set, attempting to change a constant value results in compile time error

let welcome = "Welcome Buddy!!!"

Question 2. Can we use Swift reserve keywords as variable or constant name? How?

Answer 2. Yes we can, we need to surround the reserve keyword in “`” (backticks)

var `protocol`:String = "Protocol is reserved"

Question 3. What are Type Aliases ? Why they are used?

Answer 3. Type Aliases are used to give alternative name for an existing type.They come in handy when we want to give a existing type a name which is more clear in applications context.

typealias PriorityLevel = UInt16

let a = PriorityLevel.min  // which is same as UInt16.min

Rename Xcode project completely with Pods and Bridging header

Renaming a project in Xcode can be a trouble if you don’t know what you are doing. In this tutorial you will learn about steps and checks necessary for changing project name. This guide is divided into 2 section

  1. Renaming a basic Xcode project
  2. Renaming a Xcode project with Pods and Bridging Header

Read more

Meltdown and Spectre Flaws affect all iOS and Mac devices

For the very first time mac and iPhone users have found themselves in a very unfamiliar territory, threat of a flaw|malware.Its very scary and unfamiliar experience for us.Apple has announced that all of today’s Apple devices are affected by Meltdown and Spectre, only exception being apple watch. But no need to lose sleep over it … Read more

WKWebView NSCoding support was broken in previous versions

WebKit was introduced in iOS 8 but was released with an error which resulted in a runtime crash if the configuration was done using Interface Builder. So in Xcode 9 if your project configuration has minimum OS support less than 11.0 and you try to add WebKit using interface builder Xcode shows an error. This … Read more