@@ -9,47 +9,48 @@ import UIKit
99
1010class KeyboardViewController : UIInputViewController {
1111 @IBOutlet var nextKeyboardButton : UIButton !
12-
13- override var hasFullAccess : Bool { true }
14-
12+
13+ override var hasFullAccess : Bool {
14+ true
15+ }
16+
1517 override func viewDidLoad( ) {
1618 super. viewDidLoad ( )
1719 SetappUsageReporter . shared. reportExtensionUsage ( )
18-
20+
1921 // Perform custom UI setup here
20- self . nextKeyboardButton = UIButton ( type: . system)
21- self . view. translatesAutoresizingMaskIntoConstraints = false
22- self . nextKeyboardButton. setTitle ( " Next Keyboard " , for: [ ] )
23- self . nextKeyboardButton. sizeToFit ( )
24- self . nextKeyboardButton. translatesAutoresizingMaskIntoConstraints = false
25-
26- self . nextKeyboardButton. addTarget ( self , action: #selector( handleInputModeList ( from: with: ) ) , for: . allTouchEvents)
27-
28- self . view. addSubview ( self . nextKeyboardButton)
29- self . nextKeyboardButton. leftAnchor. constraint ( equalTo: self . view. leftAnchor) . isActive = true
30- self . nextKeyboardButton. bottomAnchor. constraint ( equalTo: self . view. bottomAnchor) . isActive = true
22+ nextKeyboardButton = UIButton ( type: . system)
23+ view. translatesAutoresizingMaskIntoConstraints = false
24+ nextKeyboardButton. setTitle ( " Next Keyboard " , for: [ ] )
25+ nextKeyboardButton. sizeToFit ( )
26+ nextKeyboardButton. translatesAutoresizingMaskIntoConstraints = false
27+
28+ nextKeyboardButton. addTarget ( self , action: #selector( handleInputModeList ( from: with: ) ) , for: . allTouchEvents)
29+
30+ view. addSubview ( nextKeyboardButton)
31+ nextKeyboardButton. leftAnchor. constraint ( equalTo: view. leftAnchor) . isActive = true
32+ nextKeyboardButton. bottomAnchor. constraint ( equalTo: view. bottomAnchor) . isActive = true
3133 }
32-
34+
3335 override func viewWillLayoutSubviews( ) {
34- self . nextKeyboardButton. isHidden = !self . needsInputModeSwitchKey
36+ nextKeyboardButton. isHidden = !needsInputModeSwitchKey
3537 super. viewWillLayoutSubviews ( )
3638 }
37-
38- override func textWillChange( _ textInput : UITextInput ? ) {
39+
40+ override func textWillChange( _: UITextInput ? ) {
3941 // The app is about to change the document's contents. Perform any preparation here.
4042 }
41-
42- override func textDidChange( _ textInput : UITextInput ? ) {
43+
44+ override func textDidChange( _: UITextInput ? ) {
4345 // The app has just changed the document's contents, the document context has been updated.
44-
46+
4547 var textColor : UIColor
46- let proxy = self . textDocumentProxy
48+ let proxy = textDocumentProxy
4749 if proxy. keyboardAppearance == UIKeyboardAppearance . dark {
4850 textColor = UIColor . white
4951 } else {
5052 textColor = UIColor . black
5153 }
52- self . nextKeyboardButton. setTitleColor ( textColor, for: [ ] )
54+ nextKeyboardButton. setTitleColor ( textColor, for: [ ] )
5355 }
54-
5556}
0 commit comments