I have an IBOutlet button dragged from Interface Builder (it's easier to play with it in auto layout )
I rotated it by 45° in code as learned here
var transform = CGAffineTransformMakeTranslation(0.5, 0.5)
var angle = CGFloat(M_PI / 3.9) // degress rotation 3.9
transform = CGAffineTransformRotate(transform, angle)
button.transform = transform
button.layer.rasterizationScale = UIScreen.mainScreen().scale
button.layer.shouldRasterize = true
button.setNeedsDisplay()
now, I have diamond, triangle, rectangle shaped images to put inside as many IBOutlets. this IBOutlets are required to be side by side. But there are margins of the button that I don't know how to cut off.
so, purple is good, yellow is bad. purple area will be "the button" image but I need to cut off the yellow margins area (now is set clear color, but is clickable anyway, and I don't want it to be)
I need to make a UI on iPhone made by many shapes, each of them will be side by side the other, and I don't want the unwanted area of the button to "cover" half the button next to it. any help?
thanks in advance