Я хочу отобразить нативный DatePicker для поля внутри моего ярлыка приложения (iOS 18), как это делает мое другое приложение. Что бы я ни делал, это простое текстовое поле. Я вычистил свою папку сборки, переустановил свое приложение, но ничего не работает. < /P>
struct CreateRecordIntent: AppIntent {
static var name: String = "createRecordShortcut"
static var title: LocalizedStringResource = "Record.Create"
static var description: IntentDescription = "Record.Create.Description"
static var openAppWhenRun: Bool = true
@Parameter(
title: "DateAndTime",
default: Date()
)
var date: Date
func perform() async throws -> some IntentResult {
var userInfo: [AnyHashable: Any] = [:]
NotificationCenter.default.post(name: .createRecordShortcut, object: nil, userInfo: userInfo.isEmpty ? nil : userInfo)
return .result()
}
}
Подробнее здесь: https://stackoverflow.com/questions/797 ... -shortcuts