`
彡彡稻草
  • 浏览: 38794 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

iOS5新开发的API总述——WWDC 2011

    博客分类:
  • IOS
 
阅读更多
转自 http://alloc.sinaapp.com/?p=208
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
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics