Skip to content

Instantly share code, notes, and snippets.

View re8us's full-sized avatar

Andrey Shestakov re8us

  • Volgograd, Russia
  • 13:54 (UTC +03:00)
View GitHub Profile
@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)
@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
}