SwiftUI

Unlock the power of iOS development and create stunning, responsive user interfaces with our comprehensive guide to learning SwiftUI.

Migrating from UIKit to SwiftUI – Workable Strategies

The introduction of SwiftUI has brought a fresh, new look to iOS app development. With its declarative syntax and improved performance, it’s no wonder that many developers are eager to make the switch. However, migrating from UIKit to SwiftUI can…

Mastering GeometryReader in SwiftUI

The GeometryReader is a SwiftUI view that allows you to read the size and position of its parent view. It can be used to create layout that adapts to changes in the parent view’s size and position. The GeometryReader is…

Xcode Cheat Sheet for SwiftUI – Efficiency Hack

Master These Keyboard Shortcuts for Increased Productivity SwiftUI is a powerful tool for building user interfaces on Apple platforms, and one of the ways to make the most of it is by using keyboard shortcuts. Increase your productivity when coding…

How to Send Email in SwiftUI

Sending an email in SwiftUI can be done using the MessageUI framework. The MessageUI framework provides a simple and easy-to-use interface for sending emails in iOS apps. Here’s an example of how to send an email in SwiftUI: Now add…

Call Customer Care Button in SwiftUI

In today’s fast-paced world, customer service is more important than ever. As a business, it’s essential to provide your customers with a seamless and efficient experience when they need help. One way to do this is by implementing a “Call…

Enable and Disable Button in SwiftUI

In this tutorial, we will learn how to create an enable/disable button in SwiftUI. In the ContentView.swift file, we will create a button and a state variable that will determine whether the button is enabled or disabled. In the above…

Asking for an iOS User Review using SwiftUI

Asking for an iOS review within the context of a SwiftUI app is a novel approach to gathering feedback from users. This is an important aspect of fostering a connection with them and obtaining valuable insights that can be used…

RenameButton in SwiftUI

You may want to include a button labeled “Rename” in your app. Apple now offers a pre-made button called “RenameButton.” You can easily achieve this by the following code:

Custom Activity Ring in SwiftUI

Activity rings are a feature of the Apple Watch that track a user’s physical activity throughout the day. There are three rings: one for Move, one for Exercise, and one for Stand. I will create a basic custom activity ring…

Acing SwiftUI Chart – The Complete Guide

The Complete Guide to SwiftUI Charts: Create Beautiful and Informative Data Visualizations. Charts are an essential tool for displaying data in a way that is easy to understand and interpret. They allow users to quickly and easily identify trends, patterns,…

Show Map in SwiftUI

With SwiftUI, displaying maps in your app is made easy through the use of the Map view. It allows for seamless integration of maps within the rest of your app’s views and gives you control over various aspects such as…

Common Use cases of ViewModifier in SwiftUI

SwiftUI’s ViewModifier protocol allows you to create reusable pieces of functionality that can be applied to multiple views, making it a powerful tool for organizing and simplifying your code. By creating custom view modifiers, you can abstract away common functionality,…

How to style Text in SwiftUI?

In this blog post, we’re going to explore how to style text in SwiftUI. Text is a fundamental element in any app and being able to control its appearance is crucial for creating a polished, professional-looking user interface. In this…

Rendering Markdown in SwiftUI

Markdown is a lightweight markup language that is widely used for formatting plain text documents, and it is a great way to add rich text formatting to your SwiftUI applications. With the power of SwiftUI, it’s easy to render Markdown…

Formatting Date in SwiftUI

Dates are an essential component of many applications, and in the past, working with them in Objective-C could be challenging. The DateFormatter class was particularly complex, and developers often needed to reference a dedicated website for assistance. However, in SwiftUI,…

Video in SwiftUI

SwiftUI is a powerful framework for building user interfaces on Apple platforms, and it provides a wide range of features and tools for displaying and manipulating video content. In this blog post, we’ll explore how to present a video in…

Implicit stacking in SwiftUI

SwiftUI is a declarative framework for building user interfaces on Apple platforms. One of the core concepts in SwiftUI is the idea of “stacking” views on top of each other to build complex layouts. In this article, we’ll explore the…

How to group views together in SwiftUI

There are several ways to group views together in SwiftUI. If you want to treat multiple views as a single entity and apply a common set of modifications or layouts, you can use the Group view in SwiftUI. It is…

Tips for Writing Cleaner SwiftUI code

Welcome to this blog post on tips for writing better SwiftUI code! In this post, we will share some best practices and techniques that you can use to improve the quality, efficiency, and readability of your SwiftUI code. Writing clean…

Custom Color Picker in SwiftUI

To create a simple color picker in SwiftUI, you can use a Picker control and bind it to an array of Color values. Here is an example of how you might do this: This creates a picker control with a…

Floating Action Button in SwiftUI

To create a floating button in SwiftUI, you can use a Button with a custom background and a fixed position within a ZStack. Here is an example of how you might do this: This creates a circular button with a…

Async Custom Avatar in SwiftUI using AsyncImage

To create a custom avatar in SwiftUI using the AsyncImage library, you can use the AsyncImage view to asynchronously load the image from a URL, and then apply a cornerRadius() modifier to give it a circular shape. You can also…

How to Create A Custom Avatar in SwiftUI

To create a custom avatar in SwiftUI, you can use an Image view and apply a cornerRadius() modifier to give it a circular shape. You can also use a ZStack to overlay a border or shadow on top of the…

How to Delete List Rows from SwiftUI

SwiftUI makes it easy to delete rows from a list using the onDelete() modifier. In this blog post, we’ll learn how to use the onDelete() modifier to allow the user to delete items from a list. To get started, let’s…

How to Reorder List rows in SwiftUI

SwiftUI provides a powerful and easy-to-use API for building lists of items that can be reordered by the user. In this blog post, we’ll learn how to create a list of items that can be reordered using the built-in .onMove()…

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 Circular Progress Bar in SwiftUI

Circular progress bars, also known as donut charts, are a common visual element used to display progress or completion percentage in a circular format. In SwiftUI, you can create a custom circular progress bar by combining different views and applying…

How to animate SwiftUI views?

There are several ways to animate views in SwiftUI. Here are a few examples: Using the .animation() modifier: The .animation() modifier can be used to specify an animation to be applied to a view. For example, you could use the…

SwiftUI property wrappers

SwiftUI is a modern, declarative framework for building user interfaces on Apple platforms. One of the key features it provides is the use of property wrappers, which are a way to add functionality to properties in your SwiftUI views. Property…

Drawing paths and custom shapes in SwiftUI

To draw paths and custom shapes in SwiftUI, you can use the Path and Shape types provided by the SwiftUI framework. The Path type represents a geometric path in two-dimensional space, and it consists of a sequence of straight and…

How to scroll to a specific row in a list in SwiftUI

If you want to programmatically scroll to a specific row in a list, you can use the scrollTo() method of the ScrollViewReader view in SwiftUI. Here’s how it works: For example, the following code creates a list of 50 rows…

What are the limitations of SwiftUI?

Some drawbacks of SwiftUI – Learning curve.  Preview bugs in XCode. For complex UI, the best practices are not defined by the community yet.  Many features are still only available in UIKit.  SwiftUI is not available for older operating systems…

Image Picker in SwiftUI

Apple provides is the ability to allow users to select and upload images from their device’s photo library or camera. To implement an image picker in SwiftUI, you will need to create an ImagePicker ViewController. This ViewController will allow the…

Debunk SwiftUI myth – Frequently asked questions

The debate between the SwiftUI and the Swift Interface Builder is ongoing from the moment when SwiftUI was first introduced in WWDC 2019. There are some misconceptions about SwiftUI implementation in the existing production app as well. I have faced…

Top 10 Pros and Cons of SwiftUI

Before adapting SwiftUI in your current application or a brand new application, you should always consider all the advantages and disadvantages of SwiftUI. SwiftUI may not be good fit if you want to support older version of your application. In…

SwiftUI Interview Questions & Answers

SwiftUI is a modern, declarative framework for building user interfaces on Apple platforms. Its intuitive syntax and straightforward approach to layout make it a popular choice for iOS developers. As a result, SwiftUI is often a topic of discussion in…

Lottie Animation in SwiftUI

Lottie is an open source animation file format that’s tiny, high quality, interactive, and can be manipulated at runtime. It has a the largest community of designers and developers. App like Duolingo and headspace are using lottie animation extensively. In…

How to present WebView in SwiftUI?

SwiftUI does not provide any built in WebView. But you can easily create a WebView by the power of UIViewRepresentable. This code represents a stand alone View, so you can call it from any other View just like you would…

Share sheet in SwiftUI using UIActivityViewController

There is no built in share sheet in SwiftUI but you can easily implement a share sheet using UIActivityViewController. UIActivityViewController is a simplified built in interface to share contents such as texts, images and URLs. You can also define custom…

How to detect multiple gestures simultaneously?

If you want to detect multiple gestures at the same time, you can use SwiftUI’s simultaneously function. You can simply say that it is opposite of sequenced gestures described in How to implement sequential gestures using sequenced? For example, this…

How to implement sequential gestures using sequenced?

If you want to collaborate multiple gestures and make them detectable one after another, you can use SwiftUI’s sequenced modifier. To implement combined gestures or sequential gestures you need to create multiple gestures. In this case, the second gesture can…

How to pop or dismiss view programmatically in SwiftUI?

To pop or dismiss the view programmatically in SwiftUI, you can use use @Environment(\.presentationMode) as a variable and call wrappedValue.dismiss(). In the DetailView we have called wrappedValue.dismiss() wen the button is tapped. You can also get the same outcome if…