Author: Ravi Shankar
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…
Choosing between guard statement and if let
Swift offers two important features for handling optionals: the guard statement and if let, also known as optional binding. What is guard? The guard statement is ideal for scenarios where you want to ensure certain conditions are met before proceeding with the execution of your code. If these conditions are not met, the guard statement…
This bundle is invalid. The value for key CFBundleVersion error
If you are receiving the following error while trying to upload your binary from Xcode organiser to AppStoreConnect then try incrementing the build number. This bundle is invalid. The value for key CFBundleVersion [1] in the Info.plist file must contain a higher version than that of the previously uploaded version [1]. Please find more information…