Frame of CardIO view

860 Views Asked by At

I am working on an iOS app in Swift 3.0 and I have integrated card scanner using Card.IO for iOS. I am successfully able to scan the card, but the problem is that width and height of the camera view does not take frames as per the requirements. It only takes width and height in ratio of 3:4.

I want, the camera should take half of the screen height and full screen width, But is is not taking. When I pass the frame as

cardView = CardIOView(frame: CGRect(x: 0, y: 100, width: screen.width, height: screen.height / 2))

it does not take full screen width.

Is it a bug on SDK side, I have tried everything but no success. If anyone can help.

Thanks in advance!

1

There are 1 best solutions below

3
On

My suggestion is: you incorrectly determine the screen size: Swift: Determine iOS Screen size

let screenSize = UIScreen.main.bounds
let screenWidth = screenSize.width
let screenHeight = screenSize.height