Convertion of UIImage to Mat type using openCV in swift iOS (using obj-c bridge)

In one of our project I have one UIimage , i want to convert that image to Matrix type using openCV in swift and vice versa . I want to do affine transformation on that image also , I have the respective image points also . The mentioned code below are in kotlin , and I want to same thing in iOS swift -

val x = img?.let { Mat(it.height, img.width, CvType.CV_32FC3) }
org.opencv.android.Utils.bitmapToMat(img, x)
val warped = Mat(300, 300, CvType.CV_32FC3) //112
val size = org.opencv.core.Size(300.0, 300.0)
Imgproc.warpAffine(imgMat, warped, affineTransformation, size)
val bitmap = Bitmap.createBitmap(warped.cols(), warped.rows(), Bitmap.Config.ARGB_8888)
org.opencv.android.Utils.matToBitmap(warped, bitmap)

Any help is appreciated . Thank you