Sign in

iOS Application Developer | IOT | ML | AR | SwiftUI

Make an Expandable table view using List

Expand List

Introduction

In this tutorial, We’ll see how to create an Expandable List in SwiftUI. SwiftUI is an advanced user interface toolkit that lets us design apps in a declarative way. I am excited to start playing and coding with the new SwiftUI Framework.

Please find the link to the code at the end of the blog.

Getting Started

We will use List to make an Expandable List. We have covered List in our last blog if not, please check List Tutorial first.

Let’s start

SwiftUI’s List has an enhanced initializer that gives us functionality to expand sections with…


Picker is a control in SwiftUI which allows you to select a value from a list of possible options. In order to properly use a Picker, you need to back it with an array of possible options to choose from.

Getting Started

Picker behaves differently when we use it with VStack and Form. So let’s discuss it one by one.

  1. Picker using a VStack
  2. Picker using a Form
  3. Picker Styles

Let’s start

First create a Single View Application by selecting the SwiftUI as User Interface.


Nowadays, as Mobile Applications covering the market. Clients are more focusing on the attractive UI features. Corners of UI play a good role in making our UI attractive.

Rounded Corners

Getting Started

Let’s create a Shape as a protocol with a single required method. Create Radius & Corners variable in this structure.

struct RoundedCorner: Shape {
var radius: CGFloat = .infinity
var corners: UIRectCorner = .allCorners
func path(in rect: CGRect) -> Path {
let path = UIBezierPath(roundedRect: rect,
byRoundingCorners: corners, cornerRadii: CGSize(width:
radius, height: radius))
return Path(path.cgPath)
}
}

Then to call this method we need to create a View extension and call the…


The scroll view displays its content within the scrollable content region. Scroll view allows us to scroll in both directions i.e. Horizontally & Vertically. It automatically sizes itself to fit the content.


Perform the various operations in Core Data like Add, Delete & Save.

Introduction

In this tutorial, We’ll look at how to Add, Delete, and Save operations in Core Data SwiftUI. SwiftUI has been written to work well together: we get property wrappers, environment support, and more, all to make sure we can integrate Core Data into our SwiftUI apps easily.

SwiftUI’s integration with Core Data is different because it points very strongly in one direction: create the Core Data container once when the app starts, inject its managed object context into the environment, then perform fetch requests directly on there.

UserView

Please…


SwiftUI gives us so many ways to add the gradient. A color gradient represented as an array of color stops, each having a parametric location value.

Getting Started

  1. Text with Linear Gradient.
  2. Text with Gradient and CornerRadius.
  3. Text with Gradient, CornerRadius & Shadow.
  4. Text with Radial Gradient, CornerRadius & Shadow.
  5. Text with Angular Gradient, CornerRadius & Shadow.
  6. Text with Angular Gradient, CornerRadius, Shadow & Circle Shape.
  7. Text with Angular Gradient, CornerRadius, Shadow & Rectangle Shape.
  8. Gradient that masked with the Text.

Let’s start

Text with Linear Gradient

Take a Text and use LinearGradient to give the gradient.


Introduction

Stacks in SwiftUI is similar to the stack views in UIKit. You can create any complex UI by using HStack, VStack & ZStack. SwiftUI gives us easy way to build the UI as you no longer need to use Auto Layout. You can make everything by a combination of HStack, VStack & ZStack.

Stacks

Getting Started

In this tutorial I will give you some knowledge on how to use all these stacks. So let’s discuss it one by one

  1. Horizontal Stack (HStack)
  2. Vertical Stack (VStack)
  3. Depth-based Stack (ZStack)

Please find the link at the end of the blog.

Let’s start

We are going to create…


Make a Profile View with the help of a new UI element Form.

Introduction

Form is a container for grouping controls used for data entry, such as in settings or inspectors. Form can contain sections and will act as a container view. SwiftUI automatically adapts the controls when placed inside a form.

Please find the link at the end of the blog.

Getting Started

Form is new which is introduced in SwiftUI. SwiftUI renders forms in a manner appropriate for the platform. For example, on iOS, forms appear as grouped lists. Use Section to group different parts of a form’s content.

  1. Create a…


Create a simple Dynamic List using HStack and VStack.

Dynamic List

Introduction

In this tutorial, We’ll look at how to create a Dynamic List in SwiftUI. SwiftUI is an advanced user interface toolkit that lets us design apps in a declarative way. I am excited to start playing and coding with the new SwiftUI Framework.

Please find the link to the code at the end of the blog.

Getting Started

View is a very basic and most commonly used UI element. A type that represents part of your app’s user interface and provides modifiers that you use to configure views.

  1. Create a List with NavigationView…


Apple introduced a feature from iOS 10.3 changes, the ability to change the icon of the application. That would be useful in some cases:

  1. In a riding app when you major achieve a target.
  2. On festivals, you can change your app icons.
  3. On promotional days, you can change your app icon.
  4. For some kind of apps in which you purchase a plan. So according to the subscribed plan, you can change the app icon.

Please find the link at the end of the blog.

Let’s start

You need to add all the icon's name in Info.plist under CFBundleAlternateIcons.

Anmol Maheshwari

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store