DRWindowController 1.0.1

DRWindowController 1.0.1

测试已测试
语言语言 Obj-CObjective C
许可证 CC
发布时间上次发布2014年12月

Danny Ricciotti 维护。



  • Danny Ricciotti

Objective-C / Cocoa Touch 类,用于管理一个垂直的 "堆叠" UIView 和 UIViewController。这相对于向应用程序中添加额外的 UIWindows 或无组织地添加子视图到主 UIWindow 是一个有用的替代方案。可以指定视图的 Z 位置,让您排列哪些视图在另一些视图前面。

示例

设置您的根视图控制器

DRWindowController *windowController = [[DRWindowController alloc] initWithNibName:nil bundle:nil];
self.window.rootViewController = windowController;
[self.window makeKeyAndVisible];

// Add root controller to window manager
UIViewController *mainViewController = /* your main controller */
[windowController addWindowController:familyController atIndex:1];

在主 UI 上添加自定义 UI

// add newcontroller to window controller
UIViewController *partialScreenModalController = /* whatever */
[windowController addWindowController:partialScreenModalController atIndex:2 withCompletion:nil];


// add new UIView to the window
UIView *customAlertView = /* as you will */
[windowController addWindowView:customAlertView atIndex:100];

接口

typedef void (^DRWindowCompletionBlock)();

@interface DRWindowController : UIViewController

// Adding new views
- (void)addWindowView:(UIView *)view atIndex:(NSInteger)index;
- (void)addWindowController:(UIViewController *)controller atIndex:(NSInteger)index;
- (void)addWindowController:(UIViewController *)controller atIndex:(NSInteger)index withCompletion:(DRWindowCompletionBlock)handler options:(NSInteger)options; // todo:make a typedef
- (void)addWindowController:(UIViewController *)controller atIndex:(NSInteger)index withCompletion:(DRWindowCompletionBlock)handler;

// Removing views
- (void)removeWindowView:(UIView *)view;
- (void)removeWindowController:(UIViewController *)controller;
- (void)removeAllControllers;

@end

请参阅 https://github.com/objectiveSee/DRWindowController/blob/master/DRWindows/DRWindows/DRWindows/DRWindowController.h