😩 Old Way (UserNotifications) | 🎉 New Way (AlarmKit) |
---|---|
Gets muted by Focus modes | Rings loud and proud! |
Buried in notification center | Lives in Clock app like a VIP |
"Daily repeat" is... complicated | Perfect recurring patterns |
Feels like a cheap knockoff | Feels 100% native iOS |
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
import UIKit | |
enum Bread { | |
case plain | |
case multigrain | |
case honeyOats | |
case oats | |
} | |
enum Vegetable { |
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
// Abstraction | |
protocol Vehicle: AnyObject { | |
var vehicleType: String { get set } | |
func start() | |
func stop() | |
} | |
// Interface | |
extension Vehicle { | |
var vehicleType: String = "Car" |
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
class Car { | |
func carName() { | |
print("Unknown car") | |
} | |
} | |
class BMW: Car { | |
override func carName() { | |
print("BMW car") | |
} |
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
func multiplication(_ a: Int, b: Int) -> Int { | |
return a * b | |
} | |
func multiplication(_ a: Int, b: Int, c: Int) -> Int { | |
return a * b * c | |
} | |
func multiplication(_ a: Int, c: Int) -> Int { | |
return a * c |
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
class LoginViewController: UITableViewDelegate, UITableViewDatasource { | |
// LoginViewController confirm two protocols. It's look like multiple inheritance. | |
} |
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
class BaseViewController: UIViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
} | |
} | |
class LoginViewController: BaseViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
} |
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
// Objects and Instances | |
let carObject = Car(carType: "Automatic", carColor: .white) | |
print(carObject.carType) // Automatic |
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
class Car { | |
var carType: String? | |
var carColor: UIColor? | |
init() {} | |
init(_ carType: String?, carColor: UIColor?) { | |
self.carColor = carColor | |
self.carType = carType | |
} |