Swift

Reading articles about the Swift programming language can help you to improve your skills as a Swift developer. These articles can cover a wide range of topics, including new features in the language, best practices for writing efficient and maintainable code, and tips for debugging and troubleshooting common issues. Additionally, reading articles about Swift can help you stay up-to-date with the latest developments in the language, and give you a deeper understanding of its capabilities and limitations. This can help you to write more effective and efficient code, as well as make better decisions when choosing technologies for a specific project.

What is DispatchGroup and when should we use it?

DispatchGroup allows developers to manage groups of tasks that run concurrently. It helps to synchronize multiple asynchronous tasks and wait for all of them to complete before moving on to the next task. The DispatchGroup class provides enter() & leave()…

Type erasure in Swift and when it would be used

In Swift, type erasure is a technique used to abstract away the concrete type of a value and replace it with a protocol that describes the behavior of the value. This allows you to work with values in a generic…

iOS Architectural Patterns: The Beginner Guide

iOS architectural patterns refer to the different ways in which iOS developers organize and structure the codebase of their apps. When it comes to developing iOS apps, it’s important to choose the right architectural pattern in the beginning or at…

What’s New in Swift 5.8, Xcode 14.3 & iOS 16.4

Swift 5.8 is set to release with a host of new features and improvements, including implicit self for weak self captures, conditional compilation for attributes, and the addition of the new type StaticBigInt to the standard library.

Protocol Oriented Programming(POP): A Beginner Guide

Protocol Oriented Programming (POP) is a programming paradigm that emphasizes the use of protocols to define interfaces between components in a software system. It is a popular approach used by Swift developers to build flexible, modular, and reusable code. In…

Exploring Gang of Four Patterns in iOS Development

iOS app development has come a long way since the first iPhone was released in 2007. Today, there are millions of iOS apps available for download on the App Store, and developers are constantly looking for ways to create more…

How to implement the force update app in Swift and SwiftUI?

In today’s fast-paced world, keeping your mobile app up-to-date is crucial for ensuring its functionality and security. A force update feature is an effective way to ensure that your users are always running the latest version of your app. In…

@escaping in Swift

In Swift, the @escaping keyword is used to indicate that a closure (a block of code that can be passed around and executed at a later time) may be called after the function it was passed to has completed execution.…

Phantom types in Swift

Swift is a powerful and versatile programming language that is widely used for developing iOS and macOS apps. One of the many features that sets Swift apart from other languages is its support for “phantom types.” In this blog post,…

Refine your OOP skills for iOS Development

Object-oriented programming, or OOP, is a popular programming paradigm that is widely used in iOS development. As an iOS developer, understanding and utilizing the principles of object-oriented programming (OOP) is crucial to building robust and maintainable applications. Whether it’s through…

Acing SF Symbols – The Complete Guide – Swift & SwiftUI

SF Symbols is a set of over 4000 configurable vector-based symbols provided by Apple for use in iOS, iPadOS, and macOS apps. These symbols are designed to be highly legible and consistent with Apple’s design guidelines, making it easy for…

The power of map in Swift

The map function in Swift is a powerful tool for transforming the elements of a collection in a concise and expressive way. It allows you to apply a specific operation to each element of a collection, such as converting an…

The Power of reduce in Swift

The reduce function in Swift is a powerful tool for iterating over a collection and aggregating the values in a way that allows you to accomplish a variety of tasks, such as summing up the values in an array, or…

How to Merge Two Arrays in Swift?

In Swift, there are several ways to merge two arrays. One way is to use the + operator to concatenate the two arrays. This method creates a new array that contains the elements from both of the original arrays. Another…

How to remove nil elements from an array in Swift?

In this blog post, we’re going to explore how to remove nil elements from an array in Swift. An array is a very useful data structure, but sometimes it can contain elements that have the value of nil. This can…

iOS Developer – Bonus Interview Questions

While the basic technical questions are important, many interviewers also like to ask more open-ended and creative questions to gauge your problem-solving skills, your design sense, and your overall knowledge of the iOS ecosystem. Here are some examples of topics…

Custom segmented control in SwiftUI

The segmented control in iOS is like a selection bar with two or more segments, each of which works as a mutually exclusive segment In this super short tutorial, we will take a look SwiftUI provided segmented control as well…

How to show local notification always at the same time?

For local notifications, you need to generate the notification content and provide a time or location. Both Local and remote notifications inform the user to do specific action by displaying a notification badge/alert with/without sound. The badge generally shows when…

How to show local notification when the app is foreground?

In order to display the notification when the app is foreground/open, you need to add a delegate method. You have to implement UNUserNotificationCenterDelegate in order to get the local notification when the app is open. Add the following extension in…

How to implement custom font in SwiftUI?

Fonts can influence our emotions. They can also impact the user experience. In SwiftUi, It is very easy to use custom font by the help of info.plist and the font modifier. In this article, I will demonstrate how to add…

What is Copy On Write(COW) in Swift?

Copy-On-Write (COW) is a memory management technique used in Swift programming language to optimize the performance of memory allocation and deallocation operations. In COW, whenever a new instance of a data structure is created, the original data structure is not…

Xcode Cheat Sheet – Most used shortcuts and tips

If you’re an iOS developer, it’s essential to have a thorough understanding of the tools you use on a daily basis. After all, you likely spend 40 or more hours a week working with them, so knowing small hacks that…

ARC & when to use strong, weak, unowned

Memory management is one of the important concept when it comes to mobile application development. Memory leaks and app crashes are very common due to poorly managed memory in iOS apps. In this short article, I will describe ARC and…

Why should you use private outlets by default?

Access control is very powerful concept in object oriented programming language. Access control helps prevent you from using objects in ways they were not intended to be used. Access control lets you carefully control what properties and methods an entity…

Swift iOS interview questions and answers

Swift is a very powerful language and it combines both object-oriented and functional programming. It has many exciting features such as closures, function pointers, tuples, and multiple return values, generics, functional programming patterns, etc. In this article, I have collected…

Use of #file, #line, #function when debugging

#file, #line and #function are very common to debug features that are available in other languages like C++. I found it very useful to implement debug/logging manager. We can get the current file name, line number and function name from…

Show alert in Swift – Simplify using protocol

Alert as UIAlertController is used in almost every iOS application. It is one of the most basic components of the application. We can simplify the UIAlertController using protocol. In this short article, I have created AlertDisplaying protocol to resolve alert related…

Grasp mutating function in Swift under three minutes!

The understanding of the mutating function depends on the understanding of reference and value types. In Swift, The properties of value types cannot be changed within its instance methods by default. You need to use a mutating keyword in the…

How and when to use typealias in Swift?

The typealias is a simple but powerful concept in Swift. Type alias does not create new types. They simply provide a new name to an existing type. It makes long, compound types easy to manage. In Swift, we are passing…

First-class functions in Swift

First-class functions are the core feature of a functional programming language. Swift isn’t a functional programming language. But, it has the power of first-class functions. In this short article let’s have a look at the first-class functions and their application.…

Map, FlatMap, Filter, Reduce – High order functions in Swift

Higher-order functions are used a lot in functional programming. A higher-order function is a function that takes one or more functions as arguments and returns a function or a value as its result. All other functions are first-order functions. Higher-order…

Value and reference types in Swift -A deep dive

The value and reference types are a very important concept in Swift. A value type contains the data within its own memory. A reference type holds a pointer to another memory location that holds the actual data. In this article,…