qmathe / DropDownMenuKit

UIKit drop down menu, simple yet flexible and written in Swift
Other
303 stars 38 forks source link

Fixed working in Share Extension #23

Closed nab0y4enko closed 5 years ago

nab0y4enko commented 6 years ago

UIApplication.shared can not be used in Share Extension

qmathe commented 5 years ago

Thanks for the nice patch. I just merged it. Sorry for the late review too!

qmathe commented 5 years ago

To remain fully compatible with target/action expected in a normal app (e.g. nil target or optional sender argument), I reverted to UIApplication.sendAction(to:from:for:) as the default solution.

For app extensions as explained in the README, the framework must now be built with -DAPP_EXTENSION as a Swift flag. In this case, perform() is going to be used to send the action.