I. Create a step
First step, creating Workspace Huanghuacai.xcworkspace
The second step: give your frame a domineering side leak name, but before the name to check the weight, to see if your name already exists, you can enter the following command on the terminal
Pod Search Name
In the third step, the framework is usually service to the application, so create a new single-View Application project in workspace.
Note: When you save, you should select the Huanghuacai that was created before this project
Create git This option do not tick
Fourth step: Create a new framework named Huanghuacai. Xcode6 has launched a cocoa Touch FrameWork, where we can select it
As with the third step, add the newly created program to the Huanghuacai workspace
The fifth step is to create a new source directory under the Huanghuacai directory, which is used to save the framework file, and a separate directory is created to facilitate the open source framework's use
Sixth, drag the Source directory to the project and take care not to select Copy
Seventh Step, new Qrcode.swift
Import uikit//1. The class is set to public class, and external access is allowed to Huanghuacai:nsobject { //2. If you want to open a method to an external call, you need to use the publicly keyword public func SayHello () { println ("Hello") } Func Saygoodbye () { println ("Bye Bye") }}
eighth step, compile the Framework and add the following code to the Huanghuacai-ios appdelegate
Let Huanghuacai = Huanghuacai () println (HUANGHUACAI) Huanghuacai.sayhello ()
Nineth Step, test
Two. Adding source code Control
~/dev/github/gitignore/" New Frame project "
Three. Summary of the framework
- After you have made any changes to the Framework, you must first compile the
- Class requires public
- The public Init constructor is required, otherwise the object cannot be instantiated by the outside world
- The method that needs to be developed needs public, otherwise the outside world cannot call
iOS create a third-party framework