Skip to content

Instantly share code, notes, and snippets.

View re8us's full-sized avatar

Andrey Shestakov re8us

  • Volgograd, Russia
  • 16:52 (UTC +03:00)
View GitHub Profile
@darrarski
darrarski / FormattedTextField.swift
Last active September 26, 2024 06:33
SwiftUI FormattedTextField - TextField with custom display/edit formatters
import SwiftUI
public struct FormattedTextField<Formatter: TextFieldFormatter>: View {
public init(_ title: String,
value: Binding<Formatter.Value>,
formatter: Formatter) {
self.title = title
self.value = value
self.formatter = formatter
}
@mecid
mecid / Calendar.swift
Last active October 21, 2024 00:38
SwiftUI Calendar view using LazyVGrid
import SwiftUI
extension Calendar {
func generateDates(
inside interval: DateInterval,
matching components: DateComponents
) -> [Date] {
var dates: [Date] = []
dates.append(interval.start)