-1

I'm trying to make a alarm clock app but I don't know how to display the time in real time. Would I have to do that programmatically or using an object like UIDatePicker? I have tried searching for it but it is all for Objective-C which I am not at all familiar with.

If you have any questions please comment them down below.

alex
  • 1,746
  • 6
  • 19
  • 34
  • Did you checked this http://stackoverflow.com/questions/12076409/add-a-running-countup-display-timer-to-an-ios-app-like-the-clock-stopwatch – Sharon Nathaniel Oct 28 '14 at 03:44
  • @SharonNathaniel yes I saw this post but I didn't understand what it was saying. – alex Oct 28 '14 at 03:50
  • 2
    If you look at the answer its pretty simple, you need to take a time control with time interval of 1.0 second. This timer will execute a function - (void)timerTick:(NSTimer *)timer that will display current time. Since timer will execute this every time , you will be able to get current time in real time. – Sharon Nathaniel Oct 28 '14 at 03:52

1 Answers1

1
var date = NSDate()
var outputFormat = NSDateFormatter()
outputFormat.locale = NSLocale(localeIdentifier:"en_US")
outputFormat.dateFormat = "HH:mm:ss"
println(outputFormat.stringFromDate(date))
Steve Rosenberg
  • 19,348
  • 7
  • 46
  • 53