Skip to content

Instantly share code, notes, and snippets.

View mayooresan's full-sized avatar
💜
In love with JS stack.

Jay Mayu mayooresan

💜
In love with JS stack.
View GitHub Profile
protocol Animal{
var isIdle : Bool? {get set}
func run()
func stop()
}
class Cat : Animal, Eye{
var isIdle: Bool? = true
func run() {
print("Cat is running now")
}
func stop() {
print("Cat has stopped now")
}
protocol Animal{
var isIdle : Bool? {get set}
func run()
func stop()
}
protocol Eye{
func closeEyesAndSleep()
func openEyesAndLookAround()
}
class Cat : Animal, Eye{
var isIdle: Bool? = true
func run() {
isIdle = true
print("Cat is running now")
}
func stop() {
isIdle = false
class Cat : Eye{
var isIdle: Bool? = true
func closeEyesAndSleep() {
if isIdle == true{
print("Cat is sleeping now")
}else{
print("Cat will NOT sleep now")
}
}
import UIKit
class EnemyBaseVC: UIViewController {
let hasWeaponOfMassDescrtruction : Bool = true
override func viewDidLoad() {
super.viewDidLoad()
}
import UIKit
protocol SpyDelegate {
func didFindWeaponOfMassDestruction(found : Bool)
}
class EnemyBaseVC: UIViewController {
let hasWeaponOfMassDescrtruction : Bool = true
import UIKit
protocol SpyDelegate {
func didFindWeaponOfMassDestruction(found : Bool)
}
class EnemyBaseVC: UIViewController {
let hasWeaponOfMassDescrtruction : Bool = true
var delegate : SpyDelegate?
import UIKit
protocol SpyDelegate {
func didFindWeaponOfMassDestruction(found : Bool)
}
class EnemyBaseVC: UIViewController {
let hasWeaponOfMassDescrtruction : Bool = true
var delegate : SpyDelegate?
import UIKit
class HomeBaseVC: UIViewController, SpyDelegate {
override func viewDidLoad() {
super.viewDidLoad()
}
func didFindWeaponOfMassDestruction(found: Bool) {
// Handle the received data here