Starter: personal blog, update & error correction & reply
IOS, break the ice!
This year's technology, to iOS self-learning for the most expensive: spend thousands of dollars to buy a Mac mini computer, and buy 6 books, from beginning to end is 30 days, of course, this 30 days interspersed with DotA, sick, travel, read "Layout of the World", the history of Chu and Han, "Count of Monte Cristo", so calculate, It doesn't take much time. But it is difficult to reach the point of "breaking ice" until now.
The new operating system, the new language (C,obj-c,swift), the new IDE: structure, hotkeys, and debugging methods are different from the accustomed eclipse. So learning iOS and learning Android than, a lot more difficult, and not the technical content of the difficulty, but the peripheral problems need to be resolved, which makes people very depressed and hold your breath, for example, download Xcode, just in Xcode when the virus, the domestic network disk download all invalid, Download from official website but often inexplicably interrupted, and can not continue. The iphone4, which was purchased for iOS for more than 200 (laughs), could not be used for debugging, since the minimum version supported by Xcode is iphone4s. The source code of the book, and often because Xcode update too fast and can not be used. These things are ridiculous and pointless, but they are a waste of things and feelings-especially for people who have no income and need to borrow money from their mother.
Fortunately, these problems have passed, or become accustomed to. The choice of books, the last most satisfying is the Dongsheng "iOS Development Guide", this class-level books may be despised, but for "want to learn a new language quickly," it is necessary for the people to speak. In other words, the book most closely matches my "knowledge beginning" and "End of knowledge": What I have already, it does not speak, I do not need to be able to do things, it does not speak, I do not need to know the knowledge.
Before this book read the "IOS8 Application Development Classic", my evaluation is: useful things to say a lot, but the most people feel very refreshing point is not speaking. For example, the data store, it does not talk about the local database storage, and do not talk about remote rest interaction, which makes people feel good. Moreover, in the front suppressed a few chapters do not write HelloWorld, first of all to prepare knowledge, although it makes people feel calm and stable, but after all suppress panic.
As for the two books "Objective-c Programming" and "iOS programming" that were read before, after deciding to program with pure Swift, a little regretted spending time reading the books, but the meaning of some books is not to help you, but to eliminate your uneasiness, such as reading "OBJECTIVE-C programming"
Then, at least when you have to touch the OBJECTIVE-C code, don't be too afraid of being unfamiliar. As for the "iOS programming", the individual is very dislike, because the author's sense of existence is too strong, he is not according to the needs of the reader to plot the layout, but with his own stream of consciousness as clues, which seems very self-righteous, self-talk.
The other two "iOS development advanced" and "swifter", is written by the domestic Daniel, at present, my stage is not used, can not evaluate the good or bad, only to say that the entry stage need not rush to buy. I'll learn more about the two books before I go further.
What you need to get started is really simple:
1) Basic IDE operations, such as how to create a new project, how to debug it, how to create a new class, how to use the new class, and so on.
2) The implementation of single-interface functions, including binding the control to the controller's properties, the method of invoking the controller when the control is triggered. This two-point iOS development environment directly provides a solution that can be bundled by dragging and dropping. This allows for example, "There is an input box and a button, when the button is clicked, the button text is set to the text of the input box," The function is easy to implement.
The actual interface of the program has this requirement, that is, the program to have a variable to hold the control, when the control is triggered by invoking a method defined in the program, the method body can be maintained by the control of the variable to change the properties of the control. For example, in a Web page--
var $btn = $ ("#theBtn");
$btn. Click (function () {
$btn. Text ("XX");
});
Or, in Android, when the activity is initialized, the control is acquired through Findviewbyid, the instance property of the activity is forced to be transformed, and then the callback function (using anonymous inner class) is specified when the control fires. The function internally uses an instance property that holds the control object to alter the control's properties. These manual operations are annoying, so some IOC frameworks implement annotations to specify "control bindings" and "trigger callbacks."
"Control bindings" and "trigger callbacks" are now self-contained in iOS, and the correspondence between "interface" and "Controller class" is also enforced. In the Web page of the use of the MVVM framework, "a piece of a page" and "a certain JS object" corresponds to the Convention, but in theory, the Web page can be used in the basic JS function implementation, which has the danger of code confusion. iOS solve everything this danger in a mandatory way.
"Convention" becomes a "stipulation", which is not to deprive programmers of the freedom of the right, because "the agreement" has been a proven best practice, beyond which "freedom" is rambling unreasonable, meaningless.
3) from a single interface to a multi-interface, in a Web page, The control interface jump in the program is a method such as Request.getRequestDispatcher.forward, in Android, the use of intent, the data to be passed in the intent assignment, in the target activity from the intent value, which is similar to SERVL The Request.setattribute in ET. In iOS, opening a new interface is similar to Android, creating a new interface object and pressing it onto the top of the stack, and then pushing the object out of the stack to close the interface. However, due to the lack of intent this vector, the value can only be given directly to the target controller's properties. That is, rather than Android,ios's interface initialization function, getting the arguments that are passed is not taken from the "method entry" but from the "instance variable", which is somewhat like the difference between the Spring MVC framework and the STRUTS2 framework in the Java Web, It is not appropriate to personally feel the iOS approach (as with struts2).
Parameters are obtained from the entry parameter, and the instance variable should not be the place to place the parameter.
In addition to this manual jump, the new interface into the stack, iOS also made a common other multi-scene relationship with the implementation, such as tab tab, NAV navigation mode of the jump, this preset similar to "Syntax sugar", no it can, but it is much easier. Providing the "proven what you Need" feature as part of the base library is a sure way to make progress for all languages, just as libraries like JSON become part of the Android base library.
4) Connect to the data source. Like HTML5 and Android, iOS can also interact with a local SQLite database, and this "local persistence" requirement is of course widely available. At the same time, there are some requirements, do not need a relational database such a heavy way, only to be stored in key-value pairs, which in HTML5 (before 5 is the use of cookies), Android, iOS, of course, also provide support. These two types of support are as useful as server-side development to provide relational databases and NoSQL databases.
In addition to local persistence, interaction with the server is certainly essential, and the interactive approach to rest is the most popular. Android and iOS provide a good solution, but it is natural to use JSON Web page there is a cross-domain problem, this is a very funny thing: I provide a rest interface, who can use the client, my own website JS can also access, but other people's website JS not-- If they want to access it, they need to solve the cross-domain problem.
The above four points resolved, it can be said that "iOS has broken ice", the actual corresponding or Servlet/jdbc/ajax three technology, namely, the expression layer problem, persistent layer problem, heterogeneous system interaction problems, the three major problems, any technology, the three problems solved, the other is "icing on the cake" problem.
But in order to solve these problems, it took me one months! This includes the cost of getting familiar with the new language, the new environment, and the fact that iOS and Swift are evolving too fast for books and web materials to become obsolete.
So, starting tomorrow, we're going to start working on the iOS client for the "Think and work Studio", just like the Android client for "Think and work Studio," and I hope that when it's done, it will be more confident in iOS development.
IOS, break the ice!