How to name the Ios-learning system

Source: Internet
Author: User

Naming, not necessarily for everyone

  When I open Xcode and start writing, the name always makes me very tangled.

I think it should be a good naming habit, a good name is always pleasing to the eye.

My English is not very good so my project name is generally Chinese, easy to find quickly.

Naming variables, declaring a method I think I think of a good name.

Name an object:

Object name + type abbreviation (lowercase first letter)

The first thing to think about is what this object is for and what type it is.

First think of a Chinese name, for example, I want to name a button (UIButton) of the object, button is a Send button, so we can use SENDBNT (want to add the type of name after the abbreviation), Img,label,tableview, View, Cell, Scroll, TextField (some not suitable for abbreviations)

Create a class (capitalize first letter)

Just like creating an object, it is followed by the inheritance from

such as: Create a new view controller, followed by Viewcontroller, inside the contents of the home page can be used, Mainviewcontroller

When overriding or customizing a method:

The following are commonly used in the associated words (PS: Heard Objective-c in the method like prose)

{

[with--about] What is contained in the object

[colorwithred ...]; [Initwithtitle]; [stringWithFormat];

[for--to] get something from it [Objectforkey]; []

[get--get]

where is [at]

[By]

[did--past] something that has passed, that happened after the end of the event

[will--will] execute earlier than did method

}

If you want to let yourself write something tall, or learn more English, or you can only be named AAAAA or BBBBBB

Next add ...

How to name the Ios-learning system

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.