NSScreencast Episode #92 Background Fetch
Background Fetch - NSScreencast
Weather appでlocationからの検索をバックグラウンドを使って実行
- weather app
- search by location
- WeatherFetcher
- sharedInstance
- cachedResult
- needsRefresh
- NSTimeInterval interval = abs([lastUpdated timeIntervalSinceNow]);
- timePassed
- application capability
- background fetch
- app delegate
- [application setMinimumBackgroundFetchInterval:UIApplicationBackgroundFetchIntervalMinimum];
- UIApplicationBackgroundFetchIntervalMinimum
- UIApplicationBackgroundFetchIntervalNever
- performFetchWithCompletionHandler
- cachedResult
- [application setMinimumBackgroundFetchInterval:UIApplicationBackgroundFetchIntervalMinimum];
- testing
- breakponit with sound
- duplicate scheme
- check background fetching
- fetch twice problem
- not reload data in background
- applicationState] == UIApplicationStateActive
- not reload data in background
- problem value not refreshed on next view loading
- [NSNotificationCenter defaultCenter] postNotificationName:@"WeatherUpdated"
- in viewDidLoad
- [NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onBackgroundUpdate:) name:@"WeatherUpdated"
- onBackgroundUpdate
- snapshot has new data
- applicationDidBecomeActive