Monday, 30 September 2019

Custom TextField in SwiftUI

Custom TextField in SwiftUI
Corner Radius and Shadow 


Code:
CustomTextField.swift

import SwiftUI

struct CapsuleTextField: View {
    @State var placeholder: String
    @State var value: String
    @State var leftIcone: Image? = nil
    var body: some View {
        HStack {
            if leftIcone != nil{
                self.leftIcone!
                    .resizable()
                    .renderingMode(.original)
                    .scaledToFit()
                    .frame(width: 25, height: 25)
                    .padding(.leading, 20)
            }
            TextField(self.placeholder, text: $value)
                .frame(height: 55)
                .foregroundColor(Color(red: 1/255, green: 1/255, blue: 60/255))
        }
        .background(Color.white)
        .clipShape(Capsule())
        .shadow(radius: 4, x: 0, y: 3)
        
    }
}

struct CapsuleTextField_Previews: PreviewProvider {
    static var previews: some View {
        CapsuleTextField(placeholder: "placeholder", value: "value")
    }

}

To use this textfield write following line of code:

 CapsuleTextField(placeholder:"Email",value:self.email)

                    
                    

Saturday, 28 September 2019

Table Cell Designing in SwiftUI

Table Cell Designing in SwiftUI

Code

ContactRow.swift
This code creates a single reusable view with shadow and radius.


import SwiftUI

struct ContactView: View {
    var body: some View {
        HStack(alignment: .center, spacing: 20) {
            Image("inder")
                .resizable()
                .background(Color.white)
                .clipped()
                .clipShape(Circle())
                .frame(width: 100, height: 100, alignment: .leading)
                .padding(5)
            
            VStack(alignment: .leading, spacing: 2) {
                Text("Contact Name")
                    .font(.title)
                
                Text("9001000663")
                    .font(.subheadline)
            }
            .frame(maxWidth: .infinity,alignment: .leading)
        }
        .background(Color.white)
        .cornerRadius(8)
        .shadow(radius: 5, x: 0, y: 4)
    }
}

struct ContactView_Previews: PreviewProvider {
    static var previews: some View {
        ContactView()
    }

}

ContentView.swift
Add following code in add ContentView.swift file 
Note:- ContactDetailView() is an another view you can remove it if you don't want to create linking for now



import SwiftUI

struct ContactListView: View {
    var body: some View {
        NavigationView {
            List {
                ForEach(0..<10){ _ in
                    NavigationLink(destination: ContactDetailView()) {
                        ContactView()
                            .padding(.trailing, -25)
                            .padding(.leading, -10)
                    }
                }
            }
            .navigationBarTitle(NavigationTitle.contacts)
        }
    }
}

struct ContactListView_Previews: PreviewProvider {
    static var previews: some View {
        ContactListView()
    }
}

Hire Me

Inderjeet Singh
 iOS Developer for Hire, Freelancer


I am a freelance iOS developer, technical consultant, and open-source contributor. I have a wealth of experience working with clients from around the world. I offer my services as an iOS developer for hire to work with businesses of all sizes including start-ups, creative agencies, designers, individuals and other freelancers & developers.


The work I provide is of the highest quality, fully responsive, and tested in a wide range of devices. I take great care to ensure each project is well-architected, well-documented and easily maintainable so you can enhance an app as your company grows.

Before becoming a freelancer I worked for a company developing large enterprise solutions. There I’ve deeply learned Swift and iOS Technology, and have obtained an eye for detail and appreciation for software design, knowledge of architecting and working with large databases, as well as knowing how to efficiently project manage and work with clients and teammates successfully.
I maintain a high code quality standard and use static code analyzer. Writing code that is documented and easy to read means it can be maintained and scaled in the future and allows co-workers to quickly work with it.

During my career as an iOS developer, I created more than 5 apps and formed a good portfolio. Here are few selected pieces from it:

Mobile Marketing App:
handles mobile marketing at very ease also Manage users contacts and Media like images, videos, audios and documents.

Create Challenges App:

Grocery Management App:
User can create Campaigns and share with their employees via email, Sms and voice. It
User can complete a challenge and share it with other people and can challenge to complete it.Login/Signup via Facebook or Google. User can posting video and images of completed challenge on the Wall.
User can add Items[Milk, Curd etc] in lists to remember it to buy later. Items can be filter according to Price, Store, Purchased/Not Purchased. User can see recipes provided by Admin. Social login integrated.


SKILLS
I have experience as an iOS developer, creating native iPhone/iPad apps and games using Swift/Objective C. I learned Swift and liked it’s simplicity and expressiveness. I noticed that using Swift greatly reduces development time, I’m actively using all the features it offers, such as generics, enums with associated values, protocols, value types and many others. They allow me to create a robust yet flexible applications for my clients and maintain KISS, DRY, SOLID programming principles.

My mobile development process the use of tools such as Xcode, Git, Cocoapods, SwiftLint, and Xcode Instruments to profile and optimize an app.
Apple constantly develops their programming tools and introduces new features designed to make the programming process more effective. I’m trying to use them in my work if they are useful. For example, I started using Storyboards as soon as Apple had introduced them, and they had improved my productivity. AutoLayout is another great example; I believe it’s a mandatory for every app to have it used, so the app looks great on a wide range of devices: from iPhone 4S to iPhone 11 Pro Max .