Shion のもくログ(旧: Shion の技術メモ)

使った技術のメモや、うまくいかなかった事とかを綴ります

PR

2025/09/27 ~ 2025/10/03 のもくもく日記

もくもく 前回までは

2025/09/20 ~ 2025/09/26 のもくもく日記 をご覧ください。

途中経過

その1

Xcode でUI Preview する方法、いつの間にかSwift Macro ベースになっていた 👀

出始めの頃は、下記コードのように色々実装するものがあったけど、 新しい方法 はより簡潔に書けるし、UIKit も念頭に置いているようなので、より使いやすくて良いかも。

import Capacitor
import SwiftUI

struct BridgeVCWrapper: UIViewControllerRepresentable {
    typealias UIViewControllerType = CAPBridgeViewController

    func makeUIViewController(context: Context) -> CAPBridgeViewController {
        CAPBridgeViewController()
    }

    func updateUIViewController(_ uiViewController: CAPBridgeViewController, context: Context) {}
}

struct BridgeVCWrapper_Previews: PreviewProvider {
    static var previews: some View {
        BridgeVCWrapper()
    }
}

その2

業務でBackground Fetch を有効にした時は手入力で済ませちゃったけど、 Xcode でTarget 選択している状態で「+」をクリックすれば、いくつか項目が出てきて、より簡単に設定出来たっぽい 👀

https://developer.apple.com/documentation/xcode/adding-capabilities-to-your-app

その3

他のxcconfig を参照する時、 #include? とすると、ファイルが存在しない場合もビルドエラーにならないらしい 👀

https://developer.apple.com/documentation/xcode/adding-a-build-configuration-file-to-your-project#Include-settings-from-other-build-configuration-files

その4

増分ビルド時間の改善について、ドキュメントがあった。

その5

macOS Sequoia にアップグレードしたのだけど、ウィンドウを画面端に移動するとフルスクリーンや画面半分にリサイズされて、ちょっと戸惑った。

設定の「デスクトップとDock」のウィンドウでその機能を無効化できるようなので、しばらく無効にしよっとw

その6

Kotlin の後方互換性、ブログ ライブラリ更新をサボったらKotlinの互換性がなくなった - 縁側プログラミング が分かりやすかった。

試しにkotlin-stdlib 2.2.0 ベースの okhttp-android 5.1.0 をKotlin 1.9 系のアプリに組み込んでみたら、下記ビルドエラーになることを確認した。

Class 'http://okhttp3.Call' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.2.0, but the compiler version 1.9.0 can read versions up to 2.0.0.

Kotlin Gradle Plugin やAndroid Gradle Plugin のサポート範囲が色々あるので、それを見比べつつ、適切なKotlin バージョンを選択できるようになりたい。

今回の進捗

※関連SNS
PR