Skip to content

Commit 2b4d368

Browse files
author
Hadevs
committed
opened the DIContainer properties
1 parent 341962d commit 2b4d368

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

SwiftInjector/Containerable.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import Foundation
1010

11-
protocol Containerable: class {
11+
public protocol Containerable: class {
1212
typealias Object = AnyObject
1313
typealias ServiceName = String
1414
typealias Service = (() -> Object)
@@ -22,8 +22,8 @@ protocol Containerable: class {
2222
var recursiveNotResolvedObjects: [Object] { get set }
2323
}
2424

25-
struct ContainerObject {
26-
enum RegistrationType {
25+
public struct ContainerObject {
26+
public enum RegistrationType {
2727
case manual
2828
case automatic
2929
}
@@ -42,7 +42,7 @@ struct ContainerObject {
4242

4343

4444
//MARK: TODO: MOVE IT TO DIContainer.swift
45-
extension Containerable {
45+
public extension Containerable {
4646
private func resolveAny(typeString: String, name: String? = nil) -> Object? {
4747
let array: [ContainerObject]? = {
4848
if let filterName = name {

SwiftInjector/DIContainer.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,24 @@
99
import Foundation
1010

1111
open class DIContainer: Container {
12-
var parentContainer: Containerable
12+
open var parentContainer: Containerable
1313

14-
init(parentContainer: Containerable? = nil) {
14+
public init(parentContainer: Containerable? = nil) {
1515
self.parentContainer = parentContainer ?? RootContainer()
1616
self.register()
1717
}
1818

19-
final func register<T: Containerable.Object>(registrationType: ContainerObject.RegistrationType = .automatic,
19+
public final func register<T: Containerable.Object>(registrationType: ContainerObject.RegistrationType = .automatic,
2020
name: String? = nil,
2121
_ registration: @escaping (() -> T)) {
2222
parentContainer.register(registration, name: name, registrationType: registrationType)
2323
}
2424

25-
final func resolve<T: Containerable.Object>(name: String? = nil) -> T? {
25+
public final func resolve<T: Containerable.Object>(name: String? = nil) -> T? {
2626
return parentContainer.resolve(name: name)
2727
}
2828

29-
func register() {
29+
open func register() {
3030
// Mark: leave empty only in this class
3131
}
3232
}

SwiftInjectorable.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Pod::Spec.new do |spec|
1616
#
1717
spec.swift_version = ['4.2', '5.0']
1818
spec.name = "SwiftInjectorable"
19-
spec.version = "0.0.1.3"
19+
spec.version = "0.0.1.4"
2020
spec.summary = "SwiftInjector - library for dependency injection, maden for convinient and fast properties connection."
2121

2222
# This description is used to generate tags and improve search results.

0 commit comments

Comments
 (0)