I am making a custom keyboard. In order to determine the orientation of some buttons I need to find the width of the keyboard. I do this by using:
this can happen in two scenarios 1- you didn't set the size of the self.view (somehow ... if you created that view programmatically..)
2- if you didn't initialize that view at all ...
However if the keyboard width equals the viewcontroller width , you can use this code bekow:
CGFloat width = [UIScreen mainScreen].bounds.size.width;