iOS 18のコントロールの作り方は?

Generated on 10/4/2024

1 search

iOS 18 introduces a new way to create controls that can be integrated across various system spaces like the control center, lock screen, and action button. These controls are built using WidgetKit, which was initially introduced in iOS 14 for creating visually rich widgets. In iOS 18, WidgetKit has been extended to support controls, allowing developers to provide quick access to their app's key actions.

To create a control in iOS 18, you can follow these steps:

  1. Define the Control: Use the new controls API to specify the type of control, a symbol, and an app intent. This will make your control available in the new controls gallery, where users can add it to their control center or assign it to the action button on their iPhone 15 Pro.

  2. Customize the Control: You can tailor the control's style using modifiers to match the action it performs. Ensure that your controls feature distinctive symbols for easy recognition.

  3. Integrate with System Spaces: Controls can be placed in the control center, lock screen, or action button, providing users with quick access to frequent tasks.

  4. Handle State Changes: Use the push notification API to handle state changes across devices, ensuring that actions performed on one device are reflected on others.

For a detailed walkthrough on building controls, you can refer to the session Extend your app’s controls across the system (02:13) which covers how to build a control, perform actions, and maintain its state.

Bring your app’s core features to users with App Intents

Bring your app’s core features to users with App Intents

Learn the principles of the App Intents framework, like intents, entities, and queries, and how you can harness them to expose your app’s most important functionality right where people need it most. Find out how to build deep integration between your app and the many system features built on top of App Intents, including Siri, controls and widgets, Apple Pencil, Shortcuts, the Action button, and more. Get tips on how to build your App Intents integrations efficiently to create the best experiences in every surface while still sharing code and core functionality.

What’s new in UIKit

What’s new in UIKit

Explore everything new in UIKit, including tab and document launch experiences, transitions, and text and input changes. We’ll also discuss better-than-ever interoperability between UIKit and SwiftUI animations and gestures, as well as general improvements throughout UIKit.

Extend your app’s controls across the system

Extend your app’s controls across the system

Bring your app’s controls to Control Center, the Lock Screen, and beyond. Learn how you can use WidgetKit to extend your app’s controls to the system experience. We’ll cover how you can to build a control, tailor its appearance, and make it configurable.

Platforms State of the Union

Platforms State of the Union

Discover the newest advancements on Apple platforms.

What’s new in SwiftUI

What’s new in SwiftUI

Learn how you can use SwiftUI to build great apps for any Apple platform. Explore a fresh new look and feel for tabs and documents on iPadOS. Improve your window management with new windowing APIs, and gain more control over immersive spaces and volumes in your visionOS apps. We’ll also take you through other exciting refinements that help you make expressive charts, customize and layout text, and so much more.

What’s new in StoreKit and In-App Purchase

What’s new in StoreKit and In-App Purchase

Learn how to build and deliver even better purchase experiences using the App Store In-App Purchase system. We’ll demo new StoreKit views control styles and new APIs to improve your subscription customization, discuss new fields for transaction-level information, and explore new testability in Xcode. We’ll also review an important StoreKit deprecation.