Sobes.tech
Junior — Senior

What will be the output? (task #35)

livecode

Task condition

In Swift, a UIView object is created with a specified frame, after which an affine transformation is applied — scaling by a factor of 2 along the X-axis, while the Y-axis scale remains unchanged. It is necessary to determine the coordinates and sizes that will be printed for the bounds and frame properties after the transformation is applied.

import UIKit

let box = UIView(frame: .init(x: -50, y: -50, width: 100, height: 100))
box.transform = .init(scaleX: 2, y: 1)

print(box.bounds) // x: ?, y: ?, width: ?, height: ?
print(box.frame)  // x: ?, y: ?, width: ?, height: ?