From 29c25e79f13e1fd8a767b60642db214e663f5f6b Mon Sep 17 00:00:00 2001 From: blacktop Date: Thu, 28 Mar 2024 20:40:57 -0600 Subject: [PATCH] chore: add NEW objc property type --- types/objc/type_encoding.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/types/objc/type_encoding.go b/types/objc/type_encoding.go index c6c615a..7c82258 100644 --- a/types/objc/type_encoding.go +++ b/types/objc/type_encoding.go @@ -76,6 +76,7 @@ const ( propertyStrong = "P" // property GC'able propertyAtomic = "A" // property atomic propertyNonAtomic = "N" // property non-atomic + propertyOptional = "?" // property optional // TODO: correct this when Apple releases the macOS 14.4 ObjC source code ) type methodEncodedArg struct { @@ -170,6 +171,7 @@ func getPropertyType(attrs string) (typ string) { case propertyAtomic: case propertyNonAtomic: case propertyType: + case propertyOptional: typParts = append([]string{strings.TrimPrefix(sub, propertyType)}, typParts...) attr = strings.Join(typParts, ",") default: @@ -228,6 +230,8 @@ func getPropertyAttributeTypes(attrs string) string { attrsList = append(attrsList, "@dynamic") case propertyStrong: attrsList = append(attrsList, "collectable") + case propertyOptional: + attrsList = append(attrsList, "optional") } }