Skip to content

Instantly share code, notes, and snippets.

@hitendradeveloper
Last active June 14, 2018 21:10
Show Gist options
  • Save hitendradeveloper/ae4b6ca1a3e6975f30af9198f0f7d26a to your computer and use it in GitHub Desktop.
Save hitendradeveloper/ae4b6ca1a3e6975f30af9198f0f7d26a to your computer and use it in GitHub Desktop.
Protocol Example - 5 : Protocol Composition using new protocol - alternate way : Medium blog
import UIKit
protocol HSCombineTableViewDatasourceDelegate : UITableViewDataSource, UITableViewDelegate { } //empty protocol
class ContactListViewController: UIViewController {
//ContactListViewController implementation
}
extension ContactListViewController: HSCompositeTableViewDatasourceDelegate {
//implementation of methods releated to UITableViewDataSource and UITableViewDelegate
}
@hitendradeveloper
Copy link
Author

This is just example of protocol composition using alternate way - written for the medium blog - Protocol - The power of Swift

https://medium.com/p/45e97f6531f9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment