iOS7新特征汇总[06]What's New in Cocoa Touch学习笔记

提醒:这里是新特征汇总博文链接:iOS7新特征汇总

今晚看了一下WWDC2013的session:What's New in Cocoa Touch

该session介绍了iOS 7中Cocoa Touch里面新增的许多内容。

下面是一些学习笔记,供大家参考一下(由于是边看边记录,如有文字录入错误,还请见谅):

1、Multitasking

Background fetching

you must call this at launch

Remote notification

Method: didReceiveRemoteNotification

call the completion handler when fetch is complete

Background transfers

Method: handleEventsForBackgroundURLSession

NSURLSession replace API for NSURLConnection

Data upload download task

session have identifiers

2、view and image

Image Rendering Modes

Creating image with redering mode

method: imageWithRenderingMode:

param: UIImageRenderingMode

Tint

New UIView property

@property (nonatomic, retain) UIColor *tintColor;

Dimming adjustment behavior

@property (nonatomic) UIViewTintAdjustmentMode tintAdjustmentMode;

Finding out about changes

-(void) intColorDidChange;

View Animation

No animations!

+(void)performWithoutAnimation:

Keyframes

+(void)animationKeyframesWithDuration

+(void)addKeyframeWithRelativeStartTime:

UIViewKeyframeAnimationOptions

3、Motion Effects

Applies relative values to key paths of a target view

Affected by device "pose" or position

Affects animatable properties only

class: UIInterpolatingMotionEffect

initialization——initWithKeyPath:

UIMotionEffect

abstract superclass

one method

keyPathsAndRelativeValuesForViewerOffset:

UIOffset: CGFloat horizontal, vertical;

UIView

adding and removing motion effects

addMotionEffect:

removeMotionEffect:

@property (copy, nonatomic) NSArray *motionEffects;

4、Collection Views

Transitions between layouts

method: setCollectionViewLayout: animated: completion

UICollectionViewTransitionLayout

5、View Controllers

Layout

wantsFullScreenLayout

deprecated in iOS 7.0

extended edges

content size

@property (nonatomic) CGSize preferredContentSize;

status bar appearance

new behavior for the status bar

new status bar style

UIStatusBarStyleDefault

UIStatusBarStyleLightContent (new)

// UIStatusBarStyleBlackTranslucent

// UIStatusBarStyleBlackOpaque

6、Custom Transitions

bounded "canned" transition

interactive, user-driven transition

new delegate method on UIViewController

UIViewControllerTransitioningDelegate

UIViewControllerAnimatedTransitioning

UIViewControllerInteractiveTransitioning

UIViewControllerContextTransitioning

ref: WWDC2013 Custom Transitions Using View Controllers

7、State Restoration

Ignoring Snapshots

-(void)ignoreSnapshotOnNextApplicationLaunch;

Other Objects

Non-view and non-view controller can now participate

method: registerObjectForStateRestoration:

Bluetooth State Restoration

8、AirDrop

Adopt UIActivityItemSourceProtocol

Update application's info.plist to create, register, and export UTI for custom document formats

New Documents/Inbox directory

9、Dynamics

Fluid, responsive animations

Enhances the interactions in you application

Concentration on behaviors

class: UIDynamicAnimator

UIDynamicBehavior

UIDynamicItem

supported behaviors

UIAttachmentBehavior

UICollisionBehavior

UIGravityBehavior

UIPushBehavior

UISnapBehavior

UDynamicItemBehavior

10、Text

Dynamic type sizing

@property(nonatomic, readonly) NSString * preferredContentSizeCategory;

UIFont

Font scaling based on content size category

preferredFontForTextStyle:

Text Kit

Objective-C API

class: NSTextStorage

NSLayoutManager

NSTextContainer

UITextView UITextField UILable

additional class

NSTextAttachment

11、More New Feathures

Multipeer Connectivity

Local network discovery

seesion management

encryptyed sessions

file transfers

SpriteKit

iOS 、OS X

High-performance sprite-based game framework

image atlas support

UIKit and AppKit integration

Game Controller

Buttons

Analog joysticks

Multiple controllers

MapKit

Directions

3D cameras

Map tile overlays

Map snapshots

Geodesic polylines

CoreLocation

Bluetooth LE beacons

advertising

ranging

New region types

Region monitoring

Accessibility

Guided Access API

GameCenter

new turn-based game API

turns tabs

mode for bidding

leader board improvements

system integrity features

本文由破船原创●转载请注明出处●2013-07-03

标签: none

?>