Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Brandon Mahoney
iOS Development with Swift Techdegree Graduate 30,149 PointsError in Stormy app
I am looking at the old Stormy app from Swift 1.0. In the DetailBackgroundView I am getting the following error:
No '|' candidates produce the expected contextual result type 'CGGradientDrawingOptions'
For the following code:
UInt32(CGGradientDrawingOptions.DrawsBeforeStartLocation) | UInt32(CGGradientDrawingOptions.DrawsAfterEndLocation))
Anyone know what needs to be changed with Swift 2.0?
1 Answer
Brandon Mahoney
iOS Development with Swift Techdegree Graduate 30,149 PointsI solved the problem with the following:
let options: CGGradientDrawingOptions = [.DrawsBeforeStartLocation, .DrawsAfterEndLocation]
I then called options in its place:
CGContextDrawLinearGradient(context, purpleGradient,
CGPointMake(160, 0),
CGPointMake(160, 568),
options.self)