Skip to main content

WWDC

iOS 16 的新功能 - 官方 Apple 支持 (中国)

2022

iOS 16 可以定制锁屏界面风格以及锁屏界面显示的 Widget。

WatchOS 9 还新增了用药提醒功能,用户不仅可以设定用药时间,同时健康应用还会提醒用户该药物的副作用以及症状。用户仅需通过 iPhone 拍摄药品盒子,即可将药品名称记入健康应用。睡眠 App 中推出了睡眠阶段功能。

MacOS Ventura 引入了一个全新的多任务模式:Stage Manager。还支持将 iPhone 手机作为电脑的外置网络摄像头使用,,且无需线缆连接。

SF Symbols 4: 4000+ 图标的内置图标库。

Xcode build timeline: 可视化编译过程的时间损耗,快速查看耗时任务和瓶颈。

Replace CAPTCHAs with Private Access Tokens - WWDC22 - Videos - Apple Developer

Improve app size and runtime performance - WWDC22 - Videos - Apple Developer

Reduce networking delays for a more responsive app - WWDC22 - Videos - Apple Developer

  • Adopt HTTP3/QUIC
  • Eliminate unnecessary server queuing (修改服务器配置的缓冲区大小)
  • Support and test L4S

Learn about the latest updates to Vision APIs that help your apps recognize text, detect faces and face landmarks, and implement optical flow.

Improve DNS security for apps and servers - WWDC22 - Videos - Apple Developer

  • DNSSEC 解决的是 DNS 被劫持、污染的问题(定向到一个错的 IP 地址)
  • Encrypted DNS 解决的是隐私性问题(访问的站点不被中间者得知)

Privacy

CLLocationButton

Using the Location Button

Meet the Location Button - WWDC 2021

Move beyond passwords - WWDC 2021

Xcode

Meet Xcode Cloud - WWDC 2021

Symbolication: Beyond the basics - WWDC 2021

Detect and diagnose memory issues - WWDC 2021

Understand and eliminate hangs from your app - WWDC 2021

Detect bugs early with the static analyzer - WWDC 2021

Discover breakpoint improvements - WWDC 2021

Swift

Meet async/await in Swift - WWDC 2021

Swift concurrency: Behind the scenes - WWDC 2021

ARC in Swift: Basics and beyond - WWDC 2021

WWDC 2021 - What‘s new in Swift

WWDC 2019 - What's New in Swift

WWDC 2018 - What's New in Swift

WWDC 2017 - What's New in Swift

Networking

Accelerate networking with HTTP/3 and QUIC - WWDC 2021

Analyze HTTP traffic in Instruments - WWDC 2021

Explore WKWebView additions - WWDC 2021

Develop advanced web content - WWDC 2021

Optimize for 5G networks - WWDC 2021

Reduce network delays for your app - WWDC 2021

UIKit

Make blazing fast lists and collection views - WWDC 2021

Others

WWDC 2021 - Ultimate application performance survival guide

WWDC 2020 - Eliminate animation hitches with XCTest

WWDC 2020 - Identify trends with the Power and Performance API

WWDC 2020 - Why is my app getting killed?

WWDC 2020 - Expanding automation with the App Store Connect API

WWDC 2020 - Diagnose performance issues with the Xcode Organizer

WWDc 2019 - What's New in App Store Connect

WWDC 2019 - Getting Started with Instruments

WWDC 2019 - Developing a Great Profiling Experience

WWDC 2018 - iOS Memory Deep Dive

WWDC 2017 - Finding Bugs Using Xcode Runtime Tools

WWDC 2016 - Thread Sanitizer and Static Analysis

Explore media formats for the web - WWDC23 - Videos - Apple Developer

The incumbent formats are GIF, JPEG, and PNG.

  • GIF: It does not support a full color palette being limited to 8 bits color at a time. Since it's a lossless format, file sizes can be quite large, making it less suitable for larger animations.
  • JPEG: A great feature is progressive loading. It's a lossy format.
  • PNG: supports transparency. It's lossless and doesn't compress as well as JPEG, so it's not very suitable for big images with lots of color. Like GIF, it was designed to replace, it supports animations, though I've rarely seen those in the wild.

Safari 17 supports an additional four extra modern formats.

WebP was added to Safari 14 and macOS Big Sur. This is a modern image format that uses advanced compression algorithms to achieve smaller file sizes without sacrificing image quality. WebP files are typically smaller than those earlier image formats. WebP lets you do animations with video-like quality, and so use it where it's a bad idea to use GIF due to their size or lack of colors.

One exciting addition to Safari 17 is JPEG-XL. JPEG-XL uses a new compression algorithm called "Modular Entropy Coding" that allows for greater flexibility in adjusting the compression ratio. A key feature of JPEG-XL is that you can losslessly convert, that is, not occur any data loss going from your existing JPEG files to JPEG-XL, all while significantly reducing their size by up to 60%.

AVIF is another modern image format that uses the AV1 video codec to achieve high compression rates without sacrificing image quality. Widely supported across all browsers, it is well suited for live photos and supports up to 12 bits color depth. It also has the broadest support, and you should include it as fallback. AVIF can be up to ten times smaller than JPEG.

In Safari 17, we added support for HEIC, also known as HEIF. It's an image format that uses the HEVC video codec compression algorithm to achieve small file sizes. But since it's not widely supported on other platforms, you will probably only want to use it as an alternative format. This is the format used by iPhones and iPad to save photos, so you can directly handle photo uploaded from your iPhone with no conversion. If you intend to display images using a WKWebView inside your app, this is the format you should be using, as it's hardware accelerated and can be rendered quickly and efficiently.

You don't have to choose!

// Support existing and modern image formats
<picture>
<source srcset="images/large/sophie.heic" type="image/heic" />
<source srcset="images/large/sophie.j×]" type="image/jx]" />
<source srcset="images/large/sophie.avif" type="image/avif" />
<img src="images/large/sophie.jpeg" />
</picture>

In the early 2000s, browser plugins like Flash and QuickTime emerged as a popular way to add video to websites. And in 2010, HTML5 was introduced, which made it possible to embed video directly into webpages without the need for those plugins.

HTTP Live Streaming (HLS) was introduced by Apple in 2009. One of the key features of HLS is its support for adaptive bitrate streaming, which allows for the delivery of the best possible video quality based on the user's internet connection speed and device capabilities.

img

Adaptive streaming in HLS works by dividing the video content into small chunks or segments, typically between two and ten seconds in length. Each segment is encoded at multiple bitrates, and these different bitrate versions are made available to the client via a manifest file in the form of an M3U8 multi-variant playlist. HLS does a brilliant job at selecting the best suitable variant. It's very simple to use and is the best solution for the end users. Unfortunately, even today, only Safari supports it. Web developers wanted more control and more flexibility, such as the selection and transfer of media data, or the ability to play DRMed content on desktop.

苹果开发的“HTTP 直播流”(HTTP Live Streaming,HLS)技术本身是一个协议,而 Edge 在 Windows 10 正式版发行之后确定支持了这项协议。直到目前为止,非苹果的浏览器只有 Chrome 和 Edge 支持了 HLS 技术,而且在 Chrome 上实现 HLS,还需要用户编写额外的 js 脚本。因此,只有 Edge 完全具备使用 HLS 进行网络转播的能力。

And so in 2013, the Media Source Extension (MSE) was published by the W3C body. It is a low-level toolkit that allows for adaptive streaming by giving the webpage more control and responsibilities for managing buffering and resolution. Overall, MSE has been a game changer for web developers. It has enabled the development of high-quality streaming experiences on the web and is now the most used web video technology. MSE has some drawbacks. It isn't particularly good at managing of buffer levels, the timing and amount of network access, and media variant selection. These inefficiencies have largely been immaterial on relatively powerful devices like modern general purpose computers. Power usage on mobile devices was much higher than with the HLS native player, and so MSE was never made available on iPhones because we couldn't achieve with MSE the required battery savings.

The new Managed Media Source API makes it easier for media website authors to support streaming media playback on constrained capability devices, all while allowing User Agents to react to changes in available memory and networking capabilities.

Build robust and resumable file transfers - WWDC23 - Videos - Apple Developer

下载、上传都可以断点续传

img

// Pausing and resuming a URLSessionUploadTask
let uploadTask = session.uploadTask(with: request, fromFile: fileURL)
uploadTask.resume()
guard let resumeData = await uploadTask.cancelByProducingResumeData() else {
// Upload cannot be resumed return
}

let newUploadTask = session.uploadTask(withResumeData: resumeData)
newUploadTask.resume()

// Retrieving resume data on error
do {
let (data, response) = try await session.upload(for: request, fromFile: fileURL)
} catch let error as URLError {
guard let resumeData = error.uploadTaskResumeData else {
// Upload cannot be resumed
return
}
}

如何使用 BackgroundSession