ScholarQuill logoScholarQuillUniversity Notes
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
Study Tools
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
Contact
ScholarQuill logo
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
ScholarQuill logoScholarQuillUniversity Notes
Study PortalCOMP4126Ios Keyboard Customizi…
Ctrl + K
Login
Explore
Search
Semester
Papers
CGPA
    COMP4126

    Mobile Application Development 2

    Progress0 / 38 done
    Topics38
    1Understanding Xcode2Using the Xcode interface builder and objects library3Understanding view hierarchy and creating a custom app icon
    4Understanding outlets and actions5Using text fields, buttons, labels, web views, and page controllers6Using views with subviews and creating views using code
    7Working with the single view template8Exploring the app delegate and adding new view controllers9Transitioning between multiple view controllers using animations
    10Tabbar and master detail templates
    11Customizing for different inputs12Adjusting text field behaviors and dismissing the keyboard13Detecting keyboard activities with notification center14Using scroll view and responding to keyboard activities programmatically
    15Detecting device hardware16Dynamically adjusting graphical layouts and creating universal apps
    17Understanding UITableView and UITableViewCell18Working with UITableView data source and delegate19Master detail template, drill-down menus, and navigation20Using property lists for data persistence and creating multi-section tables
    21Portrait and landscape modes22Handling device rotation and forcing specific orientation23Dynamically adjusting layouts based on rotation
    24Importing sqlite3 and creating a database25Writing tables, inserting records, and bundling a database with your app26Checking for database existence and reading/displaying data
    27NSTimer class and object transformations28Rotation, scaling, translation, animating image arrays, and playing video
    29Email, Safari, and SMS30Working with camera and photo library
    31Consuming and parsing XML and JSON32Integrating Twitter and Facebook with iOS apps
    33MapKit and MKMapView34Getting and displaying user location and directional information35Displaying map annotations, disclosure buttons, and reverse geocoding36Working with iCloud
    37Gyroscope and accelerometer38Outputting sensor data and using the Shake API
    3 min read
    Topic 11 of 38
    Topic Study Note Illustration
    11

    The iOS Keyboard: Customizing for different inputs

    The iOS Keyboard is the on-screen keyboard that appears when a user taps a text input field (like a UITextField or UITextView ).

    πŸ“± The iOS Keyboard: Customizing for Different Inputs (iOS – Xcode)


    βœ… 1. Definition

    The iOS Keyboard is the on-screen keyboard that appears when a user taps a text input field (like a UITextField or UITextView).

    Customizing the keyboard means changing its type and behavior according to the kind of data the user should enter (e.g., email, number, URL).


    🧠 2. Key Concepts

    πŸ”Ή UITextField / UITextView

    • UI elements used for user input
    • Automatically show keyboard when tapped

    πŸ”Ή Keyboard Type

    • Defines which keyboard layout appears
    • Helps improve user experience and input accuracy

    πŸ”Ή First Responder

    • The active input field that currently shows the keyboard

    ⌨️ 3. Common Keyboard Types

    Keyboard Type Use Case
    Default General text input
    Number Pad Phone numbers, PIN
    Decimal Pad Prices, calculations
    Email Address Email input (@ and . included)
    URL Web addresses
    Phone Pad Contact numbers

    βš™οΈ 4. How to Set Keyboard Type in Xcode


    πŸ”Ή Method 1: Using Storyboard

    Steps:

    1. Select Text Field
    2. Open Attributes Inspector
    3. Find Keyboard Type
    4. Choose required type (e.g., Email Address)

    πŸ”Ή Method 2: Using Code

    @IBOutlet weak var textField: UITextField!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        textField.keyboardType = .emailAddress
    }
    

    πŸ“Š 5. Example Scenarios


    πŸ”Ή Login Screen

    • Username β†’ Default keyboard
    • Password β†’ Secure entry (hidden text)
    passwordField.isSecureTextEntry = true
    

    πŸ”Ή Phone App

    • Phone number input β†’ Number pad
    phoneField.keyboardType = .phonePad
    

    πŸ”Ή Web Browser App

    • URL input β†’ URL keyboard
    urlField.keyboardType = .URL
    

    πŸŽ›οΈ 6. Additional Keyboard Features


    πŸ”Ή Return Key Type

    Controls button text on keyboard:

    Type Label
    Done Finish input
    Go Navigate
    Search Search action
    Next Move to next field
    textField.returnKeyType = .done
    

    πŸ”Ή Secure Text Entry

    Used for passwords:

    passwordField.isSecureTextEntry = true
    

    πŸ”Ή Auto-Capitalization

    textField.autocapitalizationType = .words
    

    Options:

    • None
    • Words
    • Sentences
    • All Characters

    πŸ“Š 7. Diagram Description (for Exams)

    Draw:

    TextField β†’ Tap β†’ iOS Keyboard (Email / Number / URL layout)
    

    πŸ“Œ 8. Important Rules / Tips

    • Always choose correct keyboard type for better UX
    • Use secure text entry for passwords
    • Disable autocorrect when not needed
    • Use appropriate return key for better navigation
    • Avoid default keyboard for specialized input

    ⚠️ 9. Common Mistakes

    • ❌ Using default keyboard for email/phone
    • ❌ Not enabling secure entry for passwords
    • ❌ Wrong keyboard type causing input errors
    • ❌ Not setting return key behavior

    πŸ’‘ 10. Example App

    🎯 Registration Form

    • Name β†’ Default keyboard
    • Email β†’ Email keyboard
    • Phone β†’ Number pad
    • Password β†’ Secure text
    nameField.keyboardType = .default
    emailField.keyboardType = .emailAddress
    phoneField.keyboardType = .phonePad
    passwordField.isSecureTextEntry = true
    

    πŸ“ 11. Likely Exam Questions

    1. What is the iOS keyboard?
    2. Explain different types of iOS keyboards.
    3. How do you set keyboard type in Xcode?
    4. What is secure text entry?
    5. Differentiate between email and number pad keyboards.
    6. What is return key type? Give examples.
    7. How does keyboard customization improve user experience?
    8. Write code to set email keyboard type.

    πŸ“š 12. Quick Revision Summary

    • iOS keyboard appears when user taps input field

    • Can be customized using:

      • Keyboard Type
      • Return Key Type
      • Secure Text Entry
    • Common types:

      • Default, Email, URL, Number Pad
    • Improves:

      • Accuracy
      • User experience
      • Input speed

    ← Previous topic 10
    Application Templates: Tabbar and master detail templates
    Next topic 12 β†’
    Adjusting text field behaviors and dismissing the keyboard

    Past Papers

    Open this section to view and download past papers

    Click on Show Past Papers to load available exam papers.

    Reading Progress
    0%
    3mremaining
    510words
    Beginnerlevel
    On This Page

    No headings found

    Study Toolkit

    Subject Portal

    Mobile Application Development 2