IQKeyboardManagerConstants.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. //
  2. // IQKeyboardManagerConstants.h
  3. // https://github.com/hackiftekhar/IQKeyboardManager
  4. // Copyright (c) 2013-16 Iftekhar Qurashi.
  5. //
  6. // Permission is hereby granted, free of charge, to any person obtaining a copy
  7. // of this software and associated documentation files (the "Software"), to deal
  8. // in the Software without restriction, including without limitation the rights
  9. // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10. // copies of the Software, and to permit persons to whom the Software is
  11. // furnished to do so, subject to the following conditions:
  12. //
  13. // The above copyright notice and this permission notice shall be included in
  14. // all copies or substantial portions of the Software.
  15. //
  16. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22. // THE SOFTWARE.
  23. #ifndef IQKeyboardManagerConstants_h
  24. #define IQKeyboardManagerConstants_h
  25. #import <Foundation/NSObjCRuntime.h>
  26. ///-----------------------------------
  27. /// @name IQAutoToolbarManageBehaviour
  28. ///-----------------------------------
  29. /**
  30. `IQAutoToolbarBySubviews`
  31. Creates Toolbar according to subview's hirarchy of Textfield's in view.
  32. `IQAutoToolbarByTag`
  33. Creates Toolbar according to tag property of TextField's.
  34. `IQAutoToolbarByPosition`
  35. Creates Toolbar according to the y,x position of textField in it's superview coordinate.
  36. */
  37. typedef NS_ENUM(NSInteger, IQAutoToolbarManageBehaviour) {
  38. IQAutoToolbarBySubviews,
  39. IQAutoToolbarByTag,
  40. IQAutoToolbarByPosition,
  41. };
  42. /**
  43. `IQPreviousNextDisplayModeDefault`
  44. Show NextPrevious when there are more than 1 textField otherwise hide.
  45. `IQPreviousNextDisplayModeAlwaysHide`
  46. Do not show NextPrevious buttons in any case.
  47. `IQPreviousNextDisplayModeAlwaysShow`
  48. Always show nextPrevious buttons, if there are more than 1 textField then both buttons will be visible but will be shown as disabled.
  49. */
  50. typedef NS_ENUM(NSUInteger, IQPreviousNextDisplayMode) {
  51. IQPreviousNextDisplayModeDefault,
  52. IQPreviousNextDisplayModeAlwaysHide,
  53. IQPreviousNextDisplayModeAlwaysShow,
  54. };
  55. /**
  56. `IQEnableModeDefault`
  57. Pick default settings.
  58. `IQEnableModeEnabled`
  59. setting is enabled.
  60. `IQEnableModeDisabled`
  61. setting is disabled.
  62. */
  63. typedef NS_ENUM(NSUInteger, IQEnableMode) {
  64. IQEnableModeDefault,
  65. IQEnableModeEnabled,
  66. IQEnableModeDisabled,
  67. };
  68. #endif
  69. /*
  70. /---------------------------------------------------------------------------------------------------\
  71. \---------------------------------------------------------------------------------------------------/
  72. | iOS NSNotification Mechanism |
  73. /---------------------------------------------------------------------------------------------------\
  74. \---------------------------------------------------------------------------------------------------/
  75. ------------------------------------------------------------
  76. When UITextField become first responder
  77. ------------------------------------------------------------
  78. - UITextFieldTextDidBeginEditingNotification (UITextField)
  79. - UIKeyboardWillShowNotification
  80. - UIKeyboardDidShowNotification
  81. ------------------------------------------------------------
  82. When UITextView become first responder
  83. ------------------------------------------------------------
  84. - UIKeyboardWillShowNotification
  85. - UITextViewTextDidBeginEditingNotification (UITextView)
  86. - UIKeyboardDidShowNotification
  87. ------------------------------------------------------------
  88. When switching focus from UITextField to another UITextField
  89. ------------------------------------------------------------
  90. - UITextFieldTextDidEndEditingNotification (UITextField1)
  91. - UITextFieldTextDidBeginEditingNotification (UITextField2)
  92. - UIKeyboardWillShowNotification
  93. - UIKeyboardDidShowNotification
  94. ------------------------------------------------------------
  95. When switching focus from UITextView to another UITextView
  96. ------------------------------------------------------------
  97. - UITextViewTextDidEndEditingNotification : (UITextView1)
  98. - UIKeyboardWillShowNotification
  99. - UITextViewTextDidBeginEditingNotification : (UITextView2)
  100. - UIKeyboardDidShowNotification
  101. ------------------------------------------------------------
  102. When switching focus from UITextField to UITextView
  103. ------------------------------------------------------------
  104. - UITextFieldTextDidEndEditingNotification (UITextField)
  105. - UIKeyboardWillShowNotification
  106. - UITextViewTextDidBeginEditingNotification (UITextView)
  107. - UIKeyboardDidShowNotification
  108. ------------------------------------------------------------
  109. When switching focus from UITextView to UITextField
  110. ------------------------------------------------------------
  111. - UITextViewTextDidEndEditingNotification (UITextView)
  112. - UITextFieldTextDidBeginEditingNotification (UITextField)
  113. - UIKeyboardWillShowNotification
  114. - UIKeyboardDidShowNotification
  115. ------------------------------------------------------------
  116. When opening/closing UIKeyboard Predictive bar
  117. ------------------------------------------------------------
  118. - UIKeyboardWillShowNotification
  119. - UIKeyboardDidShowNotification
  120. ------------------------------------------------------------
  121. On orientation change
  122. ------------------------------------------------------------
  123. - UIApplicationWillChangeStatusBarOrientationNotification
  124. - UIKeyboardWillHideNotification
  125. - UIKeyboardDidHideNotification
  126. - UIApplicationDidChangeStatusBarOrientationNotification
  127. - UIKeyboardWillShowNotification
  128. - UIKeyboardDidShowNotification
  129. - UIKeyboardWillShowNotification
  130. - UIKeyboardDidShowNotification
  131. */