forked from NikolayShubenkovProgSchool/iProg0102_072015
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PostOffice.m
38 lines (31 loc) · 789 Bytes
/
PostOffice.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//
// PostOffice.m
// iProg0102_072015
//
// Created by Nikolay Shubenkov on 11/07/15.
// Copyright (c) 2015 Nikolay Shubenkov. All rights reserved.
//
#import "PostOffice.h"
@implementation PostOffice
- (instancetype)initWithInfo:(NSDictionary *)info
{
self = [super init];
if (self){
_name = info[@"addressSource"];
_latitude = [info[@"latitude"] doubleValue];
_longitude = [info[@"longitude"] doubleValue];
NSParameterAssert(_name.length > 0);
NSParameterAssert(info[@"latitude"]);
NSParameterAssert(info[@"longitude"]);
}
return self;
}
- (CLLocationCoordinate2D) coordinate
{
return CLLocationCoordinate2DMake(self.latitude, self.longitude);
}
- (NSString *)title
{
return self.name;
}
@end