nicolasgomollon / LTZTimeZones

A drop-in time zone selection manager that works completely offline.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LTZTimeZones

LTZTimeZones is a drop-in time zone selection manager that works completely offline. LTZTimeZones uses location and time zone data gathered from GeoNames, along with some modifications.

Usage

  1. Drag-and-drop the LTZTimeZones folder into your Xcode project.

  2. Initialize a shared instance of LTZTimeZones:

#import "LTZTimeZones.h"
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0ul), ^{
	[LTZTimeZones sharedManager];
});
  1. Display the LTZSearchController:
#import "LTZSearchController.h"
LTZSearchController *searchController = [[LTZSearchController alloc] init];
// Don't forget to set the delegate!
searchController.delegate = self;
[self.navigationController pushViewController:searchController animated:YES];
  1. Implement LTZSearchDelegate:
- (void)searchDidSelectLocation:(LTZLocation *)location {
	// Pop the search controller.
	[self.navigationController popViewControllerAnimated:YES];
	// Do something useful with `location`!
	selectionLabel.text = [NSString stringWithFormat:@"%@\n%@ (%@)", location.name, location.timeZone.name, location.timeZone.abbreviation];
}

See the TimeZonesSample demo project included in this repository for a working example of the project.

Requirements

LTZTimeZones works on iOS 7 and above.

License

LTZTimeZones is released under the MIT License.

About

A drop-in time zone selection manager that works completely offline.

License:MIT License


Languages

Language:Objective-C 100.0%