[解決方案]應用程序幫助導航

現在有很多應用程序第一次啓動的時候都有一個左右滑動的幫助導航,這些導航往往是介紹應用程序的新功能。

新應用在第一次啓動時或者新版本升級完第一次啓動時就顯示。

解決方法就是先檢測是不是當前版本的第一次啓動。

NSString *appFirstLaunchFlag = @"app_first_launch_flag";
NSString *cachedAppVersion  = [[NSUserDefaults standardUserDefaults] objectForKey:appFirstLaunchFlag];
NSString *currentAppVersion = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
if([currentAppVersion compare:cachedAppVersion options:NSNumericSearch] == NSOrderedDescending)
{
    // First time launch
    // Do some work here
    [[NSUserDefaults standardUserDefaults] setObject:currentAppVersion forKey:appFirstLaunchFlag];
}
else
{}







發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章