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
class Cat : Animal, Eye{
var isIdle: Bool? = true
func run() {
isIdle = true
print("Cat is running now")
}
func stop() {
isIdle = false
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 Animal{
func run()
func stop()
}
protocol Eye{
func closeEyesAndSleep()
func openEyesAndLookAround()
}
class Dog : Animal{
func run() {
print("Dog is running now")
}
func stop() {
print("Dog has stopped now")
}
}
class Cat : Animal{
func run() {
print("Cat is running now")
}
func stop() {
print("Cat has stopped now")
}
}
class Cat : Animal{
}
class Cat{
}
protocol Animal{
func run()
func stop()
}

Generic UI Stuff

Creating and adding multiple bar buttons to navigation bar

let addBarButtonItem = UIBarButtonItem(barButtonSystemItem: .add, target: self, action: #selector(ViewController.addPerson(_:)))
let filterBarButtonItem = UIBarButtonItem(title: "Filter", style: .plain, target: self, action: #selector(ViewController.filter))

navigationItem.rightBarButtonItems = [addBarButtonItem, filterBarButtonItem]

creating a actionsheet style alert controller without using third party apps