摘要: 首先,在正式使用Masonry之前,我们先来看看在xib中我们是如何使用AutoLayout 从图中我们可以看出,只要设置相应得局限,控制好父视图与子视图之间的关系就应该很ok的拖出你需要的需求。这里就不详细讲解具体拖拽的方法..... 然后,我们按着上图的属性来看看如何简单得使用Masonry 这 阅读全文
posted @ 2016-12-23 11:48 D-Ben 阅读(315) 评论(0) 推荐(0) 编辑
摘要: ReactiveCocoa 是一个框架,它允许你在你的iOS程序中使用函数响应式(FRP)技术。加上第一部分的讲解,你将会学会如何使用信号量(对事件发出数据流)如何替代标准的动作和事件处理逻辑。你也会学到如何转换、分离和组合这些信号量。 在这里,也就是第二部分里,你将会学到更多先进的Reactive 阅读全文
posted @ 2016-12-23 11:31 D-Ben 阅读(191) 评论(0) 推荐(0) 编辑
摘要: 作为一个iOS开发者,你写的每一行代码几乎都是在响应某个事件,例如按钮的点击,收到网络消息,属性的变化(通过KVO)或者用户位置的变化(通过CoreLocation)。但是这些事件都用不同的方式来处理,比如action、delegate、KVO、callback等。ReactiveCocoa为事件定 阅读全文
posted @ 2016-12-23 11:29 D-Ben 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 导入头文件:#import "Reachability.h" 然后将 SystemConfiguration.framework 添加进工程: 1、检查当前的网络状态(wifi、WAN还是无网络) NetworkEnvironment.h: NetworkEnvironment.m: 调用方法: 2 阅读全文
posted @ 2016-12-23 11:25 D-Ben 阅读(699) 评论(0) 推荐(0) 编辑
摘要: 1、模拟器沙盒目录文件都在个人用户名文件夹下的一个隐藏文件夹里,中文叫资源库,他的目录其实是Library。因为应用是在沙箱(sandbox)中的,在文件读写权限上受到限制,只能在几个目录下读写文件:Documents:应用中用户数据可以放在这里,iTunes备份和恢复的时候会包括此目录tmp:存放 阅读全文
posted @ 2016-12-23 11:20 D-Ben 阅读(225) 评论(0) 推荐(0) 编辑
摘要: BMKMapPoint point1 = BMKMapPointForCoordinate(_userGps); BMKMapPoint point2 = BMKMapPointForCoordinate(CLLocationCoordinate2DMake(latitude, longitude) 阅读全文
posted @ 2016-12-23 11:18 D-Ben 阅读(209) 评论(0) 推荐(0) 编辑
摘要: - (CLLocationCoordinate2D)hhTrans_GCGPS:(CLLocationCoordinate2D)baiduGps { const double x_pi = 3.14159265358979324 * 3000.0 / 180.0; CLLocationCoordin 阅读全文
posted @ 2016-12-23 11:17 D-Ben 阅读(188) 评论(0) 推荐(0) 编辑
摘要: CLLocationCoordinate2D coor = CLLocationCoordinate2DMake(latitude, longitude);//原始坐标 //转换 google地图、soso地图、aliyun地图、mapabc地图和amap地图所用坐标至百度坐标 NSDictiona 阅读全文
posted @ 2016-12-23 11:16 D-Ben 阅读(580) 评论(0) 推荐(0) 编辑
摘要: - (void)drawRect:(CGRect)rect { UIBezierPath * path = [UIBezierPath bezierPath]; [path moveToPoint:CGPointMake(fView_Width(self)/2., 6*DX_Proportion)] 阅读全文
posted @ 2016-12-23 11:12 D-Ben 阅读(2175) 评论(0) 推荐(0) 编辑
摘要: + (NSString *)formatterDate:(NSNumber *)desDate WithDateFormatter:(NSString *)formatter{ NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] ini 阅读全文
posted @ 2016-12-23 11:09 D-Ben 阅读(739) 评论(0) 推荐(0) 编辑
摘要: + (CGFloat)achiveWidthAttrString:(NSAttributedString *)attrString withHeight:(CGFloat)height { CGRect desRect = [attrString boundingRectWithSize:CGSiz 阅读全文
posted @ 2016-12-23 11:08 D-Ben 阅读(813) 评论(0) 推荐(0) 编辑
摘要: - (BOOL)isUrlString { NSString *emailRegex = @"[a-zA-z]+://.*"; NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailReg 阅读全文
posted @ 2016-12-23 11:07 D-Ben 阅读(2997) 评论(1) 推荐(0) 编辑
摘要: + (BOOL)stringContainsEmoji:(NSString *)string { __block BOOL returnValue = NO; [string enumerateSubstringsInRange:NSMakeRange(0, [string length]) opt 阅读全文
posted @ 2016-12-23 11:06 D-Ben 阅读(990) 评论(0) 推荐(0) 编辑
摘要: /*** MD5 ***/ #define CC_MD5_DIGEST_LENGTH 16 /* digest length in bytes */ #define CC_MD5_BLOCK_BYTES 64 /* block size in bytes */ #define CC_MD5_BLOC 阅读全文
posted @ 2016-12-23 11:04 D-Ben 阅读(865) 评论(0) 推荐(0) 编辑
摘要: - (CGFloat)achiveWidthWithHeight:(CGFloat)height Font:(UIFont *)font { CGSize size = [self boundingRectWithSize:CGSizeMake(MAXFLOAT, height) options:N 阅读全文
posted @ 2016-12-23 11:02 D-Ben 阅读(164) 评论(0) 推荐(0) 编辑
摘要: CGFloat fView_Height(UIView *aView) { return aView.frame.size.height; } CGFloat fView_Width(UIView *aView) { return aView.frame.size.width; } // x方向的比 阅读全文
posted @ 2016-12-23 10:58 D-Ben 阅读(159) 评论(0) 推荐(0) 编辑
摘要: - (void)show { [[UIApplication sharedApplication].windows[0] addSubview:self.projectView]; CGRect frame = self.projectView.frame; frame.origin.y = fVi 阅读全文
posted @ 2016-12-23 10:50 D-Ben 阅读(3039) 评论(1) 推荐(0) 编辑
摘要: static UIWindow *topWindow_; static UIScrollView *scrollView_; /** * 显示顶部窗口 */ + (void)show { dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t 阅读全文
posted @ 2016-12-23 10:46 D-Ben 阅读(812) 评论(0) 推荐(0) 编辑
摘要: 在iOS 9中,新iPhone将第三维度添加到了用户界面。 用户现在可以用力摁下主屏按钮来快速调出应用提供的功能菜单。 在应用中,用户现在可以用力摁下视图以查看更多内容的预览并且快速访问一些功能。 用户现在可以用力摁下主屏按钮来快速调出应用提供的功能菜单。 在应用中,用户现在可以用力摁下视图以查看更 阅读全文
posted @ 2016-12-23 10:44 D-Ben 阅读(676) 评论(0) 推荐(0) 编辑
摘要: 一、概要 iOS开发时,项目中会引用许多第三方库,CocoaPods(https://github.com/CocoaPods/CocoaPods)可以用来方便的统一管理这些第三方库(从一个坑出来,又进了另一个坑而已……)。 二、安装 由于网上的教程基本都大同小异,但细节之处还不是很完善,所以借机会 阅读全文
posted @ 2016-12-23 10:36 D-Ben 阅读(219) 评论(0) 推荐(0) 编辑