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

Commit

Permalink
[ios] Import required frameworks with static framework umbrella
Browse files Browse the repository at this point in the history
The umbrella header inside the static framework now imports the required iOS SDK frameworks so manual linking is unnecessary. This change corrects a regression introduced in #3183, when the umbrella header used in version 3.0.1 was removed.
  • Loading branch information
1ec5 committed Feb 18, 2016
1 parent a503048 commit 1c25dc0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
9 changes: 2 additions & 7 deletions ios/docs/pod-README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The Mapbox iOS SDK may be installed as either a dynamic framework or a static fr

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

1. Open the project editor and select your application target. Drag `Mapbox.framework` from the `dynamic` folder into the “Embedded Binaries” section of the General tab. In the sheet that appears, make sure “Copy items if needed” is checked, then click Finish.
1. Open the project editor and select your application target. Drag `Mapbox.framework` from the `dynamic` folder into the “Embedded Binaries” section of the General tab. (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.

1. In the Build Phases tab, click the + button at the top and select “New Run Script Phase”. Enter the following code into the script text field:

Expand All @@ -33,18 +33,13 @@ 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. Open the project editor and select your application target. Drag `Mapbox.framework` from the `static` folder into the “Embedded Binaries” section of the General tab. In the sheet that appears, make sure “Copy items if needed” is checked, then click Finish.
1. Open the project editor and select your application target. Drag `Mapbox.framework` from the `static` folder into the “Embedded Binaries” section of the General tab. (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.

1. Add the following Cocoa Touch frameworks and libraries to the “Linked Frameworks and Libraries” section:

- `GLKit.framework`
- `ImageIO.framework`
- `MobileCoreServices.framework`
- `QuartzCore.framework`
- `SystemConfiguration.framework`
- `libc++.tbd`
- `libsqlite3.tbd`
- `libz.tbd`

1. In the Build Settings tab, add `-ObjC` to the “Other Linker Flags” (`OTHER_LDFLAGS`) build setting.

Expand Down
3 changes: 3 additions & 0 deletions ios/framework/Mapbox-static.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#import <GLKit/GLKit.h>
#import <ImageIO/ImageIO.h>
#import <MobileCoreServices/MobileCoreServices.h>
9 changes: 2 additions & 7 deletions platform/ios/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ This is the recommended workflow for manually integrating the SDK into an applic
1. Build from source manually per above.
1. Open the project editor and select your application target. Drag `build/ios/pkg/dynamic/Mapbox.framework` into the “Embedded Binaries” section of the General tab. In the sheet that appears, make sure “Copy items if needed” is checked, then click Finish.
1. Open the project editor and select your application target. Drag `build/ios/pkg/dynamic/Mapbox.framework` into the “Embedded Binaries” section of the General tab. (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.
1. In the Build Phases tab, click the + button at the top and select “New Run Script Phase”. Enter the following code into the script text field:
Expand All @@ -95,18 +95,13 @@ If your application targets iOS 7.x, you’ll need to install the static framewo

1. Build from source manually per above.

1. Open the project editor and select your application target. Drag `build/ios/pkg/static/Mapbox.framework` into the “Embedded Binaries” section of the General tab. In the sheet that appears, make sure “Copy items if needed” is checked, then click Finish.
1. Open the project editor and select your application target. Drag `build/ios/pkg/static/Mapbox.framework` into the “Embedded Binaries” section of the General tab. (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.

1. Add the following Cocoa Touch frameworks and libraries to the “Linked Frameworks and Libraries” section:

- `GLKit.framework`
- `ImageIO.framework`
- `MobileCoreServices.framework`
- `QuartzCore.framework`
- `SystemConfiguration.framework`
- `libc++.tbd`
- `libsqlite3.tbd`
- `libz.tbd`

1. In the Build Settings tab, add `-ObjC` to the “Other Linker Flags” (`OTHER_LDFLAGS`) build setting.

Expand Down
2 changes: 2 additions & 0 deletions platform/ios/scripts/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ if [[ ${BUILD_STATIC} == true ]]; then
step "Copying static library headers…"
mkdir -p "${OUTPUT}/static/${NAME}.framework/Headers"
cp -pv include/mbgl/{darwin,ios}/*.h "${OUTPUT}/static/${NAME}.framework/Headers"
cat ios/framework/Mapbox-static.h > "${OUTPUT}/static/${NAME}.framework/Headers/Mapbox.h"
cat ios/framework/Mapbox.h >> "${OUTPUT}/static/${NAME}.framework/Headers/Mapbox.h"
fi

step "Copying library resources…"
Expand Down

0 comments on commit 1c25dc0

Please sign in to comment.