0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[Swift] バックグラウンドで処理を継続させたい場合に、処理数が多いとダメな時があるっぽい

Posted at

バックグラウンドでも動くタイマーアプリを作ろうとして
https://qiita.com/rc_code/items/f0d9d19e7844fbcf0260
↑この記事と
https://qiita.com/SatoTakeshiX/items/8e1489560444a63c21e7
↑この記事を参考に作っていた時にわかったこと

動くパターン

timer = Timer.scheduledTimer(
            timeInterval: 0.1, //⇦ここ
            target: self,
            selector: #selector(handleTimer(_:)),
            userInfo: nil,
            repeats: true
        )

動かないパターン

timer = Timer.scheduledTimer(
            timeInterval: 0.01, //⇦ここ
            target: self,
            selector: #selector(handleTimer(_:)),
            userInfo: nil,
            repeats: true
        )

覚書。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?