如何为 WKInterfaceDate 设置日期
How to set a date for WKInterfaceDate
WKInterfaceDate 可以显示与当前值不同的日期和时间吗?
如果是,我如何设置不同的日期?
苹果文档说:
A WKInterfaceDate object is a custom label that displays the current
date or time. Use this object when you want to display date or time
information without further interaction from your WatchKit extension.
At runtime, use the date object to configure the appearance of the
date and time information being displayed.
对于不同的日期,您可以简单地创建标签并将其文本设置为您使用 NSDateFormatter 从某些 NSDate 创建的字符串。
WKInterfaceDate 可以显示与当前值不同的日期和时间吗?
如果是,我如何设置不同的日期?
苹果文档说:
A WKInterfaceDate object is a custom label that displays the current date or time. Use this object when you want to display date or time information without further interaction from your WatchKit extension. At runtime, use the date object to configure the appearance of the date and time information being displayed.
对于不同的日期,您可以简单地创建标签并将其文本设置为您使用 NSDateFormatter 从某些 NSDate 创建的字符串。