Author: Ravi Shankar

  • Privacy Manifests and Required Reason API

    Most of the iOS developers might have received an email about “Privacy Manifest” issues from Apple when submitting an app for review. “We noticed one or more issues with a recent submission for App Store review ITMS-91053: Missing API declaration, TMS-91064: Invalid tracking information etc. You must include a NSPrivacyAccessedAPITypes array in your app’s privacy…

  • How to simplify persistent data using @AppStorage

    In SwiftUI, the @AppStorage property wrapper that assists how we interact with UserDefaults, streamlining the process of persisting data. By simplifying data persistence, @AppStorage makes reading from and writing to UserDefaults more straightforward and integrated within the SwiftUI framework. Let us take the following example where we are trying to store tap count in User…

  • How to detect availability of internet connection in Swift

    In today’s world, mobile apps are a big part of our lives. Many of these apps need an internet connection to work properly. This is why it’s so important for app developers to make sure users have a smooth experience, whether they are connected to the internet or not. On iOS devices, developers can use…

  • Understanding .onAppear and .onDisappear in SwiftUI

    SwiftUI simplifies the way developers think about the lifecycle of views with its declarative syntax. Unlike UIKit, which requires you to manage the lifecycle through methods like viewDidLoad, viewWillAppear, and viewWillDisappear, SwiftUI provides .onAppear and .onDisappear modifiers for executing code when a view appears or disappears. This tutorial demonstrates how to use these modifiers in…

  • Handling HTML Text Gaps in Swift

    When working with HTML content in iOS applications, developers often encounter challenges in displaying text with the proper formatting, especially when it comes to maintaining the gaps or spaces between paragraphs. In this post, we are going to explore a simple solution to ensure your HTML text is displayed with the appropriate paragraph breaks, enhancing…

  • Auto Layout in iOS

    Using Auto Layout feature developers can align UI controls for different devices, screen sizes and orientation. This reduces the code to be maintained and makes life easy for the developers. Auto Layout solves UI design issues by creating relationship between the UI elements. This follows constraint based layout system where you can define contraints for…

  • Button in Swift UI – Code Snippet

    A button in SwiftUI is a fundamental interactive component that allows users to trigger actions. SwiftUI Button Basics The two main elements for creating a button are Let us see this with an example of having a button in Expense Split app to add expenses The above code snippets defines the trigger action which is…

  • How to customize status bar in iOS

    Status Bar appears at the top of your device displaying information such as battery left in your device and carrier details. The default style of status bar is black and looks as shown in the below screenshot. But if your screen designs are dark then you can change the status bar style to Light Content.…