在处理个人资料 - 头像的时候,通常有两个选项,一个是调用系统相机,一个是调用系统相册.这里要使用的就是UIImagePickerController方法. 在头像位置的imageView添加一个手势,或者添加一个透明的按钮,用来实现click方法,直接上代码: - (IBAction)click:(id)sender{ //创建提醒视图 UIAlertController *alertController = [UIAlertController alertControllerWithTitl…
UIAlertController *alertVc = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet]; UIAlertAction *cancle = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIA…
解决方法: /* I think this is because in iOS 8, alert views and action sheets are actually presented view controllers (UIAlertController). So, if you're presenting a new view controller in response to an action from the UIAlertView, it's being presented w…
系统 ios9.1 语言swift2.0 在app 里最常用的功能就是多媒体选择,首先我们storyboard 创建一个button 用于触发选择事件 @IBAction func selectImageAction(sender: AnyObject) { } 这时候通常会弹出来一个ActionSheet 上面有拍照 , 相册,录像 和取消 这几项.iOS 8 以后actionsheet 和 alertview 都统一用UIAlertController 方法调用,8.3以前actionshe…
基于 UIImagePickerController 的拓展,分别支持调用相机.相册的功能,其中相机可以设置默认调用前后摄像头; 简单对此进行了封装和实现,其中还有很多点可以继续挖掘和优化,该版本具体 code 如下: GitHub 链接地址 声明: /* 相机管理 */ #import <Foundation/Foundation.h> @protocol YHCameraManagerDelegate <NSObject> /** 事件回调*/ - (void)YHCamera…
iOS8之后,UIActionSheet改父于UIAlertController.带来了一丢丢兼容性的问题. 比如在弹出的actionsheet中选择从相册选择图片或者拍照,之后弹出UIImagePickerController进行选择. 在iOS8以前的方法里,直接在 -(void) actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex; Click的委托事件里处理就好了,但是在…
[assetsLibrary addAssetsGroupAlbumWithName:@"iOSDevTip1" resultBlock:^(ALAssetsGroup *group12) { [groups addObject:group12]; } failureBlock:nil]; 使用AssetsLibrary在iOS8+上是无法创建已删除的同名相册,group为nil崩溃,图片有保存在系统相册.…
楼主在整理项目的警告,于是乎你懂的. 然后自己整理了一下以后方便自己忘了之后能及时找到它 关于UIAlertController .h文件的解析 /** 关于UIAlertController的解析 */ #import <UIKit/UIViewController.h> // NS_ASSUME_NONNULL_BEGIN //枚举 UIAlertActionStyle typedef NS_ENUM(NSInteger, UIAlertActionStyle) { UIAlertActi…
今天写弹出框UIAlertController,用alertView习惯了,所以封装了一下,跟alertView用法一样,不说了,直接上代码: 先来了解一下otherButtonTitles:(nullable NSString *)otherButtonTitles, ... 写法: iOS实现传递不定长的多个参数的方法是使用va_list.va_list是C语言提供的处理变长参数的一种方法.在调用的时候要在参数结尾的时候加nil.va_list的使用需要注意: (1)首先在函数里定义va_l…
// 将UIAlertController模态出来 相当于UIAlertView show 的方法// 初始化一个一个UIAlertController    // 参数preferredStyle:是IAlertController的样式    // UIAlertControllerStyleAlert 创建出来相当于UIAlertView    // UIAlertControllerStyleActionSheet 创建出来相当于 UIActionSheet    UIAlertCont…