KRDragView 0.8

KRDragView 0.8

测试测试
语言语言 Objective-CObjective C
许可 MIT
发布最后发布2015年5月

Kalvar Lin 维护。



截图

KRDragView   KRDragView
KRDragView   KRDragView

Podfile

platform :ios, '7.0'
pod "KRDragView", "~> 0.8"

如何开始

KRDragView 模拟在背景下面拖动和滑动视图来显示菜单。就像卡片一样,您可以拖动视图并释放它来移动/显示其下的事物。

#pragma --mark Sample Methods
-(void)draggingFromTopToBottom
{
    //krDragViewModeToBottomAllowsDraggingBack mode is dragging the view from top to bottom.
    krDragViews = [[KRDragView alloc] initWithView:self.outView
                                          dragMode:krDragViewModeToBottomAllowsDraggingBack];
    self.krDragViews.sideInstance   = 80.0f;
    self.krDragViews.durations      = 0.15f;
    //To set the distance of cross central line.
    self.krDragViews.openDistance   = 80.0f; //self.view.frame.size.height / 2;
    self.krDragViews.openCompletion = ^{
        NSLog(@"open");
    };
    self.krDragViews.closeCompletion = ^{
        NSLog(@"close");
    };
    [self.krDragViews start];
}

-(void)draggingFromBottomToTop
{
    //krDragViewModeToTopAllowsDraggingBack mode is dragging the view from bottom to top.
    krDragViews = [[KRDragView alloc] initWithView:self.outView
                                          dragMode:krDragViewModeToTopAllowsDraggingBack];
    self.krDragViews.sideInstance   = self.view.frame.size.height;
    self.krDragViews.durations      = 0.15f;
    //To set the distance of cross central line.
    self.krDragViews.openDistance   = 80.0f; //self.view.frame.size.height / 2;
    self.krDragViews.openCompletion = ^{
        NSLog(@"open");
    };
    self.krDragViews.closeCompletion = ^{
        NSLog(@"close");
    };
    [self.krDragViews start];
}

#pragma --mark View Recycles
- (void)viewDidLoad
{
    [super viewDidLoad];

    [self draggingFromTopToBottom];
    //[self draggingFromBottomToTop];

}

-(void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    //[self.krDragViews start];
}

-(void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    [self.krDragViews stop];
}

#pragma IBActions
-(IBAction)open:(id)sender
{
    [self.krDragViews open];
}

-(IBAction)back:(id)sender
{
    [self.krDragViews backToInitialState];
}

版本

KRDragView 现在是 V0.8 测试版。

许可

KRDragView 在 MIT 许可下可用(或您想做什么)。有关更多信息,请参阅 LICENSE 文件。