How can you make something like a tooltip when moving to a new scene, so that everything appears automatically once? I try to make through alert, but can there be an easier way?

    1 answer 1

    I suggest you use this method.

    let defaults1 = NSUserDefaults.standardUserDefaults() var count1 = defaults.integerForKey("count3") ?? 0 if count1 == 0 { // ΠΊΠ°ΠΆΠ΄Ρ‹Π΅ 40 Π²Ρ…ΠΎΠ΄ showAlert(count1) } count1 += 1 defaults1.setInteger(count1, forKey: "count3") 

    This method will be used only once at the first launch.

    and here is an example of an alert.

     func showAlert(count:Int) { let alert = UIAlertController(title: "Π’Π½ΠΈΠΌΠ°Π½ΠΈΠ΅", message: "Если Ρƒ Вас Π²ΠΎΠ·Π½ΠΈΠΊΠ°ΡŽΡ‚ ΠΏΡ€ΠΎΠ±Π»Π΅ΠΌΡ‹ Π² Ρ€Π°Π±ΠΎΡ‚Π΅ прилоТСния, Π’Ρ‹ ΠΌΠΎΠΆΠ΅Ρ‚Π΅ ΠΎΠΏΠΎΠ²Π΅ΡΡ‚ΠΈΡ‚ΡŒ нас ΠΎΠ± этом, Π²Ρ‹Π±Ρ€Π°Π² ΠΏΡƒΠ½ΠΊΡ‚ Β«ΠžΠΏΠΎΠ²Π΅ΡΡ‚ΠΈΡ‚ΡŒ ΠΎΠ± ошибкС» Π² ΠΏΡ€Π°Π²ΠΎΠΌ Π²Π΅Ρ€Ρ…Π½Π΅ΠΌ ΡƒΠ³Π»Ρƒ экрана.", preferredStyle: .Alert) alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: nil)) // show the alert dispatch_async(dispatch_get_main_queue(), { () -> Void in self.presentViewController(alert, animated: true, completion: nil) }) } 

    Good luck.