iOS Control header file interpretation

Source: Internet
Author: User

Take Uitextfield to illustrate:

1.

Ns_class_available_ios(2_0) @interface uitextfield:uicontrol <uitextinput, nscoding >

@end

The contents of the middle of these two lines of content,

such as @property (nonatomic,copy) NSString *text; is the Uitextfield property that sets the text information for the Uitextfield. Other properties can be consulted by reference to the official documentation.

For Example -(cgrect) Placeholderrectforbounds: (cgrect) bounds; is the Uitextfield override method for Uitextfield customization. Other rewriting methods can be consulted by reference to the official documentation.

2.

@protocol uitextfielddelegate <nsobject>

@end

The middle of these two lines of content,

For example-(BOOL) textfieldshouldbeginediting: (Uitextfield *) TextField, is the proxy method of Uitextfield, written in the controller, This method listens when the text starts to enter, and can do some other things. Other proxy methods can be consulted by reference to the official documentation.

3.

For example Uikit_extern NSString *const uitextfieldtextdidbegineditingnotification; is an immutable string constant, is the convention commonly known as using this uitextfieldtextdidbegineditingnotification string, Nsnotificationcenter to register a uitextfielddidbegineditingnotification to implement the monitoring, other classes to send notifications, registration notification This class calls the appropriate method. Several other fixed strings can be consulted by reference to the official documentation.

iOS Control header file interpretation

Related Article

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.