FreeRDP
Loading...
Searching...
No Matches
SceneDelegate.m
1/*
2 Scene delegate (UIScene life cycle)
3
4 Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz
5
6 This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
7 If a copy of the MPL was not distributed with this file, You can obtain one at
8 http://mozilla.org/MPL/2.0/.
9 */
10
11#import "SceneDelegate.h"
12
13#import "AboutController.h"
14#import "BookmarkListController.h"
15#import "AppSettingsController.h"
16#import "MainTabBarController.h"
17
18@implementation SceneDelegate
19
20@synthesize window = _window;
21
22- (void)scene:(UIScene *)scene
23 willConnectToSession:(UISceneSession *)session
24 options:(UISceneConnectionOptions *)connectionOptions
25{
26 if (![scene isKindOfClass:[UIWindowScene class]])
27 return;
28
29 UIWindowScene *windowScene = (UIWindowScene *)scene;
30 _window = [[UIWindow alloc] initWithWindowScene:windowScene];
31
32 MainTabBarController *tabBarController = [[[MainTabBarController alloc] init] autorelease];
33
34 // create bookmark view and navigation controller
35 BookmarkListController *bookmarkListController =
36 [[[BookmarkListController alloc] initWithNibName:@"BookmarkListView"
37 bundle:nil] autorelease];
38 UINavigationController *bookmarkNavigationController = [[[UINavigationController alloc]
39 initWithRootViewController:bookmarkListController] autorelease];
40
41 // create app settings view and navigation controller
42 AppSettingsController *appSettingsController =
43 [[[AppSettingsController alloc] initWithStyle:UITableViewStyleGrouped] autorelease];
44 UINavigationController *appSettingsNavigationController = [[[UINavigationController alloc]
45 initWithRootViewController:appSettingsController] autorelease];
46
47 // create about view controller
48 AboutController *aboutViewController =
49 [[[AboutController alloc] initWithNibName:nil bundle:nil] autorelease];
50
51 // add tab-bar controller to the main window and display everything
52 NSArray *tabItems =
53 [NSArray arrayWithObjects:bookmarkNavigationController, appSettingsNavigationController,
54 aboutViewController, nil];
55 [tabBarController setViewControllers:tabItems];
56
57 [_window setRootViewController:tabBarController];
58 [_window makeKeyAndVisible];
59}
60
61- (void)dealloc
62{
63 [_window release];
64 [super dealloc];
65}
66
67@end