Search code examples
watchkitapple-watchwatchos-2

How to set a date for WKInterfaceDate


Can WKInterfaceDate show a date & time different from the current values?

If yes, how can I set a different date?


Solution

  • apple documentation says:

    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.

    For different date you can simply create label and set it's text to a String that you create with NSDateFormatter out of some NSDate.