IQKeyboardManagerConstants.swift 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. //
  2. // IQKeyboardManagerConstants.swift
  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. import Foundation
  24. ///-----------------------------------
  25. // MARK: IQAutoToolbarManageBehaviour
  26. ///-----------------------------------
  27. /**
  28. `IQAutoToolbarBySubviews`
  29. Creates Toolbar according to subview's hirarchy of Textfield's in view.
  30. `IQAutoToolbarByTag`
  31. Creates Toolbar according to tag property of TextField's.
  32. `IQAutoToolbarByPosition`
  33. Creates Toolbar according to the y,x position of textField in it's superview coordinate.
  34. */
  35. @objc public enum IQAutoToolbarManageBehaviour: Int {
  36. case bySubviews
  37. case byTag
  38. case byPosition
  39. }
  40. /**
  41. `IQPreviousNextDisplayModeDefault`
  42. Show NextPrevious when there are more than 1 textField otherwise hide.
  43. `IQPreviousNextDisplayModeAlwaysHide`
  44. Do not show NextPrevious buttons in any case.
  45. `IQPreviousNextDisplayModeAlwaysShow`
  46. Always show nextPrevious buttons, if there are more than 1 textField then both buttons will be visible but will be shown as disabled.
  47. */
  48. @objc public enum IQPreviousNextDisplayMode: Int {
  49. case `default`
  50. case alwaysHide
  51. case alwaysShow
  52. }
  53. /**
  54. `IQEnableModeDefault`
  55. Pick default settings.
  56. `IQEnableModeEnabled`
  57. setting is enabled.
  58. `IQEnableModeDisabled`
  59. setting is disabled.
  60. */
  61. @objc public enum IQEnableMode: Int {
  62. case `default`
  63. case enabled
  64. case disabled
  65. }
  66. /*
  67. /---------------------------------------------------------------------------------------------------\
  68. \---------------------------------------------------------------------------------------------------/
  69. | iOS Notification Mechanism |
  70. /---------------------------------------------------------------------------------------------------\
  71. \---------------------------------------------------------------------------------------------------/
  72. ------------------------------------------------------------
  73. When UITextField become first responder
  74. ------------------------------------------------------------
  75. - UITextFieldTextDidBeginEditingNotification (UITextField)
  76. - UIKeyboardWillShowNotification
  77. - UIKeyboardDidShowNotification
  78. ------------------------------------------------------------
  79. When UITextView become first responder
  80. ------------------------------------------------------------
  81. - UIKeyboardWillShowNotification
  82. - UITextViewTextDidBeginEditingNotification (UITextView)
  83. - UIKeyboardDidShowNotification
  84. ------------------------------------------------------------
  85. When switching focus from UITextField to another UITextField
  86. ------------------------------------------------------------
  87. - UITextFieldTextDidEndEditingNotification (UITextField1)
  88. - UITextFieldTextDidBeginEditingNotification (UITextField2)
  89. - UIKeyboardWillShowNotification
  90. - UIKeyboardDidShowNotification
  91. ------------------------------------------------------------
  92. When switching focus from UITextView to another UITextView
  93. ------------------------------------------------------------
  94. - UITextViewTextDidEndEditingNotification: (UITextView1)
  95. - UIKeyboardWillShowNotification
  96. - UITextViewTextDidBeginEditingNotification: (UITextView2)
  97. - UIKeyboardDidShowNotification
  98. ------------------------------------------------------------
  99. When switching focus from UITextField to UITextView
  100. ------------------------------------------------------------
  101. - UITextFieldTextDidEndEditingNotification (UITextField)
  102. - UIKeyboardWillShowNotification
  103. - UITextViewTextDidBeginEditingNotification (UITextView)
  104. - UIKeyboardDidShowNotification
  105. ------------------------------------------------------------
  106. When switching focus from UITextView to UITextField
  107. ------------------------------------------------------------
  108. - UITextViewTextDidEndEditingNotification (UITextView)
  109. - UITextFieldTextDidBeginEditingNotification (UITextField)
  110. - UIKeyboardWillShowNotification
  111. - UIKeyboardDidShowNotification
  112. ------------------------------------------------------------
  113. When opening/closing UIKeyboard Predictive bar
  114. ------------------------------------------------------------
  115. - UIKeyboardWillShowNotification
  116. - UIKeyboardDidShowNotification
  117. ------------------------------------------------------------
  118. On orientation change
  119. ------------------------------------------------------------
  120. - UIApplicationWillChangeStatusBarOrientationNotification
  121. - UIKeyboardWillHideNotification
  122. - UIKeyboardDidHideNotification
  123. - UIApplicationDidChangeStatusBarOrientationNotification
  124. - UIKeyboardWillShowNotification
  125. - UIKeyboardDidShowNotification
  126. - UIKeyboardWillShowNotification
  127. - UIKeyboardDidShowNotification
  128. */