Apple version App development experience

Source: Internet
Author: User

These months of work, including Web development, Android app development and Apple app development, the first two languages are familiar with the Java, so Apple knowledge learning, more than the learning of Android knowledge, more than the "language base" piece, other similar.

Before I sent the Android article, like interested, poke my name to see it.


0. Language Basics

Last year, when I bought a Mac to start learning iOS programming, we used Swift, which was objective-c (OC) this year.

The internet has a comparison between OC and Java blog, in fact, object-oriented languages, the ability is similar, mainly in different ways. OC is the biggest special, when calling the method in brackets, I feel this is ugly and weird, but the idea is to let each parameter's meaning in the code is directly present, in addition to the use of brackets also no other good way.

property is supported by the point symbol call, seemingly directly to the field to write, assign value, the actual call is the Getter/setter method, like a JSP write El expression, such as a certain point, the actual call is getter.

Before looking at C code, the strangest thing is the relationship between H file and M file, and the way of reference, not like Java, a public class declaration, import each other, think abstruse mysterious, deep not knowledge. In fact, just a fixed notation, H declares some public methods, m implements these methods, and can declare some private methods, a bit like the Java Interface Declaration and implementation Class (Xximpl), but OC corresponds to the concept of "interface" is "protocol", with prototype declaration, indeed, with " Agreement "more image, it would have been to the realization of the ability, like the Java Declaration interface is often called"xxable"."

Other basic syntax is not redundant, similar to the Java function, just a change of appearance, referring to the "objective-c programming" "Objective-c Advanced Programming" "Effective Objective-c" three book is very good. More noticeable is the "objective-c advanced Programming," the three main themes, namely "automatic reference count""blocks" and "gcd" the three major syntactic sugars, presumably corresponding to Java memory Recycling reference count knowledge, Java using anonymous inner class implementation callback function, Java in particular, the Android to write cross-threading code three topics, in the latter two aspects, the old Java is really slightly clumsy, OC syntax sugar is very convenient. However, I compare the soil, JAVA8 has not been studied, it is not clear how easy the grammatical sugar. (Be free to study the supposedly convenient concepts of java8, Scala, groovy)

1. Development environment and reference materials

Reference, because the learning FQ time is short, most of the time with the main reference book is a few books at hand, a translation of a foreign book by me to the bed decided not to look, very dissatisfied, "iOS Development Guide" and "IOS9 Development Guide" The two people post and Telecommunications publishing house books I like. The introduction of translation books, some authors "self-awareness" overweight, not according to the knowledge system, sub-level arrangement chapters, but according to their own wishful thinking "stream of consciousness" arrangement, forcing the reader to follow his ideas, and he arranged the order, not the system structure, basic knowledge, the most core common skills in the important position, but " Anyway, I'm the boss of my book ", to put some very marginal knowledge, in its basic knowledge has not yet confessed to the circumstances of the hasty proposed, lack of basic knowledge is not understood at all, even if the effort to understand it is not much use. I always think that maybe the people in the bones understand Lao Tzu "after the body and body first" teachings, more know to put themselves in a secondary position, to the reader's brain as the goal, the knowledge well carding arrangements, as far as possible to send readers to the brain, so as to "meet the needs", readers like, sales natural Good, "name" and "Naturally comes with it. Rather than being present, the reader is strongly ordered to follow him. But the words can not be said, "IOS8 application Development classic" is quite good, and I read a lot of foreign books are very good (earlier written personal book), which is limited to some "positioning in the introductory book but the small white very unfriendly" book dissatisfaction.

Say more, and then the story, the above four books are bought last year, "swifter" "iOS Development Advanced" and "OBJECTIVE-C programming" also. The last grammar book, very carefully read the necessary, important points are basically mentioned, but did not write code to see some knowledge may be difficult to understand, while writing code side often read it is good, "objective-c advanced Programming" and "effective objective-c" was bought the day before yesterday, The thin is surprising, but the content is good, the former said "three grammar sugar", not much, the latter as long as read "effective Java" or "effective Javascript" naturally will be born with goodwill (C + + that I did not read, estimated also very good, this is " Brand effect "), open look, sure enough are some of the best practice recommendations, like the Bible in the proverbs, gently read a, you can get, familiar taste. In addition, the day before yesterday also bought this "IOS Auto layout Development Cheats", before the layout in the storyboard, the constraints on the control let me hurt the brain, do not know what information to reference, had to grope, with this book, you can strengthen a bit.

Above said is the book, later looked crossing net document, feels very good, although my English reading ability is not very strong, but with the Youdao dictionary to take the word plug-in reading up reading effect can also. The advantages of the official website is authority, new, concise and accurate, reasonable arrangement, which is better than all the aspects of books, so many people say that with the official website documents do not have to buy books, not unreasonable. But the official website documents so many, with which "catalogue" Does the Panorama survey, what "order" does the reading study? "Search box" emergency can, can be piecemeal (but this does not seem to be as good as Google + StackOverflow), but as " System Learning "The starting point is too out of order and context, a reading order on the Internet post, a bit outdated, although original aim, but unfamiliar with the document novice, when" million change "after the occurrence, how to" do not leave the Pope "? The author did not say. Finally found the most honest official website Document Entry page http://developer.apple.com/develop/is good, tutorial do the navigation map, API to do a dictionary, use the former to find specific technical topics, using the latter to understand the different types of library functions, interspersed learning for a period of time, will be able to grasp the important knowledge.

In addition to books and documents, open source application is also a good learning object, because it is fresh, in the simulator can run directly, but also to change the code to see the effect, the next breakpoint to see the mystery. I use the source code of the iOS client in China. Read the source code, I am accustomed to the method is the first time to overview, read-through, regardless of 3,721, reading will go down, not too thin, do not open the simulator, in the most basic linear order, the whole project of the codes over again (of course, some of the package class of the same technology, only the difference between the business, you do not Then the second time, open the simulator (if it is a Web application is running the application to open the browser), focus on the context of specific functions, understand the interface display and response when the code execution process, the object and the object is how to organize, the class of the parent class is how to encapsulate, focus on the flow process, As for the use of specific third-party or base class libraries, method calls, subtle algorithms, if you feel able to learn something, see also can, do not look also okay. It is important to observe the structure of the sub-modules in the source code, the function of the flow of response, which is the "trunk" and the main "branch", as for the specific fine branches and leaves, temporarily ignored can also.

Development tools Xcode, I am now not familiar with it, fortunately, the part of the code will be the basic typing, copying, pasting on the line, more advanced use, when it feels "xcode estimate has this function", to Google search on the line, Xcode use, "IOS9 Development Guide" Very simple introduction is very practical, the official website has more detailed tutorials (not yet see), "iOS development advanced" gives some useful tools (still useless), feel plus search engine, there is no problem. It is important to be skilled, "工欲善其事".

2. Page Knowledge

Page knowledge two main points: first, in a single page, the use of components and constraints, the second is the collaboration of multiple pages.

In a single page, the basic components are added to the page the simplest, drag-and-drop, binding to the controller variable, and binding response method is also very simple, while opening storyboard and controller, drag. Because the "controller holds the control" and " The controller provides the response function "is the interface programming (and regardless of the life of the MVC or MVVM bar) rules, so Xcode directly implemented with the IDE, and not like Android, but also with the third-party IOC framework, or angular as a manual declaration. Of course, if you prefer the mouse movement and the left and right click, as well as the use of keyboard combinations, like "code" rather than " It is also possible to manually write code to declare a Component object and add it to the controller's view, or even manually add a constraint. Just, this, compared to drag to drag, the workload is much too much, so when to use the code, when used to drag, it will be based on the structure of the group and the characteristics of the project, for me personally, because the single fight, but also novice, so both try to learn in practice.

Components can be customized, which is of course, like Android, provides a callback method in which you can declare a component class by drawing your own custom style from the canvas. Not much to say.

Using constraints, about the relativelayout of Android, relative layout, in the layout of the page is not position:relative but absolute, out of the document flow. Manually specify who is on the left, who is on whom, and how far away. But this method, is always "the" "the" the first, the first left after the right linear layout, that is, the document flow in the HTML, Android in the Linearlayout,ios how to implement? Look at the code of Open source China, open a vision, with tableview achieve linearlayout effect, specify the first row cell should be what, the second line should be what. However, this is similar to the old HTML in the table layout, the HTML table layout has long been discarded, do not know iOS, tableview when the use of LinearLayout, is not the mainstream, or there is a better solution, need to continue to study.

Multi-page collaboration, the most commonly used is nothing more than the basic pop-up, advance navigation, label switching three kinds, in addition to basic pop too basic, advance navigation and tag switching has also been provided with the native support. Android tags on the bottom, but also need to implement manually, iOS directly drag-and-drop, but iOS navigation navigation also to be placed on the storyboard, Android relatively simple, the reason is that the Android phone comes with a back button, so "forward" Back "is justified, while iOS can only show buttons in the title bar to point. Compared to the Web page, the main jump in the page is of course forward and backward, into the stack, and "tab" in the Web page as a local control embellishment, and the app's "tag" is actually the page's "menu", but the Web click menu, in fact, is generally also " Forward ", in addition to the trendy pages of Opoa, and the old iframe nested pages outside. But the app's tag switch is basically equivalent to IFRAME.SRC assignment.

3. Data Knowledge

The app's data knowledge is nothing but two points, one is local storage and the other is rest interaction.

Local storage, divided into direct write files, write key value pairs, write database three kinds, have basic implementation, not much to say.

Rest interaction, self-or third-party has a convenient library, according to supply and demand, basic needs must be convenient to supply, nor need to say much.

4. Practical Experience

In fact, the Apple version of the app is not online, this experience is still to be added.

function realization, basically interface knowledge and data knowledge combined is equal to everything, in front of the formula of Android.

Third-party dependence, but also has the fact that the standard, not much to say.

Login logic, like the Android logic, just different platform specific code differences, not much to say.

The app is HTML-embedded and not actually used.

5. Personal Impressions

I don't like OC, I hate the way curly braces are called, and I don't think it's necessary to show the meaning of each parameter.

But not only with Swift, Java development Although SSH is the mainstream, directly with the servlet is rare, but the basis of the servlet is the security and confidence and source.

Moreover, it is said that Swift also inevitably uses the OC's legacy class, hiding always can not escape.

Perhaps after OC becomes familiar, will the code of C and C + + be more familiar?

Object-oriented language, encapsulation inheritance polymorphism, original aim, have interface programming, State event response, is the immutable rule. MVC and MVVM? Is the difference as big as you think?

The more you do the application will feel barren, feel in the same place for a round, so-called language switching, to get through the whole stack, but also today to eat an apple, tomorrow to eat a pear transformation, change to change is the same.

Back, after graduating a few years later, back to learn the principles of computer composition, operating system, data structures and algorithms, network. In the past few years, I have studied design patterns, refactoring, software engineering, and language frameworks.

The ocean of the computer, vast boundless, programming language and application domain, as well as concrete product, actually are the object, the internal strength is powerful, use what moves, take what language, can tiger wind. Gentleman without a device.

But the internal strength, perhaps is the philosophy, understands the world to run the way, can in the procedure better simulates. (Example: Object-oriented)

Perhaps it is psychology that understands the habits of the user's life in order to be better able to help in design.

Perhaps the logical ability and the way of thinking, with better communication skills, with colleagues, users, customers produce high-quality communication, and exchange, is the product of this.

may be FQ ability, English level, search engine use ability, reading ability, writing ability.

All of this is important, but we always ignore it.

"No matter what else, now start writing code, there is a problem," Baidu "a bit!" 」

How many times in this way, in the tactical diligence, day after day overtime, like pulling the same in-situ spinning, self-thought to do a lot of work, but actually no progress.

It's a lot of time to step back and think strategically about what you're going to do for the next five or five years.

What we want to develop is the habit of laying out our own life.

"With the son to survive, rather than to abandon the son and take the potential," the value of things, not necessarily to do, so-called "values", so-called "trade-offs", all contain the part of the value of the discarded things.

And our most valuable is that time, done this, can not do that, in economics, this is called "opportunity cost".

If we want to, in the lifetime, in the world to play a piece of their own heaven and earth, then what should we prepare now? This is the key to the problem.

Do not pull the mill to rise, sweating every day overtime, earn a twenty thousand or thirty thousand a month to be satisfied. Is this really the value of your youth?

At this moment, the fool around you is envy envy hate, or underestimate, really does not matter, you live not to give them to see.

This write iOS, very small white, basically no value, if there is value, is here a few words of discussion.

I hope to see a friend of the programming here has inspired.

Because we know that many of our friends will be able to drill into the code of Ecstasy, which is good, can let the coding ability soar, but at the same time, may forget to take a step back to see the sky.

Don't use tactical diligence to conceal strategic laziness.

Think about it a lot.

Discard small take big.

Layout life.

Apple version App development experience

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.