Created
January 1, 2019 02:56
-
-
Save arifinfrds/dd1d7d24bdbd3992bbb6def3b083a976 to your computer and use it in GitHub Desktop.
Simple example of not clean ethod Implementation.
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
import UIKit | |
extension ViewController: UITableViewDelegate { | |
// Some UITableViewDelegate methods | |
// ... | |
func scrollViewDidScroll(_ scrollView: UIScrollView) { | |
let verticalOffset = tableView.contentOffset.y | |
if verticalOffset >= 64 { | |
navigationController?.unTransparentNavBar(tintColor: Resources.Color.primaryColor, barTintColor: .white) | |
let textAttributes = [NSAttributedStringKey.foregroundColor: UIColor.black] | |
navigationController?.navigationBar.titleTextAttributes = textAttributes | |
} else { | |
navigationController?.transparentNavBar(tintColor: .white) | |
let textAttributes = [NSAttributedStringKey.foregroundColor: UIColor.clear] | |
navigationController?.navigationBar.titleTextAttributes = textAttributes | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment