This code:
let rect = CGRectMake( 0.0, 0.0, 16.0, 16.0 )
let context = UIGraphicsGetCurrentContext()
UIGraphicsBeginImageContext( rect.size )
CGContextSetFillColorWithColor( context, color.CGColor )
CGContextFillRect( context, rect )
let image = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
Is throwing these errors:
MakeImage[60890] <Error>: CGContextSetFillColorWithColor: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
MakeImage[60890] <Error>: CGContextFillRects: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
CGRect size seems fine, which other posts suggest as the problem. So what else is incorrectly set, please? Thank you.