Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[ios] Add -ObjC to static podspec; update custom CocoaPods steps
Browse files Browse the repository at this point in the history
  • Loading branch information
friedbunny authored Sep 1, 2016
1 parent be08c79 commit 5a3bba6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 27 deletions.
35 changes: 8 additions & 27 deletions platform/ios/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ There are several ways to install custom builds of the Mapbox iOS SDK:

#### Dynamic framework

This is the recommended workflow for manually integrating the SDK into an application targeting iOS 8 and above:
This is the recommended workflow for manually integrating custom builds of the SDK into an application targeting iOS 8 and above:

1. Build from source manually per above.
1. Build from source manually, per above.

1. Open the project editor, select your application target, then go to the General tab. Drag Mapbox.framework from the `build/ios/pkg/dynamic/` directory into the “Embedded Binaries” section. (Don’t drag it into the “Linked Frameworks and Libraries” section; Xcode will add it there automatically.) In the sheet that appears, make sure “Copy items if needed” is checked, then click Finish.

Expand All @@ -54,7 +54,7 @@ bash "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/Mapbox.framework/strip-fra

If your application targets iOS 7.x, you’ll need to install the static framework instead:

1. Build from source manually per above.
1. Build from source manually, per above.

1. Drag the Mapbox.bundle and Mapbox.framework from the `build/ios/pkg/static/` directory into the Project navigator. In the sheet that appears, make sure “Copy items if needed” is checked, then click Finish. Open the project editor and select your application target to verify that the following changes occurred automatically:

Expand Down Expand Up @@ -87,37 +87,18 @@ pod 'Mapbox-iOS-SDK', podspec: 'https://raw.githubusercontent.com/mapbox/mapbox-

##### Using your own build with CocoaPods

To install a _development version_ of this SDK using CocoaPods you will need to build it from source manually per above, then include that build product in your Podfile.
1. Build from source manually, per above.

1. Zip up the build product.

```bash
cd build/ios/pkg/
ZIP=mapbox-ios-sdk.zip
rm -f ../${ZIP}
zip -r ../${ZIP} *
```

1. Customize [`Mapbox-iOS-SDK.podspec`](../ios/Mapbox-iOS-SDK.podspec) to download this zip file.

```rb
{...}
m.source = {
:path => "{...}/mapbox-ios-sdk.zip"
}
{...}
```

1. Update your app's `Podfile` to point to the `Mapbox-iOS-SDK.podspec`.
1. Update your app’s `Podfile` to point to `Mapbox-iOS-SDK.podspec`.

```rb
pod 'Mapbox-iOS-SDK', :path => '{...}/Mapbox-iOS-SDK.podspec'
pod 'Mapbox-iOS-SDK', :path => '{...}/build/ios/pkg/{dynamic|static}/Mapbox-iOS-SDK.podspec'
```

1. Run `pod update` to grab the newly-built library.

If using the static framework, add `$(inherited)` to your target’s Other Linker Flags in the Build Settings tab.

### Configuration

1. Mapbox vector tiles require a Mapbox account and API access token. In the project editor, select the application target, then go to the Info tab. Under the “Custom iOS Target Properties” section, set `MGLMapboxAccessToken` to your access token. You can obtain an access token from the [Mapbox account page](https://www.mapbox.com/studio/account/tokens/).
Expand Down
1 change: 1 addition & 0 deletions platform/ios/Mapbox-iOS-SDK-static-part.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
m.resource_bundle = { 'Mapbox' => 'Mapbox.bundle/*' }
m.vendored_frameworks = 'Mapbox.framework'
m.module_name = 'Mapbox'
m.xcconfig = { 'OTHER_LDFLAGS' => '-ObjC' }

end

0 comments on commit 5a3bba6

Please sign in to comment.