-
Notifications
You must be signed in to change notification settings - Fork 568
/
Copy pathSBExampleViewController.m
39 lines (32 loc) · 1.14 KB
/
SBExampleViewController.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//
// SBExampleViewController.m
// JDStatusBarNotificationExample
//
// Created by Markus on 29.10.13.
// Copyright (c) 2013 Markus. All rights reserved.
//
#import "SBExampleViewController.h"
#import "Swift-To-ObjC-Header.h"
@implementation SBExampleViewController {
UIViewController *_hostingController;
}
- (instancetype)initWithTitle:(NSString *)title {
self = [super initWithNibName:nil bundle:nil];
if (self) {
self.title = title;
}
return self;
}
- (void)loadView {
self.view = [[UIView alloc] init];
self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
self.view.backgroundColor = [UIColor systemGray6Color];
UIViewController *hostingController = [ExamplesScreenFactory createExamplesScreenWithTitle:self.title];
[hostingController willMoveToParentViewController:self];
[self addChildViewController:hostingController];
[self.view addSubview:hostingController.view];
hostingController.view.frame = self.view.bounds;
hostingController.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
_hostingController = hostingController;
}
@end