Skip to content

Commit 08b5d15

Browse files
committed
Update README.md
1 parent c910ce6 commit 08b5d15

1 file changed

Lines changed: 50 additions & 1 deletion

File tree

README.md

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,55 @@
11
DRWindowController
22
=========
33

4-
An Objective-C / CocoaTouch class for managing layers of UIViews and UIViewControllers. This is useful because Cocoa Touch does not allow you to create multiple UIWindows.
4+
An Objective-C / Cocoa Touch class for managing a vertical "stack" of UIViews and UIViewControllers. This is a useful alternative to adding additional UIWindows to an application or having an unorganized appraoch to adding subviews to the main UIWindow. The Z-position of views can be specified to let you arrange which views are in front of others.
5+
6+
7+
## Example ##
8+
9+
### Setting your root view controller
10+
```objective-C
11+
DRWindowController *windowController = [[DRWindowController alloc] initWithNibName:nil bundle:nil];
12+
self.window.rootViewController = windowController;
13+
[self.window makeKeyAndVisible];
14+
15+
// Add root controller to window manager
16+
UIViewController *mainViewController = /* your main controller */
17+
[windowController addWindowController:familyController atIndex:1];
18+
```
19+
20+
### Adding custom UI above main UI
21+
```objective-C
22+
23+
// add newcontroller to window controller
24+
UIViewController *partialScreenModalController = /* whatever */
25+
[windowController addWindowController:partialScreenModalController atIndex:2 withCompletion:nil];
26+
27+
28+
// add new UIView to the window
29+
UIView *customAlertView = /* as you will */
30+
[windowController addWindowView:customAlertView atIndex:100];
31+
32+
```
33+
34+
## Interface ##
35+
36+
```objective-C
37+
typedef void (^DRWindowCompletionBlock)();
38+
39+
@interface DRWindowController : UIViewController
40+
41+
// Adding new views
42+
- (void)addWindowView:(UIView *)view atIndex:(NSInteger)index;
43+
- (void)addWindowController:(UIViewController *)controller atIndex:(NSInteger)index;
44+
- (void)addWindowController:(UIViewController *)controller atIndex:(NSInteger)index withCompletion:(DRWindowCompletionBlock)handler options:(NSInteger)options; // todo:make a typedef
45+
- (void)addWindowController:(UIViewController *)controller atIndex:(NSInteger)index withCompletion:(DRWindowCompletionBlock)handler;
46+
47+
// Removing views
48+
- (void)removeWindowView:(UIView *)view;
49+
- (void)removeWindowController:(UIViewController *)controller;
50+
- (void)removeAllControllers;
51+
52+
@end
53+
```
554
655
See https://github.com/objectiveSee/DRWindowController/blob/master/DRWindows/DRWindows/DRWindows/DRWindowController.h

0 commit comments

Comments
 (0)