Category Archives: Swift

Swift is the new language introduced by Apple and is used for developing application in iOS platform.

Swift Defer Statement explained

      No Comments on Swift Defer Statement explained

When you want to ensure that a code block is executed just before control exits the scope, Swift Defer Statement comes to your rescue. Sometimes a function is required to have multiple conditional exit point and covering those exit points without swift defer statement can lead to code duplication or it might… Read more »

Swift nonmutating setters. an Oxymoron?

      No Comments on Swift nonmutating setters. an Oxymoron?

While going through Xcode 10.1 release notes I stumbled upon a very unfamiliar term “nonmutating setters”. Inquisitiveness had the best of me and I spent time reading about it and implementing examples. Here is the jest for you nonmutable setters cannot be used within Classes or protocol bound classes nonmutable setters… Read more »

Using PromiseKit and Alamofire For Clean API Layer

      No Comments on Using PromiseKit and Alamofire For Clean API Layer

Promise kit and Alamofire when used together create a very powerful and flexible API Layer Every App interacting with web services contains an API layer which separates API handling from the rest of the application logic. Usually, the API layer is implemented using delegates or escaping closures. Escaping closures and delegates are… Read more »

Swift Interview Questions and Answers

      No Comments on 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… 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… Read more »

Fatal error: unexpectedly found nil while unwrapping an Optional value

fatal error: unexpectedly found nil while unwrapping an Optional value This error is caused by unconditionally unwrapping an optional  which had nil. Optional is a type in swift which can either contain a value or no value nil. When a optional variable or constant which contains nil is forced unwrapped… Read more »