12 2015 档案
摘要:OC 中单例的使用+ (instancetype)sharedManager { static id instance; static dispatch_once_t onceToken; NSLog(@"%ld", onceToken); dispatch_once(&on...
阅读全文
摘要:懒加载的格式如下:lazy var demoView: UIView = { let v = UIView(frame: CGRect(x: 0, y: 0, width: 100, height: 100)) v.backgroundColor = UIColor.redColor()...
阅读全文
摘要:didSet 的使用在 OC 中,我们通常希望在给某一个变量赋值之后,去做一些额外的操作最经典的应用就是在自定义 Cell 的时候,通过模型的设置方法完成 Cell 的填var length: Int? { didSet { timeStr = String(format: "%...
阅读全文
摘要:学了写 swift ,这里简单的列出 swift 的用法//传统的 for 循环的写法for var i = 0;i<10;i++ { print(i)}//..i 的值为0~9,不包含10for i in 0..<10 { print(i)}//...i 的值为0到10for ...
阅读全文
摘要://新创建一个类#import typedef NS_ENUM(NSInteger, XFNoticesStyle) { XFNoticesStyleSuccess = 0, XFNoticesStyleFail = 1,};@interface XFNotices : UIV...
阅读全文
摘要:在 info.plist添加以下值App Transport Security Settings Dictionary Allow Arbitrary Loads Boolean YES
阅读全文
摘要:@property (strong, nonatomic) UITextField *iPhoneText;@property (strong, nonatomic) UITextField *passwordText;@property (strong, nonatomic) UIButton *...
阅读全文
摘要:///返回键盘处理方法1此方法只能针对继承自 UIControl的子类适用-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { [self.view endEditing:YES];}方法2//添加手势方法监听键盘处理的...
阅读全文
摘要:方法1:使用 HV方式self.backImageView.translatesAutoresizingMaskIntoConstraints = NO; [self.view addConstraints:[NSLayoutConstraint constraintsWithVisualForm...
阅读全文
摘要:http://tieba.baidu.com/p/3383982183
阅读全文
浙公网安备 33010602011771号