CGContextRef context = ();
//设置起始点
CGContextMoveToPoint (context, 160, 100);
CGContextAddLineToPoint (context, 100, 180);
CGContextAddLineToPoint (context, 160, 180);
// 设置边界
[[UIColor blackColor] setStroke];
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.border_box { | |
box-sizing: border-box; | |
-webkit-box-sizing: border-box; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[textfield becomeFirstResponder]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ViewController.m | |
// 数据持久化 | |
// | |
// Created by fhefh on 16/3/13. | |
// Copyright © 2016年 fhefh. All rights reserved. | |
// | |
#import "ViewController.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1、 三角函数 | |
double sin (double);正弦 | |
double cos (double);余弦 | |
double tan (double);正切 | |
2 、反三角函数 | |
double asin (double); 结果介于[-PI/2, PI/2] | |
double acos (double); 结果介于[0, PI] | |
double atan (double); 反正切(主值), 结果介于[-PI/2, PI/2] | |
double atan2 (double, double); 反正切(整圆值), 结果介于[-PI, PI] | |
3 、双曲三角函数 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ViewController.m | |
// 图片水印 | |
// | |
// Created by fhefh on 16/3/21. | |
// Copyright © 2016年 fhefh. All rights reserved. | |
// | |
#import "ViewController.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// DataBaseHandler.h | |
// 代码:http://www.jianshu.com/p/a02479cc5e15 | |
// | |
#import <Foundation/Foundation.h> | |
#import <sqlite3.h> | |
@interface DataBaseHandler : NSObject | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ViewController.m | |
// 图片截屏 | |
// | |
#import "ViewController.h" | |
@interface ViewController () | |
@property (weak, nonatomic) IBOutlet UIImageView *picView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//延迟执行任务函数dispatch_after | |
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{ | |
NSLog(@"start"); | |
//dispatch_after 是异步执行的 | |
//队列只决定在哪个线程中执行任务 并不能决定执行时间 | |
/** | |
* 第一个参数: 在哪个时间点执行 | |
* dispatch_time(从哪个时间点开始,经历多少纳秒) | |
* 第二个参数: 在哪个队列中执行block任务 | |
* 第三个参数: block任务 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 状态栏(statusbar) | |
CGRect rectStatus = [[UIApplication sharedApplication] statusBarFrame]; | |
NSLog(@"status width - %f", rectStatus.size.width); // 宽度 | |
NSLog(@"status height - %f", rectStatus.size.height); // 高度 | |
// 导航栏(navigationbar) | |
CGRect rectNav = self.navigationController.navigationBar.frame; | |
NSLog(@"nav width - %f", rectNav.size.width); // 宽度 | |
NSLog(@"nav height - %f", rectNav.size.height); // 高度 |