Skip to content

Instantly share code, notes, and snippets.

@blsage
blsage / iColor-Demo0.swift
Created October 17, 2020 23:23
SwiftUI hex initialization
import SwiftUI
import iColor
struct ContentView: View {
var body: some View {
Color("#fafafa")
}
}
@blsage
blsage / iColor-Demo1.swift
Created October 18, 2020 01:07
SwiftUI integer RBG color initialization
import SwiftUI
import iColor
struct ContentView: View {
var body: some View {
Color(red: 250, green: 250, blue: 250)
}
}
@blsage
blsage / iColor-Demo2.swift
Last active October 19, 2020 21:24
SwiftUI new colors
import SwiftUI
import iColor
struct ContentView: View {
var body: some View {
Color.neonBlue
Color.darkGray
Color.lightGreen
}
}
@blsage
blsage / iPhoneNumberTextField-Demo0.swift
Last active October 19, 2020 21:41
iPhoneNumberTextField simple example
import SwiftUI
import iPhoneNumberTextField
struct ContentView: View {
@State var text: String = ""
@State var isEditing: Bool = false
var body: some View {
iPhoneNumberTextField("Phone", text: $text, isEditing: $isEditing)
}
@blsage
blsage / iPages-Demo0.swift
Last active October 22, 2020 00:48
iPages simple example
import SwiftUI
import iPages
struct ContentView: View {
@State var currentPage: Int = 0
var body: some View {
iPages(currentPage: $currentPage) {
Color.red
Color.blue
@blsage
blsage / iPages-Demo1.swift
Last active October 22, 2020 00:47
iPages modifiers demo
iPages(currentPage: $currentPage) {
Text("Kanye")
Text("Omari")
Text("West")]
}
.hideDots(false)
.wrapsInfinitely(true)
.dotsTintColors(currentPage: Color.pink:, otherPages: Color.purple)
.dotsBackgroundStyle(style: .prominent)
@blsage
blsage / iTextField-Demo0.swift
Created October 19, 2020 22:31
iTextField simple example
import SwiftUI
import iTextField
struct ContentView: View {
@State var text: String = ""
@State var isEditing: Bool = false
var body: some View {
iTextField("Placeholder", text: $text, isEditing: $isEditing)
}
@blsage
blsage / iTextField-Demo1.swift
Created October 19, 2020 22:37
iTextField modifier example
iTextField("Placeholder", text: $text, isEditing: $isEditing)
.accentColor(.purple)
.fontFromUIFont(UIFont(name: "Avenir", size: 40))
.keyboardType(.URL)
.returnKeyType(.done)
.disableAutocorrection(true)
.autocapitalization(.none)
.padding()
@blsage
blsage / iPaymentButton-Demo0.swift
Created October 19, 2020 22:59
iPaymentButton simple example
import SwiftUI
import iPaymentButton
struct ContentView: View {
var body: some View {
iPaymentButton(action: {
// Add your custom payment code here
})
}
}
@blsage
blsage / iPaymentButton-Demo1.swift
Created October 19, 2020 23:06
iPaymentButton view customization example
iPaymentButton(type: .support, style: .whiteOutline, action: { } )
.cornerRadius(25)