@objc
func drawRectangle()
{
// Get the Graphics Context
let context = UIGraphicsGetCurrentContext()
// Set the rectangle outerline-width
context?.setLineWidth( 5.0)
// Set the rectangle outerline-colour
UIColor.red.set()
// Create Rectangle
context?.addRect( CGRect(x: 0, y: 0, width: 100, height: 100))
// Draw
context?.strokePath()
}
I have tried using this and exporting the method but the rectangle isn't displayed in the react native app