ChapterStructureVC
ChapterStructureVC
struct Points{
var x = 0.0, y = 0.0
mutating func moveBy(x deltaX: Double){
print("before = ",self)
//automatic create new instance after it replace existing one with self
x = x + deltaX
print("after = ",self.x)
}
mutating func stepBy(x deltaX: Double){
print("before = ",self.x)
//Assigning to self Within a Mutating Method
self = Points(x: self.x + deltaX, y: self.y)
print("after = ",self.x)
}
static func forwardBy(x deltaX: Double){
print(self)
}
}
}
}
struct Student {
var studentId = 0
var studentRollNo = 0
}
enum player{
case play, pause, start, stop
mutating func turnPause() {
self = .pause
}
}
class ChapterStructureVC:
UIViewController,UITableViewDelegate,UITableViewDataSource{
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) ->
Int {
return 10
}
return cell
}
func structAndClassInstance(){
func callingPrintStruct(){
self.abccheck()
func mutatingFunc(){
///////////////Class
func classReference(){