Documentation Archive Developer
Search

MetalKit Changes for Swift

MetalKit

Modified MTKMesh
Protocols
FromAnyObject
To--

Modified MTKMeshBuffer
DeclarationProtocols
From
class MTKMeshBuffer : NSObject, MDLMeshBuffer, NSCopying {
    init()
    var length: Int { get }
    var allocator: MTKMeshBufferAllocator { get }
    var buffer: MTLBuffer { get }
    var offset: Int { get }
    var type: MDLMeshBufferType { get }
    func zone() -> MDLMeshBufferZone?
}
AnyObject, MDLMeshBuffer, NSCopying, NSObjectProtocol
To
class MTKMeshBuffer : NSObject, MDLMeshBuffer {
    init()
    var length: Int { get }
    var allocator: MTKMeshBufferAllocator { get }
    var buffer: MTLBuffer { get }
    var offset: Int { get }
    var type: MDLMeshBufferType { get }
    func zone() -> MDLMeshBufferZone?
}
MDLMeshBuffer

Protocols
FromAnyObject, MDLMeshBufferAllocator, NSObjectProtocol
ToMDLMeshBufferAllocator

Modified MTKSubmesh
Protocols
FromAnyObject
To--

Protocols
FromAnyObject
To--

Modified MTKView
DeclarationProtocols
From
class MTKView : UIView {
    init(frame frameRect: CGRect, device device: MTLDevice?)
    init(coder coder: NSCoder)
    weak var delegate: MTKViewDelegate?
    var device: MTLDevice?
    var currentDrawable: CAMetalDrawable? { get }
    var framebufferOnly: Bool
    var presentsWithTransaction: Bool
    var colorPixelFormat: MTLPixelFormat
    var depthStencilPixelFormat: MTLPixelFormat
    var sampleCount: Int
    var clearColor: MTLClearColor
    var clearDepth: Double
    var clearStencil: UInt32
    var depthStencilTexture: MTLTexture? { get }
    var multisampleColorTexture: MTLTexture? { get }
    func releaseDrawables()
    var currentRenderPassDescriptor: MTLRenderPassDescriptor? { get }
    var preferredFramesPerSecond: Int
    var enableSetNeedsDisplay: Bool
    var autoResizeDrawable: Bool
    var drawableSize: CGSize
    var paused: Bool
    func draw()
}
AnyObject, NSCoding
To
class MTKView : UIView, NSCoding {
    init(frame frameRect: CGRect, device device: MTLDevice?)
    init(coder coder: NSCoder)
    weak var delegate: MTKViewDelegate?
    var device: MTLDevice?
    var currentDrawable: CAMetalDrawable? { get }
    var framebufferOnly: Bool
    var presentsWithTransaction: Bool
    var colorPixelFormat: MTLPixelFormat
    var depthStencilPixelFormat: MTLPixelFormat
    var sampleCount: Int
    var clearColor: MTLClearColor
    var clearDepth: Double
    var clearStencil: UInt32
    var depthStencilTexture: MTLTexture? { get }
    var multisampleColorTexture: MTLTexture? { get }
    func releaseDrawables()
    var currentRenderPassDescriptor: MTLRenderPassDescriptor? { get }
    var preferredFramesPerSecond: Int
    var enableSetNeedsDisplay: Bool
    var autoResizeDrawable: Bool
    var drawableSize: CGSize
    var paused: Bool
    func draw()
}
NSCoding