ios - Custom Keyboard ViewDidLoad method not printing to console -
i've got simple keyboard, try print console won't show up... ideas? done within folder keybaord target, here's code:
import uikit class keyboardviewcontroller: uiinputviewcontroller, uicollectionviewdelegate, uicollectionviewdatasource, uicollectionviewdelegateflowlayout { @iboutlet var nextkeyboardbutton: uibutton! @iboutlet var collectionview: uicollectionview! override func updateviewconstraints() { super.updateviewconstraints() // add custom view sizing constraints here } override func viewdidload() { super.viewdidload() print("keyboard view loaded") //keyboard nib setup let nib = uinib(nibname: "keyboardview", bundle: nil) let objects = nib.instantiatewithowner(self, options: nil) view = objects[0] as! uiview //cell setup collectionview.registernib(uinib(nibname: "customcell", bundle: nil), forcellwithreuseidentifier: "mycell") // perform custom ui setup here self.nextkeyboardbutton = uibutton(type: .system) self.nextkeyboardbutton.settitle(nslocalizedstring("next keyboard", comment: "title 'next keyboard' button"), forstate: .normal) self.nextkeyboardbutton.sizetofit() self.nextkeyboardbutton.translatesautoresizingmaskintoconstraints = false self.nextkeyboardbutton.addtarget(self, action: "advancetonextinputmode", forcontrolevents: .touchupinside) self.view.addsubview(self.nextkeyboardbutton) let nextkeyboardbuttonleftsideconstraint = nslayoutconstraint(item: self.nextkeyboardbutton, attribute: .left, relatedby: .equal, toitem: self.view, attribute: .left, multiplier: 1.0, constant: 0.0) let nextkeyboardbuttonbottomconstraint = nslayoutconstraint(item: self.nextkeyboardbutton, attribute: .bottom, relatedby: .equal, toitem: self.view, attribute: .bottom, multiplier: 1.0, constant: 0.0) self.view.addconstraints([nextkeyboardbuttonleftsideconstraint, nextkeyboardbuttonbottomconstraint]) }
thanks!
since keyboard extension need run extension in order debug , not app. set active scheme keyboard
the circle e inside of means loading extension. make choose app run extension in. long in app when bring keyboard should work.
Comments
Post a Comment