-
-
Save gimenete/2202379d4c3629738372a287b0d4abb3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func layoutFloatingView() { | |
let width = CGRectGetWidth(tableView.frame) | |
let y = tableView.contentOffset.y + (tableView.tableHeaderView == nil ? 0 : CGRectGetHeight(tableView.tableHeaderView!.frame)) + 64 | |
floatingView.frame = CGRectMake(0, y, width, 65) | |
tableView.bringSubviewToFront(floatingView) | |
} | |
override func scrollViewDidScroll(scrollView: UIScrollView) { | |
layoutFloatingView() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment