'setMenuVisible(_:animated:)' was deprecated in iOS 13.0: Use showMenuFromView:rect: or hideMenuFromView: instead iOS swift

 Problem:

My code for my dropdown menu as like below.

        menu.setTargetRect(CGRect(x: cell.frame.midX, y: cell.frame.origin.y+25, width: 20, height: 20), in: cell.superview!)

        menu.setMenuVisible(true, animated: true)


The above code shows warning as like below.

'setMenuVisible(_:animated:)' was deprecated in iOS 13.0: Use showMenuFromView:rect: or hideMenuFromView: instead

How can i solve that?

Solution:

setMenuVisible(_:animated:)' is deprecated after ios 13.So please use the below code instead of above.

        menu.showMenu(from: cell.superview!, rectCGRect(x: cell.frame.midXy: cell.frame.origin.y+25, width: 20, height: 20))


Comments

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

store cgpoint in userdefaults iOS swift