Let's say I have one or more 100*50 rectangular buttons on my ViewController.
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
@IBAction func myButton(sender: UIButton) {
}
}
usually I put my graphic images as their image. then I apply auto layout.
BUT! I need them to be oblique not horizontal, I.E. if you have a square, I need to rotate it to be a diamond (45°), it's the same. I know it's not possible via interface builder. how to make it by code?
maybe I should use CGAffineTransformRotate or RotateTranform but I really don't know how to start