Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


IOS Develop Framework(Sagittarius 射手座:IOS下的一套基础快速开发框架)


IOS Sagit框架 :QQ群:702724292

One: The cause of creating the Sagit development framework:

I remember that when IT started the business, I recruited an IOS girl to do development, and then:

----------The accident of the girl started here -----------

1: Interview: There are works, attitude is good, I feel that I should be able to do something.

2: Just recruited: I found the article reading every day, but I didn't see something late.

3: Process Q&A: What are you doing now? The answer is in the framework.

4: Found the crisis: accidentally saw her knocking the keyboard with a single finger, I feel bad.

5: Dealing with the crisis: IOS, after a week, after reading her code, talk Over!

---------- The girl’s accident ended here -----------

In the fast learning IOS, I quickly scanned a lot of training video tutorials and found that the routines are very primitive.

These primitive routines can be understood, but if these come to the project, it will endless harm.

According to the cost of starting a business at the time, the people who came with a high probability were the following three types:

1: Just got out of the training class;

2: Just finished watching the training video;

3: Just skipped after a project with a training video.

In order to be bound by the next developer:

Let a friend with 3-4 years of development experience help the whole frame.

After reading his entire framework, I found that it was just a regular tool class folder.

Give him a request to repackage one of the network requests.

Looking back, although there are improvements, it is still not my intention.

Maybe you can guide to continue to improve, but not with me, not with him.

So I did it myself: when the framework was roughly 60% complete, I recruited a male developer.

----------The boy’s accident started here-----------

In order to catch up with the project, the newcomers started on the basis of the framework.

Given that newcomers can get something, plus the help of a frame, they will be handed.

Due to the imperfection of the frame and the incomprehension of the frame, a small pit is encountered.

There are more spit, and I can only agree that he is mixing the other frames together.

Later, there were countless pits and flashback accidents.

Early attention to IT and the use of IT even the App's children's learning, it is clear.

Or it should be sensible in my previous IT series of entrepreneurial articles.

Now, he is over!

----------The boy’s accident ended here-----------

After re-taking back to IOS, I found that the code logic is also a squad. Fortunately, some of the previous ones still follow the framework.

It took me more than a week to understand and start refactoring the code for the entire project.

At the same time, the existing dependencies of the framework were also removed, and the framework was re-reconstructed.

At present, the reconstruction of the framework has been carried out 70%-80%, and some functions have not been added.

But the whole does not affect the basic functions, so it is time to share the Sagit framework with everyone!

Two: Name the frame:

Since the name of the CYQ.Data framework has been squandered by everyone, the subsequent framework naming has become particularly painstaking.

After studying the English names of planets, constellations, fruits, plants, animals, colors, shapes, etc.

Finally: Aries (DreFrame. For DotNet),

There is again: Taurus.MVC For DotNet

After that: Gemini.workflow For DotNet workflow engine is currently difficult to produce (written at the beginning, and later no time to toss).

Therefore, getting together the Golden Zodiac and calling Athena will become the most mysterious task for me to come to Earth!

This leapfrog was selected: Sagittarius (shooter)

The first is the prefix of ST's prefix just right for the name of the current startup company: with the sky.

Second, take the first half to make the name of the frame, shorthand: Sagit (pronounced: shooting the sun, very harmonious found that there is wood)

Three: The applicable scenario of the framework:

1: Research study:

A: After a few years of work, development is no longer a problem and requires a bit of new thinking to break through the limited bottleneck.

It is not difficult to understand the framework code, mainly to learn thinking, think more, and train yourself how to write.

B: For teachers in the training industry, you can use the framework of thinking to guide new people before the end of training, and then let them out.

2: Project development:

A: Developers don't have the concept of a framework.

B: There are currently no other alternative frameworks.

In general, in addition to games, other regular projects are suitable. 


The following is a brief introduction to the framework, which can only be briefly introduced:

Sagit Innovation One: Simple Relative Layout Syntax

1: Unified standard parameters, self-adapting to the phone screen, and implementing AutoLayout.

A: The frame defaults to the IPhone6 ​​pixel as the standard reference system: 750*1334.

B: When developing, the standard pixel unit is used as a parameter.

C: When running, it will automatically adapt to the corresponding proportion of parameters.

(PS: If you need to modify the standard, you can modify the definition in the STDefineUI.h file)

Look at the parameter annotations given by the UI, and easily layout:

2: Concise relative layout syntax, one line

Take the above picture as an example, do layout

A: Relative to the layout of the parent element Logo:

[[[[self addImageView: @" login_logo " ] width: 170 height: 170 ] relate:Top v: 288 ] toCenter:X];

B: Relative to the layout of fixed elements, the following line of code refers to other places:

[[[[self addImageView: @" icon_verify " ] width: 48 height: 48 ] onBottom:pwdIcon y:26] toCenter:X];

3: Partially refreshable layout

The following line of code re-predicts the relative layout of the subview of the approved view.

[self refleshLayout];


Sagit Innovation 2: Completely separated View and Controller

I remember a long time ago, I wrote an article: Objective-C iOS pure code layout a bunch of code can be put here!

At that time, it was only a prelude to the study, and did not achieve complete separation. Of course, it is solved now.

For example: a text box with a button, click the button to pop up the contents of the text box.

In the previous practice, you would write a bunch of UI-related creation methods in the Controller, or you need to define some UI as global variables, so as to get the UI values ​​later.

Worst is the end of the hand that I left before I finished: (The red one below, you need to define a specific LoginView variable in the Controller)

Ok, now this problem has been completely solved by me, 0 invasion has become a fact, look at the sample code below:

LoginView's code: created a text box and a click button

@interface LoginView : STView // This is LoginView.h


@implementation LoginView // This is LoginView.m -( void )initUI { [[self addTextField: @" userName " placeholder: @" Enter the phone number " ] x: 0 y: 0 width: 100 height: 100 ]; [[self addButton: @" btnLogin " title: @"login" ] onRight:self.lastSubView.PreView x: 10 ]; } @end

LoginController code: There is a button event, get the phone number username and pop up to prompt

@interface LoginController : STController // This is LoginController.h


@implementation LoginController //This is LoginController.m

    NSString* userName=[self uiValue:@"userName"];
    [ prompt:userName];


self.window.rootViewController = [LoginController new ];

Effect: (For the screenshot, deliberately created a new demo...)


There are no references to each other in the two file codes of LoginView and LoginController.

But the UI and events are magically related. How did this happen?

The secret is in the source code of the STView and STController files.

Sagit Innovation 3: Automat


IOS Develop Framework(Sagittarius 射手座:IOS下的一套基础快速开发框架)







No releases published


No packages published