Skip to content

Commit 44e62ca

Browse files
committed
Added tvOS framework target and scheme
Also conditionally uncompiled Contacts framework integration, because Contacts framework is unavailable on tvOS.
1 parent ae180c1 commit 44e62ca

File tree

8 files changed

+419
-6
lines changed

8 files changed

+419
-6
lines changed

MapboxGeocoder.swift.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Pod::Spec.new do |s|
77
s.summary = "Mapbox Geocoding API for Swift and Objective-C."
88

99
s.description = <<-DESC
10-
MapboxGeocoder.swift makes it easy to connect your iOS or OS X application to the Mapbox Geocoding API. MapboxGeocoder.swift exposes the power of the Carmen geocoder through a simple API similar to Core Location’s CLGeocoder.
10+
MapboxGeocoder.swift makes it easy to connect your iOS, OS X, or tvOS application to the Mapbox Geocoding API. MapboxGeocoder.swift exposes the power of the Carmen geocoder through a simple API similar to Core Location’s CLGeocoder.
1111
DESC
1212

1313
s.homepage = "https://www.mapbox.com/geocoding/"

MapboxGeocoder.xcodeproj/project.pbxproj

Lines changed: 299 additions & 2 deletions
Large diffs are not rendered by default.
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "0730"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "DA5170C01CF253EE00CD6DCF"
18+
BuildableName = "MapboxGeocoder.framework"
19+
BlueprintName = "MapboxGeocoderTV"
20+
ReferencedContainer = "container:MapboxGeocoder.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
<TestableReference
32+
skipped = "NO">
33+
<BuildableReference
34+
BuildableIdentifier = "primary"
35+
BlueprintIdentifier = "DA5170C91CF253EE00CD6DCF"
36+
BuildableName = "MapboxGeocoderTests.xctest"
37+
BlueprintName = "MapboxGeocoderTVTests"
38+
ReferencedContainer = "container:MapboxGeocoder.xcodeproj">
39+
</BuildableReference>
40+
</TestableReference>
41+
</Testables>
42+
<MacroExpansion>
43+
<BuildableReference
44+
BuildableIdentifier = "primary"
45+
BlueprintIdentifier = "DA5170C01CF253EE00CD6DCF"
46+
BuildableName = "MapboxGeocoder.framework"
47+
BlueprintName = "MapboxGeocoderTV"
48+
ReferencedContainer = "container:MapboxGeocoder.xcodeproj">
49+
</BuildableReference>
50+
</MacroExpansion>
51+
<AdditionalOptions>
52+
</AdditionalOptions>
53+
</TestAction>
54+
<LaunchAction
55+
buildConfiguration = "Debug"
56+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
57+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
58+
launchStyle = "0"
59+
useCustomWorkingDirectory = "NO"
60+
ignoresPersistentStateOnLaunch = "NO"
61+
debugDocumentVersioning = "YES"
62+
debugServiceExtension = "internal"
63+
allowLocationSimulation = "YES">
64+
<MacroExpansion>
65+
<BuildableReference
66+
BuildableIdentifier = "primary"
67+
BlueprintIdentifier = "DA5170C01CF253EE00CD6DCF"
68+
BuildableName = "MapboxGeocoder.framework"
69+
BlueprintName = "MapboxGeocoderTV"
70+
ReferencedContainer = "container:MapboxGeocoder.xcodeproj">
71+
</BuildableReference>
72+
</MacroExpansion>
73+
<AdditionalOptions>
74+
</AdditionalOptions>
75+
</LaunchAction>
76+
<ProfileAction
77+
buildConfiguration = "Release"
78+
shouldUseLaunchSchemeArgsEnv = "YES"
79+
savedToolIdentifier = ""
80+
useCustomWorkingDirectory = "NO"
81+
debugDocumentVersioning = "YES">
82+
<MacroExpansion>
83+
<BuildableReference
84+
BuildableIdentifier = "primary"
85+
BlueprintIdentifier = "DA5170C01CF253EE00CD6DCF"
86+
BuildableName = "MapboxGeocoder.framework"
87+
BlueprintName = "MapboxGeocoderTV"
88+
ReferencedContainer = "container:MapboxGeocoder.xcodeproj">
89+
</BuildableReference>
90+
</MacroExpansion>
91+
</ProfileAction>
92+
<AnalyzeAction
93+
buildConfiguration = "Debug">
94+
</AnalyzeAction>
95+
<ArchiveAction
96+
buildConfiguration = "Release"
97+
revealArchiveInOrganizer = "YES">
98+
</ArchiveAction>
99+
</Scheme>

MapboxGeocoder/MBGeocodeOptions.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import Contacts
1+
#if !os(tvOS)
2+
import Contacts
3+
#endif
24

35
/**
46
A structure that specifies the criteria for results returned by the Mapbox Geocoding API.
@@ -98,6 +100,7 @@ public class ForwardGeocodeOptions: GeocodeOptions {
98100
self.init(queries: [query])
99101
}
100102

103+
#if !os(tvOS)
101104
/**
102105
Initializes a forward geocode options object with the given postal address object.
103106

@@ -108,6 +111,7 @@ public class ForwardGeocodeOptions: GeocodeOptions {
108111
let formattedAddress = CNPostalAddressFormatter().stringFromPostalAddress(postalAddress)
109112
self.init(query: formattedAddress.stringByReplacingOccurrencesOfString("\n", withString: ", "))
110113
}
114+
#endif
111115

112116
override var params: [NSURLQueryItem] {
113117
var params = super.params

MapboxGeocoder/MBPlacemark.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import Contacts
1+
#if !os(tvOS)
2+
import Contacts
3+
#endif
24

35
// MARK: Postal Address Properties
46

@@ -221,6 +223,7 @@ public class Placemark: NSObject, NSCopying, NSSecureCoding {
221223
return nil
222224
}
223225

226+
#if !os(tvOS)
224227
/**
225228
The placemark’s postal address.
226229

@@ -230,6 +233,7 @@ public class Placemark: NSObject, NSCopying, NSSecureCoding {
230233
public var postalAddress: CNPostalAddress? {
231234
return nil
232235
}
236+
#endif
233237

234238
/**
235239
A dictionary containing the Contacts keys and values for the placemark.
@@ -424,6 +428,7 @@ public class GeocodedPlacemark: Placemark {
424428
return scope == .Address ? lines : Array(lines.suffixFrom(1))
425429
}
426430

431+
#if !os(tvOS)
427432
@available(iOS 9.0, OSX 10.11, *)
428433
public override var postalAddress: CNPostalAddress? {
429434
let postalAddress = CNMutablePostalAddress()
@@ -452,6 +457,7 @@ public class GeocodedPlacemark: Placemark {
452457

453458
return postalAddress
454459
}
460+
#endif
455461

456462
public override var addressDictionary: [NSObject: AnyObject]? {
457463
var addressDictionary: [String: AnyObject] = [:]

MapboxGeocoder/MapboxGeocoder.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#import <Foundation/Foundation.h>
22
#import <CoreLocation/CoreLocation.h>
3+
#if !TARGET_OS_TV
34
#import <Contacts/Contacts.h>
5+
#endif
46

57
FOUNDATION_EXPORT double MapboxGeocoderVersionNumber;
68

Podfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,8 @@ target 'MapboxGeocoderMacTests' do
2020
platform :osx, '10.10'
2121
shared_test_pods
2222
end
23+
24+
target 'MapboxGeocoderTVTests' do
25+
platform :tvos, '9.0'
26+
shared_test_pods
27+
end

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[📱&nbsp;![iOS Build Status](https://www.bitrise.io/app/6cae401ec4c1d406.svg?token=MJnXK0c2x2tmTnmHSPtcFA&branch=master)](https://www.bitrise.io/app/6cae401ec4c1d406) &nbsp;&nbsp;&nbsp;
44
[🖥💻&nbsp;![OS X Build Status](https://www.bitrise.io/app/8413a6e577d6aa9a.svg?token=N1agv0mw75SOE_SykliueQ&branch=master)](https://www.bitrise.io/app/8413a6e577d6aa9a)
55

6-
MapboxGeocoder.swift makes it easy to connect your iOS or OS X application to the [Mapbox Geocoding API](https://www.mapbox.com/geocoding/). MapboxGeocoder.swift exposes the power of the [Carmen](https://github.com/mapbox/carmen) geocoder through a simple API similar to Core Location’s CLGeocoder.
6+
MapboxGeocoder.swift makes it easy to connect your iOS, OS X, or tvOS application to the [Mapbox Geocoding API](https://www.mapbox.com/geocoding/). MapboxGeocoder.swift exposes the power of the [Carmen](https://github.com/mapbox/carmen) geocoder through a simple API similar to Core Location’s CLGeocoder.
77

88
MapboxGeocoder.swift pairs well with [MapboxDirections.swift](https://github.com/mapbox/MapboxDirections.swift), [MapboxStatic.swift](https://github.com/mapbox/MapboxStatic.swift), and the [Mapbox iOS SDK](https://www.mapbox.com/ios-sdk/) or [OS X SDK](https://github.com/mapbox/mapbox-gl-native/tree/master/platform/osx).
99

0 commit comments

Comments
 (0)