1.第一步(把冰箱门打开)
//客服电话
NSString *hotLineStr = [NSString removerBlankString:self.creditCardModel.hotline];
UIActionSheet * actionSheet = [[UIActionSheet alloc] initWithTitle:@"拨打客服热线?"delegate:self cancelButtonTitle:@"取消" destructiveButtonTitle:hotLineStr otherButtonTitles:nil];
[actionSheet showInView:self.view];
2.第二步(把大象放进去)
#pragma mark - UIActionSheetDelegate Method
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex (NSInteger)buttonIndex {
if (buttonIndex == 0) {
NSString *hotLineStr = [NSString removerBlankString:[NSString removerBlankString:self.creditCardModel.hotline]];
UIAlertView * alertView = [[UIAlertView alloc] initWithTitle:nil message:hotLineStr delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"呼叫", nil];
[alertView show];
}
}
3.第三步(把冰箱门盖上)
#pragma mark - UIAlertViewDelegate Method
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex == 1) {
NSString *hotLineStr = [NSString removerBlankString:[NSString removerBlankString:self.creditCardModel.hotline]];
NSString * phoneNumber = [NSString stringWithFormat:@"tel://%@", hotLineStr];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:phoneNumber]];
}
}
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。