• Home
  • DSA
  • iOS
  • Flutter
  • Android
    • Jetpack
    • Android Tutorials
    • Android development
    • Android Kotlin
  • 5G
  • 4G LTE
    • IoT
  • E-learning
  • Blog
  • Streaming
Monday, May 19, 2025
  • Home
  • DSA
  • iOS
  • Flutter
  • Android
    • Jetpack
    • Android Tutorials
    • Android development
    • Android Kotlin
  • 5G
  • 4G LTE
    • IoT
  • E-learning
  • Blog
  • Streaming
subscribe
subscribe to my newsletter!

"Get all latest content delivered straight to your inbox."

[mc4wp_form id="36"]
Codeplayon
Codeplayon
  • Home
  • DSA
  • iOS
  • Flutter
  • Android
    • Jetpack
    • Android Tutorials
    • Android development
    • Android Kotlin
  • 5G
  • 4G LTE
    • IoT
  • E-learning
  • Blog
  • Streaming
HomeiOSCreate a Login Page in SwiftUI – using swiftui button & textfield, Image
Jan. 11, 2024 at 4:15 pm
iOS

Create a Login Page in SwiftUI – using swiftui button & textfield, Image

1 year agoFebruary 7, 2024
Login Page Design in SwiftUI
986views

Hi developer in this iOS swiftUi tutorial i am share how to design a login page in swiftUi. using SwiftUI Button, Textfield & image. like gmail login page, facebook login page etc. With make customized button ui and image.

What is Login page in SwiftUi .

Table of Contents

Toggle
  • What is Login page in SwiftUi .
  • mychart login page swiftUi Example.
  • mychart login page Full Source code Example.

A login page specifies the login URL in a web application that users must pass through to get to the authenticated URLs at the heart of the application. Authenticated URLs are URLs that become accessible to users only after they successfully log in to the login URL.

A login page is a door that users must open in order to get the best out of their user experience with a website. It is the starting point of navigating a website in a personalized manner.

so let’s start to create a login page Ui you just follow below code.

mychart login page swiftUi Example.

let’s create a new ios project selecting with swifitUi and follow the below code. in the body view firstly use the Vstack and then use a Text after the showing a image.

 

SwiftiUI Text For App Tital

   Text("Login")

                .font(.largeTitle).foregroundColor(Color.white)
                .padding([.top, .bottom], 40)
                .shadow(radius: 10.0, x: 20, y: 10)

 

Swifit UI Image with Circle  for Logo

Image(systemName: "apple.logo")

                .resizable()

                .frame(width: 80, height: 80)

                .padding(.all, 20)

                .overlay(Circle().stroke(Color.white, lineWidth: 2))

                .shadow(radius: 10.0, x: 20, y: 10)

                .padding(.bottom,40)

 

TextField SwiftUI for Enter Email ID

TextField("Email", text: self.$email)

                    .padding()

                    .background(Color.themeTextField)

                    .cornerRadius(20.0)

                    .shadow(radius: 10.0, x: 20, y: 10)

 

SwiftUI  SecureField for Password

SecureField("Password", text: self.$password)

                    .padding()

                    .background(Color.themeTextField)

                    .cornerRadius(20.0)

                    .shadow(radius: 10.0, x: 20, y: 10)

            }.padding([.leading, .trailing], 27.5)

            

SwiftUI Button for Login Button

Button(action: {


            }) {

                Text("Sign In")

                    .font(.headline)

                    .foregroundColor(.white)

                    .padding()

                    .frame(width: 300, height: 50)

                    .background(Color.green)

                    .cornerRadius(15.0)

                    .shadow(radius: 10.0, x: 20, y: 10)

            }.padding(.top, 50)

 

 

also i am using VStack and HStack for mange the UI field vertical and horizontally. you can find complete code below.

 

mychart login page Full Source code Example.

import Foundation

import SwiftUI

struct LoginView: View {

    // MARK: - Propertiers

    @State private var email = ""

    @State private var password = ""

    

    // MARK: - View

    var body: some View {

        VStack() {

            Text("Login")

                .font(.largeTitle).foregroundColor(Color.white)

                .padding([.top, .bottom], 40)

                .shadow(radius: 10.0, x: 20, y: 10)

            

            Image(systemName: "apple.logo")

                .resizable()

                .frame(width: 80, height: 80)

                .padding(.all, 20)

                .overlay(Circle().stroke(Color.white, lineWidth: 2))

                .shadow(radius: 10.0, x: 20, y: 10)

                .padding(.bottom,40)

                

            

            VStack(alignment: .leading, spacing: 15) {

                TextField("Email", text: self.$email)

                    .padding()

                    .background(Color.themeTextField)

                    .cornerRadius(20.0)

                    .shadow(radius: 10.0, x: 20, y: 10)

                

                SecureField("Password", text: self.$password)

                    .padding()

                    .background(Color.themeTextField)

                    .cornerRadius(20.0)

                    .shadow(radius: 10.0, x: 20, y: 10)

            }.padding([.leading, .trailing], 27.5)

            

            Button(action: {

                

            }) {

                Text("Sign In")

                    .font(.headline)

                    .foregroundColor(.white)

                    .padding()

                    .frame(width: 300, height: 50)

                    .background(Color.green)

                    .cornerRadius(15.0)

                    .shadow(radius: 10.0, x: 20, y: 10)

            }.padding(.top, 50)

            

            Spacer()

            HStack(spacing: 0) {

                Text("Don't have an account? ")

                Button(action: {}) {

                    Text("Sign Up")

                        .foregroundColor(.white)

                }

            }

        }

        .background(

            LinearGradient(gradient: Gradient(colors: [.red, .blue]), startPoint: .top, endPoint: .bottom)

                .edgesIgnoringSafeArea(.all))

        

    }

}

extension Color {

    static var themeTextField: Color {

        return Color(red: 220.0/255.0, green: 230.0/255.0, blue: 230.0/255.0, opacity: 1.0)

    }

}

struct LoginView_Previews: PreviewProvider {

    static var previews: some View {

        LoginView()

    }

}

read more android, iOS , Flutter tutorial and example on codeplayon. happy coding if it helpful for your learn share and explore more.

Read More Tutorial 

  • Codeplayon Jetpack Compose Tutorial 
  • Codeplayon Android Tutorial 
  • Codeplayon Flutter Tutorial 
  • Codeplayon on Github
Tags :Login PageLogin Page DesignSwiftUI Login Page
share on Facebookshare on Twitter
Shivam MalikJanuary 11, 2024

Shivam Malik

Welcome to my blog! I’m Ritu Malik, and here at Codeplayon.com, we are dedicated to delivering timely and well-researched content. Our passion for knowledge shines through in the diverse range of topics we cover. Over the years, we have explored various niches such as business, finance, technology, marketing, lifestyle, website reviews and many others.
view all posts
filmymeet5 : Facts About You Should Know 2025
Create a Weather iOS APP UI with Sunrise And Sunset View in SwiftUI

You Might Also Like

iOS 18.2 new features
iOS

iOS 18.2 new features you can test for yourself on Your iPhone first

Shivam Malik
How do you make a line chart and bar chart graph in SwiftUI
iOS

How do you make a line chart and bar chart graph in SwiftUI?

Shivam Malik
How to used swiftui button and TextField
iOS

How to used swiftui button & TextField – iOS

Shivam Malik
Build a Compass app with SwiftUI
iOS

Build a Compass app with SwiftUI

Shivam Malik
How to build Bubble level app swiftui
iOS

How to build Bubble level app swiftui

Shivam Malik
How to create a Image Slider in SwiftUI
iOS

How to create a Image Slider in SwiftUI ?

Shivam Malik

Get Even More

"Get all latest content delivered straight to your inbox."
[mc4wp_form id="36"]

latest posts

Image 2
technologyUncategorized

Android Phone Specifications You Should Always Check Before Buying

Shivam Malik
278
Blog

Creating a Culture of Safety and Respect at Work

Shivam Malik
256
Blog

The Essential Elements of a Secure Web Gateway and Its Role in Modern Business Networks

Shivam Malik
372
Blog

The Art of Crafting SEO Strategies That Stand the Test of Time

Shivam Malik
232

find me on socials

Search

Contact Info

Contact information that feels like a warm, friendly smile.

Phone:9671718285
Email:Info.codeplayon@gmail.com
Website:Codeplayon

popular posts

Joinpd.com

How to Join a Pear Deck Session with JoinPD.com Code? 2023 Guide

6 months agoJanuary 8, 2025
y2mate com youtube video downloder

Y2mate: YouTube Video Downloader and MP3, MP4 Converter [2025]

4 months agoJanuary 7, 2025
Best StreamEast live Alternatives For Free Sports Streaming

streameast.live For NFL Free Sports Streaming 2024

2 years agoJanuary 27, 2024
Sitemap.Html
  • Android Phone Specifications You Should Always Check Before Buying
  • Creating a Culture of Safety and Respect at Work
  • The Essential Elements of a Secure Web Gateway and Its Role in Modern Business Networks
  • The Art of Crafting SEO Strategies That Stand the Test of Time
  • How SAFe® Product Owner and ITIL Foundation Training Enhance Agile Service Management
Codeplayon
  • Privacy Policy

Copyright © 2024 Codeplayon | NewsMozi Sitemap