Error: Use of unresolved identifier 'kCGBlendModeMultiply'

后端 未结 1 1808
执笔经年
执笔经年 2021-01-17 19:04

I recently updated to Xcode 7, beta 3.

And I\'ve run into some issues, I can\'t seem to find any questions for on SO.

When I run my application, i get 3 errors

1条回答
  •  野的像风
    2021-01-17 19:52

    This should work:

    CGContextSetBlendMode(ctx, CGBlendMode.Multiply)
    

    ... or even just this:

    CGContextSetBlendMode(ctx, .Multiply)
    

    If you Ctrl-click on CGContextSetBlendMode and then from its declaration jump (in the same way) to declaration of CGBlendMode then you will see:

    enum CGBlendMode : Int32 {
    
        /* Available in Mac OS X 10.4 & later. */
        case Normal
        case Multiply
        case Screen
        case Overlay
    
        // ...
    }
    

    Similarly, the other line that produces the error should be changed to:

    let strokingPath = CGPathCreateCopyByStrokingPath(layer.path, nil, 4, .Round, .Miter, 4)
    

    0 讨论(0)
提交回复
热议问题