English Original: Things I wish I had known before starting IOS Development-part 2
Http://www.cocoachina.com/ios/20150611/12111.html
If you haven't read the first part of this article, please read the second part first.
In the first part, I discussed some basic questions about learning iOS development. The second section will discuss some more practical issues that you will encounter when developing iOS apps.
Debugging
Undoubtedly, you will encounter many errors and anomalies in the process of developing your application. For example, you will encounter Nsinvalidargumentexception, encounter Nsinternalinconsistencyexception, and encounter the "0xfaded322" error code. Sometimes you can find the answer on stack overflow or Quora, but most of the time you have to be self-reliant.
Xcode has the ability to break breakpoints, view debugging, and log, which is the perfect choice for debug. But after all, tango, you still need to find some powerful helper for it.
1.Pony Debugger
Square/ponydebugger:ponydebugger-Use chrome Developer Tools for remote network and data debugging for your native iOS app.
Square has developed this powerful open source tool. It is a remote debugging tool, similar to the combination of a client library and a gateway server. It uses chrome Developer Tools on a Web browser to debug your app's network traffic and data storage. As a powerful network debugger, Ponydebugger allows users to view the application's network requests in real time. It also has another cool feature, which is the ability to remotely debug the core data stack for iOS apps.
2.Cocoa Lumberjack
Cocoalumberjack:cocoalumberjack-Fast, simple, powerful and flexible. It's Cocoalumberjack, a handy Mac and iOS log frame.
Cocoalumberjack, which is fast, simple, powerful, and flexible, is a good Mac and iOS log framework. If you're looking for a powerful logging tool, and you want it to have a cool feature like custom formatting, cocoalumberjack is your dish.
3.Reveal App
Runtime view debugging for Reveal:reveal-ios applications.
Although view debugging has been introduced into iOS, reveal is undoubtedly more powerful in terms of debugging details. It's a charge app, but it's definitely worth it. It has some very useful features, such as Auto Layout inspection.
4.OHHTTPStubs
Alisoftware/ohhttpstubs:ohhttpstubs-Easily stub your network requests. Test your app with virtual network data to customize response time ...
The Ohhttpstubs library can easily stub your network requests. It can help you:
Test your app with bogus network data (stubbed from file) and simulate a slow network to check the performance of your app in bad network conditions.
Obtain forged network data from the device for writing unit tests .
Data storage
Most applications may need to store data on a variety of tasks locally. Data storage is a complex topic. It has many choices, each of which corresponds to a situation. But I like a rule on stack overflow, and it's nice to use it to choose the data storage method.
If the data exactly matches the memory and is relatively unstructured, use the plist
If the data exactly matches memory and has a tree structure, use the XML
If the data does not match memory and has a graphical structure, and the application does not require additional query capability, the core data is used
If the data does not match memory and has a complex structure, or if the application requires strong query power from a relational database, use SQLite
If the data must be confidential (such as a password), use keychain.
The following lists some of the data storage aspects of the library, may be helpful to everyone.
FMDB
Ccgus/fmdb:fmdb-the wrapper of Cocoa/objective-c built around SQLite
If you use SQLite in your project, this wrapper library will make your work easier.
Ssfkeychain
Soffes/sskeychain:sskeychain-Simple objective-c Wrapper,mac and keychain on iOS can be used
To store sensitive data in your app, you must always use keychain. This library simplifies the process of using keychain data storage.
Magical Record
Magicalrecord-Easily manage core Data
Core data is very difficult to manage. This library gives you the ability to manage core Data in a comfortable way.
Internet
To make your app more interesting, you'll inevitably have to access some APIs. While iOS is doing well in support of the network, such as having nsurlsession, nsurlconnection, and nsjsonserialization, I recommend that you use the following library.
Afnetworking
Afnetworking:afnetworking-an simply astounding iOS and OS X network framework.
I think it's one of the best iOS libraries ever, and its features are more than cool. But perhaps the most important of these features is the developer community, which uses the library every day and contributes to afnetworking. Some of the hottest apps on the iphone, ipad and Mac are supported by afnetworking.
Restkit
Restkit/restkit:restkit is the framework for using and building restful Web resources on iOS and OS X.
Restkit has a well-designed API to access and build restful resources like spring breeze. If you're using core data for storage and data reading with rest service, your best choice is it-the restkit that integrates perfectly with core data.
Alamofire
Alamofire/alamofire:alamofire-swift the refined HTTP Networking.
Yo yo Spacek, swift powder do not make trouble, pancake fruit to a set. Here's what you have prepared for you. Alamofire is a sophisticated network library with some of the powerful features of Swift's exclusive capabilities.
You can also find a lot of other libraries here.
Vsouza/awesome-ios
awesome-ios--'s selection of premium iOS ecosystems, including objective-c and swift projects.
Dependency Management
I mentioned the dependency management in the previous article, but the important question to say two times! I'm going to give it a lecture here. In the project, you have three main ways of managing dependencies.
CocoaPods
Dependency Manager for CocoaPods.org:iOS and Mac projects.
Cocoapods is a dependency manager for Swift and objective-c cocoa projects. With nearly 10,000 libraries, it can help you expand your project size easily. The most effective way to manage this dependency of Ruby gems is in practice.
Google developer made a YouTube video explaining why you should use Cocoapods in your project. Laugh carefully.
Click here to watch the video: Route 85:an Introduction to CocoaPods
Github submodules
You can also use Git submodules to manage dependencies in a sub repos form in your project. The advantage of submodules over Cocoapods is that submodules are also sub-repos-not only that git and git GUIs gradually recognize and support them more, it also means that your dependencies can connect git repos and the wider world. and Cocoapods can't.
But Git Submodules also has its own problem: there are no sources of code that you rely on in your project. It just points to the sub-module library. And most of the time you're not going to take care of the library.
Carthage
Carthage/carthage:carthage-Simple, de-centralized cocoa dependency manager.
The Carthage is designed to provide the simplest way to add a framework to a cocoa application. Carthage uses Xcodebuild to build the framework binaries, leaving the integration work to the user. The cocoapods approach is simpler and easier to use, while the Carthage approach is more flexible and gentle.
Unfortunately, Carthage also has a huge flaw-it only supports iOS 8 and later .
Test
Most people yawn when they mention application testing. But if there is no test, it is unfortunate that the day your application suddenly collapsed. When you publish your app, you must first conduct a deep test to ensure that your users get the best experience.
There are a lot of test frameworks that can simplify the testing effort.
Xctest
Xctest is a unit test framework that is included in Xcode. It supports unit testing as part of the project compilation process. Xctest is highly integrated with Xcode, so it provides features such as continuous integration support and coverage testing.
KIF
Kif-framework/kif:kif-keep It Functional-ios Functional Testing Framework
KIF is the abbreviation for keep It functional. Open source from square, it is an iOS integrated testing framework. It makes it easy to automate iOS apps by leveraging its accessibility-that is, systems make it possible to access apps that can't be displayed.
Kiwi
KIWI-BDD/KIWI:KIWI-BDD for IOS
Kiwi is the behavior Driven Development library developed by iOS. The goal is to provide a BDD library that is very simple to install and use.
Quick
Test framework for Quick/quick:quick-swift (and Objective-c).
Quick is a behavioral-driven development framework for swift and Objective-c. It was developed by RSpec, Specta and ginkgo. Fighting with quick is nimble--a matching framework for testing services.
I try to talk about as many technical questions as possible in this article. After jumping into the big hole in iOS, you'll be able to use what I'm talking about. There's so much to say about iOS development, so I'm not talking about marketing. If you want to see it, then wait for my next article!
What you should know before learning about iOS development (Part 2)