All Blogs

Create immersive 3D Objects in visionOS appvisionOS

Create immersive 3D Objects in visionOS app

Since Virtual Reality and Augmented Reality technologies appeared, blending virtual 3D Objects into real-life environments has been the ultimate goal. visionOS, a cutting-edge platform in the realm of digital visualization, introduces a transformative approach to presenting 3D objects with unparalleled clarity and detail. Source: Apple Presenting 3D Object Open up Xcode and create a new Vision project. Select Volume for the Initial Scene. If you are completely new to VisionOS, we highly su

February 1, 2024

Exploring visionOS app development with SwiftUIvisionOS

Exploring visionOS app development with SwiftUI

Welcome to the new world of Spatial Computing with visionOS. In this article, we will get familiar with the basic concepts of Spatial Computing and see how SwiftUI native components are used to build beautiful immersive experiences. Let's get started. Window, Volume and Space Apple Vision Pro introduces a boundless spatial platform for discovery, experimentation, and enjoyment, enabling the complete reimagining of your 3D experience. Users have the flexibility to engage with your application

January 31, 2024

Convert SwiftUI views to PDF using ImageRenderer in SwiftUISwiftUI

Convert SwiftUI views to PDF using ImageRenderer in SwiftUI

Apple unveiled a fresh API named ImageRenderer in iOS 16, enabling swift conversion of SwiftUI views into images and .pdf files. This addition simplifies the process of creating top-notch images from your SwiftUI designs. Let's explore it! Converting Views to Images By definition, it is an object that can create / generate images from SwiftUI views. final class ImageRenderer<Content> where Content : View To use ImageRenderer, we need to instantiate an instance of it with the content that

December 14, 2023

Charts in SwiftUISwiftUI

Charts in SwiftUI

In the dynamic landscape of mobile application development, creating visually engaging and insightful charts is a crucial aspect of conveying information effectively to users. SwiftUI, Apple's declarative UI framework, brings a seamless and intuitive approach to building user interfaces. Within the SwiftUI framework lies a powerful framework for data visualization — SwiftUI Charts. Introduction Charts is a specialized framework designed to simplify the integration of charts and graphs into S

November 29, 2023

Observable Macro in SwiftUISwiftUI

Observable Macro in SwiftUI

At WWDC23, the @Observable macro was introduced with a clear mission: to simplifying the handling of observation-related code and improve the app's performance. In this article let's explore what it brings to the table and how to migrate from using ObservableObject protocol to the new Observation framework using Observable macro. Observation framework Beginning with iOS 17, iPadOS 17, macOS 14, tvOS 17, and watchOS 10, SwiftUI introduces support for the new Observation framework. Capability

November 27, 2023

Custom Shapes in SwiftUISwiftUI

Custom Shapes in SwiftUI

Have you ever used Rectangle(), RoundedRectangle(cornerRadius: _), Circle() or Capsule() for layout in SwiftUI? The answer is likely Yes. It is because they are so convenient to use. But have you ever wonder what they are actually? Are they just normal View? The answer is NO, they are Shape. Shape Protocol In SwiftUI, Shape refers to a protocol that defines the outline of a view or control. It's a fundamental concept for drawing and designing custom views or controls with different shapes. T

November 13, 2023

List in SwiftUISwiftUI

List in SwiftUI

In SwiftUI, a List is a view that displays a collection of data in a scrollable, vertically stacked format. It is commonly used to create dynamic, scrollable lists of items, such as tables, menus, and other structured data. You will soon find List very similar to UITableView in UIKit. Let's get familiar with it with some simple demo. List of items Here, we list down some simple target for today: struct ContentView: View { var body: some View { List { Text("Exercise 3

November 7, 2023

Top iOS Interview Questions on NotificationCenterInterview

Top iOS Interview Questions on NotificationCenter

Q1. When should we use NotificationCenter over other things in Swift? NotificationCenter allows different parts of your application to communicate and send notifications (messages) to each other without needing to have direct references to each other. You should use them when you have situations where one part of your app needs to notify other parts about changes or events, especially when the components involved are loosely coupled and don't need to maintain strong references to each other.

October 25, 2023

Top iOS Interview Questions on Enumeration in SwiftInterview

Top iOS Interview Questions on Enumeration in Swift

Q1. What is an enumeration? An enumeration is a common type that defines a group of related values. Enums are used to represent a set of distinct cases, and each case can have an associated value or a raw value. Here's how to declare an enumeration: enum NetworkError { case noInternet case serverNotFound case unauthorized case internalServerError } // How to create a variable? let error: NetworkError = .serverNotFound print(error) // Output: serverNotFound In this case, err

October 25, 2023

Top 10 iOS Interview Questions on Initializer in SwiftInterview

Top 10 iOS Interview Questions on Initializer in Swift

Q1. What is a default initializer in Swift? A default initializer is an automatically generated constructor provided by the Swift compiler for your custom data types, such as classes and structures (structs). It allows instances of your types to be created without explicitly defining an initializer. Q2. What is a memberwise initializer in Swift? A memberwise initializer is an automatically generated constructor for a struct that allows you to initialize its properties by simply providing val

October 20, 2023

Protocol Inheritance in SwiftSwift

Protocol Inheritance in Swift

Protocol inheritance allows us to define a new protocol that inherits the properties and functions of one or more existing protocols. This feature is essential for building modular, reusable, and organized code. It promotes code consistency, reusability, and ensures that conforming types adhere to a set of common rules and conventions. Just like classes can inherit from other classes, protocols can inherit from other protocols. When a protocol inherits from another protocol, it gains all the re

October 20, 2023

Parsing JSON data using Codable in SwiftSwift

Parsing JSON data using Codable in Swift

Most applications require communication with the server in order to send and retrieve information in JSON format. In order to use the JSON data in the application, we need to store it in models in a proper format. In order to store the JSON data, we encode and decode it into a format that meets the requirements. Codable is not only works for JSON rather it works for JSON, PropertyLIst, and XML. We always have the option of storing JSON data in models by parsing it manually. In this way, we have

October 11, 2023

Top 5 Dependency Injection iOS Interview QuestionsInterview

Top 5 Dependency Injection iOS Interview Questions

Q1. What is dependency injection? What are the types of Dependency Injection in Swift? Dependency Injection is simply injecting the dependencies that a class or module requires through its constructor, properties and methods, instead of creating them within the class itself. It promotes loose coupling between components, making the code more modular, testable, and maintainable. There are three common types of dependency injection: Constructor Injection: This is the most common form of depend

October 8, 2023

Protocol Composition in SwiftSwift

Protocol Composition in Swift

In Swift, protocol composition is a powerful feature that allows you to combine multiple protocols into a single name. This can be very useful when you want to define a type that needs to adhere to multiple protocols simultaneously. Instead of writing multiple protocols again and again, you can just give a single name by combining them. In this article, you will learn about: * Protocol Composition without typealias * Protocol Composition with typealias * Using Composition in Functions * Pr

September 4, 2023

Practical Guide to Protocol Extensions in SwiftSwift

Practical Guide to Protocol Extensions in Swift

Protocol Extensions allow you to add default implementations and computed properties to protocols. This mean, when a type conforms to a protocol, it automatically gains the functionalities provided by the protocol extension. In this article, you will learn about:

August 29, 2023

Secure iOS Application with SSL Pinning | Man in the Middle AttackSwift

Secure iOS Application with SSL Pinning | Man in the Middle Attack

SSL Pinning is a technique where we introduce a certificate between application and server so our connection is secure. Although iOS checks for a valid certificate from its trust store while making connection to server.

August 18, 2023

Protocol Oriented Programming in SwiftSwift

Protocol Oriented Programming in Swift

This article will dive deep into Protocol-Oriented Programming in Swift, exploring advanced techniques and real-world examples.

August 16, 2023

Top 10 iOS Interview QuestionsInterview

Top 10 iOS Interview Questions

We have listed down 10 must know iOS Interview Questions that will help an iOS developer prepare for the interviews.

June 7, 2023

ProgressView in SwiftUISwiftUI

ProgressView in SwiftUI

Almost everyone hates the buffering screen we get due to low internet or the app processing something. Well, but since 5G is here in India, there are less chances of you spending your day just staring at a progress view. Even though we all hate it, making a progress view in your app is inevitable and at some point, you would have to use it in our app. May it be for showing process while you save something to CoreData or to show progress while you are getting something from URLSession. Looking

December 24, 2022

Sets in SwiftSwift

Sets in Swift

You may have come across the concept of Arrays and Dictionaries, two primitive types of collecting and storing the values, but there is a third one in the group called Sets. These three types are together referred to as Collection Types. If you're unfamiliar with Arrays and Dictionaries, we strongly suggest reading up on those concepts before continuing with this one. What makes Sets different from Arrays/Dictionaries? What are Sets? Sets are unsorted collections that contain unique values.

December 10, 2022

Swift Anytime Bangalore Meetup

Swift Anytime Bangalore Meetup

The Swift Anytime Bangalore Meet-up was an exciting event that brought together an enthusiastic group of iOS developers from all over India. Held in December, 2022, this event was the perfect opportunity for like-minded professionals to share ideas, network, and learn from one another. The event kicked off with a fun and informative introduction by the Co-founders of Swift Anytime, who explained the organisation's mission and goals. Attendees were then treated to a fast-paced quiz session that

December 9, 2022

Understand UIResponder & Responder Chain to Handle EventsUIKit

Understand UIResponder & Responder Chain to Handle Events

In this article, you will learn how to handle events that communicate through the app. What is UIResponder? This is an abstract interface for responding to and handling events. An abstract interface is just combination of properties and methods to override them only. You can say, all the instances of UIResponder (responder objects) are the backbone of iOS apps. Here are some responder objects that are most commonly used: * UIView * UIViewController * UIControl * UIApplication Note: You w

December 6, 2022

How to access private members of a class in SwiftInterview

How to access private members of a class in Swift

This article will show you how to access a class's private members, such as variables and methods in Swift. In the normal case, you cannot access private members outside the scope of a class directly, but let's see what are the alternative ways to access members within and outside the scope of a class. What is the Private Access Control? In Swift, private is an access control used to define how types, functions, and other declarations can be accessed in your project. You can set the private

December 3, 2022

What is Trailing closure in Swift?Interview

What is Trailing closure in Swift?

As per the standard definition, Closures are self-contained blocks of functionality that can be passed around and used in your code. When passing a closure expression to a function as the function’s final argument, it can be useful to write a trailing closure. Trailing closure is written after the function call’s parentheses even though it is still an argument to the function. When you use the trailing closure syntax, you don’t write the argument label for the closure as part of the function c

November 29, 2022

Toggle in SwiftUISwiftUI

Toggle in SwiftUI

Toggles are some of the most used UIControl in iOS Apps since it lets let you switch between a binary state - true or false, 0 or 1. You are most likely to encounter a toggle in settings or some kind of list view. But regardless of your app has settings or not, it doesn't hurt to learn about Toggle in SwiftUI. Before diving into a toggle, let's take a look at Human Interface Guideline. Note: This is UIKit equivalent of UISwitch Takeaways from Human Interface Guideline * Recommended to use

November 26, 2022

How to use Gestures In SwiftUISwiftUI

How to use Gestures In SwiftUI

Back when we had Blackberry and Nokia phones, everything was based on button clicks. After clicking those chunky keys, you would be able to write the text and use the phone. Got some nostalgia kicking in, huh? Well, that was the scenario back then. When the touch screen phone came, all those chunky keys were gone and everything was based on finger gestures. There are multiple gestures one can perform on a modern cell phone: tap, drag, swipe, pinch, double-tap, rotate, shake, touch and hold, and

November 16, 2022

View Controller LifecycleInterview

View Controller Lifecycle

Introduction In iOS development, the view controllers are the foundation of the Application's internal structure. The View Controller is the parent of all the views present on a storyboard. Each UIKit application has at least one ViewController. It facilitates the transition between various parts of the user interface. Functions are called in the following order when a View Controller is added to the view hierarchy: Join our Slack community now! State Transition Functions viewDidLoad()

October 20, 2022

How to dismiss the keyboard in SwiftUISwiftUI

How to dismiss the keyboard in SwiftUI

When dealing with forms and more, it is likely that you would encounter a scenario where you would want to dismiss the keyboard programmatically ie. on click of "Submit" or "Next" button. Without further ado, let's explore a couple of ways to dismiss the keyboard in SwiftUI. Using App Delegate Methods One of the easiest way is to use app delegate method and calling the endEditing() on UIApplication. This method will resign the first responder of the view (which, in this case, is the textfield'

October 18, 2022

Action Sheets in SwiftUISwiftUI

Action Sheets in SwiftUI

Action Sheets allow you to show a popover over the current view presenting the user with certain options to select. In SwiftUI, you can implement action sheets using .actionSheet view modifier. You can observe the usage of action sheets through iOS, specially in events while confirming actions. So without further ado, let's dive in and explore about action sheets. But before that, it is important to follow right practices, so let's look into what Apple's Human Interface Guideline says. Best P

October 14, 2022

Links in SwiftUISwiftUI

Links in SwiftUI

In Apps, there are many scenarios where you want to open a link, the link can be a web link, a link to an external app like mail, or phone, or any deep link. In this article, we will be take a look at Link API provided by SwiftUI to handle a different kind of links. Links Links that directly open in the default web browser or external apps can be made using Link(). For example's sake, let's try a Link with text inits along with a destination URL. struct ContentView: View { var body: some

October 11, 2022

Swift native base class NSObjectUIKit

Swift native base class NSObject

Description The root class of most Objective-C class hierarchies, from which subclasses inherit a basic interface to the runtime system and the ability to behave as Objective-C objects. It's the one class that has no superclass. Core Responsibility: The NSObject class provides inheriting classes with a framework for creating, initializing, deallocating, copying, comparing, archiving, and unarchiving objects, run-time environment, querying objects, and message forwarding. > The NSObject is an a

October 6, 2022

Top 5 open source iOS Repositories to start with this Hacktoberfest 2022Hacktoberfest

Top 5 open source iOS Repositories to start with this Hacktoberfest 2022

Just like how people wait for December for the Christmas vibe and ritual the whole year, developers wait for October for the Hacktoberfest. Now you ask what is Hacktoberfest and why should one participate in it? Hacktoberfest is a month long running event organised by Digital Ocean for encouraging open sourcing, many of the third party pods/dependencies that we use in our day to day development, are open sourced and handled by folks around the community, as you heavily rely on this open source

October 5, 2022

Full Sheets In SwiftUISwiftUI

Full Sheets In SwiftUI

Full Sheets are used extensively in SwiftUI for presenting views. They are almost similar to sheets. If this were UIKit, you would code something like: var controller = ViewController() controller.modalPresentationStyle = .fullScreen self.present(controller, animated: true) But since this is SwiftUI, we use a view modifier command. For full sheets, there are not a lot of parameters you could play around with. We are going to explore the two commands that you are most likely to encounter in

September 30, 2022

UIView Fundamentals MasterclassUIKit

UIView Fundamentals Masterclass

In this article, you will learn about the basics of UIView. In addition, you will learn the purpose of UIView and initialization and implementation of UIView along with some practical examples. Also, how view create an hierarchy tree to render it on superview. Let's start. Basically, UIView is a container in iOS apps to create the user interface. You can have N number of views inside a view to build different kinds of user interfaces. Declaration: class UIView: UIResponder { } A view

September 29, 2022

Sheets In SwiftUISwiftUI

Sheets In SwiftUI

Sheets are used extensively in SwiftUI for presenting views. If this were UIKit, you would use a command like self.present(ViewController(), animated: true) but in SwiftUI, we use a view modifier command. For sheets, they are not a lot of parameters you could play around with. We are going to explore the two commands that you are most likely to encounter in practical development today. So without further ado, let's dive in. Basic Implementation All you need to implement a sheet is a state

September 27, 2022

Optionals and Unwrapping in SwiftInterview

Optionals and Unwrapping in Swift

An Optional is a type of its own that can handle the absence of a value. Optionals can contain nil values and there are multiple ways to unwrap them. In this article, we will understand why not to unwrap them forcefully and how to unwrap them safely. Optionals > A type that represents either a wrapped value or nil, the absence of a value. Some examples of optionals are: /* Optional types either contain a value or nil. It can be defined as Optional<type>. type? like Int? is syntatical su

September 22, 2022

Picker In SwiftUISwiftUI

Picker In SwiftUI

Pickers are control elements which let you pick a value from a list of mutually exclusive arrays. You can use it in forms or for selecting normal data. Human Interface Guidelines Summary Before diving into coding, let's take a look at Human Interface Guidelines summary. * Consider this when using medium-to-long list of items. * Use predictable and logically ordered value. * Consider showing it as a popover or a bottom sheet rather than switching views. Source: Apple Developer Basic Imp

September 20, 2022

Get started with WeatherKitWWDC

Get started with WeatherKit

This year, we received a package of surprises from Apple at WWDC22. Out of these exciting announcements, we got a new framework entirely focused on fetching weather data to your app or website called "WeatherKit." We will go through the step-by-step process of importing this framework and covering its basic requirements and usage. Why use WeatherKit? There are a bunch of reasons for using WeatherKit: * Powered by Apple Weather Service. * Easy to implement in your Xcode project, supports

September 15, 2022

How to delete derived data in XcodeXcode

How to delete derived data in Xcode

Xcode stores intermediate build results, generated indexes and other built results in form of derived data. It can grows to 5-10 GBs or even more depending on how complex your projects are. Sometimes, derived data can result into strange Xcode errors. That's why it is highly recommendable to delete the derived data. Also, note here that it is totally alright to delete the derived data (there are few consequences described in next paragraph). You won’t lose any your app data if you delete the de

September 13, 2022

Access Control in SwiftSwift

Access Control in Swift

This guide will explain how to make your code more or less accessible by using Swift's access controls. Basically, access controls in swift are used to define how types, functions, and other declarations can be accessed in your project. You can set the accessibility (visibility) of classes, structs, enums, functions, variables, and so on. Swift provides a variety of access controls that can be used for different purposes. These are: * Open * Public * Internal * Fileprivate * Private Di

September 7, 2022

Add Custom Themes in XcodeXcode

Add Custom Themes in Xcode

As an iOS Developer, Xcode is something you work with for over 8 hours a day or even more. Wouldn't it be cool to have your unique Xcode theme to make your life a little more exciting? Let’s see how you can add more themes to Xcode Finding Xcode themes A simple search with query "Xcode Themes" will reveal several Xcode themes for you to pick and choose. Go ahead and download the repo of the theme you like. Xcode themes mentioned: * Dracula * Charmed Dark Xcode theme * Sundell's Colors

September 6, 2022

ContextMenu in SwiftUISwiftUI

ContextMenu in SwiftUI

Context menus are basically peek-and-pop interactions and can be a great add-on to the UI elements in your app and can enhance the experience. Context menus works pretty much like Menus in SwiftUI. An analogy you could use is that context menu and menus are cousins. You will observe how Apple uses context menus consistently throughout their apps. Human Interface guidelines: The key takeaways from the human interface guideline for the context menus are: 1. Use submenus to manage complexity

August 24, 2022

For loop in SwiftSwift

For loop in Swift

In this guide, you will learn about For Loop in Swift. We will see many examples of how to use for-loop over collections and ranges. Looping means repeating an action over and over again. In Swift, there are some control flow statements that are used to control the execution flow of code. Some of them (like for-loop and repeat-while) are used to perform repeating tasks. For-Loops are used to repeat a task following a termination condition. For loop Usage For loop is a well-known statement f

August 18, 2022

How to convert Radians to Degrees in Swift?Swift

How to convert Radians to Degrees in Swift?

When working with rotating view animations or 2d/3d games, you would have to eventually deal with degrees and radians at some point. There are rare scenerios where you would have to convert radians to degrees since most of the angles are dealt in radians in Swift. But there is no harm to take a look, right? Before diving into the coding path, let’s get the math part clear. 1 pi radian = 180 degrees Note: pi = 3.14 Thus, for converting radians to degrees, you have to multiply it by 180  and

August 16, 2022

How to convert Degrees to Radians in Swift?Swift

How to convert Degrees to Radians in Swift?

When working with rotating view animations or 2d/3d games, you would have to eventually deal with degrees and radians at some point. Even though, most people have a better understanding of degrees over radians, most of the angles are dealt in radians in Swift [and general math as a matter of fact]. Before diving into the coding path, let’s get the math part clear. 1 pi radian = 180 degrees > Note: pi = 3.14 Thus, for converting degrees to radians, you have to multiply it by pi and divide by

August 9, 2022

Segmented Control in SwiftUISwiftUI

Segmented Control in SwiftUI

Segmented controls can be observed in social media apps - like in Twitter profile or Instagram profile view. If there were UIKit, we would use UISegmentedControl, but since it's SwiftUI, we used Picker with a specific picker style. So without further ado, let's dive straight into it. But before that, let's take a quick look at the human interface guidelines. Human Interface Guideline Summary Some takeaways from Human Interface Guideline: * Limit the number of segments and try to be consiste

August 6, 2022

Ultimate guide on Timer in SwiftSwift

Ultimate guide on Timer in Swift

A timer is a class used to perform any task after a specific time interval. Timers are super handy in Swift for scheduling tasks with a delay or scheduling repeating work. In this article, we are going to cover the following things: * How to schedule tasks? * Repeating and non-repeating timers * Using RunLoop modes * Keep track of timer * Timer optimisation to reduce energy and power impact class Timer : NSObject Why Timers are required? You often face requirements where you need to p

August 1, 2022

Slider in SwiftUISwiftUI

Slider in SwiftUI

Sliders are a replacement of UISlider from UIKit. You could observe the use of slider mostly in forms where one has to value from a big range. In the case you are looking forward to use this, let's dive into slider. But before that, let's learn about the key take aways from Human Interface Guidelines. HIG: * Work on the slider such that it matches the your app's theme. Add minimum value and maximum value tag. Source Slider Terminologies Let's take a look at a picture that describes all t

July 28, 2022

Dictionaries in SwiftSwift

Dictionaries in Swift

This tutorial assumes that you know the concept of an Array in Swift []. Dictionaries are nothing other than the advanced layer of an Array! If you want to store information about students going to the school like their Name, Surname, ID, Grades, and Address, keeping it as an array is a good idea, but what if some information is missing. For example, a student is not graded yet, and to find out things like that makes it difficult for you to figure ou

July 26, 2022

The Ternary Operator in SwiftSwift

The Ternary Operator in Swift

In Swift, we often use if-else statements to perform some conditional operations. In some cases, we can use ternary operator instead of if-else to write more readable code. To understand how the ternary operator works, let's examine its syntax. In order to understand ternary operators, we assume you are familiar with if-else statements []. Ternary Operator Syntax: condition ? expression1 : expression2 In syntax, If condition == tr

July 21, 2022

How to use VideoPlayer in SwiftUISwiftUI

How to use VideoPlayer in SwiftUI

With iOS 14, Apple introduced a native way for implementing video playback in your SwiftUI app. The VideoPlayer component in AVKit provides with this capability. So without further ado, let's dive in. Basic Implementation Let's try to play some local media. Firstly, you would need to import some media in Assets folder or in the project folder itself. Now that you have imported the media, let's play it using Video Player - player initializer. import SwiftUI import AVKit // 1 struct Conte

July 19, 2022

How to generate random number in SwiftSwift

How to generate random number in Swift

There are many times when you need to generate random values in your iOS apps such as: * Simulating dice rolls. * Shuffling playing cards. * Creating unique ID for a user. * Random object from an array. In Swift 4.2, there are new, simple and secure ways to generate random values. Before that, there was a random function written in C language. Today, you'll learn about the random() function that takes a range of values and as an output it returns a randomly picked value every time. Let's

July 14, 2022

AsyncImage in SwiftUISwiftUI

AsyncImage in SwiftUI

Almost all the modern apps and websites are driven by images and videos. The images you see on shopping apps, social media and entertainment apps are all loaded from some backend source. Since there are a lot of backend calls needed for this, if you actually waiting for all those images to load before showing the website, it would take immense amount of time to load the apps - which would result in bad user experience. A very simple but efficient solution for that is loading the image asynchron

July 12, 2022

SwiftUI 4 TextField, ShareLink & Presentation DetentsSwiftUI

SwiftUI 4 TextField, ShareLink & Presentation Detents

Now that you have explored about new color gradients, SF symbol rendering modes, variable colors and more in the Part 1, let's talk about native half sheet presentation, share sheet links and new modifiers in TextField. So without further ado, let's dive in. Presentation Detents Before SwiftUI 4, for implementing half sheet presentation, one would usually have to go some hack and implement UIViewRepresentable since there was no native way to do it in SwiftUI. But this year they introduced pre

June 28, 2022

What's new in SwiftUI Colors and SF Symbols? ft. WWDC'22WWDC

What's new in SwiftUI Colors and SF Symbols? ft. WWDC'22

SwiftUI was launched in 2019 and since then Apple has been constantly adding features and updates to make it production ready. Following that, there were drastic amount of updates made in SwiftUI 4. So, without further ado, let's dive into new updates on colors, styles and SF symbol implementation.​ 💡You can download the new SF Symbols from here []. Gradient Colors Before diving into gradient colors, let's get some context on foreground and backgroun

June 18, 2022

What's new in M2 MacBooks? ft. WWDC'22WWDC

What's new in M2 MacBooks? ft. WWDC'22

This year's WWDC includes significant upgrades to hardware (chipset) and software (iOS 16, macOS Ventura). Apple introduced their next generation of Apple Silicon M2 which they are shipping into their newly redesigned MacBook Air and the previous 13-inch MacBook Pro. So without further ado, let's dive into the specs. Source: Apple Source: Apple Let's check out how the new chipset differs from the previous generation. M1 ChipM2 ChipStarting Price999 USD (MacBook Air 2020)1199 USD (MacBo

June 15, 2022

What's new in Apple's iOS 16? ft. WWDC'22WWDC

What's new in Apple's iOS 16? ft. WWDC'22

It's that time of the year! Apple revealed iOS 16 this Monday in its keynote event at WWDC22. > “iOS 16 is a big release with updates that will change the way you experience iPhone,” said Craig Federighi, Apple’s Senior Vice President of Software Engineering. Here's everything you need to know: Features Your Lock Screen, but reimagined! iOS 16 has delivered the biggest update ever to your Lock Screen. Source: Apple * Personalize your Lock Screen the way you like it using a set of custom fon

June 8, 2022

Apple WWDC 2022 Keynote RecapWWDC

Apple WWDC 2022 Keynote Recap

The year's most exciting week for developers began yesterday, or as most of us like to say - it's Christmas for developers. Apple kicked off Day 1 of the Worldwide Developers Conference 2022 (WWDC) with a jam-packed Keynote. From new software reveals to futuristic hardware announcements, here's a recap of everything announced on Monday.​ iOS 16 & iPadOS 16 iOS 16 offers new intelligence, sharing, and communication features that will change the way you use your iPhones.​ * You can now custom

June 7, 2022

How to implement Apple's SharePlay? WWDC'22SharePlay

How to implement Apple's SharePlay? WWDC'22

With the launch of iOS 15 (in June 2021), Apple launched a new feature which allows you to experience content together with other people on a FaceTime call. Integrating SharePlay to your applications is really straightforward once you understand how the objects work and when the methods should be triggered. So, without further ado, let's dive straight into the fundamentals. Prerequisites * Developer account * Two devices to test it on Note: If not possible, you can implement catalyst in y

June 7, 2022

How to use Geometry Reader in SwiftUISwiftUI

How to use Geometry Reader in SwiftUI

SwiftUI Layout works very differently than UIKit; Wherein UIKit we dealt with raw frames, and either added constraints accordingly or have some concrete frame-set to specify the position of views, in SwiftUI, the layouts are defined in form of stacks, spacers and paddings. This layout system provides us a lot of simple and flexible ways to define our view's position, but sometimes scenarios arise where you need to have specific frames or size set for a view either by setting some concrete value

June 4, 2022

Visual Effects in SwiftUISwiftUI

Visual Effects in SwiftUI

Swift provides with different ways of displaying visual effects like blur and vibrancy effects. These can mostly be used as background for views and can be used to improve the overall app design. You can observe these blur effects throughout iOS like in app library, control center and app dock. Materials Adding visual effect as background in iOS 15 is as easy as doing the following: Text("Hello, World!") .frame(width: 200, height: 50) .background(.thickMaterial) No

May 24, 2022

Swift if else, switch case Conditional StatementsSwift

Swift if else, switch case Conditional Statements

To put it simply, a group of codes, when executed on a particular/certain conditions, are known as conditional statements. You can quickly identify them by figuring out some noticeable terms like if, if ...else, switch case. Generally, developers use it when needed to execute the code on a particular condition, and that could be any like, for example, * if the value is more significant, lower, or equal to * if the specified condition is true/false, etc. Read and go over the detailed explanat

May 18, 2022

Variables in SwiftSwift

Variables in Swift

What are variables? Most of you are here to understand the first and foremost concept of programming, but we will help you answer with the simple steps: If you were attentive and loved Maths as your subject in High School, it's easy to identify this concept quickly. Never mind, forget that Math Class from your boring instructor. We are here to explain it in an easy way. For that, speak out the word variable. Does it sound somewhere close to the word "Vary", well now we assume you know the meani

May 17, 2022

Arrays in SwiftSwift

Arrays in Swift

Till now, what you saw is assigning only one value to a variable/constant. You might have one question though, what if I have a bunch of values to store? Answer to that question is quite straight forward, to store the collection of Hot wheels, we keep it in a rectangle or square box. Just like that, if you want to store a collection of items in one variable, an array helps there. Arrays can be defined as a collection of same type of values in an ordered position. Let's first have a look at the

May 12, 2022

Colors and Gradient in SwiftUISwiftUI

Colors and Gradient in SwiftUI

Colors are powerful. They can convey a message by the visuals and can give a certain kind of vibe to the art (for us, the app). It is one of those inevitable things that you are going to encounter while making pixel perfect production app. So, without further ado, let's dive into colors in SwiftUI. Usage The primary usage that most developers encounter first in SwiftUI App Development is as for adding background and color to the view. Let's look into an example: VStack { Text("

May 11, 2022

Are Arrays thread-safe in Swift?Interview

Are Arrays thread-safe in Swift?

Introduction An array is an ordered, random-access generic collection. The Array type to hold elements of a single type, the array’s Element type. An array can store any kind of elements—from integers to strings to classes. Are Arrays Thread-Safe? Intrinsically, Arrays in Swift are not thread-safe. Arrays are 'value-typed' in the effect of assignment, initialization, and argument passing — creates an independent instance with its own unique copy of its data. Immutable arrays (declared using

May 1, 2022

Functions in SwiftSwift

Functions in Swift

The function is a set of commands/statements. To create a simple function, you first have to define and name it; generally, naming is according to the task you want it to perform. For example: var age = 18 let name = "Krishna" print("Hi, I am " + "\(name)") print("I am " + "\(age)") The set of commands you see above may be needed more than once for the XYZ project, and programmers make work easy for people, including them. To use the same code every time, the concept of function is essential

May 1, 2022

What are Constants in Swift?Swift

What are Constants in Swift?

This tutorial assumes that you know how to declare a variable and to work with data types. Well, almost everything is similar between constants and variables, except for two things. If you store a value in constant, it will stay the same throughout the whole program, unlike variables and the grammar (in terms of programming, we call it Syntax). Talking about syntax, then they pretty much have the same format. The only difference is changing the var keyword with let. For example: var x = 45 //V

May 1, 2022

Difference between Array and NSArrayInterview

Difference between Array and NSArray

Array and NSArray are very similar and core constructs in iOS Development, and cause of this similarities we sometime forget how different this two construct works, these are some major difference that you must know about Array and NSArray. Array Array is a struct which means it is value type in Swift. var arr = ["Taylor", "Swift", "Taylor's", "Version"] func modifyArr(a : Array<String>) { a[2] = "Not Taylor's" } modifyArr(arr) print(arr) /* This prints - ["Taylor", "Swift", "Taylor'

April 27, 2022

What is inout Parameter in Swift?Swift

What is inout Parameter in Swift?

By default, function parameters are constants/non-mutable and if you try to change the value of a function parameter from within the body of that function, it results in a compile-time error. Therefore, if you want a function to modify a parameter’s value, and you want those changes to persist after the function call has ended, define that parameter as an in-out parameter instead. Well, it's time to take an example; var number = 6 func doubleNumber(num: Int) -> Int { return num * 2 } pri

April 26, 2022