Skip to content

Commit

Permalink
[Fix] Append public
Browse files Browse the repository at this point in the history
  • Loading branch information
SHcommit committed Jun 29, 2023
1 parent 9891cf7 commit bc40e2f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions Sources/SHCoordinator/FlowCoordinator+Utils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ extension FlowCoordinator {
/// $0.start()
/// }
/// ```
func set(apply: @escaping (Self) -> Void) {
public func set(apply: @escaping (Self) -> Void) {
apply(self)
}
}
Expand All @@ -34,7 +34,7 @@ extension FlowCoordinator {
/// Then, start child coordinator : ]
///
/// - Param with coordinator : parent's child coordinator
func addChild<Coordinator>(with childCoordinator: Coordinator) where Coordinator: FlowCoordinator {
public func addChild<Coordinator>(with childCoordinator: Coordinator) where Coordinator: FlowCoordinator {
childCoordinator.set { [weak self] in
self?.child.append($0)
$0.parent = self
Expand All @@ -50,7 +50,7 @@ extension FlowCoordinator {
/// Notes:
/// 1. When a particular ViewController is viewWillDisappeared, it must use this method to remove itself from the child array owned by its parent.
/// Otherwise, the object that handles the child coordinator of the parent coordinator continues to hold unnecessary coordinator instances. If so, a memory leak occurs.
func removeSelf(from parent: FlowCoordinator) {
public func removeSelf(from parent: FlowCoordinator) {
guard let idx = parent.child.firstIndex(where: {$0===self}) else {
print("DEBUG: Delete target \(self) is not available in child coordinators")
return
Expand All @@ -59,7 +59,7 @@ extension FlowCoordinator {
parent.child.remove(at: idx)
}

func removeAllChild() {
public func removeAllChild() {
child.removeAll()
}
}
Expand All @@ -79,7 +79,7 @@ extension FlowCoordinator {
/// // my coordinator type is some coordinator
/// }
/// ```
func isCoordinator<T: FlowCoordinator>(
public func isCoordinator<T: FlowCoordinator>(
ofType type: T.Type
)-> Bool {
return self is T
Expand Down
4 changes: 2 additions & 2 deletions Sources/SHCoordinator/FlowCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#if os(iOS)
import UIKit

protocol FlowCoordinator: AnyObject {
public protocol FlowCoordinator: AnyObject {
// MARK: - Properties
var parent: FlowCoordinator! { get set }
var child: [FlowCoordinator] { get set }
Expand Down Expand Up @@ -41,7 +41,7 @@ extension FlowCoordinator {
/// }
/// }
/// ```
func finish() {
public func finish() {
guard let parent = parent else {
print("DEBUG: current coordinator is root coordinator")
return
Expand Down

0 comments on commit bc40e2f

Please sign in to comment.