- May 27, 2025
- Mins Read
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.
pod ‘TimeZonePicker’
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)
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.
Light and scrollable view controller for tvOS to present blocks of text Description TvOSTextViewer is a view controller to present ...
TvOSSlider is an implementation of UISlider for tvOS. Description and usage TvOSSlider palliates missing an implementation of UISlider for tvOS as part ...
TvOSScribble, based on CoreML, mitigates the lack of a physical numpad area in Siri Remote implementing a handwriting gesture recognizer. ...
PIN keyboard for tvOS Description TvOSPinKeyboard is a view controller that allows easily asking for PIN codes in tvOs Requirements ...
📺 A tvOS button which truncates long text with '... More'. The TvOSMoreButton is a simple view which aims to ...