iOS5新開發的API總述

來源:互聯網
上載者:User
1.UIStepper

iOS5新UI控制項,用來數字輸入.

2.UIAlertView新樣式
typedef enum { UIAlertViewStyleDefault = 0, UIAlertViewStyleSecureTextInput,//密碼輸入框 UIAlertViewStylePlainTextInput,//一般輸入框 UIAlertViewStyleLoginAndPasswordInput//兩個輸入框 } UIAlertViewStyle;   @property(nonatomic,assign) UIAlertViewStyle alertViewStyle; - (UITextField *)textFieldAtIndex:(NSInteger)textFieldIndex
3.TV4.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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.