小功能
Kaiccy
爱拼才会赢~
展开
-
屏幕截图
这是调用//用来截取测试的view UIView *testView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)]; testView.backgroundColor = [UIColor redColor]; self.shotImage = [[UIImage alloc] init]; _shotI原创 2016-11-11 18:12:31 · 358 阅读 · 0 评论 -
iOS 原生二维码的扫面功能
这里只是介绍实现最基础的扫描功能,没有任何修饰需要导入#import <AVFoundation/AVFoundation.h>首先定义所需的属性@property ( strong , nonatomic ) AVCaptureDevice * device; @property ( strong , nonatomic ) AVCaptureDeviceInput * input; @prope原创 2016-11-16 16:41:18 · 722 阅读 · 0 评论 -
闪光灯的开启与关闭
//开启关闭闪光灯 -(void)flashLightClick{ AVCaptureDevice * device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; if (device.torchMode==AVCaptureTorchModeOff) { //闪光灯开启 [d原创 2016-11-15 18:05:18 · 1322 阅读 · 0 评论 -
iOS原生二维码处理
前期准备#import <CoreImage/CoreImage.h> #import <AssetsLibrary/AssetsLibrary.h> #import <AVFoundation/AVFoundation.h>@interface QRViewController ()<AVCaptureMetadataOutputObjectsDelegate>@property (nonatom原创 2017-08-31 11:49:11 · 303 阅读 · 0 评论 -
解析HTML标签 iOS
//解析HTML标签 - (NSString *)filterHTML:(NSString *)html{ NSDictionary *dic = @{NSDocumentTypeDocumentAttribute:NSHTMLTextDocumentType}; NSData *data = [html dataUsingEncoding:NSUnicodeStringEncodi原创 2017-10-19 14:25:19 · 890 阅读 · 0 评论 -
在navigationBar上添加searchBar 并设置字体
//添加搜索框 - (void)addSearchBar{ CGRect mainViewBounds = self.navigationController.view.bounds; self.searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(CGRectGetWidth(mainViewBounds)/2-((CG原创 2017-11-02 14:46:22 · 1300 阅读 · 0 评论 -
iOS 验证码倒计时
属性@property (weak, nonatomic) IBOutlet UIButton *getCodeBtn; @property (nonatomic, assign) NSInteger secondsCountDown; @property (nonatomic, strong) NSTimer *countDownTimer;方法//倒计时 - (void)timeOutActio原创 2017-11-29 16:55:30 · 270 阅读 · 0 评论 -
输入验证码或密码,自动下一位 iOS
系统没有textFeild 的相关当输入内容改变时候的代理方法。。。所以我们自己加一个监听来实现如下的效果主要代码如下:[_code1F becomeFirstResponder]; [_code1F addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChan原创 2017-12-28 17:07:44 · 1075 阅读 · 0 评论 -
判断页面中的该填项是否填完整,改变按钮状态 iOS
开发中很多这种情况,就是页面中有一些需要填写的信息,然后有一个按钮,当页面中的textFeild 还未填写完整时,按钮是不可点击的状态,填写完整后才可以点击,该怎么实现呢,实现思路: 因为页面中先填写哪个textField是不一定的,所以我需要给每个textFeild 添加监听事件,当编辑状态改变时,去判断页面中所有的textFeild 是否都已经有值,有值则改变按钮的可点击状态由于项目中原创 2017-12-29 15:51:05 · 929 阅读 · 0 评论