Commit 0ccd016e authored by Felix Paul Kühne's avatar Felix Paul Kühne

library: show first steps tutorial on first launch

parent 5d752352
......@@ -23,6 +23,9 @@
#import "UIBarButtonItem+Theme.h"
#import "VLCFirstStepsViewController.h"
/* prefs keys */
static NSString *kDisplayedFirstSteps = @"Did we display the first steps tutorial?";
@implementation EmptyLibraryView
- (IBAction)learnMore:(id)sender
......@@ -50,6 +53,12 @@
@implementation VLCPlaylistViewController
+ (void)initialize
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults registerDefaults:@{kDisplayedFirstSteps : [NSNumber numberWithBool:NO]}];
}
- (void)loadView {
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
_tableView = [[UITableView alloc] initWithFrame:[UIScreen mainScreen].bounds style:UITableViewStylePlain];
......@@ -135,6 +144,13 @@
{
[super viewDidAppear:animated];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if (![[defaults objectForKey:kDisplayedFirstSteps] boolValue]) {
[self.emptyLibraryView performSelector:@selector(learnMore:) withObject:nil afterDelay:1.];
[defaults setObject:[NSNumber numberWithBool:YES] forKey:kDisplayedFirstSteps];
[defaults synchronize];
}
if ([[MLMediaLibrary sharedMediaLibrary] libraryNeedsUpgrade]) {
self.navigationItem.rightBarButtonItem = nil;
self.navigationItem.leftBarButtonItem = nil;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment