-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XExtensionItemSource API is Too Complicated #43
Comments
For starters, what about an initializer that just looks like: @interface XExtensionItemSource
- (instancetype)initWithItem:(id)item;
@end Unfortunately I think this would need to be additive, rather than replacing the existing initializers, but would at least provide a low-barrier for those who just want to throw a single item in and not worry about placeholders or additional attachments. Metadata could still be appended using |
Love that idea. |
Additionally, as per @AriX and @prendio2 we can ditch the existing |
How about: @interface XExtensionItemSource
- (instancetype)initWithItems:(NSArray *)items;
@end Which would accept an array of objects (urls, images, strings, whatever). The first item in the array is used as placeholder and all are translated into |
@prendio2 Would this initializer be in addition to the existing ones, or in place of? I can see having it by the low-barrier-to-entry option, but the problem with this being the only initializer is that it’s not easy to translate an array of items into an array of item providers. A couple reasons why:
|
Right yeah, maybe a simplification too far |
Hey all, I just finished implementing a proposed revision of the Some notes:
I'd be glad to hear any thoughts on the matter. What do you like? What do you not like? Any concerns? Did I miss anything? |
@AriX Definitely an interesting approach. I need to chew on this some more for sure but here are a few initial thoughts.
|
Keep me updated on any other thoughts and ideas you have. Happy to change this around or ditch my ideas altogether. |
👍
It does, I guess I just kind of figured that the block-based initializers would cover this use case sufficiently. But maybe not.
Honestly I was just thinking of the Safari special-case, so it's probably not worth worrying about. |
Just pushed the corresponding changes to my repo on GitHub. Everyone, please let me know if you have thoughts or if you think it makes sense to pull any of this into the mainline repo. Also realized that an added benefit of the way this version is implemented is that it can easily be backwards-compatible with iOS 7 (minus the extensions and attachments and metadata, of course). Not sure if that's something anyone cares about, but it could help with developer adoption, since iOS 7 is still rather widely used. |
This is looking really good; I’d like to move forward with this approach. @prendio2 @mattbischoff: if you two could have a look and weigh in as well, it’d be much appreciated. @AriX How do you think we should go about integrating? Either of these options is fine with me, I have zero preference:
My goal is to have a 1.0 tag applied by next Thursday, May 21 – ideally sooner, to give myself some breathing room. I’m going to be off the grid for the three weeks that follow, traveling for my honeymoon. We likely won’t drum up too much PR around this until Tumblr.app support actually hits the App Store, so I plan to have a blog post queued up that I’ll leave in @mattbischoff’s hands. |
@AriX A few bits of specific feedback:
I’m going to close this issue (default subject) in favor of the changes proposed on your branch. |
I took a look and agree that this is a better API / approach. If there are any specific open questions left, let me know and I can help work those out, but otherwise full steam ahead. |
Fantastic. Let me take your feedback and update my branch and create a pull request with my changes. If you'd be willing to handle the unit testing and stuff, that'd be great. Happy to sign that waiver. |
See #46! |
This looks good to me. We've already submitted Unread 1.5.1 with the current API but would happily move to this new approach. One thought on the per-activity |
I'm a little worried that XExtensionItemSource is a little bit confusing/difficult to use for newcomers. Normal users might not be familiar with what a "placeholder item" is or why it's here.
It seems confusing that you can initialize an XExtensionItemSource with an attachments array or use the registerItemProvidingBlock: method and what the difference is between those things. And how are people supposed to understand how
attributedContentText
ties into those things? I worry that you have to be an expert in how UIActivityItemSource/NSExtensionItem/NSItemProvider work in order to use this API.Compare that to UIActivityViewController, which (in the simple case) is easy as can be - literally just pass it whatever object you want. I wonder if we should be trying to offer a slightly higher-level API that abstracts away a few of these things. Particularly the placeholder item, the attachments array, and the attributedContentText/attributedTitle properties. I think that attributedTitle and subject are fundamentally the same concept and could be easily merged (since the activities that use subject never use attributedTitle)
Working on ideas for alternatives.
The text was updated successfully, but these errors were encountered: