Skip to content
This repository was archived by the owner on Dec 12, 2024. It is now read-only.

Commit 0a4f43c

Browse files
author
Stephen Hawley
committed
who doesn't like conceptual comments?
1 parent 185d6a5 commit 0a4f43c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

SwiftRuntimeLibrary/SwiftNativeObject.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@ public abstract class SwiftNativeObject : SwiftNativeInstance, ISwiftObject {
1010
SwiftMetatype class_handle;
1111
SwiftObjectFlags object_flags = SwiftObjectFlags.IsSwift;
1212

13+
14+
// this is the one standard constructor for all objects
15+
// The classHandle is here so that the object matches the structure of the
16+
// ObjC counterpart.
17+
// "But why," you ask, "is the registry an argument since it is a singleton?"
18+
// "Because it's entirely possible to have a constructor in swift that will turn into
19+
// SomeObject(IntPtr someThing, SwiftMetatype classHandle)
20+
// but it should be impossible to have one with the signature below since the type
21+
// SwiftObjectRegistry doesn't exist in swift.
1322
protected SwiftNativeObject (IntPtr handle, SwiftMetatype classHandle, SwiftObjectRegistry registry)
1423
{
1524
if (SwiftNativeObjectTagAttribute.IsSwiftNativeObject (this)) {

0 commit comments

Comments
 (0)