UiTextView String Trim after Device Orientation

24 views Asked by At

i am creating an iPad app. When i changing the device orientation, after go to Landscape mode and again Portraint mode the value inside UiTextView not showing correctly.

image of landscape mode

image of portrait mode again

1

There are 1 answers

0
Ben Rockey On BEST ANSWER

call the below function. It invoke when changing the device orientation.

override func viewWillTransitionToSize(size: CGSize, withTransitionCoordinator coordinator: UIViewControllerTransitionCoordinator) {
    if UIDevice.currentDevice().orientation.isLandscape.boolValue {
        dispatch_async(dispatch_get_main_queue(), { // code for reload data })
    } 
    else {
        dispatch_async(dispatch_get_main_queue(), { // code for reload data })
    }}