Introduction to common modules for iOS engineering
Writing iOS programs often requires support from a number of third-party frameworks, which can significantly reduce workload and focus on the logic of the software itself.
GitHub has a lot of good third-party frameworks, and license is friendly to business. Take a look at some of the frameworks that almost every project wants to integrate.
1. Mantle
Mantle allows us to simplify the model layer of cocoa and cocoa touch applications. To put it simply, a network request is often made in the program, and the request is generally a JSON string, and we typically build a model class to hold the data. This requires that we write a series of serialization code to convert the JSON to model. This is time-consuming, error-prone, and not easy to modify. Mantle is a good solution to this problem and is easier to use.
- Github:https://github.com/mantle/mantle
- Reference: Tools: Mantle source article: mantle
- Cocoapod integration: Pod ' mantle ', ' ~> 1.5.4 '
2. Masonry
In the IB era, if you're still using the code, the absolute layout is too low. With Apple released IPhone6, IPhone 6 Plus. iOS devices will have an increasingly rich screen size, and it's not possible to make a layout based on each size. Therefore, it is necessary to use AutoLayout. In storyboard, it can be very convenient to use AutoLayout, but in order to better co-development, some companies still in the handwriting layout, frustrating is Apple provides the AutoLayout syntax obscure, Very effective (you can see the syntax of AutoLayout dynamically here). Masonry is designed to solve complex handwritten autolayout. How to use AutoLayout gracefully, and look at masonry.
- Github:https://github.com/masonry/masonry
- Reference: How to use, please see the Readme
- Cocoapod integration: Pod ' masonry ', ' ~> 0.6.1 '
3. reachability
In the era of mobile internet, there should be few applications that do not require a network connection. Monitoring network connection status is almost an essential part. Reachability can do the job perfectly.
- Github:https://github.com/tonymillion/reachability
- Reference: The use of the method is very simple, see the Readme
- Cocoapod integration: Pod ' reachability ', ' ~> 3.2 '
4. Blockskit
Blockskit is definitely the intimate companion of Objective-c, which provides a powerful block syntax support for OC classes, making it comfortable, fast, and elegant to write OC code. Anyway I was absolutely inseparable from it.
- Github:https://github.com/zwaldowski/blockskit
- Reference: Block usage summary, using block in arc, how to prevent circular referencing (ZZ)
- Cocoapod integration: Pod ' blockskit ', ' ~> 2.2.5 '
5. Kvocontroller
If you use KVO in your project, then Kvocontroller is definitely a good choice. It is a KVO enhanced framework for Facebook open source. There are several features:
- Use Blocks, custom Actions, or nskeyvalueobserving callbacks for notifications.
- No exception when Observer is removed
- Implicit observer removal from controller Dealloc
- Improve performance with nskeyvalueobservinginitial
- Thread-safe and provides additional protection when the observer recovers
Is there any reason not to use Kvocontroller?
- Github:https://github.com/facebook/kvocontroller
- Reference: Kvocontroller:facebook Open source KVO (key-value observing) tool
- Cocoapod:pod ' Kvocontroller ', ' ~> 1.0.3 '
6. Mbprogresshud
A veteran, classic notification component, if you do not specifically design the art of waiting and notification view, then use it!
- Github:https://github.com/jdg/mbprogresshud
- Reference:
- Cocoapod:pod ' Mbprogresshud ', ' ~> 0.9 '
7. Odrefreshcontrol
Many companies design their own pull-up refresh view, such as the NetEase news iOS client, drop down when there will be ads. If you just need a drop-down refresh, then consider the Odrefreshcontrol, which is the original iOS6 on the rubber candy refresh style, very interesting. Now there are a lot of big apps in use, such as shrimp music and QQ client.
Github:https://github.com/sephiroth87/odrefreshcontrol Reference: * cocoapod:pod ' Odrefreshcontrol ', ' ~> 1.1.0 '
8. Pop
Facebook is also open source. The famous pop, do animation is the perfect choice. Accept it.
- Github:https://github.com/facebook/pop
- Reference: Facebook Pop usage Guide popping (use instance of Pop)
- Cocoapod:pod ' Pop ', ' ~> 1.0.7 '
9. afnetworking
OBJECTIVE-C Network Request Library is the choice.
- Github:https://github.com/afnetworking/afnetworking
- Reference
- Cocoapod:pod ' afnetworking ', ' ~> 2.5.0 '
CommentsGit summary
Git and GitHub have been using it, but have not studied it in detail, just a few simple commands to commit to upload. These days, the company has no project, relatively busy, the principle of git and command detailed read it over.
The official Git website is http://git-scm.com/
Git Pro is a great book that covers every aspect of git in detail, and everything you encounter about git can be found on top of it. And it's free, with Chinese and English versions.
《Git Pro》
English version of online reading
《Git Pro》
Chinese version of online reading
A book is a good book, or too thick. Take time. And if you don't have any git experience, it's a lot more than just looking at the book. So I did not look at the meeting. Find another tutorial on the web, detailing the daily use of git, not verbose, is about the features that are often used in the project.
The tutorial author is 廖雪峰
. Here you can find the address of this tutorial tutorial
He also wrote a companion iOS App. Interested can also download support.
Here is a summary of the knowledge learned:
The following is from the previous tutorial mentioned above
Basic commands
- Git init: Initializing the Repository
- git add \<filename>: Add non-tracked files to staging area or add modified files to staging area
- git rm \<filename>: Remove a file from the Git tracking list
- git commit-m ' commit log ': Commit a version to Git
- git log: View all commit history
- Git status: View the status of your current git
- Git checkout–\<file>: Undo changes to working directory files
- git reset HEAD \<file>: Canceling staging
Version Management
- Git reset–hard head^: Version fallback previous version
- Git reset–hard head^^: Version fallback on the first version
- Git reset–hard head~100: Previous 100 versions of version fallback
- Git reflog: View operation record, can find all history commit
- git diff head–\<file>: command to see the difference between the latest version of the workspace and the repository
Remote Management
- git clone [email protected]:michaelliao/gitskills.git: Download the remote library
- git remote add origin [email protected]:p ath/repo-name.git: Add Remote Library Address
- Git push-u Origin master: Submitted remote Library
- git remote-v: viewing remote library information
- Git push origin branch-name: pushes a branch from the local, if push fails, first crawl the remote new commit with Git pull
- Git checkout-b branch-name origin/branch-name: Local and remote branches are created locally, and the names of local and remote branches are best consistent
- Git branch–set-upstream branch-name Origin/branch-name: Establishing associations for local and remote branches
- Git pull: From a remote crawl branch, if there is a conflict, you must first handle the conflict
Branch
- Git branch: viewing branches
- Git branch \<name>: Creating a branch
- git checkout \<name>: Toggle Branch
- Git checkout-b \<name>: Creating and switching branches
- git merge \<name>: Merging a branch to the current branch
- Git branch-d \<name>: deleting branches
- git log–graph: command to see branching merge diagram
In the actual development, we should follow several basic principles of branch management: first, the Master branch should be very stable, that is, only to release the new version, usually do not work on it; where do you work? Work on the Dev branch, that is, the dev branch is unstable, at some point, such as the 1.0 release, then merge the Dev branch to master, release the 1.0 version on the master branch; you and your little friends each work on the dev branch, Everyone has their own branch, and sometimes it's time to merge on the Dev branch.
Tag tag
- git tag \<name>: For creating a new label
- Git tag-a-M "Blablabla ..." to specify label information
- git tag-a v0.1-m "version 0.1 released" 3628164
- git tag: You can view all tags
- Git push Origin \<tagname>: Can push a local tag
- git push origin–tags: You can push all the local tags that have not been pushed
- git push origin:refs/tags/\<tagname>: can delete a remote label
- Git tag-d: Can delete a local tag
About You is the start of Dish B