摘要: class 引用类型 struct enum 值类型 如果一个A对象 从 VC1 传到 VC2,VC2对其修改, 如果A对象是 class的,VC1的发生改变, rugA对象是 struct huoz enum的,VC1的 A不改变,还是原来A的东西 阅读全文
posted @ 2016-06-15 10:40 lol挂 阅读(123) 评论(0) 推荐(0)
摘要: let words = ["ss","aa","bb","ddd"] let tweet = "this is an example tweet larking about swift sad" let valid = !words.filter({tweet.containsString($0)} 阅读全文
posted @ 2016-04-29 11:39 lol挂 阅读(161) 评论(0) 推荐(0)
摘要: 1 先把imageview添加在tableview上,注意大小位置,-150_heroBigImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"hero_bg.jpg"]]; _heroBigImageVie... 阅读全文
posted @ 2015-11-25 13:39 lol挂 阅读(2476) 评论(0) 推荐(0)
摘要: #import "UIScrollView+EmptyDataSet.h" _tableView.emptyDataSetSource = self; _tableView.emptyDataSetDelegate = self;- (NSInteger)tableView:(UITab... 阅读全文
posted @ 2015-11-12 14:02 lol挂 阅读(2259) 评论(0) 推荐(0)
摘要: var cells: NSDictionary?let path = NSBundle.mainBundle().bundlePath let plistName:NSString = "Property List.plist" let finalPath:NSStrin... 阅读全文
posted @ 2015-11-12 11:15 lol挂 阅读(338) 评论(0) 推荐(0)
摘要: 使用auto layout 来做UI,这样的话就能适配各种屏幕尺寸(size classes建议用any width,any height 这样适配的是所有的屏幕)头文件能不import就不要import文件,节省编译时间.用枚举来表示状态,选项,状态码本地如果要读取实例变量就直接调用( _var ... 阅读全文
posted @ 2015-11-10 15:20 lol挂 阅读(121) 评论(0) 推荐(0)
摘要: #import @interface UIView (StringTag)@property (nonatomic, strong) NSString *stringTag;- (UIView *)viewWithStringTag:(NSString *)tag;- (UIView *)findF... 阅读全文
posted @ 2015-11-10 10:51 lol挂 阅读(616) 评论(0) 推荐(0)
摘要: #import @interface LoadingView : UIView{ UIView *conerView;}///是否是模拟同步@property (nonatomic) BOOL isLikeSynchro;///显示加载框- (void)show;///关闭加载框- (void)c... 阅读全文
posted @ 2015-06-04 16:42 lol挂 阅读(199) 评论(0) 推荐(0)
摘要: NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; [formatter setDateFormat:@"YYYY-MM-dd HH:mm:ss"]; // 1 NSDate *date = [NSDate date]; ... 阅读全文
posted @ 2015-05-24 11:40 lol挂 阅读(333) 评论(0) 推荐(0)
摘要: vc2中:头文件1typedef void(^attentionBlock)(id sender);2@property (nonatomic,copy) attentionBlock attentionblock;3- (void)attentionwithBlock:(attentionBloc... 阅读全文
posted @ 2015-05-22 17:28 lol挂 阅读(96) 评论(0) 推荐(0)