NSExtensionContext should add generic types to inputItems

Originator:SlaunchaMan
Number:rdar://28378537 Date Originated:19-Sep-2016 10:15 PM
Status:Open Resolved:
Product:iOS SDK Product Version:Xcode Version 8.0 (8A218a)
Classification:Enhancement Reproducible:Always
 
Summary:
Here’s an excerpt from NSExtensionContext.h where inputItems is defined:

// The list of input NSExtensionItems associated with the context. If the context has no input items, this array will be empty.
@property(readonly, copy, NS_NONATOMIC_IOSONLY) NSArray *inputItems;

Since the documentation states that the objects in the array are NSExtensionItems, it seems only logical that the array should be defined as follows:

// The list of input NSExtensionItems associated with the context. If the context has no input items, this array will be empty.
@property(readonly, copy, NS_NONATOMIC_IOSONLY) NSArray<NSExtensionItem *> *inputItems;

Steps to Reproduce:
1. In Swift, use a view controller’s extensionContext in an extension and access its inputItems array.

Expected Results:
The value is typed [NSExtensionItem] or [ExtensionItem].

Actual Results:
The value is typed [Any].

Version:
Xcode Version 8.0 (8A218a)

Notes:
While we’re at it, NSExtensionItem defines an array of attachments that are NSItemProviders, but the array doesn’t have type information.

Configuration:
MacBook Pro (Retina, 15-inch, Mid 2015), OS X Version 10.11.6 (15G1004)

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!