To create a view with a red background color of size 100 by 100 in Swift, you can use the UIView
class and set its backgroundColor
and frame
properties:
main.swift109 chars3 lines
You can then add this view to your view hierarchy with:
main.swift24 chars2 lines
Note: view
here refers to the view controller's view, assuming you are creating this view in a view controller.
gistlibby LogSnag