
Timezone
From syxUI — written for both platforms, not translated between them.
A timezone picker list.
Inputs · SwiftUI · iOS 17
- inputs
- swiftui
The actual source
PickerTimezone.swift
// Timezone · syxUI · https://syxui.dev/components/picker-timezone
// Free in any project. Keep this line and credit syxUI where a person can read it.
import SwiftUI
let pkBlue = Color(red: 0.0, green: 0.47, blue: 1.0)
extension View {
func formaCard(_ pad: CGFloat = 18) -> some View {
self.padding(pad)
.background(Color(.systemBackground), in: RoundedRectangle(cornerRadius: 20, style: .continuous))
.overlay(RoundedRectangle(cornerRadius: 20, style: .continuous).stroke(Color.primary.opacity(0.06), lineWidth: 1))
.shadow(color: .black.opacity(0.05), radius: 14, x: 0, y: 6)
}
}
struct PickerTimezone: View { var body: some View { VStack(spacing: 0) { ForEach(Array([("Pacific Time", "GMT-8", true), ("Eastern Time", "GMT-5", false), ("London", "GMT+0", false)].enumerated()), id: \.offset) { i, tz in HStack { VStack(alignment: .leading, spacing: 1) { Text(tz.0).font(.system(size: 15)); Text(tz.1).font(.system(size: 12)).foregroundStyle(.secondary) }; Spacer(); if tz.2 { Image(systemName: "checkmark").font(.system(size: 13, weight: .semibold)).foregroundStyle(pkBlue) } }.padding(.horizontal, 14).padding(.vertical, 10); if i < 2 { Divider() } } }.formaCard(6).frame(width: 280) } }
iOS 17 · No dependencies
Dependencies
- SwiftUI
- No external dependencies
Requires iOS 17


