ScholarQuill logoScholarQuillUniversity Notes
  • Notes
  • Past Papers
  • Blogs
  • Todo
Login
ScholarQuill logoScholarQuillUniversity Notes
Login
NotesPast PapersBlogsTodo
More
SubjectsDiscussionCGPA CalculatorGPA CalculatorStudent PortalCourse Outline
About
About usPrivacy PolicyReportContact
Notes
Past Papers
Blogs
Todo
Analytics
    Current Subject
    🧩
    Mobile Application Development 2
    COMP4126
    Progress0 / 38 topics
    Topics
    1. Creating an iOS App: Understanding Xcode2. Using the Xcode interface builder and objects library3. Understanding view hierarchy and creating a custom app icon4. Outlets, Actions, and Views: Understanding outlets and actions5. Using text fields, buttons, labels, web views, and page controllers6. Using views with subviews and creating views using code7. Using View Controllers: Working with the single view template8. Exploring the app delegate and adding new view controllers9. Transitioning between multiple view controllers using animations10. Application Templates: Tabbar and master detail templates11. The iOS Keyboard: Customizing for different inputs12. Adjusting text field behaviors and dismissing the keyboard13. Detecting keyboard activities with notification center14. Using scroll view and responding to keyboard activities programmatically15. Working with Different iOS Devices (iPhone & iPad): Detecting device hardware16. Dynamically adjusting graphical layouts and creating universal apps17. Using Table Views: Understanding UITableView and UITableViewCell18. Working with UITableView data source and delegate19. Master detail template, drill-down menus, and navigation20. Using property lists for data persistence and creating multi-section tables21. Supporting Screen Rotations: Portrait and landscape modes22. Handling device rotation and forcing specific orientation23. Dynamically adjusting layouts based on rotation24. Working with Databases: Importing sqlite3 and creating a database25. Writing tables, inserting records, and bundling a database with your app26. Checking for database existence and reading/displaying data27. Using Animations & Video: NSTimer class and object transformations28. Rotation, scaling, translation, animating image arrays, and playing video29. Accessing Integrated iOS Apps: Email, Safari, and SMS30. Working with camera and photo library31. Using Web Services: Consuming and parsing XML and JSON32. Integrating Twitter and Facebook with iOS apps33. Working with iOS Maps and Location Services: MapKit and MKMapView34. Getting and displaying user location and directional information35. Displaying map annotations, disclosure buttons, and reverse geocoding36. Working with iCloud37. Working with the Accelerometer: Gyroscope and accelerometer38. Outputting sensor data and using the Shake API
    COMP4126›The iOS Keyboard: Customizing for different inputs
    Mobile Application Development 2Topic 11 of 38

    The iOS Keyboard: Customizing for different inputs

    3 minread
    510words
    Beginnerlevel

    📱 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 load past papers

    Click on Show Past Papers to see past papers.
    On This Page
      Reading Stats
      Est. reading time3 min
      Word count510
      Code examples0
      DifficultyBeginner