Skip to content

ASAccessorySession is missing Constructor #22352

@aberus

Description

@aberus

Apple platform

iOS

Framework version

net9.0-*

Affected platform version

VS 2022 17.13.2, .NET 9.0.100 iOS 18.2.9180

Description

Based on swift example the ASAccessorySession should be initialized from constructor, in the api bindings is marked with DisableDefaultCtor attribute or a partial class should be implemented with constructor.

[DisableDefaultCtor]
interface ASAccessorySession {

import AccessorySetupKit

// Create a session
var session = ASAccessorySession()

// Activate session with event handler
session.activate(on: DispatchQueue.main, eventHandler: handleSessionEvent(event:))

// Handle event
func handleSessionEvent(event: ASAccessoryEvent) {  
    switch event.eventType {
    case .activated:
        print("Session is activated and ready to use")
        print(session.accessories)
    default:
        print("Received event type \(event.eventType)")
    }
}

Steps to Reproduce

Create an empty solution and try to create a new object ASAccessorySession.
Cannot create & compile a project with ASAccessorySession session = new();

Did you find any workaround?

No response

Relevant log output

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions