there is a clock
time = NSTimer.scheduledTimerWithTimeInterval(1.0, target: self, selector: "upTimeLabel", userInfo: nil, repeats: true)
} // ΡΠΊΠΎΠ±ΠΊΠ° Π·Π°ΠΊΡΡΡΠΈΡ viewDidLoad = ? override func viewWillAppear(animated: Bool) { super.viewWillAppear(animated) upTimeLabel() } func upTimeLabel() { let formatter = NSDateFormatter() // formatter.timeStyle = .MediumStyle //ΡΡΠ°ΡΠΎΠ΅ Π²ΡΡΠ°ΠΆΠ΅Π½ΠΈΠ΅... formatter.dateFormat = "HH:mm:ss" timeShow.text = formatter.stringFromDate(clock.currentTime) var soundClock = formatter.dateFormat switch soundClock { case "18 53 00" : let path = NSBundle.mainBundle().pathForResource("k_k0001", ofType: "mp3")! let url = NSURL(fileURLWithPath: path) do { let sound = try AVAudioPlayer(contentsOfURL: url) self.soundClock = sound // soundClock.numberOfLoops = -1 sound.play() } catch { // couldn't load file :( } // ΡΠΊΠΎΠ±ΠΊΠ° Π·Π°ΠΊΡΡΡΠΈΡ ΠΏΠ»Π΅Π΅ΡΠ° = do... default : let path = NSBundle.mainBundle().pathForResource("soundAvtomat", ofType: "mp3")! let url = NSURL(fileURLWithPath: path) do { let sound = try AVAudioPlayer(contentsOfURL: url) self.soundClock = sound // soundClock.numberOfLoops = -1 sound.play() } catch { // couldn't load file :( } // ΡΠΊΠΎΠ±ΠΊΠ° Π·Π°ΠΊΡΡΡΠΈΡ ΠΏΠ»Π΅Π΅ΡΠ° // ) ΡΠΊΠΎΠ±ΠΊΠ° Π·Π°ΠΊΡΡΡΠΈΡ case... } //ΡΠΊΠΎΠ±ΠΊΠ° switch
and so on ... you need to build in your sound every hour ... by default everything works out, (it means it lives ...) but case doesnβt grasp in the symbolical (OS no) - tried to change the format in the symbol - commas and: but not at all ... if to substitute in Int = OSH