Skip to content

Commit 48c0bd3

Browse files
committed
View Controllers: add containment callbacks to ViewController
Add the hooks for subclasses to get notifications on containment changes.
1 parent ec3efca commit 48c0bd3

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Sources/SwiftWin32/View Controllers/ViewController.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,18 @@ public class ViewController: Responder {
267267
NSNotification.Name(rawValue: "UIViewControllerShowDetailTargetDidChangeNotification")
268268
}
269269

270+
// MARK - Responding to Containment Events
271+
272+
/// Called just before the view controller is added or removed from a
273+
/// container view controller.
274+
public func willMove(toParent viewController: ViewController?) {
275+
}
276+
277+
/// Called after the view controller is added or removed from a container view
278+
/// controller.
279+
public func didMove(toParent viewController: ViewController?) {
280+
}
281+
270282
// MARK -
271283

272284
override public init() {

0 commit comments

Comments
 (0)