RepositorySwiftNZNew Zealand
gligorkot

gligorkot/TimeZonePicker

A TimeZonePicker UIViewController similar to the iOS Settings app. Search and select from a range of cities and countries to find your most suitable time zone.

122stars
17forks
2issues
0views

TimeZonePicker

Build Status codebeat badge Version License Platform

Buy Me a Coffee at ko-fi.com

A TimeZonePicker UIViewController similar to the iOS Settings app. Search and select from a range of cities and countries to find your most suitable time zone.

Screenshots

Installation

CocoaPods

To install it in your iOS project, install with CocoaPods

pod 'TimeZonePicker'

Usage

Basic Initialisation

To initialise a timeZonePicker you can use the class function getVC(withDelegate: TimeZonePickerDelegate) on the TimeZonePickerViewController as below:

let timeZonePicker = TimeZonePickerViewController.getVC(withDelegate: self)

Then you can use the timeZonePicker as you would any UIViewController, for example:

present(timeZonePicker, animated: true, completion: nil)

TimeZonePickerDelegate

The TimeZonePickerDelegate currently has only one method that needs to be implemented:

func timeZonePicker(_ timeZonePicker: TimeZonePickerViewController, didSelectTimeZone timeZone: TimeZone)

Once an item is selected from the table of cities/countries the above delegate method gets called, conveniently returning the TimeZonePickerViewController and the selected TimeZone. You can use the timeZonePicker to dismiss it here and the timeZone as you need it in your application. For example:

func timeZonePicker(_ timeZonePicker: TimeZonePickerViewController, didSelectTimeZone timeZone: TimeZone) {
    timeZoneName.text = timeZone.identifier
    timeZoneOffset.text = timeZone.abbreviation()
    timeZonePicker.dismiss(animated: true, completion: nil)
}

Please check the TimeZonePickerExample project for the above usage example. If you have any questions do not hesitate to get in touch with me.

Requirements

  • iOS 8 or later.
  • Swift 3

License

Copyright (c) 2017 Gligor Kotushevski

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Similar Projects

Discover other similar projects and AI models.

RepositoryTypeScript
vvo/tzdb

Always up to date IANA time zones for time zone pickers: grouped list with major cities, current offsets, DST abbreviations, and the country of any time zone. Updated daily.

917
Nov 26, 2026
RepositoryPython
jannikmi/timezonefinder

Offline timezone lookup for WGS84 coordinates, with no polygon simplification - so the answer stays correct at timezone borders.

541
Nov 24, 2026
RepositoryGo
ringsaturn/tzf

Get timezone via longitude and latitude in Go in a fast way

199
Dec 1, 2026
RepositoryPython
ringsaturn/tzfpy

Probably the fastest Python package to convert longitude/latitude to timezone name.

143
Nov 2, 2026
RepositorySwift
jogendra/example-ios-apps

 A curated list of Open Source example iOS apps developed in Swift. An amazing list for people who are beginners and learning ios development and for ios developers who need any example app or feature.

1.4k
Jul 2, 2024
RepositorySwift
kgellci/Shift

Animate gradient changes with time or motion for iOS Swift

184
Mar 29, 2019
RepositoryJavaScript
spencermountain/spacetime

A lightweight javascript timezone library

4.1k
Nov 26, 2026
RepositoryC++
HowardHinnant/date

A date and time library based on the C++11/14/17 <chrono> header

3.4k
Nov 24, 2026
RepositoryC
iOS-Swift-Developers/Swift

🥇Swift基础知识大全,🚀Swift学习从简单到复杂,不断地完善与更新, 欢迎Star❤️,欢迎Fork, iOS开发者交流:①群:446310206 ②群:426087546

1.9k
Jun 9, 2022