Skip to content

Fix blank card brand logos on Xcode 27 (SPM Assets.xcassets processing) - #117

Merged
koutaku921 merged 3 commits into
payjp:masterfrom
bu-tokumitsu:feature/ios27-support
Aug 14, 2026
Merged

koutaku921 merged 3 commits into
payjp:masterfrom
bu-tokumitsu:feature/ios27-support

Conversation

@bu-tokumitsu

Copy link
Copy Markdown
Contributor

概要

Xcode 27 でビルドすると CardFormViewController の受け付けカードブランドロゴ(Visa / MasterCard など)が空白表示になる不具合を修正

報告

原因

  • Xcode 27 の SwiftPM で Assets.xcassets が自動的にはコンパイル対象にならなくなったことで、パッケージ内の画像アセットが実行時に見つからなくなっていた点にあります。Package.swift の resources に .process として明示的に登録することで対応しました。
  • あわせて、Xcode 27 / iOS 27 対応の周辺修正を同梱しています。

対応内容

  • Assets.xcassets を SwiftPM の Resource Processing 経由でコンパイル ([Bug] Card brand logos are completely blank when building with Xcode 27 #116 本対応)
    • Package.swift の resources に Assets.xcassets を .process として追加し、Xcode 27 でも SPM
      経由でアセットカタログがコンパイル・同梱されるようにした
  • example-swift を UIScene ベースのライフサイクルへ移行
    • Xcode 27 での動作確認用に SceneDelegate.swift を追加し、Info.plist に UIApplicationSceneManifest を定義
    • AppDelegate からウィンドウ生成処理を撤去し、3-D Secure のリダイレクト URL ハンドリングを SceneDelegate 側に移譲
  • CardFormViewController の Submit ボタン二重表示を修正
    • UIScene ライフサイクル化に伴い、iOS 27 Simulator でハードウェアキーボード接続時に画面下部の submitButton と inputAccessoryView 上の accessorySubmitButton が同時に表示される事象が発生
    • 原因: Simulator でソフトウェアキーボードが出ないと keyboardWillShowNotification が発火せず、下部ボタンが隠れないまま inputAccessoryView だけが表示されていた
    • 対応: submitButton.isHidden の切り替えトリガを keyboardWillShow/Hide から UITextField.textDidBeginEditing/EndEditingNotification に変更。inputAccessoryView の表示条件(first responder状態)と一致するイベントに紐付け、キーボード表示有無に依存せず排他制御されるようにした

関連 Issues

動作検証

  • Xcode 27 / iOS 27 Simulator で example-swift を起動し、CardFormViewController(labelStyled / tableStyled /
    displayStyled)を開いてブランドロゴが正しく表示されることを確認
  • 同環境でテキストフィールドをフォーカスした際、下部の「カードを登録」ボタンが非表示になり、inputAccessoryView
    のボタンのみが表示されること、フォーカスを外すと下部ボタンが再表示されることを確認
  • 3-D Secure のリダイレクト URL 復帰が UIScene 経由でも正常に動作すること
  • Xcode 26 系でも既存動作にリグレッションがないことを確認
  • fork リポジトリ上で CI ビルドが通過することを確認: https://github.com/bu-tokumitsu/payjp-ios/actions/runs/31686444161

bu-tokumitsu and others added 3 commits August 12, 2026 13:09
Add SceneDelegate to the UIKit example so it follows the scene-based
lifecycle Apple recommends for iOS 27. Move URL open handling for the
3-D Secure redirect from AppDelegate to SceneDelegate.openURLContexts,
declare the scene manifest in both Info.plist variants (SPM and
Carthage), and align example-swift-carthage's deployment target with
example-swift at iOS 15.0.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Switch the SPM resource declaration for Assets.xcassets from .copy to
.process so actool runs and Assets.car is emitted into the bundle.
Under Xcode 27 the previous .copy declaration no longer produced a
compiled asset catalog, causing CardBrand.logoImage and other
UIImage(named:in: .module) lookups to return nil and rendering the
CardFormViewController brand logos blank (payjp#116).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Switch the bottom submitButton visibility toggle from keyboard show/hide
notifications to UITextField begin/end editing notifications. The
accessorySubmitButton is attached as the text fields' inputAccessoryView,
so its visibility is bound to first responder state — not keyboard frame
changes. On the iOS 27 simulator with a hardware keyboard connected, the
software keyboard does not appear (so keyboardWillShow does not fire),
but the inputAccessoryView still shows, causing both buttons to be
visible at once.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@koutaku921 koutaku921 self-assigned this Aug 13, 2026

@laiso laiso left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Package.swift のアセット処理(.copy → .process)を確認しました。

• Xcode 26 安定版でビルドできること
• Swift サンプルアプリでブランドロゴが表示されること
• 同アプリからカード登録まで完了できること

を確認し、問題はありませんでした。

@koutaku921 koutaku921 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

有識者レビューが完了したので、マージのためのapproveを実施します。

@koutaku921
koutaku921 merged commit c217173 into payjp:master Aug 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants