UIImagePickerController on iPad with IOS9

前端 未结 7 1050
陌清茗
陌清茗 2021-02-01 03:06

Since iOS 9 and Xcode 7 I am no longer able to implemet a UIImagePickerController on an iPad (both device and simulator). The code below works on the iPad but only prior to iOS

7条回答
  •  感情败类
    2021-02-01 03:36

    This is a bug from Apple: http://openradar.appspot.com/radar?id=5032957332946944

    Current lousy workaround:

     if UIDevice.currentDevice().userInterfaceIdiom == .Pad {
             imagePicker.allowsEditing = false
         } else {
             imagePicker.allowsEditing = true
         }
    

    Swift 3.0:

    if UIDevice.current.userInterfaceIdiom == .pad {
    }
    

提交回复
热议问题