Objective C Method : Trying to first have a user enter credit card information than agree to terms and conditions. Currently, the app is forcing a user to check terms and conditions than enter credit card information. What is a better method or better way to do this? I am not strong in Objective C. 

-(void)textFieldDidBeginEditing:(UITextField *)textField{
    
    if(_agreedToTerms){
        
        if(!_canceledScan){
    CardIOPaymentViewController *cardV = [[CardIOPaymentViewController alloc]initWithPaymentDelegate:self];
    [cardV setCollectCVV:NO];
        //CardIOPaymentViewController *cardV = [[CardIOPaymentViewController alloc]initWithPaymentDelegate:self];
     [cardV setCollectExpiry:YES];
       // [cardV setCollectPostalCode:YES];
        [self presentViewController:cardV animated:YES completion:nil];
        }
    }else{
    
    UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Error" message:@"Please agree to terms" preferredStyle:UIAlertControllerStyleAlert];
    [alertController addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action)
                                {
                                    
                                }]];
    [self presentViewController:alertController animated:YES completion:nil];
        
    }
}