Tag

ios

Posts filed under this topic.

15/02/2025

Compiler - LLVM, GCC and more

Let's talk about Swift compiler. what is swift runtime? What compiler does swift uses? Can you draw a flow diagram of how a typical swift code like if (true) { print("hello, world!") } goes through various stages of comp...

17/03/2020

Structural Design Patterns in iOS

The wikipedia definition of a software design pattern is A reusable solution to a commonly occuring problem in the context of software design. Gang of four book in 1994 formalised a number of design patterns. Here we are...

12/03/2020

Dynamic vs Static

When someone says something is dynamic, it usually means things could change. Dynamic array, meaning the content of the array could change, or a dynamic system could mean a system that is robust and can adapt to differen...

26/03/2019

Swift Race Condition: ATM Withdraw Problem

Race condition happens when 2 or more threads access the shared data at the same time and change its value at the same time resulting in unexpected state. A simple example is the typical ATM withdraw problem. ATM withdra...

26/03/2019

Deadlock example

Deadlock is a situation when two or more threads are waiting on each other to be completed causing both to be locked and not able to continue. A practical example of a deadlock is ! Let's see an example in swift. here, t...

19/03/2019

Latest swift tips

It's been a while I've updated my posts. Here are some new tips that makes coding with swift cool. @autoclosure @autoclosure attribute defines an argument that automatically gets wrapped in a closure. It's used to defer...

04/12/2016

Debug View for iOS App

It's a common requirement to tweak different configurations of the app for debug purposes. The general way of doing it is using Settings.bundle where the Settings are located inside Setting of the iPhone. It has a few dr...

20/11/2016

A case for Plist and scripting in Swift

Property List is a convenient and flexible format for saving data. It was originally defined by apple, to use in iOS devices and later extended to various apps. Plist internally is actually an XML file and can easily be...