simple way to build an ios framework

Creating a reusable, sharable code across different projects and deploy with Carthage

This article has minimal version iOS 8 require, because Apple allow developer create their own dynamic framework since iOS 8。

Below are some references you can dig into it。

iOS Static vs Dynamic frameworks clarifications

Building a static iOS framework is a pain in the ass

OS Environment

macOS Sierra

Step 1: Create a new framework project

Just like create a normal project.

create-framework

Then add your files into it.

Step 2: Share your framework

Make scheme sharable.

create-framework2

Step 3: Add files into your framework and finish.

First add your files into your framework then generate this framework by press commnad + B. After all, right click show in finder option with popup menu.

create-framework3

Step 4: Before Deploy

Run below code or see office guildline

1
carthage build --no-skip-current

create-framework4

Then checking the Carthage/Build folder.

create-framework5

Setp 5: Make a badge

add below into your Readme.md, it shows like Carthage compatible

1
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)

Step 6: Deploy it with private way

Deploy it to your personal git service such as BitBucketGitLabGithub….etc.

Then add private URL inside Cartfile on any of your projects.

1
echo git "Your Git URL Address" > Cartfile

create-framework6

to be continue….