[Swift] Automatically make keyboard show

Discussion in 'iOS Programming' started by ajbudis, Feb 21, 2015.

  1. ajbudis macrumors newbie

    Joined:
    Jun 30, 2013
    #1
    Hello All!

    I'm trying to make the keyboard automatically show when opening the app. The keyboard would open and allow for immediate typing in a Line Style Text Field. This is of course in the language Swift.


    Any help is greatly appreciated.

    AB
     
  2. kage207 macrumors 6502a

    Joined:
    Jul 23, 2008
    #2
    You can do in your viewDidLoad (but better viewDidAppear) to do:

    Objective-C:
    Code:
    [yourTextField becomeFirstResponder]
    Swift:
    Code:
    yourTextField.becomeFirstResponder()
    This is in UIResponder class.
     
  3. ajbudis thread starter macrumors newbie

    Joined:
    Jun 30, 2013
  4. grandM macrumors 6502a

    grandM

    Joined:
    Oct 14, 2013
    #4
    removing it is done by
    Code:
    yourTextField.resignFirstResponder()
     

Share This Page