IOS Code Specification

Source: Internet
Author: User

One, the definition of method name

1. The configuration view should not be named Setxxxx, but should be called showxxxx

2. Make the button highlight should not be called showxxx, but should be called highlightedxxx.

3, pop Toastview can be used showxxx.

4, add a prefix to the URL string can be used:addhttpprefixifneeded.

5,#define TASKNAME_ACTIVATE_APP @"Task_activate_app"

Two, common code specification

1. All macros are added uniformly in the PTVSNotificationMacro.h file, ① reduce compilation speed ② avoid notification name duplication.

such as: static nsstring *const notify_gotoxytabpage = @ "Notify_gotoxytabpage";

2. A good macro definition

#define WEAKSELF __weak typeof (self) weakself = self;

#define IS_STRING_NULL (obj) (![ obj iskindofclass:[nsstring class] | | (obj = nil) | | ([obj Iskindofclass:[nsnull class]]) | | (obj.length = = 0))

IOS Code Specification

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.