git.fiddlerwoaroof.com
Browse code

feature: add support for objective c properties

Ed Langley authored on 21/10/2019 04:03:47
Showing 1 changed files
... ...
@@ -168,6 +168,17 @@
168 168
   (cls o-class)
169 169
   (name :string))
170 170
 
171
+(defcstruct objc-property-attribute-t
172
+  (name :string)
173
+  (value :string))
174
+
175
+(defcfun (class-add-property "class_addProperty" :library foundation)
176
+    :pointer
177
+  (cls o-class)
178
+  (name :string)
179
+  (attributes (:pointer (:struct objc-property-attribute-t)))
180
+  (attribute-count :unsigned-int))
181
+
171 182
 (defcfun (property-copy-attribute-value "property_copyAttributeValue" :library foundation)
172 183
     :string
173 184
   (prop :pointer)
... ...
@@ -246,7 +257,7 @@
246 257
 (defun ensure-class (name)
247 258
   (let ((objc-class (objc-look-up-class name)))
248 259
     (when (and objc-class (not (null-pointer-p objc-class)))
249
-      (alexandria.0.dev:ensure-gethash name *class-cache* objc-class))))
260
+      (alexandria:ensure-gethash name *class-cache* objc-class))))
250 261
 
251 262
 (defun ensure-selector (name)
252 263
   (alexandria:ensure-gethash name