Swift: A struct with a closure

When Swift was introduced last year by Apple in one of its events, it mentioned about closure, and I have no idea what that was.  I have looked at Swift for a couple of days and I am still a bit confused about how it is going to be used.

Closure is a piece of very concise code and it is actually quite easy to construct as shown in this example.

struct Square{
    var width = 0
    var height = 0
    
    func area()->Int{
        return width*height
    }
    
    func printArea(){
        print("area \(area())")
    }
    
    //closure
    func repeatTill(count count:Int , _ delimiter:String) {
        for _ in 1...count {
            print(delimiter)
            printArea()
        }
    }
    
}

var square = Square(width: 10, height: 5)

square.repeatTill(count:3,"***")

swift

Series Navigation<< Swift: Simple inheritance with a method
Swift: Else if >>