ricardopereira / quickactions Goto Github PK
View Code? Open in Web Editor NEWSwift wrapper for iOS Home Screen Quick Actions (App Icon Shortcuts)
License: MIT License
Swift wrapper for iOS Home Screen Quick Actions (App Icon Shortcuts)
License: MIT License
I ran into one problem and couldn't figure it out what happened. I followed the instructions in the README and also checked the example code, however in performActionForShortcutItem function
func application(application: UIApplication, performActionForShortcutItem shortcutItem: UIApplicationShortcutItem, completionHandler: Bool -> Void) {
guard let quickActions = quickActions else { return completionHandler(false) }
guard let rootViewController = window?.rootViewController else { return completionHandler(false) }
completionHandler(quickActions.handle(rootViewController, shortcutItem: shortcutItem))
}
This line always return false
quickActions.handle(rootViewController, shortcutItem: shortcutItem)
I don't know if it is because I set something wrong or it is because of the library.
Hello Ricardo,
Thanks for this module . I was looking forward an easier solution of implementing Quick Actions with my app. However, I ran into some installation issues. Module is installed correctly and recognised with "import" statement at the beginning of my AppDelegate, but then there are some problems:
Use of undeclared type 'ShortcutType'
Cannot specialize non-generic type 'module<QuickActions>'
Truth be told I'm just following the steps you outlined in the readme file. At this point I'm just guessing which part goes where in my app. Could you please provide and example application for everyone to use as kickstart ?
I'm currently implementing QuickActions with your framework. I want to set custom icons for the quick actions but I don't really know how exactly. In your source there's the following line:
if self == .custom {
NSException(name: NSExceptionName(rawValue: "Invalid option"), reason: "`Custom` type need to be used with `toApplicationShortcutIcon:imageName`", userInfo: nil).raise()
return nil
}
To build the shortcuts my code looks like in your example:
let shortcuts = [
Shortcut(
type: AppShortcut.createExpense,
title: NSLocalizedString("CreateExpenseTitle", comment: ""),
subtitle: NSLocalizedString("CreateExpenseSubTitle", comment: ""),
icon: .add
)
]
There's this function:
func toApplicationShortcutIcon(_ imageName: String) -> UIApplicationShortcutIcon?
But I don't really know how to call this function or is there another way? Can someone give me an advice how to implement a custom icon?
Hey, I'd love to see this lib available in Swift 3 so I can implement it in my project.
Thanks ๐
CocoaPods
and Carthage
are awesome tools and make our life really easier, but there are some devs who still don't know how to use them.
It would be cool to add the Manual installation guide in your README.md
. You can take a look at my iOS Readme Template to see how you can do it.
The new Xcode version force me to update my project to a newer Swift version than 4.0. Now this pod is outdated. I'd really appreciate an update :).
Hi,
Thanks for this component. Can we add or remove options outside UI Controller?
Can you send a sample?
Regards,
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.