You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: Sources/Nodal/Node/Node+Hierarchy.swift
+26
Original file line number
Diff line number
Diff line change
@@ -99,6 +99,32 @@ public extension Node {
99
99
}
100
100
}
101
101
102
+
publicextensionNode{
103
+
/// Moves this node to a new parent node at the specified position within the parent's children.
104
+
///
105
+
/// - Parameters:
106
+
/// - parent: The new parent node to which this node should be moved.
107
+
/// - position: The position within the parent's children where this node should be inserted. Defaults to `.last`, adding the node as the last child of the parent.
108
+
/// - Returns: A Boolean value indicating whether the move was successful.
109
+
/// Returns `false` if the node cannot be moved. Examples of such cases include:
110
+
/// - The new parent node belongs to a different document.
111
+
/// - The node is being moved to within itself, which would create an invalid structure.
112
+
@discardableResult
113
+
func move(to parent:Node, at position:Position=.last)->Bool{
0 commit comments