SlackTextViewController
SlackTextViewController copied to clipboard
Support for setting the right button's image
Now I can only set button's title to a bunch of spaces as placeholder, and set my image.
rightButton.setTitle(" ", forState: UIControlState.Normal)
rightButton.setImage(UIImage(named: "first"), forState: UIControlState.Normal)
look forward to this feature
I'm not sure exactly what you're trying to do but if you want the right button to be a custom image with no title you can set the title to nil. For example:
textInputbar.rightButton.setTitle(nil, forState: .Normal)
textInputbar.rightButton.setImage(UIImage(named: "sendButtonEnabled").imageWithRenderingMode(.AlwaysOriginal), forState: .Normal)
textInputbar.rightButton.setImage(UIImage(named: "sendButtonDisabled").imageWithRenderingMode(.AlwaysOriginal), forState: .Disabled)
@soleares solution currently only works withs images and its intrinsic content size. Therefore the button is always the size of the image. Which is fine for non vector images.
But this solution is not satisfying for vector images because you cannot resize the buttons (or its image) size.