![]() Let's look at the most verbose initializer: If you pass just the app type via actionContextWithAppType:, Choosy will show apps of that type and just open them, passing no parameters. And two, we have some cool long-term features planned that go beyond just opening apps )įor native apps, you can use any of the actionContextWithAppType. One, you typically don't just link to an app, but you want to perform an action with it, such as show a specific Twitter profile. We prefer the word 'action' for two reasons. What we call 'action' here can also be thought of as 'external link', since you're really opening (linking to) an an external app. Use ChoosyActionContext objects to pass all information about the actions you want to execute. It's particularly easy to forget to handle a long press, leaving users without the ability to reset their defaults! Action Context So if you're manually handling one of these gestures and calling either handleAction: or resetAppSelectionAndHandleAction:, you need to override the other gesture as well and call the other method there. Just keep in mind that registerUiElement:forAction: registers the UI element for both tap and long-press gestures. You can intermix registerUiElement:forAction: and handleAction: calls as you see fit. This way, by the time your users open a screen that has a Twitter link, for example, Choosy will have received information about Twitter app type and apps, checked which apps are installed, and downloaded icons for the installed apps. ( BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( NSDictionary *)launchOptions You can, however, long press a link to force the UI to come up. So links will often launch the one app that's installed. Note on running in the simulator: it's hard to see Choosy in action in the simulator because it barely has any apps (and you can't install any). It should build and deploy to your device as-is. ![]() To run the demo app, clone this repo and run pod update in the directory where Podfile is. To see supported URL schemes or make URL scheme contributions check out choosy-data. ( Click here for a gif showing the 'select default app' gesture.) Choosy detects installed apps and knows which parameters each app supports, passing only the supported parameters to each app. ![]() With Choosy, you pass generic parameters, once, and get support for all the apps. Screenshots are from the included Demo app.īefore, you had to write code specific to each app you want to support. To get automatic support for popular Twitter clients:Ĭlick here for the gif of Choosy in action.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |