fix cgrect usage

This commit is contained in:
Lucas Nogueira
2023-02-24 15:02:43 -03:00
parent cbe4250f81
commit 34c8232f66

View File

@@ -7,7 +7,7 @@ import UIKit
public class UIUtils {
public static func centerPopover(rootViewController: UIViewController?, popoverController: UIViewController) {
if let viewController = rootViewController {
popoverController.popoverPresentationController?.sourceRect = CGRectMake(viewController.view.center.x, viewController.view.center.y, 0, 0)
popoverController.popoverPresentationController?.sourceRect = CGRect(x: viewController.view.center.x, y: viewController.view.center.y, width: 0, height: 0)
popoverController.popoverPresentationController?.sourceView = viewController.view
popoverController.popoverPresentationController?.permittedArrowDirections = UIPopoverArrowDirection.up
}