1. UIButton
1 | CGRect frame = CGRectMake(0, 100, 80, 40); |
2. UIAlertView
1 | UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"标题" message:@"你的内存已满" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:nil, nil]; |
3. UILabel
1 | UILabel *label =[[UILabel alloc]initWithFrame:CGRectMake(0, 10, 200, 34)]; |
4. UITextField
1 |
|
5.UISlider
1 | UISlider *slider =[[UISlider alloc]initWithFrame:CGRectMake(0, 100, 200, 33)]; |
6.UISegmentedControl
1 | UISegmentedControl *seg= [[UISegmentedControl alloc]initWithItems:@[@"骑士",@"勇士"]]; |
7.UIViewImage
1 | UIImageView *imageView =[[UIImageView alloc]initWithImage:[UIImage imageNamed:@"head.png" ]]; |
8.UISwitch
1 | UISwitch *uiSwitch=[[UISwitch alloc]initWithFrame:CGRectMake(20, 200, 100, 33)]; |
9.UIActionSheet
1 | UIActionSheet *actionSheet = [[UIActionSheet alloc]initWithTitle:nil delegate:self cancelButtonTitle:@"取消" destructiveButtonTitle:@"微信" otherButtonTitles:@"新浪微博",@"腾讯微博", nil]; |
10.UIWindow
1 | UIWindow *window =[[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds]; |
11.UIBarButtonItem
1 | //左边 |
12.UIWebView
UIWebView 的本地加载HTML页面
1 | CGRect rect = [UIScreen mainScreen].bounds; |
13.UIPickerView
选择器创建与代理设置
1 | NSArray *pickerArray =@[@"勇士",@"火箭",@"湖人",@"雷霆"]; |
14.UIScrollView
1 | UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 40, 200, 100)]; |
15.UIProgressView
进度条
1 | UIProgressView *progressView =[[UIProgressView alloc]initWithProgressViewStyle:UIProgressViewStyleDefault]; |
16.UIActivityIndicatorView
活动指示器
1 | UIActivityIndicatorView *activityView= [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; |
17.UINavigationBar
UINavigationBar 导航栏 需要抱一个导航栏目UINavigationItem
1 | UINavigationBar *navbar =[[UINavigationBar alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 44)]; |
18.UITabBar
1 | UITabBar *tabBar =[[UITabBar alloc]initWithFrame:CGRectMake(0, [UIScreen mainScreen].bounds.size.height-44, self.view.frame.size.width, 44)]; |
19.UIApplication
1 | NSURL *appStoreUrl = [NSURL URLWithString:@"http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=291586600&mt=8"]; |
1 | //退出编辑 |
20.UIRefreshControl
刷新组件,继承了UITableController 有refreshControl 属性存在
1 | UIRefreshControl *refreshControl = [[UIRefreshControl alloc]init]; |
21.UIImagePickerController
查看相册
1 | UIImagePickerController *pickerController = [[UIImagePickerController alloc]init]; |
22.UICollectionView
1 | UICollectionViewFlowLayout* flowLayout = [[UICollectionViewFlowLayout alloc]init]; |
23.MPMoviePlayerController
视频控制
1 | NSURL *url = [NSURL URLWithString:@"http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8"]; |
常用的一些代码片段记录
视频截图
1 | - (UIImage *) captureFromView: (UIView *) aView |
遇到block的情况下转为self
1 | __weak typeof(self)weakSelf = self; |
常用的一些Build setting 记录
Bitcode 的开启和关闭
pch文件开启和配置路径位置
需要则在Precompile Prefix Header 开启 默认关闭
Prefix Header 则配置相应的路径
例如:$(SRCROOT)/PrefixHeader.pch
v1.5.2