Skip to content

Commit

Permalink
Prepare to release
Browse files Browse the repository at this point in the history
  • Loading branch information
SpectralDragon committed Dec 17, 2019
1 parent 4cd770b commit 30e492d
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 41 deletions.
18 changes: 18 additions & 0 deletions DSL/AnyDIPart.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// AnyDIPart.swift
// SwiftDI
//
// Created by Vladislav Prusakov on 16.12.2019.
//

import Foundation

public protocol AnyDIPart {
var _body: Any { get }
}

extension AnyDIPart where Self: DIPart {
public var _body: Any {
self.body
}
}
11 changes: 0 additions & 11 deletions DSL/DIGroup.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,4 @@ public struct DIGroup<Part: DIPart>: DIPart {
public init(@DIBuilder objects: () -> Part) {
self.objects = objects()
}

public func lifeCycle(_ value: DILifeCycle) -> some DIPart {
_ = objects.lifeCycle(value)
return self
}
}

extension DIGroup {
func build(container: DIContainer) {
objects.build(container: container)
}
}
16 changes: 0 additions & 16 deletions Sources/SwiftDI/DIPart.swift → DSL/DIPart.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,6 @@

import Foundation

public protocol AnyDIPart {
var _body: Any { get }
}

extension AnyDIPart where Self: DIPart {
public var _body: Any {
self.body
}
}

public protocol DIPart: AnyDIPart {
@available(*, deprecated, message: "Use `var body: some DIPart` instead")
static func load(container: DIContainer)
Expand All @@ -28,9 +18,3 @@ public protocol DIPart: AnyDIPart {
public extension DIPart {
static func load(container: DIContainer) { }
}

public extension DIPart {
func lifeCycle(_ value: DILifeCycle) -> some DIPart {
return self
}
}
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,6 @@ DIGroup {
}
```

also contains method `lifeCycle()`
`lifeCycle()` applies to all objects in group


2) DIRegister - Register some object
```swift
DIRegister(MyService.init)
Expand Down
3 changes: 0 additions & 3 deletions Sources/SwiftDI/Inject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
import Foundation
import Combine

@available(*, deprecated, renamed: "Inject")
public typealias Injectable = Inject

/// Read only property wrapper injector.

@propertyWrapper
Expand Down
3 changes: 1 addition & 2 deletions Sources/SwiftDI/SwiftDI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ public enum SwiftDI {

internal private(set) static var sharedContainer: DIContainer = DIContainer()

/// Use container for inject dependencies using `@Injectable` and `@InjecatableObjectBinding`.
/// Call method `didConnectToSwiftDI` when container passed to method. Initialize your singletons here.
/// Use container for inject dependencies.
public static func useContainer(_ container: DIContainer) {
self.sharedContainer = container
container.didConnectToSwiftDI()
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,15 @@
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "C7146BDB-28E5-4F29-9905-0F0C032E7B0C"
uuid = "8E7B8897-C4C3-475B-A6A7-09CBD190B9A5"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "../DSL/DIGroup.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "30"
endingLineNumber = "30"
landmarkName = "build(container:)"
landmarkType = "7">
startingLineNumber = "22"
endingLineNumber = "22">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
Expand Down

0 comments on commit 30e492d

Please sign in to comment.