• This repository has been archived on 02/Jul/2018
  • Stars
    star
    341
  • Rank 123,998 (Top 3 %)
  • Language
    Ruby
  • License
    MIT License
  • Created over 9 years ago
  • Updated over 7 years ago

Reviews

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

Repository Details

Git Submodule Alternative for Cocoa.

CocoaSeeds

Gem Build Status

Git Submodule Alternative for Cocoa. Inspired by CocoaPods.

Why?

  • iOS 7 projects do not support the use of Swift libraries from CocoaPods or Carthage.

    ld: warning: embedded dylibs/frameworks only run on iOS 8 or later

  • CocoaSeeds just downloads the source code and add it to your Xcode project. No static libraries, no dynamic frameworks.

  • Git Submodule sucks.

  • It can be used with CocoaPods and Carthage.

Installation

You can get CocoaSeeds from RubyGems.

$ [sudo] gem install cocoaseeds

How to Use CocoaSeeds

1. Write a Seedfile

A Seedfile is a ruby script that manifests the dependencies of your project. You can manage third party libraries by simply specifying them in the Seedfile. Currently, CocoaSeeds supports only GitHub and BitBucket repositories. However, we are planning to support other version control systems.

Let's make an empty file named Seedfile in the directory where your Xcode project file is located. Here is a sample Seedfile:

Seedfile

github "Alamofire/Alamofire", "1.2.1", :files => "Source/*.{swift,h}"
github "devxoul/JLToast", "1.2.5", :files => "JLToast/*.{swift,h}"
github "devxoul/SwipeBack", "1.0.4"
github "SnapKit/SnapKit", :commit => "62e7645", :files => "Source/*.{swift,h}"

git "https://gitlab.com/MyCompany/CompanyLibrary.git", "1.1.0"
local "PrivateLibrary", "../libs/PrivateLibrary", :files => "Source/*.{swift,h}"

target :MyAppTest do
  github "Quick/Quick", "v0.3.1", :files => "Quick/**.{swift,h}"
  github "Quick/Nimble", "v0.4.2", :files => "Nimble/**.{swift,h}"
end

Can you guess what each line does? It has basic information about the third party libraries.

Each line in a Seedfile consists of three parts: source, tag, and files. Let's look at the second line of the previous sample.

github "devxoul/JLToast", "1.2.5", :files => "JLToast/*.{swift,h}"
~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       (Source)          (Version)             (Files)
Parts Example Required Default
Source github "devxoul/SwipeBack" Required -
Version Tag: "1.0.4"
Branch: "swift-2.0"
Commit: :commit => "SHA1"
Required -
Files :files => "JLToast/*.{swift,h}" Optional */**.{h,m,mm,swift}

Tip: You can pass an array to :files for multiple file patterns:

:files => ["/path1/*.swift", "/path2/*.swift"]

Want to use branch names instead of tags? See the Branch support section.

Specifying targets

Third party libraries can be included as a specific target by creating a target block. For example, if you want to add some testing libraries such as Quick and Nimble into test target, you can specify them like this:

target :MyAppTest do
  github "Quick/Quick", "v0.3.1", :files => "Quick/**.{swift,h}"
  github "Quick/Nimble", "v0.4.2", :files => "Nimble/**.{swift,h}"
end

Specifying Xcode project file path

If the .xcodeproj file is located in other location, you can specify the path in Seedfile.

xcodeproj "path/to/Project.xcodeproj"

target :MyApp do
    github "devxoul/JLToast", "1.2.5", :files => "JLToast/*.{swift,h}"
end

2. Install dependencies

After you are done with your Seedfile, it's time to load those libraries into your project. This is pretty simple. Just open the terminal, cd to your project directory and execute seed install command.

$ seed install

Then, all the source files will be automatically downloaded and added to a group named 'Seeds'.

Seeds-in-Xcode

3. Enjoy

Build your project and enjoy coding!

Tips and Tricks

Using branches

You can specify a branch name instead of the tag. What you need to do is just replacing the tag with the branch name.

github 'devxoul/SwiftyImage', 'swift-2.0', :files => 'SwiftyImage/SwiftyImage.swift'

Excluding files

Use exclude_files to exclude files from files pattern.

github 'devxoul/Carte', '0.2.2', :files => 'Carte/*', :exclude_files => "Carte/Carte.h"

Using resources

If the resource files are sprecified in files, they will be added to Copy Bundle Resource build phase instead of Compile Source build phase.

github 'author/Repository', 'x.y.z', :files => ['Source/*', 'Images/*']

Resolving filename conflicts

Since CocoaSeeds tries to include source files directly rather than linking dynamic frameworks, it is important to make sure that all sources have different names. CocoaSeeds provides a way to do this:

Seedfile

swift_seedname_prefix!  # add this line

github "thoughtbot/Argo", "v1.0.3", :files => "Argo/*/*.swift"
github "thoughtbot/Runes", "v2.0.0", :files => "Source/*.swift"

Then all of source files installed via CocoasSeeds will have names with the seed names as prefix.

Before (filename) After (seedname_filename)
Seeds/Alamofire/Alamofire.swift Seeds/Alamofire/Alamofire_Alamofire.swift
Seeds/Argo/Operators/Operators.swift Seeds/Argo/Operators/Argo_Operators.swift
Seeds/Runes/Operators.swift Seeds/Runes/Runes_Operators.swift

FAQ

  • Are you using this in real-world projects? (Does Apple allow apps to use CocoaSeeds?)

    • Of course I am. I'm developing a social media service that has about 2 million users. The app is on AppStore without any complaints from Apple.
  • Can I ignore Seeds folder in VCS (version control system)?

    • Yes, you can ignore the Seeds folder (by adding it to .gitignore if you use Git).

License

CocoaSeeds is under MIT license. See the LICENSE file for more info.

More Repositories

1

Then

โœจ Super sweet syntactic sugar for Swift initializers
Swift
4,045
star
2

URLNavigator

โ›ต๏ธ Elegant URL Routing for Swift
Swift
3,219
star
3

Toaster

๐Ÿž Toast for Swift
Swift
1,668
star
4

UITextView-Placeholder

A missing placeholder for UITextView
Objective-C
1,458
star
5

RxTodo

iOS Todo Application using RxSwift and ReactorKit
Swift
1,291
star
6

SwiftyImage

๐ŸŽจ Generate image resources in Swift
Swift
1,075
star
7

SwiftUITodo

An example to-do list app using SwiftUI which is introduced in WWDC19
Swift
715
star
8

Umbrella

โ˜‚๏ธ Analytics abstraction layer for Swift
Swift
607
star
9

Drrrible

Dribbble for iOS using ReactorKit
Swift
514
star
10

Pure

Pure DI in Swift
Swift
366
star
11

RxViewController

RxSwift wrapper for UIViewController and NSViewController
Swift
331
star
12

SwipeBack

Enable iOS 7+ swipe-to-back when custom back button is set.
Objective-C
321
star
13

UICollectionViewFlexLayout

A drop-in replacement for UICollectionViewFlowLayout
Swift
296
star
14

MoyaSugar

๐Ÿฏ Syntactic sugar for Moya
Swift
191
star
15

Carte

๐Ÿด Open source license notice view generator for Swift
Ruby
189
star
16

graygram-ios

[40์‹œ๊ฐ„๋งŒ์— Swift๋กœ iOS ์•ฑ ๋งŒ๋“ค๊ธฐ] ํ‘๋ฐฑ ์‚ฌ์ง„ ์ „์šฉ ์†Œ์…œ ๋ฏธ๋””์–ด ์•ฑ
Swift
180
star
17

ReusableKit

Generic reusables for UICollectionView and UITableView
Swift
158
star
18

UINavigationItem-Margin

Margins for UINavigationItem
Objective-C
158
star
19

allkdic

์˜ฌใ…‹์‚ฌ์ „ - ๋งฅ์—์„œ ๋‹จ์ถ•ํ‚ค๋ฅผ ๋ˆ„๋ฅด๋ฉด ์˜์–ด์‚ฌ์ „์ด ๋™‡!!!!
Swift
128
star
20

SwiftyColor

๐ŸŽจ The most sexy way to use colors in Swift.
Swift
120
star
21

RxCodable

RxSwift wrapper for Codable
Swift
113
star
22

RxExpect

RxSwift testing framework
Swift
105
star
23

korail

๐Ÿš† An unofficial Korail API for Python.
Python
90
star
24

Stubber

A minimal method stub for Swift
Swift
86
star
25

Cleverbot

iOS Messaging Application using Cleverbot and ReactorKit
Swift
78
star
26

Blockchain

A blockchain simulator written in Swift
Swift
65
star
27

LetsGitHubSearch

Let'Swift 18 Workshop - Let's TDD
Swift
63
star
28

CancelBag

A DisposeBag for Combine
Swift
53
star
29

TouchAreaInsets

Expand UIView touch area just like a charm
Objective-C
50
star
30

UIViewController-NavigationBar

[Deprecated] UIViewController with its own navigation bar. It provides an availability for the smooth push/pop animations between view controllers which have different navigation bar styles.
Swift
50
star
31

ios-with-swift-in-40-hours

40์‹œ๊ฐ„๋งŒ์— Swift๋กœ iOS ์•ฑ ํ•˜๋‚˜๋ฅผ ๋งŒ๋“ค์–ด๋ด…์‹œ๋‹ค.
49
star
32

SectionReactor

A ReactorKit extension for managing table view and collection view sections with RxDataSources
Swift
45
star
33

Fallback

๐Ÿ’Š Syntactic sugar for Swift do-try-catch
Swift
42
star
34

SafeCollection

Safe Collection for Swift
Swift
42
star
35

AsyncBlockOperation

NSOperation subclass for async block.
Objective-C
41
star
36

CGFloatLiteral

CGFloat(10) becomes 10.f
Swift
35
star
37

Endpoint

๐Ÿš€ Elegant API Abstraction for Swift
Swift
35
star
38

RxJSON

RxSwift wrapper for JSON
Swift
33
star
39

ASCollectionFlexLayout

A custom collection layout that allows to use Texture layout specs in ASCollectionNode.
Swift
27
star
40

next-route-map

๐Ÿš Routes for Next.js
TypeScript
26
star
41

Date.swift

๐Ÿ“… A Swift Date Library
Swift
26
star
42

ImageEffects

Bring UIImageEffects (WWDC 2013) to UIImage category with handy interface.
Objective-C
25
star
43

Todobox

[40์‹œ๊ฐ„๋งŒ์— Swift๋กœ iOS ์•ฑ ๋งŒ๋“ค๊ธฐ] ํ•  ์ผ ๋ชฉ๋ก ๊ด€๋ฆฌ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜
Swift
24
star
44

RxReusable

Reusable cells and views for RxSwift
Swift
23
star
45

AlertReactor

A ReactorKit extension for UIAlertController
Swift
23
star
46

UIButton-BackgroundContentMode

A missing background content mode for UIButton.
Objective-C
22
star
47

sketch-export-sizes-generator

๐Ÿ’Ž A simple plugin for Sketch that generates export sizes of layers.
20
star
48

RxDelegateCells

[Don't use this] UITableView Cell Height and UICollectionView Cell Size for RxSwift
Swift
19
star
49

Immutable

Missing non-mutating functions in Swift
Swift
18
star
50

PureSwinject

Auto register Pure factories to Swinject
Swift
18
star
51

graygram-web

Python
16
star
52

daumpostcode

๋‹ค์Œ ์šฐํŽธ๋ฒˆํ˜ธ ์„œ๋น„์Šค๋ฅผ ๋ณ„๋„์˜ ํŒจํ‚ค์ง€ ์„ค์น˜ ์—†์ด๋„ ๋„ค์ดํ‹ฐ๋ธŒ ์•ฑ์—์„œ ์‰ฝ๊ฒŒ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
HTML
16
star
53

Swiftproj

A command-line tool for managing Xcode project with Swift Package Manager.
Ruby
15
star
54

Meal

[40์‹œ๊ฐ„๋งŒ์— Swift๋กœ iOS ์•ฑ ๋งŒ๋“ค๊ธฐ] ์ „๊ตญ ์ดˆ/์ค‘/๊ณ ๋“ฑํ•™๊ต ๊ธ‰์‹ ์กฐํšŒ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜
Swift
15
star
55

SwinjectSafeAuto

SwinjectSafeAuto allows to auto-register services to the container and verify the required services are properly registered.
Swift
14
star
56

FastLogin

2018 FAST CAMPUS DEV SEMINAR ์‹ค์Šต ์•ฑ
Swift
14
star
57

NSOperationQueue-CompletionBlock

Completion block for NSOperationQueue.
Objective-C
13
star
58

graphql-codegen-typescript-fixtures

A plugin for graphql-code-generator that generates TypeScript fixtures for testing.
TypeScript
12
star
59

Kodium

Better Korean typo for medium.com
JavaScript
11
star
60

Estimator

Planning Poker application that communicates over BLE (Bluetoothe Low Energy)
Swift
10
star
61

Slots

Dynamic contents management for Swift.
Swift
9
star
62

MapViewVisibleAnnotations

Displays which annotations are currently visible in the specific area.
Swift
9
star
63

jira-velocity-chart-completion-rate

Displays completion rate in JIRA velocity chart.
JavaScript
9
star
64

github-monospace-editor

GitHub Monospace Editor Userscript
JavaScript
9
star
65

flask-restdoc

Flask-Restdoc is a simple tool that generates RESTful API documentation automatically from python files.
Python
9
star
66

notion-badge

Embed App Store badge in Notion
HTML
9
star
67

SwinjectFactory

Experimental Swinject extension for factory injection.
Swift
8
star
68

if_

Swift if-else statement as an expression (Experimental)
Swift
8
star
69

flask-errorhandler

Error handlers for Flask blueprints.
Python
7
star
70

shlee322-fb-troll

์ƒํ˜์ด์˜ ํŽ˜๋ถ ๊ธ€๋งˆ๋‹ค ์ผํ•˜๋ผ๋Š” ๋Œ“๊ธ€์„ ๋‹ฌ์•„๋ณด์•„์š” ^์˜ค^
Python
7
star
71

adorable

M๊™ผฬˆaฬ†ฬŽkฬŠฬˆeฬŒฬˆ tฬฬˆeฬ‘ฬˆxฬ†ฬˆt๊™ผฬˆ aฬŠฬˆdฬŒฬˆoฬ„ฬˆrฬฬˆaฬ‘ฬˆbฬ†ฬˆl๊™ผฬˆeฬ†ฬŽ
HTML
7
star
72

ModelKit

[deprecated] Experimental Model framework for Swift
Swift
7
star
73

resume

My rรฉsumรฉ
Makefile
6
star
74

Playground

A playground for an ideal project
HCL
6
star
75

Bagel

GIF converter for Mac
Swift
5
star
76

RxGitHubSearch

An example GitHub search app for my lecture
Swift
5
star
77

xcode-project-template

Swift
5
star
78

staccato

Staccato ๋ชจ์ž„ ์†Œ๊ฐœ ํŽ˜์ด์ง€
Python
5
star
79

fbmarkdown

Chrome extension that enable markdown on facebook.
JavaScript
5
star
80

JLModel

JLModel allows you to manage models in very simple way.
Objective-C
5
star
81

blog

์–ธ์  ๊ฐ„ ์“ฐ๊ฒ ์ง€?
CSS
4
star
82

TypedKey

Statically-typed key for Swift.
Swift
4
star
83

devxoul.github.io

HTML
4
star
84

Hippo-iOS

Objective-C
4
star
85

naver-cafe-chat-notification

๋„ค์ด๋ฒ„ ์นดํŽ˜ ์ƒˆ ์ฑ„ํŒ… ๊ฐœ์ˆ˜๋ฅผ ๋ธŒ๋ผ์šฐ์ € ํƒ€์ดํ‹€๋กœ ์•Œ๋ ค์ฃผ๋Š” ์Šคํฌ๋ฆฝํŠธ.
JavaScript
4
star
86

fabric-verbose

Python
4
star
87

TistoryMarkdown

A Markdown plugin for Tistory.
4
star
88

4SharedDownloader

You can download files from 4shared.com without delay.
ActionScript
4
star
89

help-me-rx-tableview-cell-height

Help me!
Swift
3
star
90

macsafe

Keep your MacBook from thieves.
Python
3
star
91

NAR

Nginx Auto Reloader
JavaScript
2
star
92

Editag

The easiest way to edit id3 tag.
ActionScript
2
star
93

ImageCrawler

JavaScript
2
star
94

ovenbreak

Utils for ovenapp.io
Makefile
2
star
95

JLChromeTabController

A chrome-like tab bar for iOS.
Objective-C
2
star
96

Evermind

Evermind is a handy tool that makes it easy to mindmap your idea from your work, study, and everyday life.
ActionScript
2
star
97

JLUtils

Objective-C
1
star
98

FastcampusFrame

Swift
1
star
99

Sonaki

Objective-C
1
star
100

Calendar

Infinite-scrolling calendar example
Objective-C
1
star