UISwipeGesture之后UIViews的动画

时间:2013-11-12 23:49:22

标签: ios objective-c animation uiview uiswipegesturerecognizer

我正在开发一款应用。第一次人们打开应用程序,他们可以看到N个视图,其中包含我首先获得核心数据的一些信息。信息实体具有标题和文本N次(取决于来自Web服务的信息)。所以我必须向N UIViews展示这个信息。

视图必须更改每个Left SwipeGesture,就像电子书一样也有动画。

现在我可以更改视图及其信息,但它看起来不像动画页面更改。

这是我的代码。我有一个自定义视图,在视图控制器中我处理SwipeGesture:

int cont = 1;

- (void)viewDidLoad
{
    [super viewDidLoad];
    infoArray = [Info getAllInfos];

    UISwipeGestureRecognizer * swipeleft=[[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(swipeleft:)];
    swipeleft.direction=UISwipeGestureRecognizerDirectionLeft;
    [self.view addGestureRecognizer:swipeleft];

}
-(void)swipeleft:(UISwipeGestureRecognizer*)gestureRecognizer
{
    if(cont < [infoArray count]){
    Info *information = [infoArray objectAtIndex:cont];
    WPCustomInfoView *info = [[WPCustomInfoView alloc] initWithFrame:self.view.bounds];
    [info configureViewWithTitle:information.title andText:information.text];
    [self.view addSubview:info];
    cont++;
        NSLog(@"Swipe %d%@",cont, information.title);

    } else {
        NSLog(@"Swipe");

        WPLoginViewController *loginVC = [[WPLoginViewController alloc] init];
        [self.navigationController pushViewController:loginVC animated:YES];

    }
}

我已经阅读了一些PageViewController,但我不知道。可能有用吗?感谢

0 个答案:

没有答案
相关问题