Skip to content

Instantly share code, notes, and snippets.

@sandeeplearner
Created May 11, 2020 20:50
Show Gist options
  • Save sandeeplearner/5e7e5e6d20e78e49a4180c909e86b8fa to your computer and use it in GitHub Desktop.
Save sandeeplearner/5e7e5e6d20e78e49a4180c909e86b8fa to your computer and use it in GitHub Desktop.
ViewController confirming to protocol
class ViewController: UIViewController,GenericOperations {
typealias Operand = Int
override func viewDidLoad() {
super.viewDidLoad()
let a = 100
let b = 200
debugPrint(self.add(operand1: a, operand2: b))
}
}
class ViewControllerV2: UIViewController,GenericOperations {
typealias Operand = String
override func viewDidLoad() {
super.viewDidLoad()
let a = "Sandeep"
let b = "Bhandari"
debugPrint(self.add(operand1: a, operand2: b))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment