1313using UIColor = AppKit . NSColor ;
1414using UIImage = AppKit . NSImage ;
1515
16+ using UIBarButtonItem = Foundation . NSObject ;
1617using UIScrollViewDelegate = Foundation . NSObjectProtocol ;
1718using UIScrollView = Foundation . NSObject ;
1819using UIGestureRecognizer = Foundation . NSObject ;
1920using UIResponder = Foundation . NSObject ;
2021using UIView = Foundation . NSObject ;
22+ using UIViewController = Foundation . NSObject ;
2123using UIWindow = Foundation . NSObject ;
2224using UIUserInterfaceStyle = Foundation . NSObject ;
2325using BezierPath = AppKit . NSBezierPath ;
@@ -131,7 +133,6 @@ interface PKCanvasView : PKToolPickerObserver {
131133 // [Export ("delegate", ArgumentSemantic.Weak), NullAllowed]
132134 // NSObject WeakDelegate { get; set; }
133135
134- [ Unavailable ( PlatformName . MacCatalyst ) , Advice ( "This API is not available when using Catalyst on macOS." ) ]
135136 [ Wrap ( "WeakDelegate" ) , NullAllowed , New ]
136137 IPKCanvasViewDelegate Delegate { get ; set ; }
137138
@@ -160,6 +161,14 @@ interface PKCanvasView : PKToolPickerObserver {
160161 [ iOS ( 17 , 0 ) , MacCatalyst ( 17 , 0 ) ]
161162 [ Export ( "maximumSupportedContentVersion" , ArgumentSemantic . Assign ) ]
162163 PKContentVersion MaximumSupportedContentVersion { get ; set ; }
164+
165+ [ iOS ( 18 , 0 ) , MacCatalyst ( 18 , 0 ) ]
166+ [ Export ( "drawingEnabled" ) ]
167+ bool DrawingEnabled {
168+ [ Bind ( "isDrawingEnabled" ) ]
169+ get ;
170+ set ;
171+ }
163172 }
164173
165174 [ iOS ( 13 , 0 ) ]
@@ -323,6 +332,8 @@ interface IPKToolPickerObserver { }
323332 [ Protocol ]
324333 interface PKToolPickerObserver {
325334
335+ [ Deprecated ( PlatformName . iOS , 18 , 0 , message : "Use 'SelectedToolItemDidChange' instead." ) ]
336+ [ Deprecated ( PlatformName . MacCatalyst , 18 , 0 , message : "Use 'SelectedToolItemDidChange' instead." ) ]
326337 [ Export ( "toolPickerSelectedToolDidChange:" ) ]
327338 void SelectedToolDidChange ( PKToolPicker toolPicker ) ;
328339
@@ -334,6 +345,10 @@ interface PKToolPickerObserver {
334345
335346 [ Export ( "toolPickerFramesObscuredDidChange:" ) ]
336347 void FramesObscuredDidChange ( PKToolPicker toolPicker ) ;
348+
349+ [ iOS ( 18 , 0 ) , MacCatalyst ( 18 , 0 ) ]
350+ [ Export ( "toolPickerSelectedToolItemDidChange:" ) ]
351+ void SelectedToolItemDidChange ( PKToolPicker toolPicker ) ;
337352 }
338353
339354 [ iOS ( 13 , 0 ) , NoMac ]
@@ -347,6 +362,10 @@ interface PKToolPicker {
347362 [ Export ( "init" ) ]
348363 NativeHandle Constructor ( ) ;
349364
365+ [ iOS ( 18 , 0 ) , MacCatalyst ( 18 , 0 ) ]
366+ [ Export ( "initWithToolItems:" ) ]
367+ NativeHandle Constructor ( PKToolPickerItem [ ] items ) ;
368+
350369 [ Export ( "addObserver:" ) ]
351370 void AddObserver ( IPKToolPickerObserver observer ) ;
352371
@@ -356,6 +375,8 @@ interface PKToolPicker {
356375 [ Export ( "setVisible:forFirstResponder:" ) ]
357376 void SetVisible ( bool visible , UIResponder responder ) ;
358377
378+ [ Deprecated ( PlatformName . iOS , 18 , 0 , message : "Use 'SelectedToolItem' instead." ) ]
379+ [ Deprecated ( PlatformName . MacCatalyst , 18 , 0 , message : "Use 'SelectedToolItem' instead." ) ]
359380 [ Export ( "selectedTool" , ArgumentSemantic . Strong ) ]
360381 PKTool SelectedTool { get ; set ; }
361382
@@ -395,6 +416,31 @@ interface PKToolPicker {
395416 [ iOS ( 17 , 0 ) , MacCatalyst ( 17 , 0 ) ]
396417 [ Export ( "maximumSupportedContentVersion" , ArgumentSemantic . Assign ) ]
397418 PKContentVersion MaximumSupportedContentVersion { get ; set ; }
419+
420+ [ iOS ( 18 , 0 ) , MacCatalyst ( 18 , 0 ) ]
421+ [ Export ( "selectedToolItem" , ArgumentSemantic . Strong ) ]
422+ PKToolPickerItem SelectedToolItem { get ; set ; }
423+
424+ [ iOS ( 18 , 0 ) , MacCatalyst ( 18 , 0 ) ]
425+ [ Export ( "selectedToolItemIdentifier" , ArgumentSemantic . Copy ) ]
426+ string SelectedToolItemIdentifier { get ; set ; }
427+
428+ [ iOS ( 18 , 0 ) , MacCatalyst ( 18 , 0 ) ]
429+ [ Export ( "toolItems" ) ]
430+ PKToolPickerItem [ ] ToolItems { get ; }
431+
432+ [ iOS ( 18 , 0 ) , MacCatalyst ( 18 , 0 ) ]
433+ [ Export ( "accessoryItem" , ArgumentSemantic . Strong ) , NullAllowed ]
434+ UIBarButtonItem AccessoryItem { get ; set ; }
435+
436+ [ iOS ( 18 , 0 ) , MacCatalyst ( 18 , 0 ) ]
437+ [ Export ( "delegate" , ArgumentSemantic . Weak ) , NullAllowed ]
438+ NSObject WeakDelegate { get ; set ; }
439+
440+ [ iOS ( 18 , 0 ) , MacCatalyst ( 18 , 0 ) ]
441+ [ Wrap ( "WeakDelegate" ) , NullAllowed ]
442+ IPKToolPickerDelegate Delegate { get ; set ; }
443+
398444 }
399445
400446 [ Mac ( 11 , 0 ) , iOS ( 14 , 0 ) ]
@@ -563,4 +609,147 @@ interface PKStrokePoint : NSCopying {
563609 [ Export ( "secondaryScale" ) ]
564610 nfloat SecondaryScale { get ; }
565611 }
612+
613+ [ iOS ( 18 , 0 ) , MacCatalyst ( 18 , 0 ) , NoMac ]
614+ [ BaseType ( typeof ( PKToolPickerItem ) ) ]
615+ [ DisableDefaultCtor ]
616+ interface PKToolPickerCustomItem {
617+ [ Export ( "initWithConfiguration:" ) ]
618+ NativeHandle Constructor ( PKToolPickerCustomItemConfiguration configuration ) ;
619+
620+ [ Export ( "configuration" ) ]
621+ PKToolPickerCustomItemConfiguration Configuration { get ; }
622+
623+ [ Export ( "color" , ArgumentSemantic . Strong ) ]
624+ UIColor Color { get ; set ; }
625+
626+ [ Export ( "allowsColorSelection" , ArgumentSemantic . Assign ) ]
627+ bool AllowsColorSelection { get ; set ; }
628+
629+ [ Export ( "width" , ArgumentSemantic . Assign ) ]
630+ nfloat Width { get ; set ; }
631+
632+ [ Export ( "reloadImage" ) ]
633+ void ReloadImage ( ) ;
634+ }
635+
636+ delegate UIImage PKToolPickerCustomItemConfigurationImageProviderCallback ( PKToolPickerCustomItem toolPickerItem ) ;
637+ delegate UIViewController PKToolPickerCustomItemConfigurationViewControllerProvider ( PKToolPickerCustomItem toolPickerItem ) ;
638+
639+ [ iOS ( 18 , 0 ) , MacCatalyst ( 18 , 0 ) , NoMac ]
640+ [ BaseType ( typeof ( NSObject ) ) ]
641+ [ DisableDefaultCtor ]
642+ interface PKToolPickerCustomItemConfiguration : NSCopying {
643+ [ Export ( "initWithIdentifier:name:" ) ]
644+ NativeHandle Constructor ( string identifier , string name ) ;
645+
646+ [ Export ( "identifier" , ArgumentSemantic . Copy ) ]
647+ string Identifier { get ; set ; }
648+
649+ [ Export ( "name" , ArgumentSemantic . Copy ) ]
650+ string Name { get ; set ; }
651+
652+ [ Export ( "imageProvider" , ArgumentSemantic . Copy ) , NullAllowed ]
653+ PKToolPickerCustomItemConfigurationImageProviderCallback ImageProvider { get ; set ; }
654+
655+ [ Export ( "viewControllerProvider" , ArgumentSemantic . Copy ) , NullAllowed ]
656+ PKToolPickerCustomItemConfigurationViewControllerProvider ViewControllerProvider { get ; set ; }
657+
658+ [ Export ( "defaultWidth" , ArgumentSemantic . Assign ) ]
659+ nfloat DefaultWidth { get ; set ; }
660+
661+ [ Export ( "widthVariants" , ArgumentSemantic . Copy ) ]
662+ NSDictionary < NSNumber , UIImage > WidthVariants { get ; set ; }
663+
664+ [ Export ( "defaultColor" , ArgumentSemantic . Strong ) ]
665+ UIColor DefaultColor { get ; set ; }
666+
667+ [ Export ( "allowsColorSelection" , ArgumentSemantic . Assign ) ]
668+ bool AllowsColorSelection { get ; set ; }
669+
670+ [ Export ( "toolAttributeControls" , ArgumentSemantic . Assign ) ]
671+ PKToolPickerCustomItemControlOptions ToolAttributeControls { get ; set ; }
672+ }
673+
674+ [ iOS ( 18 , 0 ) , MacCatalyst ( 18 , 0 ) , NoMac ]
675+ [ BaseType ( typeof ( PKToolPickerItem ) ) ]
676+ [ DisableDefaultCtor ]
677+ interface PKToolPickerEraserItem {
678+ [ Export ( "initWithEraserType:" ) ]
679+ NativeHandle Constructor ( PKEraserType eraserType ) ;
680+
681+ [ Export ( "initWithEraserType:width:" ) ]
682+ NativeHandle Constructor ( PKEraserType eraserType , nfloat width ) ;
683+
684+ [ Export ( "eraserTool" ) ]
685+ PKEraserTool EraserTool { get ; }
686+ }
687+
688+ [ iOS ( 18 , 0 ) , MacCatalyst ( 18 , 0 ) , NoMac ]
689+ [ BaseType ( typeof ( PKToolPickerItem ) ) ]
690+ [ DisableDefaultCtor ]
691+ interface PKToolPickerInkingItem {
692+ [ Export ( "initWithInkType:" ) ]
693+ NativeHandle Constructor ( PKInkType inkType ) ;
694+
695+ [ Export ( "initWithInkType:color:" ) ]
696+ NativeHandle Constructor ( PKInkType inkType , UIColor color ) ;
697+
698+ [ Export ( "initWithInkType:width:" ) ]
699+ NativeHandle Constructor ( PKInkType inkType , nfloat width ) ;
700+
701+ [ Export ( "initWithInkType:color:width:" ) ]
702+ NativeHandle Constructor ( PKInkType inkType , UIColor color , nfloat width ) ;
703+
704+ [ Export ( "initWithInkType:color:width:identifier:" ) ]
705+ NativeHandle Constructor ( PKInkType inkType , UIColor color , nfloat width , [ NullAllowed ] string identifier ) ;
706+
707+ [ Export ( "inkingTool" ) ]
708+ PKInkingTool InkingTool { get ; }
709+
710+ [ Export ( "allowsColorSelection" , ArgumentSemantic . Assign ) ]
711+ bool AllowsColorSelection { get ; set ; }
712+ }
713+
714+ [ iOS ( 18 , 0 ) , MacCatalyst ( 18 , 0 ) , NoMac ]
715+ [ BaseType ( typeof ( NSObject ) ) ]
716+ [ DisableDefaultCtor ]
717+ interface PKToolPickerItem : NSCopying {
718+ [ Export ( "identifier" ) ]
719+ string Identifier { get ; }
720+ }
721+
722+ [ iOS ( 18 , 0 ) , MacCatalyst ( 18 , 0 ) , NoMac ]
723+ [ BaseType ( typeof ( PKToolPickerItem ) ) ]
724+ interface PKToolPickerLassoItem {
725+ [ Export ( "lassoTool" ) ]
726+ PKLassoTool LassoTool { get ; }
727+ }
728+
729+ [ iOS ( 18 , 0 ) , MacCatalyst ( 18 , 0 ) , NoMac ]
730+ [ BaseType ( typeof ( PKToolPickerItem ) ) ]
731+ interface PKToolPickerRulerItem {
732+ }
733+
734+ [ iOS ( 18 , 0 ) , MacCatalyst ( 18 , 0 ) , NoMac ]
735+ [ BaseType ( typeof ( PKToolPickerItem ) ) ]
736+ interface PKToolPickerScribbleItem {
737+ }
738+
739+ [ iOS ( 18 , 0 ) , MacCatalyst ( 18 , 0 ) , NoMac ]
740+ [ Protocol ( BackwardsCompatibleCodeGeneration = false ) , Model ]
741+ [ BaseType ( typeof ( NSObject ) ) ]
742+ interface PKToolPickerDelegate {
743+ }
744+
745+ interface IPKToolPickerDelegate { }
746+
747+ [ iOS ( 18 , 0 ) , MacCatalyst ( 18 , 0 ) , NoMac ]
748+ [ Native ]
749+ [ Flags ]
750+ enum PKToolPickerCustomItemControlOptions : ulong {
751+ None = 0 ,
752+ Width = 1 << 0 ,
753+ Opacity = 1 << 1
754+ }
566755}
0 commit comments