Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><a href="http://github.com/hackiftekhar/IQKeyboardManager" rel="noreferrer">IQKeyboardManager</a> do this for you with <strong>NO LINE OF CODE</strong>, only need to drag and drop related source file to project. <a href="http://github.com/hackiftekhar/IQKeyboardManager" rel="noreferrer">IQKeyboardManager</a> also support <strong>Device Orientation</strong>, <strong>Automatic UIToolbar Management</strong>, <strong>keyboardDistanceFromTextField</strong> and much more than you think.</p> <p><img src="https://i.stack.imgur.com/emIhl.png" alt="enter image description here"></p> <p>Here is the Control Flow Chart: <img src="https://i.stack.imgur.com/v2bGW.jpg" alt="Control Flow Chart"></p> <p><strong>Step1:-</strong> Added global notifications of <code>UITextField</code>, <code>UITextView</code>, and <code>UIKeyboard</code> in a singleton class. I called it <a href="http://github.com/hackiftekhar/IQKeyboardManager" rel="noreferrer">IQKeyboardManager</a>.</p> <p><strong>Step2:-</strong> If found <code>UIKeyboardWillShowNotification</code>, <code>UITextFieldTextDidBeginEditingNotification</code> or <code>UITextViewTextDidBeginEditingNotification</code> notifications, then try to get <code>topMostViewController</code> instance from the <code>UIWindow.rootViewController</code> hierarchy. In order to properly uncover <code>UITextField</code>/<code>UITextView</code> on it, <code>topMostViewController.view</code>'s frame needs to be adjusted.</p> <p><strong>Step3:-</strong> Calculated expected move distance of <code>topMostViewController.view</code> with respect to first responded <code>UITextField</code>/<code>UITextView</code>.</p> <p><strong>Step4:-</strong> Moved <code>topMostViewController.view.frame</code> up/down according to the expected move distance.</p> <p><strong>Step5:-</strong> If found <code>UIKeyboardWillHideNotification</code>, <code>UITextFieldTextDidEndEditingNotification</code> or <code>UITextViewTextDidEndEditingNotification</code> notification, then again try to get <code>topMostViewController</code> instance from the <code>UIWindow.rootViewController</code> hierarchy.</p> <p><strong>Step6:-</strong> Calculated disturbed distance of <code>topMostViewController.view</code> which needs to be restored to it's original position.</p> <p><strong>Step7:-</strong> Restored <code>topMostViewController.view.frame</code> down according to the disturbed distance.</p> <p><strong>Step8:-</strong> Instantiated singleton <a href="http://github.com/hackiftekhar/IQKeyboardManager" rel="noreferrer">IQKeyboardManager</a> class instance on app load, so every <code>UITextField</code>/<code>UITextView</code> in the app will adjust automatically according to the expected move distance.</p> <p>That's all</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload