Skip to content

Commit

Permalink
Update StaticFrameworks.md
Browse files Browse the repository at this point in the history
  • Loading branch information
kas-kad authored Sep 22, 2017
1 parent a8795b9 commit 5b2d2ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Documentation/StaticFrameworks.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Build static frameworks to speed up your app’s launch times
Carthage supports building static frameworks in place of dynamic frameworks when used in concert with Keith Smiley’s `ld.py` script, published [here](https://github.com/keith/swift-staticlibs/blob/master/ld.py). If you have many dynamic frameworks, you may have noticed that your application's launch times can be quite slow relative to other applications. To mitigate this, Apple suggests that you embed [at most six dynamic frameworks](https://developer.apple.com/videos/play/wwdc2016/406/?time=1794) into your applications. Unfortunately, Xcode has not supported building static Swift frameworks out of the box since Apple made that recommendation, so it is a bit tricky to follow this advice. The goal of this guide is to show you how to reduce the number of embedded dynamic frameworks in your application with some simple wrappers around Carthage.

Since you’re going to be rebuilding dynamic frameworks as static frameworks, make sure that when you perform a `carthage checkout`, `carthage bootstrap`, or `carthage update` from this point forward, you are supplying the `--no-use-binaries` flag to `carthage`. This will ensure that Carthage doesn’t download prebuilt dyamic frameworks and place them into your `Carthage/Build` directory, since you won’t be needing them anyways.
Since you’re going to be rebuilding dynamic frameworks as static frameworks, make sure that when you perform a `carthage checkout`, `carthage bootstrap`, or `carthage update` from this point forward, you are supplying the `--no-use-binaries` flag to `carthage`. This will ensure that Carthage doesn’t download prebuilt dynamic frameworks and place them into your `Carthage/Build` directory, since you won’t be needing them anyways.

To build static frameworks with Carthage, we suggest wrapping invocations of `carthage build` with a script that looks something like this:

Expand Down

0 comments on commit 5b2d2ad

Please sign in to comment.