Quiero dibujar un rectángulo relleno en la vista de mi viewContoller. Escribí el código siguiente en viewDidLoad. Pero no hay cambio. ¿Qué pasa?Cómo dibujar un rectángulo?
CGRect rectangle = CGRectMake(0, 100, 320, 100);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetRGBFillColor(context, 1.0, 0.0, 0.0, 1.0);
CGContextSetRGBStrokeColor(context, 1.0, 0.0, 0.0, 1.0);
CGContextFillRect(context, rectangle);
tenga en cuenta, para esta ** pregunta muy antigua **, He puesto en la respuesta moderna, 2018 – Fattie