UI_03 ⾃定义视图、视图控制器
⼀、⾃定义label-textField视图 自定义LTView类,封装UILabel与UITextField,实现快速创建以下类型的视图 **** 使用UIView子类实现 **** LTView.h #import <UIKit/UIKit.h> @interface LTView : UIView @property ( nonatomic , retain ) UILabel * label; @property ( nonatomic , retain ) UITextField * textField; - ( instancetype )initWithFrame:( CGRect )frame labelText:( NSString *)text placeholder:( NSString *)placeholder delegate:( id < UITextFieldDelegate >)delegate; @end LTView.m #import "LTView.h" #define fWidth frame.size.width #define fHeight frame.size.height @implementation LTView - ( instancetype )initWithFrame:( CGRect )frame