Different referencing types in Swift

Source: https://wallpapercave.com/ (Edited)

Hello there!

I hope you are doing well! In this article, we shall take a look at how object references are declared in the Swift programming language and what are the different types of referencing techniques that can be used, and how.

Referencing in Swift

In Swift, only classes are declared as referencetype, whereas structs and enums are both value types. So when classes are instantiated, ARC reserves a memory block to store its details and uses this address for reference.
According to Swift’s official documentation:

An overview of getting started with Clean Architecture

Source — Self-created😎

Hello 😎!

In this article, we are going to discuss how to get started with VIP Architecture in iOS. We shall begin by looking at certain theoretical backgrounds to understand the basic working and data-flow in VIP. Following which we will dive into some real code.

Topics that shall be covered are —

  1. Why VIP?
  2. VIP: View Controller, Interactor, Presenter
  3. VIP Cycle and Data flow
  4. Implementing VIP in iOS

Why VIP?

To begin with, you may have worked with various system architectures such as MVC, MVVM, ReactiveCocoa, or VIPER which have been “good” and did a great job until recently. These architectures…

What is lazy? When to use it? Is it safe?

Source — Self😎

Hello, there!

Many of you must have seen a lazy keyword in your codebase or may have used it, but what does it mean? What does it do? Is it always safe to do things lazily? Let’s see.

Lazy allows you to do quite a few things—

  1. Instantiate a code entity — class, struct, etc. without giving initial values to some or all of its members at the time of instantiation.
  2. Suspend any task until needed.
  3. Store the computed values and prevent re-computations.

Declaring lazy

A member can be declared lazy by simply adding a lazy keyword to its signature. A lazy

Understanding the Final keyword and decoding the mystery.

Source: https://unsplash.com/@johnschno | Edited: Self

Okay! Let’s get right at it! For all of us, iOS developers, there comes a time when we encounter Final in the code. At that time we ask ourselves what does it do? Where to use it? How to use it? When not to use it? And many other questions start popping up in our heads.

Here, I will try to answer these questions, and hopefully, decode the mystery of final by the end.

Implications of using final

  1. It prevents overriding and inheritance.
  2. It increases the runtime performance of the code.

But what does this mean??? Let’s see!

Prevent Inheritance and Overriding

Swift like most other object-oriented languages…

A way to handle the restrictions on your code.

Source: https://unsplash.com/@tma | Edited: Self

Access Control enables you to restrict access to parts of your code — functions, class, enumerations, and declarations from other parts of your code. Protecting the code and restricting access to various sections can be very crucial in writing a robust and separated code for your projects. Apple says —

Controlling access comes in handier, even…

Source — Pintrest.com

Today we will try to draw custom shapes and views and try to find out more about drawings in iOS (Swift) and how that can be done through CODE.

For all the frontend developers, one of the most important parts of the development process is the implementation of User Interface. …

Ayush Singhi

iOS Developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store