博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
iOS5新开发的API总述——WWDC 2011
阅读量:4571 次
发布时间:2019-06-08

本文共 5678 字,大约阅读时间需要 18 分钟。

iOS5发布了好长时间,一直没有时间好好看一下,从今天开始重新学一下WWDC2011,以便了解一下iOS5的新功能.

此篇只简单介绍一下iOS新的API.参考官方1-01 Session 100 – What’s New in Cocoa Touch.

1.UIStepper

iOS5新UI控件,用来数字输入.

2.UIAlertView新样式

typedef enum {
UIAlertViewStyleDefault = 0,UIAlertViewStyleSecureTextInput,//密码输入框UIAlertViewStylePlainTextInput,//一般输入框UIAlertViewStyleLoginAndPasswordInput//两个输入框} UIAlertViewStyle; @property(nonatomic,assign) UIAlertViewStyle alertViewStyle;- (UITextField *)textFieldAtIndex:(NSInteger)textFieldIndex

3.TV

4.UIScreen调节亮度

@property (nonatomic) CGFloat brightness;@property (nonatomic) BOOL wantsSoftwareDimming;

5.UIScrollView delegate完成拖动时delegate

- (void)scrollViewWillEndDragging:(UIScrollView *)sv withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)tCO;

6.UIReferenceLibraryViewController显示词语解释

- (id)initWithTerm:(NSString *)term;+ (BOOL)dictionaryHasDefinitionForTerm:(NSString *)term;

7.UISplitViewController delegate,显示隐藏时delegate

- (BOOL)splitViewController:(UISplitViewController *)svc shouldHideViewController:(UIViewController *)vc inOrientation:(UIInterfaceOrientation)orientation;

8.UITableView delegate,复制或剪切cell时delegate

- (BOOL)tableView:(UITableView *)tv shouldShowMenuForRowAtIndexPath:(NSIndexPath *)ip; - (BOOL)tableView:(UITableView *)tv canPerformAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)ip; - (void)tableView:(UITableView *)tv performAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath;

9.UITableViewCell,从xib文件中获取cell

- (void)registerNib:(UINib *)nib forCellReuseIdentifier:(NSString *)identifier;

10.UIWindow keyboard notifications,键盘frame改变时notifications

NSString *const UIKeyboardWillChangeFrameNotification;NSString *const UIKeyboardDidChangeFrameNotification;

11.UIImage,image动画

+ (UIImage *)animatedImageNamed:(NSString *)name duration:(NSTimeInterval)duration;+ (UIImage *)animatedImageWithImages:(NSArray *)images duration:(NSTimeInterval)duration;@property (nonatomic, readonly) NSArray *images;@property (nonatomic, readonly) NSTimeInterval duration;

image平铺与拉伸

-(UIImage *)resizableImageWithCapInsets:(UIEdgeInsets)i;

12.UIStoryboard,故事版

@property (readonly, retain) UIStoryboard *storyboard;- (void)performSegueWithIdentifier:(NSString *)id sender:(id)sender;- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender;

13.UISlider,改变颜色

[aSlider setMinimumTrackTintColor:[UIColor redColor]];

14.UIAppearance应用于全部属性

@protocol UIAppearance <NSObject>+ (id)appearance; ...@end #define UI_APPEARANCE_SELECTOR

eg:

[[UISlider appearance] setMinimumTrackTintColor: [UIColor redColor]];//程序中所有slider改为红色

15.UIPageViewController

- (id)initWithTransitionStyle: (UIPageViewControllerTransitionStyle)style navigationOrientation:(UIPageViewControllerNavigationOrientation)orientation options:(NSDictionary *)options; id <UIPageViewControllerDelegate> delegate;id <UIPageViewControllerDataSource> dataSource;

UIPageViewControllerDelegate

- (void)pageViewController:(UIPageViewController *)pvc didFinishAnimating:(BOOL)finished previousViewControllers:(NSArray *)prevViewCs transitionCompleted:(BOOL)completed; - (UIPageViewControllerSpineLocation) pageViewController:(...)pvc spineLocationForInterfaceOrientation:(...)o;

UIPageViewControllerDataSource

- (UIViewController *) pageViewController:(UIPageViewController *)pvc viewControllerBeforeViewController:(UIViewController*)c;- (UIViewController *) pageViewController:(UIPageViewController *)pvc viewControllerAfterViewController:(UIViewController *)c;

 16.UIViewController

-(void)addChildViewController:(UIViewController *)cvc;-(void)removeFromParentViewController;@property (readonly) NSArray *childViewControllers; -(void)transitionFromViewController:(UIViewController *)fVC toViewController:(UIViewController *)toViewController duration:(NSTimeInterval)duration options:(UIViewAnimationOptions)options animations:(void (^)(void))animations completion:(void (^)(BOOL finished))completion;

 17.UIDocument

- (id)initWithFileURL:(NSURL *)url;@property (readonly) NSURL *fileURL;@property (readonly, copy) NSString *localizedName;@property (readonly, copy) NSString *fileType;@property (copy) NSDate *fileModificationDate;@property (retain) NSUndoManager *undoManager; - (void)openWithCompletionHandler: (void (^)(BOOL success))completionHandler;- (void)closeWithCompletionHandler: (void (^)(BOOL success))completionHandler;- (BOOL)loadFromContents:(id)contents ofType:(NSString *)typeName error:(NSError **)outError;- (id)contentsForType:(NSString *)typeName error:(NSError **)outError;

Errors

- (void)handleError:(NSError *)error userInteractionPermitted:(BOOL)interactionPermitted;- (void)finishedHandlingError:(NSError *)error recovered:(BOOL)recovered;- (void)userInteractionNoLongerPermittedForError: (NSError *)error;

Document States

enum {
UIDocumentStateNormal,UIDocumentStateClosed = 1 << 0,UIDocumentStateInConflict = 1 << 1,UIDocumentStateSavingError = 1 << 2,UIDocumentStateEditingDisabled = 1 << 3}; typedef NSInteger UIDocumentState; @property (readonly) UIDocumentState documentState;NSString *const UIDocumentStateChangedNotification;

18.管理资源库(没看懂)

• ALAssetsLibrary

- (void)addAssetsGroupAlbumWithName:(NSString *)name resultBlock:(ALAssetsLibraryGroupResultBlock)r;

• ALAssetsGroup

- (BOOL)addAsset:(ALAsset *)asset;

Modifying

-(void)writeModifiedImageDataToSavedPhotosAlbum:(NSData *)d metadata:(NSDictionary *)metadata completionBlock:(ALAssetsLibraryWriteImageCompletionBlock)block; -(void)setImageData:(NSData *)data metadata:(NSDictionary *)metadata completionBlock:(ALAssetsLibraryWriteImageCompletionBlock)block;

 19.其他

GameKit

Core Data

NewsstandKit

Twitter

CoreImage

GLKit

转载于:https://www.cnblogs.com/zsw-1993/archive/2013/05/15/4880072.html

你可能感兴趣的文章
Bootstrap 表格
查看>>
VBA中Dictionary对象使用(Key,Value)
查看>>
Shell脚本中计算字符串长度的5种方法
查看>>
laravel 查询随机数据
查看>>
cocos2dx-3.2 笔记 - 点击事件
查看>>
VS2017简单使用
查看>>
[2015编程之美] 资格赛C
查看>>
步进电机驱动
查看>>
C++模板
查看>>
C#--正则匹配
查看>>
5.30 考试修改+总结
查看>>
BA-设计施工调试流程
查看>>
C#-CLR各版本特点
查看>>
css3背景透明文字不透明
查看>>
实验四
查看>>
C++学习--应用篇(Windows/Linux)(书籍推荐及分享)
查看>>
金山快盘有Linux版了
查看>>
Git tag 给当前分支打标签
查看>>
继承和组合(转)
查看>>
mssql sqlserver 取消数值四舍五入的方法分享
查看>>