Why, when dealing with Share Extensions and the extensionContext.inputItems inside of a view controller, do people (and the Apple docs) only get the firstObject of the inputItems instead of iterating over all of them?
Dealing with extensionContext.inputItems for ShareExtension. Why only get firstObject of inputItems?
343 Views Asked by user3137679 At
2
Because,
NSExtensionActivationRulemay indicate that only one item is permitted, e.g.NSExtensionActivationSupportsImageWithMaxCounthas a value of 1.In either case there's no point in iterating through the array. There should only be one item, and if for some reason more than one item is present, your code can't handle it anyway.