@@ -151,6 +151,44 @@ class NCShare: UIViewController, NCShareNetworkingDelegate, NCSharePagingContent
151151 textField? . layer. borderColor = NCBrandColor . shared. brand. cgColor
152152 }
153153
154+ @objc func keyboardWillHide( notification: Notification ) {
155+ if view. frame. origin. y != 0 {
156+ self . view. frame. origin. y = 0
157+ }
158+ textField? . layer. borderColor = NCBrandColor . shared. label. cgColor
159+ }
160+
161+ @objc func keyboardWillShow( notification: Notification ) {
162+ if UIDevice . current. userInterfaceIdiom == . phone {
163+ if ( UIScreen . main. bounds. width < 374 || UIDevice . current. orientation. isLandscape) {
164+ if let keyboardSize = ( notification. userInfo ? [ UIResponder . keyboardFrameEndUserInfoKey] as? NSValue ) ? . cgRectValue {
165+ if view. frame. origin. y == 0 {
166+ self . tableView. scrollToRow ( at: IndexPath ( row: 0 , section: 0 ) , at: . top, animated: false )
167+ self . view. frame. origin. y -= keyboardSize. height
168+ }
169+ }
170+ } else if UIScreen . main. bounds. height < 850 {
171+ if view. frame. origin. y == 0 {
172+ self . tableView. scrollToRow ( at: IndexPath ( row: 0 , section: 0 ) , at: . top, animated: false )
173+ self . view. frame. origin. y -= 70
174+ }
175+ } else {
176+ if view. frame. origin. y == 0 {
177+ self . tableView. scrollToRow ( at: IndexPath ( row: 0 , section: 0 ) , at: . top, animated: false )
178+ self . view. frame. origin. y -= 40
179+ }
180+ }
181+ }
182+
183+ if UIDevice . current. userInterfaceIdiom == . pad, UIDevice . current. orientation. isLandscape {
184+ if view. frame. origin. y == 0 {
185+ self . tableView. scrollToRow ( at: IndexPath ( row: 0 , section: 0 ) , at: . top, animated: false )
186+ self . view. frame. origin. y -= 230
187+ }
188+ }
189+ textField? . layer. borderColor = NCBrandColor . shared. brand. cgColor
190+ }
191+
154192 @objc func keyboardWillHide( notification: Notification ) {
155193 if view. frame. origin. y != 0 {
156194 self . view. frame. origin. y = 0
@@ -230,7 +268,7 @@ class NCShare: UIViewController, NCShareNetworkingDelegate, NCSharePagingContent
230268 }
231269
232270 func checkEnforcedPassword( shareType: Int , completion: @escaping ( String ? ) -> Void ) {
233- guard NCCapabilities . shared. getCapabilities ( account : session . account ) . capabilityFileSharingPubPasswdEnforced,
271+ guard NCGlobal . shared. capabilityFileSharingPubPasswdEnforced,
234272 shareType == shareCommon. SHARE_TYPE_LINK || shareType == shareCommon. SHARE_TYPE_EMAIL
235273 else { return completion ( nil ) }
236274
0 commit comments