适用于 iOS 14.0+ 的 UIHostingConfiguration 的向后移植

UIHostingConfigurationBackport

Swift Package Manager

适用于iOS 14.0+的UIHostingConfiguration的向后移植。

import UIHostingConfigurationBackport

cell.contentConfiguration = UIHostingConfigurationBackport {
    HStack {
        Image(systemName: "star").foregroundStyle(.purple)
        Text("Favorites")
        Spacer()
    }
}

安装

Swift Package Manager

.package(url: "https://github.com/woxtu/UIHostingConfigurationBackport.git", from: "0.1.0")

许可证

根据 MIT 许可证获得许可。

GitHub

查看 Github