i have this code:
https://stackoverflow.com/a/50999497/19364094
and when i try to call func showCallAlert() from another ViewController it it not working for me and it not detect if user click call or cancel
what it can do?
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
how i can convert my xcode project to ipa?
i read all the methods but it very old (all methods for xcode 9) and not working..
what i can do?
I know there is a problem with this.
But I still ask if this is possible to develop call recording in swift?
I made an extension to UIViewController and inside i have function I use several times:
extension UIViewController {
func transitionToHomeVC() {
let homeViewController = self.storyboard?.instantiateViewController(withIdentifier: NameConstants.StoryBoard.homeViewController) as? HomeViewController
self.view.window?.rootViewController = homeViewController
self.view.window?.makeKeyAndVisible()
}
}
And I have a registration button and as soon as you click if the information was received and correct and etc ... then he has to move me at the to the HomeViewController screen and he does not do it.
He does all the actions but does not pass to screen.
@IBAction func signUpTapped(_ sender: Any) {
// Validate the fields
let error = validDataFields()
if error != nil {
// There's something wrong with the fields, show error message
Service.showError(vc: self, message: error!)
}
else {
// Create cleaned versions of the data
let fireName = firstNameTextField.text!.trimmingCharacters(in: .whitespacesAndNewlines)
let lastName = lastNameTextField.text!.trimmingCharacters(in: .whitespacesAndNewlines)
let email = emailTextField.text!.trimmingCharacters(in: .whitespacesAndNewlines)
let password = passwordTextField.text!.trimmingCharacters(in: .whitespacesAndNewlines)
// Create the user
Auth.auth().createUser(withEmail: email, password: password) { resulte, err in
// Check for errors
if err != nil {
// There was an error creating the user
Service.showError(vc: self, message: "Error creating user \n make sure you enter: \n current email")
}
else {
// User was created successfully, now store the first name and last name
let db = Firestore.firestore()
db.collection("users").addDocument(data: ["firstName":fireName,"lastName":lastName, "uid": resulte!.user.uid]) { error in
if error != nil {
// Show error message
Service.showError(vc: self, message: " Error saving user Data")
}
}
self.transitionToHomeVC()
}
}
}
}
why it not move to homeViewController?
class Service: UIViewController {
static func showError(_ message:String) {
// Create new Alert
let dialogMessage = UIAlertController(title: "Error", message: message, preferredStyle: .alert)
// Create OK button with action handler
let ok = UIAlertAction(title: "OK", style: .default, handler: { (action) -> Void in
print("Ok button tapped")
})
//Add OK button to a dialog message
dialogMessage.addAction(ok)
// Present Alert to
self.present(dialogMessage , animated: true, completion: nil)
}
}
why i get error in this line:
self.present(dialogMessage , animated: true, completion: nil)
the error:
Instance member 'present' cannot be used on type 'Service'
why?