Skip to content

Commit

Permalink
chore: add NEW objc property type
Browse files Browse the repository at this point in the history
  • Loading branch information
blacktop committed Mar 29, 2024
1 parent 80cfa86 commit 29c25e7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions types/objc/type_encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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")
}
}

Expand Down

0 comments on commit 29c25e7

Please sign in to comment.