PromiseKit 应用实践

来源:互联网 发布:sql注入 or 1 1 编辑:程序博客网 时间:2024/06/06 03:37

UIAlertView

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Title" message:@"Message" delegate:nil cancelButtonTitle:@"Cancel" otherButtonTitles:@"Done",nil];[alert promise].then(^(id index, UIAlertView *alertView){    NSLog(@"confirm # %@ from # %@",index,alertView);});

UIActionSheet

 UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Title" delegate:nil cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Done" otherButtonTitles: nil];[actionSheet promiseInView:self.view].then(^(id index){    NSLog(@"confirm # %@ ",index);});
0 0