Skip to content

Instantly share code, notes, and snippets.

View faizmokh's full-sized avatar
🏠
Working from home

Faiz Mokhtar faizmokh

🏠
Working from home
View GitHub Profile
@faizmokh
faizmokh / Diagonal.swift
Created July 26, 2016 12:55
Diagonal shape with CGAffineTransformMake
import UIKit
import XCPlayground
let containerView = UIView(frame: CGRect(x: 0.0, y: 0.0, width: 300, height: 200))
XCPlaygroundPage.currentPage.liveView = containerView
let diagonalView = UIView(frame: CGRect(x: (containerView.bounds.size.width - 200) / 2, y: (containerView.bounds.size.height - 100) / 2, width: 200, height: 100))
diagonalView.backgroundColor = UIColor.redColor()
diagonalView.layer.borderWidth = 2.0
diagonalView.layer.borderColor = UIColor.yellowColor().CGColor

Keybase proof

I hereby claim:

  • I am faizmokhtar on github.
  • I am faiz (https://keybase.io/faiz) on keybase.
  • I have a public key ASBRWBA3GVG_CzABT6ArsykEAK2jxz3UrAbx7pD6A2hPsAo

To claim this, I am signing this object:

Videos