Upgrade to Pro — share decks privately, control downloads, hide ads and more …

iOS 18 新機能対応

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
Avatar for mika mika
November 21, 2024
370

iOS 18 新機能対応

Avatar for mika

mika

November 21, 2024
Tweet

Transcript

  1. コントロールとは? • アプリの機能に素早くアクセスできる ◦ コントロールボタン ▪ アプリのアクション実⾏や特定領域への直接遷移といった機能を割り当てられる ▪ カメラ起動など ◦

    コントロールトグル ▪ 機能のオン/オフなど、状態を切り替える機能を割り当てられる ▪ ライトのオン/オフなど 9 https://www.apple.com/newsroom/2024/06/ios-18-makes-iphone-more-personal-capable-and-intelligent-than-ever/
  2. ⽇経電⼦版のコントロール概要 • 5つの画⾯に遷移するコントロールに対応しました! ◦ トップ ◦ 朝刊‧⼣刊 ◦ For You

    ◦ フォロー‧保存 ◦ ⽇経電⼦版を検索 • 移動中や予定の合間に素早くニュースを チェックしたい⽅におすすめ 11
  3. コントロールの実装 • WWDC2024 “Extend your app’s controls across the system”

    を確認 • WidgetKit を⽤いて作成される ◦ Widgets の作成⽅法を知っていれば、コントロールも同じように作成できる ◦ 既存の WidgetExtension に追加できる • ボタンとトグルの⼆種類 ◦ ControlWidgetButton ◦ ControlWidgetToggle 13 https://developer.apple.com/videos/play/wwdc2024/10157/
  4. コントロールの実装 • ControlConfiguration は⼆種類 ◦ StaticControlConfiguration : 構成不可能 ◦ AppIntentControlConfiguration:

    構成可能(プロパティが選べる) • AppIntent を使ってアクションを実⾏する ◦ AppIntent を試す、良いチャンス! 14 https://developer.apple.com/videos/play/wwdc2024/10157/
  5. コントロールの実装 - デザイン - • コントロールは置ける要素が決まっている • アイコン ◦ アイコンは

    Widgets の機能を直感的に理解できるものが望ましい ◦ 標準の SF Symbols またはカスタムシンボルに限られる ◦ もし独⾃のロゴやアイコンを使⽤したい場合は、カスタムシンボルを準備する必要がある 15 https://developer.apple.com/jp/design/human-interface-guidelines/controls
  6. コントロールの実装 - AppIntent - ⽇経電⼦版のコントロールは、アプリの特定の画⾯を開く機能 • AppIntent のターゲットには本体アプリを含める • AppIntent

    の perform 関数から直接カスタム URL スキームを開くことはでき ない ◦ universal link を使⽤する ◦ 作成した SampleAppIntent に static property として URL を渡し、アプリ起動処理時に SampleAppIntent.url をハンドリングする(⽇経電⼦版はこちらを採⽤) 16
  7. コントロールの実装 - AppIntent - struct SampleAppIntent: AppIntent { static var

    openAppWhenRun: Bool = true private(set) static var url: URL? static func resetStoredURL() { url = nil } @MainActor func perform() async throws -> some IntentResult { // カスタム URL スキーム Self.url = URL(string: "sampleapp://")! return .result() } } 17 func handle(urlSchemes: [any URLScheme]) -> Bool { guard let url = SampleAppIntent.url else { return false } SampleAppIntent.resetStoredURL() for urlScheme in urlSchemes where urlScheme.canOpen(url: url) { return true } return false } perform 関数の中で、static property として URL を渡す アプリ起動処理時に SampleAppIntent.url をハンドリン グして、期待した画⾯に遷移する AppIntent App 本体
  8. Widgets の地味に嬉しいアップデート struct SampleWidget: Widget { var body: some WidgetConfiguration

    { AppIntentConfiguration(...) .promptsForUserConfiguration() } } 24 • Configurable な Widgets が追加された時に ⾃動的にオプションを表⽰出来る
  9. App Store でフィーチャー • 最新機能対応すると取り上げてもらえる可能性がある • ⽇経電⼦版は iOS 18 におすすめのアプリとして

    App Store に掲載 ◦ コントロール ◦ ホーム画⾯のカスタマイズ ◦ ロック画⾯のカスタマイズ ◦ (昨年対応した)スタンバイ → ◦ など 26
  10. まとめ 新 OS 対応はやりがいだらけ! • プロダクトとして ◦ ユーザーエンゲージメントをあげるアイディアが隠れている ▪ ⽇頃から

    iOS の最新技術をキャッチアップしている iOS エンジニアだからこそ、提案が 出来る ◦ App Store で取り上げてもらえる可能性がある ▪ インプレッションが増える ⤴ • エンジニアとして ◦ 新しい技術を⼿探りで実装していくプロセスは楽しい 27