@@ -224,6 +224,44 @@ class NCShare: UIViewController, NCShareNetworkingDelegate, NCSharePagingContent
224224 textField? . layer. borderColor = NCBrandColor . shared. brand. cgColor
225225 }
226226
227+ @objc func keyboardWillHide( notification: Notification ) {
228+ if view. frame. origin. y != 0 {
229+ self . view. frame. origin. y = 0
230+ }
231+ textField? . layer. borderColor = NCBrandColor . shared. label. cgColor
232+ }
233+
234+ @objc func keyboardWillShow( notification: Notification ) {
235+ if UIDevice . current. userInterfaceIdiom == . phone {
236+ if ( UIScreen . main. bounds. width < 374 || UIDevice . current. orientation. isLandscape) {
237+ if let keyboardSize = ( notification. userInfo ? [ UIResponder . keyboardFrameEndUserInfoKey] as? NSValue ) ? . cgRectValue {
238+ if view. frame. origin. y == 0 {
239+ self . tableView. scrollToRow ( at: IndexPath ( row: 0 , section: 0 ) , at: . top, animated: false )
240+ self . view. frame. origin. y -= keyboardSize. height
241+ }
242+ }
243+ } else if UIScreen . main. bounds. height < 850 {
244+ if view. frame. origin. y == 0 {
245+ self . tableView. scrollToRow ( at: IndexPath ( row: 0 , section: 0 ) , at: . top, animated: false )
246+ self . view. frame. origin. y -= 70
247+ }
248+ } else {
249+ if view. frame. origin. y == 0 {
250+ self . tableView. scrollToRow ( at: IndexPath ( row: 0 , section: 0 ) , at: . top, animated: false )
251+ self . view. frame. origin. y -= 40
252+ }
253+ }
254+ }
255+
256+ if UIDevice . current. userInterfaceIdiom == . pad, UIDevice . current. orientation. isLandscape {
257+ if view. frame. origin. y == 0 {
258+ self . tableView. scrollToRow ( at: IndexPath ( row: 0 , section: 0 ) , at: . top, animated: false )
259+ self . view. frame. origin. y -= 230
260+ }
261+ }
262+ textField? . layer. borderColor = NCBrandColor . shared. brand. cgColor
263+ }
264+
227265 @objc func keyboardWillHide( notification: Notification ) {
228266 if view. frame. origin. y != 0 {
229267 self . view. frame. origin. y = 0
0 commit comments