Multitasking
Multitasking lets you quickly switch from one app to another at any time through a multitasking interface on an iOS device, or by using a multifinger gesture on an iPad. On iPad, multitasking also lets you use two apps at once in Slide Over, Split View, or Picture in Picture mode. Slide Over is accessed by swiping from the right side of the screen to temporarily use a second app without leaving the context of the current app, such as to quickly view your Mail inbox while you’re using Safari. Split View lets you use two side-by-side apps at the same time, and Picture in Picture lets you watch a video while working in another app.
多任务允许你在一个iOS设备上通过一个多任务界面快速在应用间切换,或者使用多手指手势在iPad。在iPad,多任务允许你一次使用两个app在Slide Over, Split View, or Picture in Picture模式。Slide Over是从屏幕右边滑动来暂时使用第二个app,而不用离开当前app的环境,例如在使用Safari的时候快速浏览你的邮箱。Split View允许你端对端同时使用两个app,画中画允许你在使用另一个app时观看视频。
~~~假装有图,原文中有演示~~~原文链接
Designing an app that thrives in a multitasking environment hinges on your app harmoniously coexisting with other apps on the device. This means your app shouldn’t use too much CPU, memory, screen space, or other system resources. It should respond well to sudden interruptions and audio from other apps, transition to and from the background quickly and smoothly, and behave responsibly when operating in the background.
设计一个app可以和设备上的app和谐共处在多任务的环境下。这意味着你的app不应该使用太多CPU,内存,屏幕空间或者其他系统资源。它应该能及时响应来自其他app突然的打断和语音,从后台能流畅地转换出来,当隐藏在后台时表现得可响应操作。
Be prepared for interruptions, and be ready to resume.Your app can be interrupted at any time. When an interruption occurs, your app should save the current state quickly and precisely so people can seamlessly continue where they left off when they return. For developer guidance, seePreserving Your App’s Visual Appearance Across LaunchesinApp Programming Guide for iOS.
准备好被打断,准备好恢复。你的app可以在任何时候被打断。当一个打断发生,你的app应该快速准确地保存当前状态,这样用户回来时可以无缝在他们离开的地方继续。For developer guidance, seePreserving Your App’s Visual Appearance Across LaunchesinApp Programming Guide for iOS.
Make sure your interface works with a double-high status bar.Certain features, such as in-progress phone calls, audio recording, and tethering display an additional status bar at the top of the screen. In unprepared apps, this added height can cause layout problems by covering or pushing down other interface elements. Test your app with these features enabled to ensure that your interface responds appropriately and still looks great.
确保你的界面能与double-high 状态栏协作。一些特性,例如进行中的电话,语音录音,共享播放一个额外的状态栏在屏幕顶部。在没准备好的app,这个增加的高度可能引起布局问题通过覆盖或者挤压下面的其他界面元素。测试你app和这些特性共存时,保证界面仍然看起来不错。
Pause activity that requires attention or active participation.If your app is a game or a media-viewing app, for example, make sure people don’t miss anything when they switch to another app. When they switch back, let them continue as if they’d never left.
暂停要求关注的活动或者激活参与。如果你的app是一款游戏或者多媒体观看app,例如,确保用户在转换到另一个app时不要丢失任何内容。当他们转换回来,继续好像他们从没离开过。
Respond appropriately to external audio.Occasionally, your app’s audio may be interrupted by audio from another app or the system itself. For example, an incoming phone call or a music playlist initiated by Siri may interrupt your app’s audio. When situations like these occur, your app’s response should meet people’s expectations. For primary audio interruptions, such as playing music, podcasts, or audiobooks, your app should pause its audio indefinitely. For shorter interruptions, such as GPS directional notifications, your app should temporarily lower its audio volume or pause its audio and resume when the interruption ends. For additional guidance, seeAudio.
对额外的语音合适回应。有时,你的app语音会被另一个app的语音打断或者系统本身。例如,一个来电或者一个由Siri启动音乐播放列表也许会打断你app语音。当发生这种情况时,你app响应应该满足用户期望。对于主要语音打断,例如播放音乐,广播或者有声书,你的app应该无限暂停它的语音。对于短暂打断,例如 GPS导航提示,你app应该短暂调低它的语音音量或者暂停它的语音,在打断结束后恢复。For additional guidance, seeAudio.
Finish user-initiated tasks in the background.When someone starts a task, they expect it to finish even if they switch away from your app. If your app is in the middle of performing a task that doesn’t need additional input, complete it in the background before suspending.
在后台完成用户开始的任务。当某人开始一个任务,他们期望它能完成即使它们离开你的app。如果你的app在执行任务的中间,而且不需要额外输入,在后台完成它。
Use notifications sparingly.Your app can arrange for notifications to be sent at specific times, whether your app is suspended, running in the background, or not running at all. Notifications are fine for communicating important information, but avoid pestering people with too many. For example, don’t show a notification every time your app finishes a task in the background. Instead, let people check on tasks by returning to your app. For additional guidance, seeNotifications.
谨慎使用通知。你的app可以安排在特定时间发送通知,不论你的app是否展开,在后台运行,或者完全没有运行。通知是很好的沟通重要信息的方式,但是太多通知会烦恼用户。例如,一个任务在后台完成时不需要每次都显示一个通知。取而代之,让用户回到你的app时检查任务。For additional guidance, seeNotifications.
For iPad-specific developer guidance, seeAdopting Multitasking Enhancements on iPad.