跟读练习: WWDC26: Modernize your UIKit app | Apple - 通过YouTube学习英语口语

C1
Hi, I'm Michael Ox, an Engineering Manager on the UI Frameworks team.
⏸ 已暂停
166
如果句子过短或过长,请点击 Edit 进行调整。
1
Hi, I'm Michael Ox, an Engineering Manager on the UI Frameworks team.
2
And today, I'll tell you how to modernize your UIKit app.
3
In this video, I'll tell you about some big changes to app adaptivity requirements and how iPhone apps are fully resizable.
4
Next, I'll present some new APIs in tab bars, navigation bars and menus.
5
Then, I'll talk about how to support Apple intelligence and some changes you should be aware of.
6
And finally, I'll cover a new skill that helps an agent to handle most of this modernization work automatically.
7
Let's get started with app adaptivity.
8
Your app can already appear in many different environments.
9
There are different screen sizes and apps can run side by side with other apps and even themselves.
10
On iPad, people expect apps to resize and move to external displays seamlessly.
11
On iPhone, people expect apps to work in both portrait and landscape orientations.
12
They also expect to mirror their iPhone to the Mac.
13
In iOS and macOS 27, this experience has been improved, and apps running in these environments are now exposed to many
14
of the dynamic changes any app native to the platform needs to support.
15
When people use iPhone mirroring on the Mac, they can fully resize the iPhone window, allowing your apps to resize and adapt.
16
Likewise, an iPhone-only app running on iPad will be fully resizable like any other iPad app.
17
Because of this, it is important that your app dynamically adjusts to any available scene size at runtime.
18
If your app is a universal binary, you're off to a great start start, but there's more to do to make your app fully adaptive
19
and have it dynamically adjust to the environment it is running in.
20
I will cover the most important steps and common issues you might encounter when making your app more adaptive.
21
Verifying your app is no longer using App Lifecycle and instead has adopted Scene Lifecycle, the basis for any adaptive app.
22
Making sure your app is not using main screen references.
23
And how to handle user interface idiom and interface orientation checks.
24
The first step is to move from App Lifecycle to Scene Lifecycle.
25
Most apps are already using Scene Lifecycle.
26
It is the basis for an adaptive app
27
and for many of the other tasks I'm going to show you in this video.
28
UiScene Lifecycle is now required when building with the latest SDKs.
29
Without it, your application will no longer launch.
30
Verify that your app is using a UI scene delegate, which is the basis for scene lifecycle.
31
If you have not yet migrated to scene lifecycle, check out the video Make your UIKit app more flexible from WWDC25,
32
and read Transitioning to the UIKit scene-based lifecycle in the documentation.
33
Next, when your iPhone app is mirrored on a Mac, or when a person moves your app to an external display on the iPad,
34
iPad, the screen associated with your scene changes. That means
35
that any reference to the main screen in your code will provide incorrect information for the environment your app is running in.
36
It is important that you do not reference the main screen in your app.
37
Instead, access the screen dynamically from a Windows window scene.
38
When a view or view controller is not available in immediate context, pass in a screen reference to any method that needs it.
39
Even better than fetching the correct screen is to remove screen references altogether.
40
There are a lot of other APIs that are better suited for an adaptive app.
41
I'll take you through two common patterns.
42
Accessing the scale of the screen should be replaced with the trait collection's display scale.
43
Views and view controllers automatically update their trait collections and provide reasonable fallbacks even when they're not part of the visible hierarchy.
44
A lot of common override points are also tracked, meaning that you do not need to explicitly monitor for changes.
45
Instead, the system tracks which trade collection properties are being used inside common layout and drawing methods, like layout subviews, update properties,
46
draw rect, and many others.
47
If a change to a tracked trade is detected, the system will ensure these methods are called again, so your UI automatically updates accordingly.
48
Check out Automatic Trade Tracking in the documentation to learn more.
49
In places where Automatic Trade Tracking is not available, Register for Trade Changes can be used to observe changes.
50
This method allows you to set up a closure that is called when a specific trade in the receiving view changes.
51
Use this to invalidate caches or update other data related to that view.
52
Check out Adapting Your App When Traits Change in the documentation to learn more.
53
Another common use of the screen is to check its bounce to get the amount of space available to your app.
54
However, in an adaptive environment, the space your scene has available is not always the full screen.
55
So if you still have any reference to screen bounds in your app, now is the time to remove these.
56
The Window Scene's Effective Geometry provides information on how much space your app has available.
57
If you need to monitor the Effective Geometry for changes, implement Window Scene Did Update Effective Geometry in your Scene Delegate.
58
In your Views and View Controllers, instead of referencing the scene bounds, use the available size of your view controller's view
59
or your view super view to determine how much space is available to it.
60
This makes your UI less dependent on how it is presented.
61
It will adjust better when your view controller appears in other contexts, for example inside of a split view controller.
62
For games, resizing can be challenging.
63
Due to this, UI Requires Fullscreen is honored on iPhone in resizable environments starting in iOS 27.
64
Its behavior has also been updated and no longer opts your app fully out of resizing.
65
Instead, it enables discrete resizing that honors your supported interface orientations.
66
In discrete resizing, every time a person changes the scene size, the system transitions the scene to a new screen configuration matching that size.
67
So your game always renders at full quality in the available space.
68
If your app is using the user interface idiom trait, be aware that this trait is no longer meaningful for any kind of layout decision.
69
Your app is expected to use the additional space in a meaningful way, regardless of whether it is running in the phone or pad user interface idiom.
70
When your iPhone app is running on an iPad or an iPhone mirroring on the Mac, it will be fully resizable, but it will still run under the phone user interface idiom.
71
Stop checking the user interface idiom for any layout decisions in your code.
72
Use size classes instead to handle sizing constraints such as collapsing menus and updating your app's layout for the available space.
73
If you need finer control, use the surrounding view size like I mentioned earlier.
74
Interface orientation also is no longer useful for layout decisions.
75
In iOS 27, an app-supported interface orientation is a preference provided to the system to the system.
76
It will be ignored when your app is running in a resizable environment.
77
You should not consider interface orientation for any layout calculations.
78
In iPhone mirroring on the Mac, your app will always be running in the portrait interface orientation regardless of the aspect ratio of your app's scene.
79
Any interface orientation checks in your app should also be updated to use size classes.
80
This conceptual shift was introduced in iOS 8.
81
At WWDC 2014, Bruce Nilo said, a device rotation is only an animated bounce change.
82
With an array of device sizes, resizable windows on iPad, and resizable iPhone apps on Mac, today this insight is more relevant than ever.
83
And speaking of interface orientation, in iOS 27, UI View also conforms to the new body protocols from Core Motion and Core Location.
84
This makes it much easier to configure your motion and location managers.
85
Connect them to the view that visualizes the motion data, such as a compass or a map view.
86
This ensures the data is always in the right coordinate space, regardless of interface orientation.
87
That covers the main adaptivity changes.
88
Now, here's how to test these changes in your app.
89
Xcode 27 brings new ways to iterate your app's behavior across
90
different screen sizes without having to install your app on multiple separate simulators or devices.
91
In the new DeviceHub app, as well as in Xcode Previews, click the Enter Resize Mode icon.
92
Then, drag the edges of the device to resize it freely.
93
This allows you to iterate on your changes quicker.
94
Once you are satisfied with the results, make sure to test iPhone mirroring and iPad with real devices.
95
To learn more about the DeviceHub app and its tools, watch Get the Most Out of DeviceHub. And that's adaptivity.
96
Before I show you a new agentic coding skill
97
that can help you with the work necessary to make your app fully adaptive, there are two more topics to cover.
98
First up, bars and menus.
99
On iPad, tab bars can expand into a full sidebar representation to surface more sections of the app hierarchy
100
when the current environment supports a sidebar.
101
On iPhone, the bottom tab bar is shown across all sizes by default.
102
New in iOS 27, iPhone apps can also opt into sidebars by setting the tabbar controller's Sidebar Preferred Placement to Sidebar.
103
Note that in contrast to the iPad, this is an app choice.
104
If your app opts into the sidebar representation, there is no way to toggle between a sidebar and tabbar layout in the UI.
105
Instead, the system determines if there is enough space to show a sidebar.
106
For example, when the horizontal size class is regular.
107
To determine if the tab bar sidebar representation can be shown, use the sidebars is available property.
108
If a sidebar is not currently available, surface the UI behind nested tabs in other parts of your app.
109
To learn more about managing tab groups, watch Make Your UIKit app more flexible from WWDC 25.
110
And to learn more about tabbars and its integration with sidebars, watch Elevate Your tab and sidebar experience in iPadOS from WWDC24.
111
UITabbarController also lets you customize the prominent tab.
112
The prominent tab is always visible, even when the tabbar collapses during scrolling.
113
In iOS 27, you have the option to make any tab prominent by setting the prominent tab identifier.
114
Okay, that's tabbars.
115
Now let's talk about navigation bars.
116
Navigation bars can interactively slide away as people scroll.
117
This provides more room on the screen for your app's content.
118
By default, navigation bars minimize in certain conditions defined by the system.
119
You can force this behavior one way
120
or the other by setting the Bar Minimization Behavior property on your navigation item to Always or Never.
121
If you handle Safe Area Avoidance yourself, set Bar Minimization Safe Area Adjustment to Never,
122
so Bar Minimization doesn't update insets automatically.
123
Another change during scroll interactions is an updated appearance for the scroll edge effects.
124
As such, you should review your design, especially where you have previously overwritten the defaults provided by the OS.
125
In particular, the automatic style no longer switches between the existing soft and hard styles, but provides its own visuals for additional clarity.
126
If you have overwritten the style from automatic previously, that decision should be re-evaluated especially when set to soft,
127
as that no longer matches the default system appearance.
128
With the refined look of liquid glass, images you set on menu elements may not be shown by default in some contexts,
129
such as in the menu bars on iPadOS and macOS.
130
If you still need an image to be visible, set the preferred image visibility property to override the default system behavior.
131
Review the updated human interface guidelines for when to include visible images in a menu element.
132
And that's Bars and Menus.
133
Now, how to support Apple intelligence in your app.
134
Menus in iOS 27 feature an Ask Siri button to allow people to start a conversation with Siri right from your app.
135
This is a powerful entry point that allows people to interact with the context they care about.
136
Menus will automatically display this item when there's content relevant for Siri.
137
To provide more relevant information specific to your app, use the new View Annotations API.
138
With it, you can annotate specific views with app entities.
139
Check out Explore Advanced App Intents features for Siri and Apple Intelligence to learn more.
140
If your app supports drag and drop, Siri can load resources from your application's drag handlers.
141
When Apple Intelligence is invoked from context menus, the system will call available drag delegate methods to load the content.
142
Avoid performing animations or presenting modal UI from session will begin.
143
Drag sessions can be initiated without a user gesture.
144
If your app has a stateful UI that shows up when a user initiates a drag, put that code in sessionDidMove instead.
145
If the adaptivity changes I outlined sound like a lot of work, I've got you covered.
146
Let's talk about what's on everyone's mind, agentic coding.
147
New in Xcode 27 is an app modernization skill.
148
It has a deep understanding of the adaptivity tasks I outlined.
149
And with the context of your project, it can make a lot of these changes automatically.
150
Use Xcode's intelligence features and ask an agent to make your app more adaptable.
151
It will automatically convert main screen calls to trait collection or scene bounce checks, adding invalidation logic if necessary.
152
It will also replace interface orientation checks with size class checks.
153
It will even convert your app to use scene lifecycle.
154
For more complex tasks, it will ask clarifying questions.
155
And for tasks too large to handle in a single session, it will add comments to help you keep track of the remaining work.
156
And to use skills in other tools, you can export the ones Xcode uses with XCRun Agent Skills Export.
157
This will create markdown files that you can then import in your workflows.
158
Skills like this one are a powerful way to prepare your app for resizable environments. And that's it.
159
These are the most important things to modernize your app.
160
Build your app with the iOS 27 SDK
161
and try out the resizable simulator in the new DeviceHub app and test your app in iPhone mirroring on macOS 27.
162
Identify areas in your app that need to be a little more flexible.
163
And if you like agentic coding, give the new skill a try and discover how much it can do automatically.
164
Thanks for joining.
165
I cannot wait to resize your apps.
166
you

下载应用

AI 为你说出的每个句子打分

TRENDING

热门

背景与情境

在这段视频中,工程经理迈克尔·奥克斯分享了现代化UIKit应用程序的关键更新。随着技术的发展,iPhone和iPad应用的适应性需求发生了显著变化。用户期望应用程序能够灵活响应不同的显示环境,包括在多个屏幕之间无缝切换。此外,视频中提到的新API和更新可帮助开发者更好地应对这些变化。

日常交流的五个关键短语

  • 适应性要求变更:应用程序需要能够动态调整以适应不同的运行环境。
  • 场景生命周期:从应用生命周期迁移到场景生命周期是创建适应性应用的基础。
  • 屏幕引用问题:不要在代码中引用主屏幕,而是动态获取相关窗口的屏幕信息。
  • 自动跟踪属性:通过跟踪属性的变化来保持用户界面的自动更新。
  • 技术迁移建议:参考文档和视频以获取从UIKit应用程序向现代技术过渡的帮助。

逐步跟读指南

为了提升英语发音和口语能力,建议您通过这个视频进行跟读练习。以下是一些建议的步骤:

  1. 准备工作:首先,确保您能流畅理解视频内容。如果有不明白的地方,可以使用雅思口语练习中常见的翻译工具进行查找。
  2. 选择一小段:从视频中截取一小段(如2-3分钟),这是您练习的重点。
  3. 跟读练习:播放视频中的一段内容,暂停后尝试重复说出相同的句子。聚焦于语调、发音和节奏,这将帮助您提高英语发音。
  4. 回放与比较:多次回放每段对话,确保您的发音与原声接近,这对提升你的shadow speak能力非常有帮助。
  5. 记录进步:定期记录您的跟读练习,您可以通过录音来回听,对比自己的发音,找到需要改进的地方。

通过这样的shadowing技巧,您能够逐步提高您的口语能力和对英语语音的敏感度,在实践中掌握英语流利的发音。

什么是跟读法?

跟读法 (Shadowing) 是一种有科学依据的语言学习技巧,最初开发用于专业口译员的培训,并由多语言者Alexander Arguelles博士普及。这个方法简单而强大:您在听英语母语原声的同时立即大声重复——就像是一个延迟1-2秒紧跟说话者的影子。与被动听力或语法练习不同,跟读法强迫您的大脑和口腔肌肉同时处理并模仿真实的讲话模式。研究表明它能显着提高发音准确性,语调,节奏,连读,听力理解和口语流利度——使其成为雅思口语备考和真实英语交流最有效的方法之一。

请我们喝杯咖啡