Rounding up to the nearest Integer value functionality is something required a lot of times. Swift has a few inbuilt functions which can do the rounding up for us but they are a bit confusing. …
In Swift, the type system distinguishes between references that can hold nil (nil references) and those that can not (non-nil references). …
In Swift, we can differentiate the variables into three different categories based on their possible values. The variable can be of default type, optional type or an explicit non-nil type. …
In Swift, the question mark works differently in different situations or when clubbed with some other keywords. It sometimes denotes the variable type as optional or sometimes being used for optional chaining. …
Swift has two data types (Double and Float) to hold the decimal values. Both of them hold the same decimal type values but have some differences. …
For-in and for-each are different variants of for loops in swift which are used to iterate over a range, set or dictionary. …
In continuation to my previous blog UserDefaults in Swift, where we understand the basic functionality of UserDefaults, we’ll try to understand today how can we store custom objects in UserDefaults. …
This particular script will help you to store and retrieve custom class or struct objects in UserDefaults. For further explaination on how this works, please read the article Custom Object in UserDefaults : Swift. …
A small set of data is required to be stored and accessed very frequently and need to be persisted across sessions or app launches. …
Adding an value change event to a UISwitch is something that is required most of the time. For views like UISwitch, we can connect an IBAction with the event type as value changed and get a callback for the value changed. …
This particular script will help you to implement a Value Change listener to all UISwitch and its subclasses in a clean way. …
Adding an editing event to a UIDatePicker is something that is required most of the time. For views like UIDatePicker, we can connect an IBAction with the event type as value changed and get a callback for the value changed. …
This particular script will help you to implement a Date Change listener to all UIDatePicker and its subclasses in a clean way. …
Adding an editing event to a UITextField is something that is required most of the time. For views like UITextField, we can connect an IBAction with the event type as editing did end or value changed and get a callback for editing finished or value changed. …
This particular script will help you to implement a Text listener to all UITextField and its subclasses in a clean way. …
The switch statement in Swift is used to execute a particular block of code based on multiple conditions. A switch statement is useful for more than one condition. …
Range Operator in Swift is a basic operator that is used to operate over a range. There are multiple types of range operators where we can include or exclude the upper range. …
For loops are used by every developer regularly. There is for-in as well as a for-each loop in Swift which has a bit different syntaxes. …
Object creation is a heavy process. When we create a class object, all the public and private properties of that class are initialised inside the constructor. …
if let and guard let are two conditional operators or condition checker which make our life super easy. Other languages have only if as condition checker but swift provides if let as well as guard let also which are operationally same but a bit different in functionality. …