Aakarsh-verma /
SwiftUILayouts
Swift Package providing a collection of reusable SwiftUI layouts
Loading repository data…
youjinp / repository
A collection of missing SwiftUI components
A collection of components that will simplify and accelerate your iOS development.
There is an example app at SwiftUIKitExampleApp which can be built and run. Just clone this repo and run it.
Real time formatting of users input into currency format.
import SwiftUIKit
struct ContentView: View {
@State private var value = 0.0
var body: some View {
//Minimal configuration
CurrencyTextField("Amount", value: self.$value)
//All configurations
CurrencyTextField("Amount", value: self.$value, alwaysShowFractions: false, numberOfDecimalPlaces: 2, currencySymbol: "US$")
.font(.largeTitle)
.multilineTextAlignment(TextAlignment.center)
}
}
Animate view's position when keyboard is shown / hidden
import SwiftUIKit
struct ContentView: View {
var body: some View {
VStack {
Spacer()
Button(action: {}) {
Text("Hi")
.adaptToKeyboard()
}
}
}
}
SwiftUI doesn't work well with CNContactPickerViewController if you just put it inside a UIViewControllerRepresentable. See this stackoverflow post. With ContactPicker here its just a one liner.
To enable multiple selection use onSelectContacts instead.
import SwiftUIKit
struct ContentView: View {
@State var showPicker = false
var body: some View {
ZStack {
// This is just a dummy view to present the contact picker,
// it won't display anything, so place this anywhere.
// Here I have created a ZStack and placed it beneath the main view.
ContactPicker(
showPicker: $showPicker,
onSelectContact: {c in
self.contact = c
}
)
VStack {
Button(action: {
self.showPicker.toggle()
}) {
Text("Pick a contact")
}
}
}
}
}
Selected from shared topics, language and repository description—not editorial ratings.
Aakarsh-verma /
Swift Package providing a collection of reusable SwiftUI layouts
maxwellt23 /
A lightweight Swift package for filtering and ranking any collection of model types by text search.
abhishek00710 /
DevSPMShowcase` is an iOS SwiftUI demo app backed by a collection of small local Swift Package Manager libraries that model the kinds of components developers reuse in day-to-day product work.