Closed ghost closed 9 years ago
+1
The Inputbar is managed by SLKTextViewController
so I'm afraid what you are tying to do isn't possible. Why not subclass SLKTextViewController
?
@dzenbot thanks for your response. I have subclassed the SLKTextViewController. But then the viewcontroller does not display what I have in the storyboard. I guess the best practice for me is just to write code to configure my viewcontroller? Thanks!
There is storyboard compatibility. Please have a look at the sample project.
@dzenbot is the sample project available in Swift?
@dzenbot the storyboard sample is only in Objective-C. :'(
There is a Swift sample project, incomplete, in https://github.com/slackhq/SlackTextViewController/tree/swift-example
I'm not yet into Swift that much and was hoping the community could contribute to build a great Swift sample ¯(ツ)/¯
Anyway, for storyboard compatibility, you should only care about the following method to override in your subclass:
override class func tableViewStyleForCoder(decoder: NSCoder) -> UITableViewStyle {
return UITableViewStyle.Plain;
}
But this storyboard compatibility.. it's not possible to use your own, existing UITableView, right? For example I have an existing scene in a storyboard. It's a UIViewController with a UITableView. It's connected to the view controller via an outlet. Now I want to make this view controller a SLKTextViewController instead, but it seems that I can't keep on using my existing table (with all its prototype cells etc). It seems that I have to remove the table view from my scene, and use the programmatically created one from SLKTextViewController. Then use individual nibs for the different cells etc, instead of using prototype cells in the storyboard.
You cannot use your custom UITableView, no. Everything is setup programatically. The Storyboard compatibility does only work when using with an empty nib extending SLKTextViewController. I'm happy to accept any improvements in this area, that make the Storyboard integration better tho.
Would be spectacular if you could just hook in a current UITableView via IBOulets.
It would. Can't imagine how it would be compatible tho. I'm open to ideas.
How can this be done? I have a tablewView that is an outlet and a UIView with a textView as an outlet. I would like to just display the inputbar. I am using Swift. Any help would be appreciated. Thanks!