InterviewSolution
Saved Bookmarks
| 1. |
class Student { let name: String init(name: String) { self.name = name } var scoreCard: ScoreCard?{ didSet{ print("\(name) got \(scoreCard!.marks) marks in this exam") } } } class ScoreCard { let marks: Float init(marks: Float) { self.marks = marks } var student: Student?{ didSet{ print("\(marks) for \(student!.name) in this exam") } } } var student: Student? var score:ScoreCard? student = Student(name: "Albert Einstein") score = ScoreCard(marks: 80) student!.scoreCard = score score!.student = student student = nil score = nil |
|
Answer» When the user receives a notification, there are two possible OUTCOME actions depending on the app state.
|
|