Understanding Copy-on-Write in Swift: Efficient Memory Management