Swift Technical Interview Questions and Answers !
Question #1 – Swift 1.0 or later What’s a better way to write this for loop with ranges? for var i = 0; i < 5; i++ { print("Hello!") } Answer: for _ in 0...4 { print("Hello!") } Question #2 – Swift 1.0 or later struct Tutorial { var difficulty: Int =…
Swift Sets and their Methods in IOS !
In Objective-C there were three basic types of Data Structures, NSArray, NSDictionary, and NSSet. In Objective-C, the immutable and mutable forms were separate, so you also had NSMutableArray, NSMutableDictionary, and NSMutableSet. In Swift we were…
Naming conventions in IOS !
Naming constants When talking about constant, there is a distinction worth making: public string IDs that identify a specific class of objects by being unique such as NSNotification names, NSError domains, etc. private IDs which are variables aimed at…
How to create uitableview with multiple sections in iOS Swift !
uitableview with multiple sections Uitableview is very important part of iOS ecosystem. Everything from songs playlist to weight trackers use tableview to show data. When you have 10,000 songs or number of rows in your table then its difficult to find…
ERROR Handling in swift !
ERROR Handling in swift Ideally, errors should never occur. File we need should always be available and networks should always be present and reliable. Unfortunately this reality is not ideal and we have to deal with the consequences. Thankfully the…
Creating the Hello World iOS App using SWIFT !
Creating the Hello World iOS App using SWIFT ! So, when you first load Xcode, assuming you haven’t turned it off in the preferences, you will see the “Welcome to Xcode” screen. To start a new app, you click the appropriately titled “Create a new Xcode…
Operation and OperationQueue on SWIFT !
Operation and OperationQueue on SWIFT ! The solution is to move work off the main thread via concurrency. Concurrency means that your application executes multiple streams (or threads) of operations all at the same time. This way the user interface stays…
What is NSOperationQueue or NSOperation in SWIFT ?
What is NSOperationQueue or NSOperation in SWIFT ? NSOperation is an abstract class which can’t be used directly so you have to use NSOperation subclasses. In the iOS SDK, we are provided with two concrete subclasses of NSOperation. These classes can be…
Asynchronous Operations with Grand Central Dispatch in SWIFT !
Grand Central Dispatch We call them Global Dispatch queues. These queues are global to the application and are differentiated only by their priority level. To use one of the global concurrent queues, you have to get a reference of your preferred queue…
Why do We Need Concurrency in IOS ?
I know you’re a good developer with experience in iOS. No matter what kinds of apps you’re going to build, however, you will need to know concurrency to make your app more responsive and fast. Here I summarize in points the advantages of learning or…