Skip to content

Commit 8a5b8e2

Browse files
committed
Update README.md
1 parent b0f09be commit 8a5b8e2

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

README.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,14 @@ class ViewController: UIViewController {
6060
### Properties
6161

6262
```swift
63-
var magneticDelegate: MagneticDelegate? // Delegate
64-
var allowsMultipleSelection: Bool // Defaults to true
65-
var selectedChildren: [Node] // Currently selected nodes
63+
/// Delegate to handle node interactions
64+
var magneticDelegate: MagneticDelegate?
65+
66+
/// Enables multiple node selection (default: true)
67+
var allowsMultipleSelection: Bool
68+
69+
/// Returns all currently selected nodes
70+
var selectedChildren: [Node]
6671
```
6772

6873
---
@@ -104,6 +109,7 @@ override func deselectedAnimation() {
104109

105110
override func removedAnimation(completion: @escaping () -> Void) {
106111
// Customize removal animation
112+
// Call completion() when done
107113
}
108114
```
109115

@@ -133,12 +139,18 @@ Subclass `Node` to define your own behavior or visuals:
133139
class ImageNode: Node {
134140
override var image: UIImage? {
135141
didSet {
142+
// Update the texture when the image changes
136143
texture = image.map { SKTexture(image: $0) }
137144
}
138145
}
139146

140-
override func selectedAnimation() {}
141-
override func deselectedAnimation() {}
147+
override func selectedAnimation() {
148+
// Define custom behavior when the node is selected
149+
}
150+
151+
override func deselectedAnimation() {
152+
// Define custom behavior when the node is deselected
153+
}
142154
}
143155
```
144156

0 commit comments

Comments
 (0)