Help us understand the problem. What is going on with this article?

iOSでアプリケーションの状態を判定するメソッド

More than 5 years have passed since last update.
if (UIApplicationStateActive == [[UIApplication sharedApplication] applicationState]) {
    NSLog(@"Active");
} else if (UIApplicationStateInactive == [[UIApplication sharedApplication] applicationState])  {
    NSLog(@"Inactive");
} else if (UIApplicationStateBackground == [[UIApplication sharedApplication] applicationState])  {
    NSLog(@"Background");
}
yimajo
株式会社キュリオシティソフトウェアの代表です。iOSアプリを作っています。最近はCombine frameworkガイドブック / RxSwift研究読本などを書いてます。
https://swift.booth.pm/
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away