RFAboutView-Swift
RFAboutView-Swift copied to clipboard
Incorrect UI centering when using on iPad in modal=.formSheet
When using the controller with an iPad but presenting it in a modal = .formSheet the UI overall for the App Info, copyright, email etc... is not centered properly. A quick glance into the code, and I think the assumption made in the function
func sizeForPercent(_ percent: CGFloat) -> CGFloat {
if UIDevice.current.userInterfaceIdiom == .pad {
return ceil(((view.frame.size.width * 0.7) * (percent / 100)))
} else {
return ceil(view.frame.size.width * (percent / 100))
}
}
is slightly incorrect, since it is assuming on iPad the VC is presented full screen... In addition, it's not only the userInterfaceIdiom and the modal presentation that should be checked but in case of an app supporting slideOver the frame maybe even different. Thanks!