自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

CG-L 的技术博客

Stay Hungry,Stay Foolish.

  • 博客(633)
  • 收藏
  • 关注

原创 What's new in iOS11?

原文链接:https://developer.apple.com/library/content/releasenotes/General/WhatsNewIniOS/Articles/iOS_11_0.html#//apple_ref/doc/uid/TP40017637-SW1iOS 11.0本文总结了在主流iOS设备运行的iOS11中与开发者相关的关键特性。本文同时列出了详细描述新特性的相关文

2017-09-25 16:04:28 1322

原创 我遇到过的 iOS 面试题(swift)

8、UInt8、UInt16、UInt32、UInt64的最大值分别是? 7、写出比下方更有效率的算法?var a = 3for _ in 0..<100 { a = a * 2}6、CChar实质是哪个类型? 5、swift函数参数设置成引用传递类型的标签是? 4、在 swift调用c 函数最少需要哪几个文件? 3、类与结构(应该是结构体?)最突出的区别特性是? 2、现有一个

2017-02-12 22:05:52 2966

原创 我遇到过的 iOS 面试题(Object-C)

2、 1、描述一下UIViewController的生命周期,从ViewController2返回到ViewController时,ViewController会执行哪些方法?

2017-02-11 08:55:30 1990

原创 iOS 转跳到 AppStore 为应用评分

方法一:直接跳到商店NSString *str = [NSString stringWithFormat:@"itms-apps://itunes.apple.com/app/id1071190903"];[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];方法二:加载一个商店控制器//自定义方法- (v

2017-01-09 23:03:10 497

原创 再次封装 AFNetworking

#import <Foundation/Foundation.h>#import "AFNetworking.h"typedef void(^NetworkingSuccess)(id response);typedef void(^NetworkingFail)(NSError *error);@interface NetworkingTools : NSObject+ (void)post

2017-01-09 22:17:24 470

原创 OC 创建枚举,创建单例,文本中划线(富文本)

//NS_ENUM,定义状态等普通枚举 typedef NS_ENUM(NSUInteger, TTGState) { TTGStateOK = 0, TTGStateError, TTGStateUnknow }; //NS_OPTIONS,定义选项 typedef NS_OPTIONS(NSUInteger, TTGDirection) { TTGDirectionNone =

2017-01-09 22:12:32 494

原创 CGContextRef普通用法

//1.获得上下文 CGContextRef ctx = UIGraphicsGetCurrentContext(); CGContextSaveGState(ctx); /*================ 画圆 ================*/ CGContextAddArc(ctx, self.center.x, 30 + radius, radius,

2016-10-29 13:52:12 507

原创 用 Charts 绘图表框架制作统计图

集成 Charts 框架:http://www.th7.cn/Program/IOS/201610/978760.shtml 还要另外集成 Masonry 框架使用举例:折线图:@interface LineViewController ()<ChartViewDelegate>@property (nonatomic,strong) LineChartView *LineChartView;

2016-10-10 16:50:33 1899

原创 示例:在项目中写一个FMDB 的封装类

#import #import "FMDatabase.h"@interface FMDBManager : NSObject@property (nonatomic,retain)FMDatabase *dataBase;//建购物车的表- (void)createShopCarTable;//加对象- (BOOL)insertShopCar:(CGGoodsListBasic

2016-09-09 09:49:19 484

原创 实用知识:将系统相册的导航栏颜色改为白色

#pragma mark 相机白色navigation- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated { [[UINavi

2016-09-03 08:09:20 880

原创 工具类:自写一个简单的图片浏览器(LCGPicBrowser)

@property (nonatomic,strong) NSMutableArray *images;@property (nonatomic,strong) UIScrollView *scrollView;@property (nonatomic,strong) UILabel *countLB;#pragma mark - 点击图片放大//点击显示大图- (void)clickToB

2016-09-01 22:30:55 577

原创 工具类:计算距离现在的时间:刚刚/几分钟前/几小时前/几天前/几个月前/几年前

//计算距离现在的时间+ (NSString *)compareCurrentTime:(NSString *)str { //把字符串转为NSdate NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@"yyyy-MM-dd HH:m

2016-09-01 21:54:15 1205

原创 工具类:自定义 pickerView

@property (weak, nonatomic) IBOutlet UIButton *constellationBtn;@property (nonatomic,strong) UIView *pickerMainView;@property (nonatomic,strong)UIPickerView *pickerView;//自定义pickerview@property (non

2016-08-30 22:28:23 412

原创 实用知识:修改文字间距、行距

NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:@"Using NSAttributed String,try your best to test attributed string text"]; [str addAttribute:NSForegroundColorAttr

2016-08-27 08:32:07 717

原创 工具类:压缩一张图片

#import <UIKit/UIKit.h>@interface UIImage (compressImage)//对图片尺寸进行压缩--+(UIImage*)imageWithImage:(UIImage*)image scaledToSize:(CGSize)newSize;@end#import "UIImage+compressImage.h"@implementation UIIm

2016-08-27 08:25:41 521

原创 工具类:计算一串字符串的宽高

#import <Foundation/Foundation.h>@interface NSString (StringSize)/** *返回值是该字符串所占的大小(width, height) *font : 该字符串所用的字体(字体大小不一样,显示出来的面积也不同) *maxSize : 为限制改字体的最大宽和高(如果显示一行,则宽高都设置为MAXFLOAT, 如果显示为多行,只需将宽

2016-08-27 08:24:45 490

原创 js 调用 oc 方法来发起微信支付

//首先创建JSContext对象、获取当前JS运行环境 JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"]; //将我们的context对象与js方法建立桥接联系,相当于监听 js 中名为“wxpay”的方法,在 Block 中

2016-08-20 11:37:50 871

原创 用 webView 加载 html 字符串代码来显示图片

核心代码句:[self.webView loadHTMLString:[NSString stringWithFormat:@"<此处填写要加载的路径或者地址>"] baseURL:nil];给 html 字符串代码添加字符,可以用替换的思想进行添加//此 html 代码中原有的语句是:“/images/upload/Image/asdfasfdasdfpic.jpg”,我们要加上“http://w

2016-08-20 11:27:46 1550

原创 用 PNChart 做统计图

用 cocoapod 下载图表库:pod “PNChart”#import "ViewController.h"#import "CorePlot-CocoaTouch.h"#import "PNChartDelegate.h"#import "PNChart.h"#define ARC4RANDOM_MAX 0x100000000@interface ViewController ()<P

2016-08-20 11:18:37 1907

原创 一个带有 PlaceHolder 的BRPlaceholderTextView

#import <UIKit/UIKit.h>@interface BRPlaceholderTextView : UITextView@property(copy,nonatomic) NSString *placeholder;@property(strong,nonatomic) NSIndexPath * indexPath;//最大长度设置@property(assign,nonat

2016-08-10 22:02:10 1234

原创 关于sqlite 语句的摘录(结合 FMDB)

//创建管理类NSString *HomePath = [NSString stringWithFormat:@"%@/Documents/Message.db",NSHomeDirectory()]; self.dataBase = [[FMDatabase alloc]initWithPath:HomePath]; [self.dataBase open];//打开表NSSt

2016-08-10 21:58:21 277

原创 JPush 的一些总结

前几天做了一个 JPush 的 demo,这里记录一下关于推送的知识点: 1、要设置标签和别名(注册DeviceToken后再设置)[JPUSHService setTags:[[NSSet alloc]initWithObjects:[NSString stringWithFormat:@"100"], nil] aliasInbackground:@"100"];2、在控制器拿到收到的推送通知

2016-08-10 21:49:47 483

原创 功能类:二维码扫描(相机扫描,相册扫描)

#import <UIKit/UIKit.h>@interface SaoMiaoViewController : UIViewController@end#import "SaoMiaoViewController.h"#import <AVFoundation/AVFoundation.h>#define IS_VAILABLE_IOS8 ([[[UIDevice currentDevic

2016-07-18 22:15:16 640

原创 功能类:一个微信小视频的录制类与播放类

#import <UIKit/UIKit.h>@interface CameraViewController : UIViewController@end#import "CameraViewController.h"#import <AVFoundation/AVFoundation.h>#import "ViewController.h"#import "PlayerViewControl

2016-07-18 22:10:13 957

原创 按钮文字倒计时效果

// 开启倒计时效果(将此方法在按钮点击事件中执行)- (void)openCountdown { //倒计时时间 __block NSInteger time = 59; dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); dispatch_s

2016-06-21 22:59:04 735

原创 正则判断手机、密码、邮箱

#import <Foundation/Foundation.h>@interface NSString (checkNumOrPW)//正则匹配手机号+ (BOOL)checkTelNumber:(NSString *) telNumber;//正则匹配用户密码6-20位数字、字母和下划线三选二组合+ (BOOL)checkPassword:(NSString *) password;/

2016-06-21 22:54:26 653

原创 自定义弹框

#import <UIKit/UIKit.h>//取消按钮点击事件typedef void(^cancelBlock)();//确定按钮点击事件typedef void(^sureBlock)();@protocol MyAlterViewDelegate <NSObject>@optional- (void)clickCancelButton;- (void)clickContinueB

2016-06-21 22:50:44 341

原创 本地动态生成验证码

#import <UIKit/UIKit.h>@interface AuthcodeView : UIView//字符素材数组@property (strong, nonatomic) NSArray *dataArray;//验证码字符串@property (strong, nonatomic) NSMutableString *authCodeStr;@end#import "Auth

2016-06-21 22:49:50 459

原创 自定义 Switch 开关按钮

#import <UIKit/UIKit.h>@interface SevenSwitch : UIControl@property (nonatomic, assign) BOOL on;@property (nonatomic, strong) UIColor *inactiveColor;@property (nonatomic, strong) UIColor *activeColo

2016-06-21 22:48:05 1494

原创 工作周志(2016.06.12-2016.06.18)

工作一周了,想想还是要写一写工作周志,记录一下这一周的工作内容,碰到的知识和工作的体会。以此为头,养成一个定时总结的良好习惯。这一周的事情主要是做用户的登录,注册和找回密码的页面功能。登录:1、封装了一个自定义的 UISwitch 控件 2、封装了一个本地生成验证码的类注册:1、封装了一个正则判断密码的分类(做正则判断是一件很纠结的事情,至今我还是没太搞得懂怎么去做判断,分类是

2016-06-20 22:09:50 774

转载 实用知识:UIButton 图片在上文字在下

http://blog.csdn.net/dolacmeng/article/details/48373769

2016-05-31 13:18:24 1750

转载 报错:*** Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:], /BuildRoot/Librar

报错:* Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:], /BuildRoot/Library/C使用UITableView出现 * Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:], /Buil

2016-05-31 07:48:31 3527

原创 实用知识:NSPredicate(谓词)的使用

#import "ViewController.h"#import "Person.h"@interface ViewController ()@end@implementation ViewController- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading th

2016-05-26 11:05:35 294

原创 实用知识:FMDB使用示例(常用)

#import "ViewController.h"#import <FMDB/FMDB.h>@interface ViewController ()@property (nonatomic,strong) FMDatabase *db;@end@implementation ViewController- (void)viewDidLoad { [super viewDidLoad]

2016-05-25 11:14:21 544

原创 实用知识:SQL 表连接查询

表连接查询什么是表连接查询?需要联合多张表才能查到想要的数据 表连接的类型内连接:inner join 或者 join (显示的是左右表都有完整字段值的记录)左外连接:left outer join (保证左表数据的完整性)示例 查询0316班的所有学生嵌套查询SELECT * FROM t_student where class_id = (SELECT id FROM t_class

2016-05-24 12:08:38 326

原创 实用知识:SQL 约束(主键、外键)

简单约束建表时可以给特定的字段设置一些约束条件,常见的约束有NOT NULL :规定字段的值不能为nullUNIQUE :规定字段的值必须唯一DEFAULT :指定字段的默认值 (建议:尽量给字段设定严格的约束,以保证数据的规范性)示例CREATE TABLE T_Person (id integer, name text NOT NULL UNIQUE, age integer NOT

2016-05-24 10:24:26 471

原创 实用知识:SQL 常用指令(增删改查 )

DDL - 数据定义语句创建表 格式: CREATE TABLE IF NOT EXISTS 表名 (字段名1 字段类型1, 字段名2 字段类型2, …); /* 创建数据表 DDL CREATE CREATE TABLE --创建数据表 T_Student --数据表名称 ( id --字段名称 INTEGER

2016-05-24 08:01:50 419

原创 实用知识:git 常用指令

git help :git指令帮助手册 查看其他指令的做法:git help 其他指令git config :git的配置信息相关(修改的是.git/config文件) 配置用户名:git config “user.name” 用户名(用于跟踪修改记录) 配置邮箱:git config “user.email” 邮箱(用于多人开发间的沟通) 查看配置信息:git config –l 编辑配

2016-05-23 08:33:20 322

原创 实用知识:第三方储存(LeanCloud)

#import "ViewController.h"#import <AVOSCloud/AVOSCloud.h>#import "ShoppingCarTableDefine.h"@interface ViewController ()@end@implementation ViewController- (void)viewDidLoad{ [super viewDidLoad];

2016-05-22 17:42:08 1322

原创 实用知识:指纹识别功能的实现

#import "ViewController.h"// iPhone5S开始, 6S第二代, 指纹识别验证 YES/NO// 授权验证, 指纹识别框架#import <LocalAuthentication/LocalAuthentication.h>@interface ViewController ()// 指纹识别@property (strong, nonatomic) LAConte

2016-05-22 13:35:34 1353

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除