Giter Club home page Giter Club logo

cocoapods-amimono's Introduction

cocoapods-amimono

amimono

Move all dynamic frameworks symbols into the main executable.

Why would you want this plugin in your Podfile?

Apple introduced dynamic linking on iOS 8 alongside with Swift. Shortly after, this was adopted by CocoaPods as a requirement to use Pods that contain Swift, because Xcode can't use static libraries with Swift.

On iOS 9.1, a dyld crash affected the vast majority of apps that used a high number of dynamic frameworks. You can learn more about the issue on artsy/eigen#1246. Although the issue was fixed on iOS 9.3.2, it was clear that having a high number of dynamic frameworks was not a good idea. During WWDC 2016, someone asked what would be the optimal number of dynamic frameworks on an iOS application and we got the following response:

Apple advises to use about half a dozen dynamic frameworks in an app. Hard to achieve with external & internal deps. -- from Twitter

This is hardly an option for some. If you think you might be in that group, then continue reading.

What is this plugin doing?

This plugin is based on dyld-image-loading-performance. In a nutshell, it copies all symbols of your CocoaPods dependencies into your main app executable, so the dynamic linker doesn't have to load the frameworks. You can verify this yourself by enabling

log_setting_xcode.png

and looking at the log output you shouldn't find any dlopen call of your CocoaPods frameworks.

Limitations

Currently this plugin has the following limitations:

  • You will have modify your post_install hook. This is necessary because the CocoaPods plugin API currently doesn't offer everything that the gem needs.

Installation

gem install cocoapods-amimono

Usage

Add the following to your Podfile:

plugin 'cocoapods-amimono'

Add the following to your post_install hook:

post_install do |installer|
  require 'cocoapods-amimono/patcher'
  Amimono::Patcher.patch!(installer)
  ...

Example project

Here.

cocoapods-amimono's People

Contributors

dhcdht avatar plu avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.