Skip to content

MetalKit iOS xcode9 beta1

Timothy Risi edited this page Sep 1, 2017 · 2 revisions

#MetalKit.framework

Risi

diff -ruN /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalKit.framework/Headers/MTKModel.h /Applications/Xcode9-beta1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalKit.framework/Headers/MTKModel.h
--- /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalKit.framework/Headers/MTKModel.h	2016-09-23 21:49:20.000000000 -0400
+++ /Applications/Xcode9-beta1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalKit.framework/Headers/MTKModel.h	2017-05-19 23:24:33.000000000 -0400
@@ -16,15 +16,16 @@
 /*!
  @group MTKModelErrors
  */
+typedef NSString * MTKModelError NS_STRING_ENUM;
 
 /*!
  @constant MTKModelErrorDomain
  */
-MTK_EXTERN NSString * __nonnull const MTKModelErrorDomain NS_AVAILABLE(10_11, 9_0);
+MTK_EXTERN MTKModelError __nonnull const MTKModelErrorDomain NS_AVAILABLE(10_11, 9_0);
 /*!
  @constant MTKModelErrorKey
  */
-MTK_EXTERN NSString * __nonnull const MTKModelErrorKey NS_AVAILABLE(10_11, 9_0);
+MTK_EXTERN MTKModelError __nonnull const MTKModelErrorKey NS_AVAILABLE(10_11, 9_0);
 
 
 /*!
@@ -192,7 +193,7 @@
  @param mesh Model I/O Mesh from which to create this MetalKit mesh
  @param device Metal device on which to create mesh resources
  @param error Pointer to an NSError object set if an error occurred
- @discussion The designated initializer for this class.  This does NOT initialize any meshes that are children of the Model I/O mesh, only submeshes that are part of the given mesh.  An exceiption is raise if vertexBuffer objects in the given mesh and the indexBuffer of any submesh in this mesh have not been created with a MTKMeshBufferAllocator object.  If a Submesh using MDLGeometryTypeQuads or MDLGeometryTypeTopology is used, that submesh will be copied, and recreated to use MDLGeometryTypeTriangles, before this routine creates the MTKSubmesh.
+ @discussion The designated initializer for this class.  This does NOT initialize any meshes that are children of the Model I/O mesh, only submeshes that are part of the given mesh.  An exception is raised if vertexBuffer objects in the given mesh and the indexBuffer of any submesh in this mesh have not been created with a MTKMeshBufferAllocator object.  If a submesh using MDLGeometryTypeQuads or MDLGeometryTypeTopology is used, that submesh will be copied, and recreated to use MDLGeometryTypeTriangles, before this routine creates the MTKSubmesh.
  */
 - (nullable instancetype)initWithMesh:(nonnull MDLMesh *)mesh
                                device:(nonnull id<MTLDevice>)device
@@ -206,7 +207,7 @@
  @param sourceMeshes Array built by this method containing MDLMesh objects corresponding the returned MTKMesh objects
  @param error Pointer to an NSError object set if an error occurred
  @return MetalKit Meshes created from the Model I/O asset
- @discussion A convenience method to create MetalKit meshes from each mesh in a Model/IO asset.  Resulting meshes are returned while the Model I/O meshes from which they were generated will appear in the sourceMeshes array.  All vertexBuffer objects in each MDLMesh object in the asset and the indexBuffer of each submesh within each of these meshes must have been created using a MTKMeshBufferAllocator object.
+ @discussion A convenience method to create MetalKit meshes from each mesh in a Model I/O asset.  resulting meshes are returned while the corresponding Model I/O meshes from which they were generated will appear in the sourceMeshes array.  All vertexBuffer objects in each MDLMesh object in the asset and the indexBuffer of each submesh within each of these meshes must have been created using a MTKMeshBufferAllocator object.  Thus 
  */
 + (nullable NSArray<MTKMesh*>*)newMeshesFromAsset:(nonnull MDLAsset *)asset
                                            device:(nonnull id<MTLDevice>)device
@@ -216,13 +217,14 @@
 /*!
  @property vertexBuffers
  @abstract Array of buffers in which mesh vertex data resides.
+ @discussion This is filled with mesh buffer objects using the layout described by the vertexDescriptor property.  Elements in this array can be [NSNull null] if the vertexDescriptor does not specify elements for buffer for the given index
  */
 @property (nonatomic, readonly, nonnull) NSArray<MTKMeshBuffer *> *vertexBuffers;
 
 /*!
  @property vertexDescriptor
  @abstract Model I/O vertex descriptor specifying the layout of data in vertexBuffers.
- @discussion This is not directly used by this object, but the application can use this information to determine rendering state or create a Metal vertex descriptor to build a RenderPipelineState object capable of interpreting data in 'vertexBuffers'.
+ @discussion This is not directly used by this object, but the application can use this information to determine rendering state or create a Metal vertex descriptor to build a RenderPipelineState object capable of interpreting data in 'vertexBuffers'.  Changing propties in the object will not result in the relayout data in vertex descriptor and thus will make the vertex descriptor no loger describe the layout of vertes data and verticies. (i.e. don't change properties in this vertexDescriptor)
  */
 @property (nonatomic, readonly, nonnull) MDLVertexDescriptor *vertexDescriptor;
 
@@ -258,40 +260,40 @@
  @abstract Partially converts a Metal vertex descriptor to a Model I/O vertex descriptor
  @discussion This method can only set vertex format, offset, bufferIndex, and stride information in the produced Model I/O vertex descriptor.  It does not add any semantic information such at attributes names.  Names must be set in the returned Model I/O vertex descriptor before it can be applied to a a Model I/O mesh.
  */
-MTK_EXTERN MDLVertexDescriptor* __nonnull MTKModelIOVertexDescriptorFromMetal(MTLVertexDescriptor* __nonnull metalDescriptor);
+MTK_EXTERN MDLVertexDescriptor* __nonnull MTKModelIOVertexDescriptorFromMetal(MTLVertexDescriptor* __nonnull metalDescriptor) NS_AVAILABLE(10_11, 9_0);
 
 /*!
  @function MTKModelIOVertexDescriptorFromMetalWithError
  @abstract Partially converts a Metal vertex descriptor to a Model I/O vertex descriptor
  @discussion This method can only set vertex format, offset, bufferIndex, and stride information in the produced Model I/O vertex descriptor.  It does not add any semantic information such at attributes names.  Names must be set in the returned Model I/O vertex descriptor before it can be applied to a a Model I/O mesh. If error is nonnull, and the conversion cannot be made, it will be set.
  */
-MTK_EXTERN MDLVertexDescriptor* __nonnull MTKModelIOVertexDescriptorFromMetalWithError(MTLVertexDescriptor* __nonnull metalDescriptor, NSError * __nullable * __nullable error);
+MTK_EXTERN MDLVertexDescriptor* __nonnull MTKModelIOVertexDescriptorFromMetalWithError(MTLVertexDescriptor* __nonnull metalDescriptor, NSError * __nullable * __nullable error) NS_AVAILABLE(10_12, 10_0);
 
 /*!
  @function MTKMetalVertexDescriptorFromModelIO
  @abstract Partially converts a Model I/O vertex descriptor to a Metal vertex descriptor
  @discussion This method can only set vertex format, offset, bufferIndex, and stride information in the produced Metal vertex descriptor. It simply copies attributes 1 for 1. Thus attributes in the given Model I/O vertex descriptor must be arranged in the correct order for the resulting descriptor to properly map mesh data to vertex shader inputs.  Layout stepFunction and stepRates for the resulting MTLVertexDescriptor must also be set by application.
  */
-MTK_EXTERN MTLVertexDescriptor* __nonnull MTKMetalVertexDescriptorFromModelIO(MDLVertexDescriptor* __nonnull modelIODescriptor);
+MTK_EXTERN MTLVertexDescriptor* __nullable MTKMetalVertexDescriptorFromModelIO(MDLVertexDescriptor* __nonnull modelIODescriptor) NS_AVAILABLE(10_11, 9_0);
 
 /*!
  @function MTKMetalVertexDescriptorFromModelIOWithError
  @abstract Partially converts a Model I/O vertex descriptor to a Metal vertex descriptor
  @discussion This method can only set vertex format, offset, bufferIndex, and stride information in the produced Metal vertex descriptor. It simply copies attributes 1 for 1. Thus attributes in the given Model I/O vertex descriptor must be arranged in the correct order for the resulting descriptor to properly map mesh data to vertex shader inputs.  Layout stepFunction and stepRates for the resulting MTLVertexDescriptor must also be set by application.  If error is nonnull, and the conversion cannot be made, it will be set.
  */
-MTK_EXTERN MTLVertexDescriptor* __nonnull MTKMetalVertexDescriptorFromModelIOWithError(MDLVertexDescriptor* __nonnull modelIODescriptor, NSError * __nullable * __nullable error);
+MTK_EXTERN MTLVertexDescriptor* __nullable MTKMetalVertexDescriptorFromModelIOWithError(MDLVertexDescriptor* __nonnull modelIODescriptor, NSError * __nullable * __nullable error) NS_AVAILABLE(10_12, 10_0);
 
 /*!
  @function MTKModelIOVertexFormatFromMetal
  @abstract Converts a Metal vertex format to a Model I/O vertex format
  @return A Model I/O vertexformat correspoinding to the given Metal vertex format.  Returns MDLVertexFormatInvalid if no matching Model I/O vertex format exists.
  */
-MTK_EXTERN MDLVertexFormat MTKModelIOVertexFormatFromMetal(MTLVertexFormat vertexFormat);
+MTK_EXTERN MDLVertexFormat MTKModelIOVertexFormatFromMetal(MTLVertexFormat vertexFormat) NS_AVAILABLE(10_11, 9_0);
 
 /*!
 @function MTKMetalVertexFormatFromModelIO
 @abstract Converts a Model I/O vertex format to a Metal vertex format
 @return A Metal vertexformat correspoinding to the given Model I/O vertex format.  Returns MTLVertexFormatInvalid if no matching Metal vertex format exists.
 */
-MTK_EXTERN MTLVertexFormat MTKMetalVertexFormatFromModelIO(MDLVertexFormat vertexFormat);
+MTK_EXTERN MTLVertexFormat MTKMetalVertexFormatFromModelIO(MDLVertexFormat vertexFormat) NS_AVAILABLE(10_11, 9_0);
 
diff -ruN /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalKit.framework/Headers/MTKTextureLoader.h /Applications/Xcode9-beta1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalKit.framework/Headers/MTKTextureLoader.h
--- /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalKit.framework/Headers/MTKTextureLoader.h	2016-07-28 21:29:46.000000000 -0400
+++ /Applications/Xcode9-beta1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalKit.framework/Headers/MTKTextureLoader.h	2017-05-19 23:24:33.000000000 -0400
@@ -19,106 +19,115 @@
  @group MTKTextureLoaderErrors
  */
 
+typedef NSString * MTKTextureLoaderError NS_STRING_ENUM NS_SWIFT_NAME(MTKTextureLoader.Error);
+
 /*!
  @constant MTKTextureLoaderErrorDomain
  */
-MTK_EXTERN NSString * __nonnull const MTKTextureLoaderErrorDomain NS_AVAILABLE(10_11, 9_0);
+MTK_EXTERN MTKTextureLoaderError __nonnull const MTKTextureLoaderErrorDomain NS_AVAILABLE(10_11, 9_0);
 /*!
  @constant MTKTextureLoaderErrorKey
  */
-MTK_EXTERN NSString * __nonnull const MTKTextureLoaderErrorKey NS_AVAILABLE(10_11, 9_0);
+MTK_EXTERN MTKTextureLoaderError __nonnull const MTKTextureLoaderErrorKey NS_AVAILABLE(10_11, 9_0);
 
 /*!
  @group MTKTextureLoaderOptions
  */
 
+typedef NSString * MTKTextureLoaderOption NS_STRING_ENUM NS_SWIFT_NAME(MTKTextureLoader.Option);
+
 /*!
  @constant MTKTextureLoaderOptionAllocateMipmaps
  @abstract Identifier to be used in an options NSDictionary with a boolean NSNumber specifying whether to allocate memory for mipmaps when creating the texture
  @discussion If the boolean value specified with this string is true, the resulting Metal texture will have been created with mipmaps whose contents are undefined. It is the responsibility of the caller to fill out the contents of the mipmap data unless MTLTextureLoaderOptionGenerateMipmaps is specified. If the file being loaded contains data for mipmaps (such as in a PVR or KTX file) this option does not need to be specified. In those cases the mipmap memory will be allocated and the image data loaded.
  */
-MTK_EXTERN NSString * __nonnull const MTKTextureLoaderOptionAllocateMipmaps NS_AVAILABLE(10_11, 9_0);
+MTK_EXTERN MTKTextureLoaderOption __nonnull const MTKTextureLoaderOptionAllocateMipmaps NS_AVAILABLE(10_11, 9_0);
 
 /*!
  @constant MTKTextureLoaderOptionGenerateMipmaps
  @abstract Identifier to be used in an options NSDictionary with a boolean NSNumber specifying whether to generate mipmaps when creating the texture
  @discussion If the boolean value specified with this string is true, the resulting Metal texture will be created with mipmaps. If the file being loaded contains data for mipmaps (such as in a PVR or KTX file), specifying this option will overwrite the existing mipmap data in the loaded texture. This option can only be used if the pixel format of the texture is color filterable and color renderable. This option implies MTKTextureLoaderOptionAllocateMipmaps. Specifying this option will cause the MTKTextureLoader to submit work to the GPU on behalf of the caller.
  */
-MTK_EXTERN NSString * __nonnull const MTKTextureLoaderOptionGenerateMipmaps NS_AVAILABLE(10_12, 10_0);
+MTK_EXTERN MTKTextureLoaderOption __nonnull const MTKTextureLoaderOptionGenerateMipmaps NS_AVAILABLE(10_12, 10_0);
 
 /*!
  @constant MTKTextureLoaderOptionSRGB
  @abstract Identifier to be used in an options NSDictionary with a boolean NSNumber specifying whether to create the texture with an sRGB (gamma corrected) pixel format
  @discussion If the boolean value specified with this string is true, the texture will be created with an sRGB pixel format regardless of whether the image file specifies that the data has already been gamma corrected. Likewise, if false, the texture will be created with a non-sRGB pixel format regardless of whether the image file specifies that the data has been gamma corrected. To use the sRGB information specified in the file, do not specify this in the options dictionary.
  */
-MTK_EXTERN NSString * __nonnull const MTKTextureLoaderOptionSRGB NS_AVAILABLE(10_11, 9_0);
+MTK_EXTERN MTKTextureLoaderOption __nonnull const MTKTextureLoaderOptionSRGB NS_AVAILABLE(10_11, 9_0);
 
 /*!
  @constant MTKTextureLoaderOptionTextureUsage
  @abstract Identifier to be used with an NSNumber specifying the MTLTextureUsage flags
  @discussion The resulting Metal texture will be created with the MTLTextureUsage flags indicated by the NSNumber associated with this string.
  */
-MTK_EXTERN NSString * __nonnull const MTKTextureLoaderOptionTextureUsage NS_AVAILABLE(10_11, 9_0);
+MTK_EXTERN MTKTextureLoaderOption __nonnull const MTKTextureLoaderOptionTextureUsage NS_AVAILABLE(10_11, 9_0);
 
 /*!
  @constant MTKTextureLoaderOptionTextureCPUCacheMode
  @abstract Identifier to be used with an NSNumber specifying the MTLCPUCacheMode
  @discussion The resulting Metal texture will be created with the MTLCPUCacheMode indicated by the NSNumber associated with this string.
  */
-MTK_EXTERN NSString * __nonnull const MTKTextureLoaderOptionTextureCPUCacheMode NS_AVAILABLE(10_11, 9_0);
+MTK_EXTERN MTKTextureLoaderOption __nonnull const MTKTextureLoaderOptionTextureCPUCacheMode NS_AVAILABLE(10_11, 9_0);
 
 /*!
  @constant MTKTextureLoaderOptionTextureStorageMode
  @abstract Identifier to be used with an NSNumber specifying the MTLStorageMode
  @discussion The resulting Metal texture will be created with the MTLStorageMode indicated by the NSNumber associated with this string. If this option is omitted, the texture will be created with the default storage mode for Metal textures: MTLStorageModeShared on iOS, and MTLStorageModeManaged on OS X. Specifying this option with MTLTextureStorageModePrivate cause the MTKTextureLoader to submit work to the GPU on behalf of the caller.
  */
-MTK_EXTERN NSString * __nonnull const MTKTextureLoaderOptionTextureStorageMode NS_AVAILABLE(10_12, 10_0);
+MTK_EXTERN MTKTextureLoaderOption __nonnull const MTKTextureLoaderOptionTextureStorageMode NS_AVAILABLE(10_12, 10_0);
+
+
+typedef NSString * MTKTextureLoaderCubeLayout NS_STRING_ENUM NS_SWIFT_NAME(MTKTextureLoader.CubeLayout);
 
 /*!
  * @constant MTKTextureLoaderOptionCubeLayout
  * @abstract Identifier to be used in an options NSDictionary with an MTKTextureLoaderCubeLayout NSString specifying whether to create a cubemap from a 2D image
  * @discussion The NSString value specified with this string must be one option of MTKTextureLoaderCubeLayout. If this option is omitted, the texture loader will not create cubemaps from 2D textures. This option cannot be used with PVR files, KTX files, or MDLTextures, which support cube textures directly.
  */
-MTK_EXTERN NSString * __nonnull const MTKTextureLoaderOptionCubeLayout NS_AVAILABLE(10_12, 10_0);
+MTK_EXTERN MTKTextureLoaderOption __nonnull const MTKTextureLoaderOptionCubeLayout NS_AVAILABLE(10_12, 10_0);
 
 /*!
  * @constant MTKTextureLoaderCubeLayoutVertical
  * @abstract Identifier specifying that the texture loader will create a cube texture from six faces arranged vertically within a single 2D image
  * @discussion A texture cube will be created from six faces arranged vertically within a single 2D image. The image height must be six times the image width, with faces arranged in the following order from top to bottom: +X, -X, +Y, -Y, +Z, -Z.
  */
-MTK_EXTERN NSString * __nonnull const MTKTextureLoaderCubeLayoutVertical NS_AVAILABLE(10_12, 10_0);
+MTK_EXTERN MTKTextureLoaderCubeLayout __nonnull const MTKTextureLoaderCubeLayoutVertical NS_AVAILABLE(10_12, 10_0);
+
+typedef NSString * MTKTextureLoaderOrigin NS_STRING_ENUM NS_SWIFT_NAME(MTKTextureLoader.Origin);
 
 /*!
  * @constant MTKTextureLoaderOptionOrigin
  * @abstract Identifier to be used in an options NSDictionary with an MTKTextureLoaderOrigin NSString specifying whether to flip textures vertically
  * @discussion The NSString value specified with this string must be one option of MTKTextureLoaderOrigin. If this option is omitted, the texture loader will not flip loaded textures. This option cannot be used with block-compressed texture formats, and can only be used with 2D, 2D array, and cube map textures. Each mipmap level and slice of a texture will be flipped.
  */
-MTK_EXTERN NSString * __nonnull const MTKTextureLoaderOptionOrigin NS_AVAILABLE(10_12, 10_0);
+MTK_EXTERN MTKTextureLoaderOption __nonnull const MTKTextureLoaderOptionOrigin NS_AVAILABLE(10_12, 10_0);
 
 /*!
  @constant MTKTextureLoaderOriginTopLeft
  @abstract Identifier specifying that the texture loader should flip textures whose origin is in the bottom-left corner
  @discussion The texture will be flipped vertically if metadata in the file being loaded indicates that the source data starts with the bottom-left corner of the texture.
  */
-MTK_EXTERN NSString * __nonnull const MTKTextureLoaderOriginTopLeft NS_AVAILABLE(10_12, 10_0);
+MTK_EXTERN MTKTextureLoaderOrigin __nonnull const MTKTextureLoaderOriginTopLeft NS_AVAILABLE(10_12, 10_0);
 
 /*!
  @constant MTKTextureLoaderOriginBottomLeft
  @abstract Identifier specifying that the texture loader should flip textures whose origin is in the top-left corner
  @discussion The texture will be flipped vertically if metadata in the file being loaded indicates that the source data starts with the top-left corner of the texture.
  */
-MTK_EXTERN NSString * __nonnull const MTKTextureLoaderOriginBottomLeft NS_AVAILABLE(10_12, 10_0);
+MTK_EXTERN MTKTextureLoaderOrigin __nonnull const MTKTextureLoaderOriginBottomLeft NS_AVAILABLE(10_12, 10_0);
 
 /*!
  @constant MTKTextureLoaderOriginFlippedVertically
  @abstract Identifier specifying that the texture loader should always flip textures
  @discussion The texture will be flipped vertically regardless of any metadata in the file indicating the placement of the origin in the source data
  */
-MTK_EXTERN NSString * __nonnull const MTKTextureLoaderOriginFlippedVertically NS_AVAILABLE(10_12, 10_0);
+MTK_EXTERN MTKTextureLoaderOrigin __nonnull const MTKTextureLoaderOriginFlippedVertically NS_AVAILABLE(10_12, 10_0);
 
-typedef void (^MTKTextureLoaderCallback) (id <MTLTexture> __nullable texture, NSError * __nullable error);
+typedef void (^MTKTextureLoaderCallback) (id <MTLTexture> __nullable texture, NSError * __nullable error) NS_SWIFT_NAME(MTKTextureLoader.Callback);
 
-typedef void (^MTKTextureLoaderArrayCallback) (NSArray<id <MTLTexture>> * __nonnull textures, NSError * __nullable error) NS_AVAILABLE(10_12, 10_0);
+typedef void (^MTKTextureLoaderArrayCallback) (NSArray<id <MTLTexture>> * __nonnull textures, NSError * __nullable error) NS_SWIFT_NAME(MTKTextureLoader.ArrayCallback) NS_AVAILABLE(10_12, 10_0);
 
 /*!
  @class MTKTextureLoader
@@ -150,7 +159,7 @@
  @param completionHandler Block called when the texture has been loaded and fully initialized
  */
 - (void)newTextureWithContentsOfURL:(nonnull NSURL *)URL
-                            options:(nullable NSDictionary <NSString *, NSObject *> *)options
+                            options:(nullable NSDictionary <MTKTextureLoaderOption, id> *)options
                   completionHandler:(nonnull MTKTextureLoaderCallback)completionHandler;
 
 /*!
@@ -171,13 +180,13 @@
  @discussion Uses texture data from version of the texture from the texture set in the asset catalog
              which mathces the device's traits.
              This method attempts to load a texture asset with thw name iven.  If a texture asset
-             with the name given does not exist, it will attempt to create a texture from a an
-             image asset with the name give if it can.
+             with the name given does not exist, it will attempt to create a texture from an
+             image asset with the given name
  */
 - (void)newTextureWithName:(nonnull NSString *)name
                scaleFactor:(CGFloat)scaleFactor
                     bundle:(nullable NSBundle *)bundle
-                   options:(nullable NSDictionary <NSString *, NSObject *> *)options
+                   options:(nullable NSDictionary <MTKTextureLoaderOption, id> *)options
          completionHandler:(nonnull MTKTextureLoaderCallback)completionHandler NS_AVAILABLE(10_12, 10_0);
 
 
@@ -189,7 +198,7 @@
  @param completionHandler Block called when all of the textures have been loaded and fully initialized. The array of MTLTextures will be the same length and in the same order as the requested array of paths. If an error occurs while loading a texture, the corresponding array index will contain NSNull. The NSError will be null if all of the textures are loaded successfully, or will correspond to one of the textures which failed to load.
  */
 - (void)newTexturesWithContentsOfURLs:(nonnull NSArray<NSURL *> *)URLs
-                              options:(nullable NSDictionary <NSString *, NSObject *> *)options
+                              options:(nullable NSDictionary <MTKTextureLoaderOption, id> *)options
                     completionHandler:(nonnull MTKTextureLoaderArrayCallback)completionHandler NS_AVAILABLE(10_12, 10_0);
 
 /*!
@@ -199,7 +208,7 @@
  @param names An array of texture asset names
  @param scaleFactor scale factor of the texture to retrieve from the asset catalog.  Typically the
                     value retrieved from -[UIView contentScale] or -[NSWindow backingScaleFactor].
- @param bundle Resource bundle in which the assets are located
+ @param bundle Resource bundle in which the assets are located.  Main bundle used if nil.
  @param options Dictonary of MTKTextureLoaderOptions. The following options are ignormed when used
                 to load a texture asset but can be used when creating a texture from an image asset
                     MTKTextureLoaderOptionGenerateMipmaps
@@ -213,13 +222,13 @@
  @discussion Uses texture data from version of the texture from the texture set in the asset catalog
              which mathces the device's traits.
              This method attempts to load a texture asset with each name iven.  If a texture asset
-             with the name given does not exist, it will attempt to create a texture from a an
-             image asset with the name give if it can.
+             with the name given does not exist, it will attempt to create a texture from an
+             image asset with the given name.
  */
 - (void)newTexturesWithNames:(nonnull NSArray<NSString *> *)names
                  scaleFactor:(CGFloat)scaleFactor
                       bundle:(nullable NSBundle *)bundle
-                     options:(nullable NSDictionary <NSString *, NSObject *> *)options
+                     options:(nullable NSDictionary <MTKTextureLoaderOption, id> *)options
            completionHandler:(nonnull MTKTextureLoaderArrayCallback)completionHandler NS_AVAILABLE(10_12, 10_0);
 
 
@@ -231,7 +240,7 @@
  @param completionHandler Block called when texture has been loaded and fully initialized
  */
 - (void)newTextureWithData:(nonnull NSData *)data
-                   options:(nullable NSDictionary <NSString *, NSObject *> *)options
+                   options:(nullable NSDictionary <MTKTextureLoaderOption, id> *)options
          completionHandler:(nonnull MTKTextureLoaderCallback)completionHandler;
 
 /*!
@@ -242,7 +251,7 @@
  @param completionHandler Block called when texture has been loaded and fully initialized
  */
 - (void)newTextureWithCGImage:(nonnull CGImageRef)cgImage
-                      options:(nullable NSDictionary <NSString *, NSObject *> *)options
+                      options:(nullable NSDictionary <MTKTextureLoaderOption, id> *)options
             completionHandler:(nonnull MTKTextureLoaderCallback)completionHandler;
 
 /*!
@@ -253,7 +262,7 @@
  @param completionHandler Block called when texture has been loaded and fully initialized
  */
 - (void)newTextureWithMDLTexture:(nonnull MDLTexture *)texture
-                         options:(nullable NSDictionary <NSString *, NSObject *> *)options
+                         options:(nullable NSDictionary <MTKTextureLoaderOption, id> *)options
                completionHandler:(nonnull MTKTextureLoaderCallback)completionHandler NS_AVAILABLE(10_12, 10_0);
 
 /*!
@@ -265,7 +274,7 @@
  @param error Pointer to an autoreleased NSError object which will be set if an error occurred
  */
 - (nullable id <MTLTexture>)newTextureWithContentsOfURL:(nonnull NSURL *)URL
-                                                options:(nullable NSDictionary <NSString *, NSObject *> *)options
+                                                options:(nullable NSDictionary <MTKTextureLoaderOption, id> *)options
                                                   error:(NSError *__nullable *__nullable)error;
 
 /*!
@@ -277,7 +286,7 @@
  @param error Pointer to an autoreleased NSError object which will be set if an error occurred. Will be null if all of the textures are loaded successfully, or will correspond to one of the textures which failed to load.
  */
 - (NSArray <id <MTLTexture>> * __nonnull)newTexturesWithContentsOfURLs:(nonnull NSArray <NSURL *> *)URLs
-                                                               options:(nullable NSDictionary <NSString *, NSObject *> *)options
+                                                               options:(nullable NSDictionary <MTKTextureLoaderOption, id> *)options
                                                                  error:(NSError *__nullable *__nullable)error NS_AVAILABLE(10_12, 10_0);
 
 /*!
@@ -289,7 +298,7 @@
  @param error Pointer to an autoreleased NSError object which will be set if an error occurred
  */
 - (nullable id <MTLTexture>)newTextureWithData:(nonnull NSData *)data
-                                       options:(nullable NSDictionary <NSString *, NSObject *> *)options
+                                       options:(nullable NSDictionary <MTKTextureLoaderOption, id> *)options
                                          error:(NSError *__nullable *__nullable)error;
 
 /*!
@@ -301,7 +310,7 @@
  @param error Pointer to an autoreleased NSError object which will be set if an error occurred
  */
 - (nullable id <MTLTexture>)newTextureWithCGImage:(nonnull CGImageRef)cgImage
-                                          options:(nullable NSDictionary <NSString *, NSObject *> *)options
+                                          options:(nullable NSDictionary <MTKTextureLoaderOption, id> *)options
                                             error:(NSError *__nullable *__nullable)error;
 
 /*!
@@ -313,18 +322,18 @@
  @param error Pointer to an autoreleased NSError object which will be set if an error occurred
  */
 - (nullable id <MTLTexture>)newTextureWithMDLTexture:(nonnull MDLTexture *)texture
-                                             options:(nullable NSDictionary <NSString *, NSObject *> *)options
+                                             options:(nullable NSDictionary <MTKTextureLoaderOption, id> *)options
                                                error:(NSError *__nullable *__nullable)error NS_AVAILABLE(10_12, 10_0);
 
 /*!
- @method newTextursWithName:sca;eFactpr:bundle:options:error:
+ @method newTextursWithName:scaleFactor:bundle:options:error:
  @abstract Synchronously create a Metal texture with texture data from a given texture or image 
            asset name
  @return The Metal texture. nil if an error occured
  @param names An array of texture asset names
  @param scaleFactor scale factor of the texture to retrieve from the asset catalog.  Typically the
                     value retrieved from -[UIView contentScale] or -[NSWindow backingScaleFactor].
- @param bundle Resource bundle in which the asset is located
+ @param bundle Resource bundle in which the asset is located.  Main bundle used if nil.
  @param options Dictonary of MTKTextureLoaderOptions. The following options are ignormed when used
                 to load a texture asset but can be used when creating a texture from an image asset
                     MTKTextureLoaderOptionGenerateMipmaps
@@ -334,13 +343,13 @@
  @discussion Uses texture data from version of the texture from the texture set in the asset catalog
              which mathces the device's traits.
              This method attempts to load a texture asset with the name given.  If a texture asset
-             with the name given does not exist, it will attempt to create a texture from a an
-             image asset with the name give if it can.
+             with the name given does not exist, it will attempt to create a texture from an
+             image asset with the given name.
   */
 - (nullable id <MTLTexture>)newTextureWithName:(nonnull NSString *)name
                                    scaleFactor:(CGFloat)scaleFactor
                                         bundle:(nullable NSBundle *)bundle
-                                       options:(nullable NSDictionary <NSString *, NSObject *> *)options
+                                       options:(nullable NSDictionary <MTKTextureLoaderOption, id> *)options
                                          error:(NSError *__nullable *__nullable)error NS_AVAILABLE(10_12, 10_0);
 
 
diff -ruN /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalKit.framework/Headers/MTKView.h /Applications/Xcode9-beta1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalKit.framework/Headers/MTKView.h
--- /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalKit.framework/Headers/MTKView.h	2016-09-23 21:49:20.000000000 -0400
+++ /Applications/Xcode9-beta1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalKit.framework/Headers/MTKView.h	2017-05-18 22:09:29.000000000 -0400
@@ -129,7 +129,7 @@
 /*!
  @method releaseDrawables
  @abstract Release the depthStencilTexture and multisampleColorTexture
- @discussion Can be called by the app to release the textures in order to conserve memory when it goes into the background
+ @discussion Can be called by the app to release the textures in order to conserve memory when it goes into the background.   The view will recreate multisampleColorTexture or depthStencilTexture upon the next access of the respective properties.  Both multisampleColorTexture and depthStencilTexture will be recreated in the access to currentRenderPassDescriptor.
  */
 - (void)releaseDrawables;
 
diff -ruN /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalKit.framework/Headers/MetalKit.apinotes /Applications/Xcode9-beta1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalKit.framework/Headers/MetalKit.apinotes
--- /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalKit.framework/Headers/MetalKit.apinotes	1969-12-31 19:00:00.000000000 -0500
+++ /Applications/Xcode9-beta1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalKit.framework/Headers/MetalKit.apinotes	2017-05-19 23:24:33.000000000 -0400
@@ -0,0 +1,24 @@
+---
+Name: MetalKit
+
+SwiftVersions:
+- Version: 3
+  Typedefs:
+  - Name: MTKTextureLoaderCubeLayout
+    SwiftWrapper: none
+  - Name: MTKTextureLoaderError
+    SwiftWrapper: none
+  - Name: MTKTextureLoaderOption
+    SwiftWrapper: none
+  - Name: MTKTextureLoaderOrigin
+    SwiftWrapper: none
+  - Name: MTKModelError
+    SwiftWrapper: none
+  Functions:
+  - Name: MTKMetalVertexDescriptorFromModelIO
+    NullabilityOfRet: N
+  - Name: MTKMetalVertexDescriptorFromModelIOWithError
+    NullabilityOfRet: N
+
+
+
Clone this wiki locally