How do you alloc/dealloc unsafe pointers in Swift?

后端 未结 4 1595
我寻月下人不归
我寻月下人不归 2021-02-01 09:23

With Beta 4, I had this code that worked fine:

var red, green, blue, alpha: UnsafePointer
red = UnsafePointer.alloc(1)
green = Unsa         


        
4条回答
  •  广开言路
    2021-02-01 09:42

    To answer your question about setting the stroke color from a UIColor, this will work:

    CGContextSetStrokeColorWithColor(myUIColor.CGColor);
    

    I do this a lot in my C++-based Quartz 2D code.

提交回复
热议问题