Last active
July 13, 2017 04:02
-
-
Save tranhieutt/1cb4a1967f2d5961b86c222af86c7c36 to your computer and use it in GitHub Desktop.
Swift coding convention
This file contains hidden or 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
//Not preferred: | |
class MyViewController: UIViewController, UITableViewDataSource, UIScrollViewDelegate { | |
// all methods | |
} | |
//Preferred: | |
class MyViewController: UIViewController { | |
// class stuff here | |
} | |
// MARK: - UITableViewDataSource | |
extension MyViewController: UITableViewDataSource { | |
// table view data source methods | |
} | |
// MARK: - UIScrollViewDelegate | |
extension MyViewController: UIScrollViewDelegate { | |
// scroll view delegate methods | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment