samedi 28 février 2015

Setting UIView dimensions with Bezier Path

i'll preface by saying i'm less than a month into programming with swift. so i've still heavy in the learning phase and much of the stuff online i've search has been written in Objective-C.


my problem right now is that, I have been using a CA Layer to display images. (i want to use CA layers because of the animating properties they have that I plan to utilize)


the layer is itself is connect with my UIView like this:



@IBOutlet weak var myView: UIView!

var l: CALayer {
return myView.layer
}


now i have set the UIView in storyboard something like x:100, y:100, w:100, h:100.


but instead of a 100x100 square to put my image into. I want a polygon shape that I can custom draw with bezier points.


how can i draw the bezier path and set the frame/bound? of the UIView to this custom bezier shape?


this is my first post. i hope that i phrased this question right and didn't overlook any obvious solutions.




Aucun commentaire:

Enregistrer un commentaire