Created
August 15, 2016 12:19
-
-
Save hudinwal/228a448ad6654ae89c4dc2c636591905 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
var topOffset: CGFloat = 0.0 | |
private let kTopWindowAspectRatio : CGFloat = 3.0/4.0 | |
override func viewDidLayoutSubviews() { | |
super.viewDidLayoutSubviews() | |
// Calculate the top offset and set it if not corectly set | |
if(topOffset != CGRectGetWidth(pullDownTableView.bounds) * kTopWindowAspectRatio) { | |
topOffset = CGRectGetWidth(pullDownTableView.bounds) * kTopWindowAspectRatio | |
// Setup table view insets and offsets | |
let topInset = CGRectGetHeight(pullDownTableView.bounds) | |
pullDownTableView.contentInset = UIEdgeInsetsMake(topInset, 0, 0, 0); | |
pullDownTableView.contentOffset = CGPointMake(0, -topOffset) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment