Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autolayout: grow KSTokenView to include UITableView #16

Closed
senfi opened this issue Aug 12, 2015 · 2 comments
Closed

Autolayout: grow KSTokenView to include UITableView #16

senfi opened this issue Aug 12, 2015 · 2 comments

Comments

@senfi
Copy link

senfi commented Aug 12, 2015

When using Autolayout, is it possible to grow the height-constraint of the KSTokenView to include the table view and not just the tokens? I made an example to make clear what i mean: 4f289e3

The green UIView is below the KSTokenView and they are connected via a a "vertical space"-constraint. The green view moves down, when tokens are added, but it does not move below the tableview. Is there a way to include an option to do this or can you point me to the heigth-calculation?
vertical space constraint pushes green view down

KSTokenView-height does not include tableView

@khawars
Copy link
Owner

khawars commented Aug 13, 2015

@senfi, currently there is no way to link search results tableview with any other external view element. You have to manually calculate the search result position and update external view. Here is a rough example

func tokenView(tokenView: KSTokenView, didChangeFrame frame: CGRect) { var frame = myView.frame frame.origin.y = tokenView.frame.maxY+tokenView.searchResultSize.height myView.frame = frame }

After the search result is hidden, you can re-locate the view.
func tokenViewDidHideSearchResults(tokenView: KSTokenView) { var frame = myView.frame frame.origin.y = 150 // or whatever was the initial position myView.frame = frame }

Two delegates, tokenViewDidHideSearchResults and tokenViewDidShowSearchResults are added in latest commit today 03e7507.

@khawars khawars closed this as completed Aug 13, 2015
@senfi
Copy link
Author

senfi commented Aug 13, 2015

Yeah, great idea. Thank you for your support! This should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants