• Stars
    star
    253
  • Rank 160,776 (Top 4 %)
  • Language
    Ruby
  • License
    MIT License
  • Created almost 7 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A cocoapods plugin enables static framework for all pods

cocoapods-static-swift-framework

A cocoapods plugin that enables static frameworks for all pods.

Cocoapods only supports static framework at pod level, which means an option in podspec and just valid for that pod. By using this plugin, we can make all pod to static framework with only one word!

(There's 'swift' in the plugin name as it's originally built for swift. You can also use it for pure objc project too.)

Usage

Install via gem:

$ gem install cocoapods-static-swift-framework

Add the following to your podfile:

plugin 'cocoapods-static-swift-framework'

NOTE: Static frameworks is still using framework, not static library. So don't forget to add use_frameworks!

NOTE: From cocoapods 1.7, the generated resource bundle specified with s.resource_bundle in podspec, will not be copied to the .framework folder. It's a default behavior of cocoapods.

About Static framework

Why

Too many dynamic frameworks will increase app boot time dramatically, also the Copy framework build phase will expend unendurable time in the code-build-run loop. (There is also a dyld crash) Static framework have no these problems.

What is a static framework

First of all, what is a framework? Framework is just a bundle with specifications to organize files, for whom xcode provides convenient methods to link bianry and copy resources.

Static framework, or precisely static-linking framework, has no official defination. There's only (dynamic) framework. "When linking, it found that the binary in the framework is static-linking, then it will link the binary staticaly. There's no special handling." an Apple engineer answered me at WWDC.

Resources in static framework can't be copied to app's main bundle automatically. If you use cocoapods, it will handle it automatically, but not for the manual integration.

The binary in the framework will be linked statically, as its name, to the main binary. There's no framework file in the Framework folder of the app bundle. Resources will copied to app bundle's root path. So there's a potential bug of conflict of resource file names.

requirement

  • Xcode 9+
  • cocoapods 1.5+ (v1.7 tested)

License

MIT

Appreciate a 🌟 if you like it. Another cocoapods plugin made by me to improve pod compile time: cocoapods-binary

More Repositories

1

cocoapods-binary

integrate pods in form of prebuilt frameworks conveniently, reducing compile time
Ruby
1,304
star
2

Neat

Fix the line height problems of TextKit
Objective-C
103
star
3

ComponentSwift

Bring ComponentKit to Swift, A React-inspired view framework for iOS
Objective-C++
49
star
4

fucking-beijing-bus-api

北京实时公交 API
Swift
47
star
5

cocoapods-developing-folder

a branch of tools for who heavily use development pods
Ruby
30
star
6

Mappable

flexible JSON to Model converter, specially optimized for immutable properties
Swift
27
star
7

RunMario

iOS jailbreak tweak that allow playing SuperMarioRun on jailbreak device
Logos
25
star
8

sketch-engineer-friendly-text

Sketch plugin that make text layer's metric friendly to iOS engineer
JavaScript
24
star
9

alternate-icon-demo

demo for changing icon dynamically for iOS app
Swift
15
star
10

LazyWarningChecker

move "Treat Warnings as Errors" to commit time
Python
7
star
11

Literal

convenient initializers for CGPoint and etc..
Swift
6
star
12

SmashTheAddress

崩溃日志符号化python脚本,使用atosl工具
Python
3
star
13

courses

复刻自己的一个android课程表app
Objective-C
3
star
14

JustMyPassword

Jailbreak tweak. Allow you add new card in wallet while using 4-digit password
Logos
3
star
15

Sketch-iOS-text-solution

Swift
3
star
16

MathjaxZhihu

use Mathjax to render equations in Zhihu.com
JavaScript
2
star
17

LEPhotoCollectionView

CollectionView and cell for viewing images like Photo app
Objective-C
2
star
18

go-optional

optional type for golang
Go
2
star
19

Shell

Run shell commands fastly
Swift
2
star
20

HiThere

popup an image beside the cursor
Swift
2
star
21

go-either

An Either type for golang with generics
Go
1
star
22

Ring

One ring to rule them all
Shell
1
star