Home
zeeshan's blog
Cancel

iOS View

Lifecycle Lifecycle of a UIViewController: loadView Creates the view that the controller manages. It’s only called when the view controller is created and only when done programatically. It is r...

Github Action for iOS

To start with Github Action we need to have a repo and few test written to verify our build and test command. First let’s create a YML file in the directory .github/workflows at the root of your re...

Swift 5.5 notes

SE-2096 async, await These are the two new keywords in Swift 5.5 for funcs mostly to make them asynchronous and use it like a synchronous function. async and await is to help us avoid pyramid of d...

Big O notation

Drop the constants Ex: Runtime $O(2N)$ will become $O(N)$ Drop the non-dominant terms Since we drop constants therefore $O(N^2 + N^2)$ becomes $O(N^2)$. If we did not care about the latter $N^2$ ...

Codable

Decoding enum Parsing a String value to an enum case with undefined case value to an unknown case using singleValueContainer enum Fruits: String, Decodable { case mango, banana, unknown ...

Swift 5.3 notes

SE-2076 Multi-pattern catch clause do { //... } catch MyError.code1, MyError.code2 {} SE-2079 Multiple trailing closure No need for small curly braces anymore. Button { //... } label { ...

Swift logs

There are many ways we can log our data in standard output console and few of them also supports logging in Console.app. Let’s have a look at them: print() debugPrint() dump() NSLog OSLo...

Combine In-Practice!

Key Points Apple introduced a new framework to deal with asynchronous programming called Combine in WWDC 2019. A framework which provides stream of events which can emits values and optionally...

Combine Introduction!

Apple introduced a new framework to deal with asynchronous programming called Combine in WWDC 2019. A framework which provides stream of data which can emits values and optionally end in a suc...

autoreleasepool

High-Level Overview The ball gets rolling when the autorelease message is sent to an object. autorelease is implemented on NSObject, and just calls through to [NSAutoreleasePool addObject: self]. T...