Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3 more delegate methods added to detect an action #94

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Commits on May 30, 2019

  1. Added 3 delegate methods to detect an action

    The FPNTextField() has 3 components that assist it when the user decides to enter their phone number:
    
    1. tapping the flag itself triggers the pickerView to show all the flags
    2. tapping the Done button on the keyboard dismisses the pickerView with all the flags
    3. tapping the instance of the FPNTextField() also dismisses the pickerView with all the flags
    
    Every UI is different, inside the my app I have an additional "NextButton" that is inside the vc that contains the FPNTextField(). 
    
    1. func detectWhenFlagIsTapped() // option to do something when the flag is tapped
    -when the flag is tapped, the keyboard switches from numeric to show the pickerView with all the flags, I may want to disable the NextButton because it wouldn't make any sense to have it enabled knowing the user is in the process of choosing a country (the pickerView flags are on screen).
    
    2. func detectWhenDoneButtonTapped() // option to do something when the Done button is tapped
    -if the pickerView with the flags are on screen, when the Done button that is on top of the keyboard is tapped, I may want to enable or disable my NextButton.
    
    3. func detectWhenTextFieldTapped()  // option to do something when the instance of the fpnTextField is tapped
    -if the pickerView with the flags are on screen, when the instance of the FPNTextField() is tapped (meaning the user is entering their phone number), I may want to enable or disable my NextButton.
    
    All 3 of these delegate methods are set inside the FPNTextField class in the following:
    
    func detectWhenFlagIsTapped() is set in the displayCountryKeyboard() method
    	
    func detectWhenDoneButtonTapped() is set in the resetKeyBoard() method
    	
    func detectWhenTextFieldTapped() is added inside the FPNTextField class as an additional target method's selector:
     addTarget(self, action: #selector(textFieldTapped), for: .editingChanged)
    lsamaria authored May 30, 2019
    Configuration menu
    Copy the full SHA
    d92217a View commit details
    Browse the repository at this point in the history
  2. Added 3 more delegate methods to detect an action

    The FPNTextField() has 3 components that assist it when the user decides to enter their phone number:
    
    1. tapping the flag itself triggers the pickerView to show all the flags
    2. tapping the Done button on the keyboard dismisses the pickerView with all the flags
    3. tapping the instance of the FPNTextField() also dismisses the pickerView with all the flags
    
    Every UI is different, inside the my app I have an additional "NextButton" that is inside the vc that contains the FPNTextField(). 
    
    1. When the flag is tapped, the keyboard switches from numeric to show the pickerView with all the flags, I wanted to disable the NextButton because it wouldn't make any sense to have it enabled knowing the user is in the process of choosing a country (the pickerView flags are on screen).
    
    2. If the pickerView with the flags are on screen, when the Done button that is on top of the keyboard is tapped, I may want to enable or disable my NextButton.
    
    3. If the pickerView with the flags are on screen, when the instance of the FPNTextField() is tapped (meaning the user is entering their phone number), I may want to enable or disable my NextButton.
    
    All 3 of these delegate methods are set inside the FPNTextField class in the following:
    
    func detectWhenFlagIsTapped() // set in the displayCountryKeyboard() method
    	
    func detectWhenDoneButtonTapped() // set in the resetKeyBoard() method
    	
    func detectWhenTextFieldTapped() // added inside the FPNTextField class as an additional target method's selector:
     addTarget(self, action: #selector(textFieldTapped), for: .editingChanged)
    lsamaria authored May 30, 2019
    Configuration menu
    Copy the full SHA
    d253eec View commit details
    Browse the repository at this point in the history
  3. 3 more delegate methods added to detect actions

    The FPNTextField() has 3 components that assist it when the user decides to enter their phone number:
    
    1. tapping the flag itself triggers the pickerView to show all the flags
    2. tapping the Done button on the keyboard dismisses the pickerView with all the flags
    3. tapping the instance of the FPNTextField() also dismisses the pickerView with all the flags
    
    Every UI is different, inside the my app I have an additional "NextButton" that is inside the vc that contains the FPNTextField(). 
    
    1. When the flag is tapped, the keyboard switches from numeric to show the pickerView with all the flags, I wanted to disable the NextButton because it wouldn't make any sense to have it enabled knowing the user is in the process of choosing a country (the pickerView flags are on screen).
    
    2. If the pickerView with the flags are on screen, when the Done button that is on top of the keyboard is tapped, I may want to enable or disable my NextButton.
    
    3. If the pickerView with the flags are on screen, when the instance of the FPNTextField() is tapped (meaning the user is entering their phone number), I may want to enable or disable my NextButton.
    
    All 3 of these delegate methods are set inside the FPNTextField class in the following:
    
    func detectWhenFlagIsTapped() // set in the displayCountryKeyboard() method
    	
    func detectWhenDoneButtonTapped() // set in the resetKeyBoard() method
    	
    func detectWhenTextFieldTapped() // added inside the FPNTextField class as an additional target method's selector:
     addTarget(self, action: #selector(textFieldTapped), for: .editingChanged)
    lsamaria authored May 30, 2019
    Configuration menu
    Copy the full SHA
    2e077fd View commit details
    Browse the repository at this point in the history