Skip to content

Commit

Permalink
Merge branch 'release/5.0.3' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyapuchka committed Oct 23, 2016
2 parents 455456e + 84573d9 commit 5eb0eec
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 15 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# CHANGELOG

## 5.0.3

* Added Swift 2.3 compatibility. `swift2.3` brunch is no longer maintained.
[#127](https://github.com/AliSoftware/Dip/issues/127), [@ilyapuchka](https://github.com/ilyapuchka)

#### Fixed

* Fixed reusing instances registered with `WeakSingleton` scope
[#129](https://github.com/AliSoftware/Dip/issues/129), [@ilyapuchka](https://github.com/ilyapuchka)

## 5.0.2

#### Fixed
Expand Down
2 changes: 1 addition & 1 deletion Dip.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Dip"
s.version = "5.0.2"
s.version = "5.0.3"
s.summary = "Dependency Injection for Swift made easy."

s.description = <<-DESC
Expand Down
4 changes: 2 additions & 2 deletions Dip/Dip.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 5.0.2;
CURRENT_PROJECT_VERSION = 5.0.3;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
Expand Down Expand Up @@ -482,7 +482,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 5.0.2;
CURRENT_PROJECT_VERSION = 5.0.3;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand Down
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![License](https://img.shields.io/cocoapods/l/Dip.svg?style=flat)](http://cocoapods.org/pods/Dip)
[![Platform](https://img.shields.io/cocoapods/p/Dip.svg?style=flat)](http://cocoapods.org/pods/Dip)
[![Swift Version](https://img.shields.io/badge/Swift-2.2--3.0-F16D39.svg?style=flat)](https://developer.apple.com/swift)
[![Swift Version](https://img.shields.io/badge/Swift-2.3--3.0-F16D39.svg?style=flat)](https://developer.apple.com/swift)
[![Swift Version](https://img.shields.io/badge/Linux-3.0--RELEASE-4BC51D.svg?style=flat)](https://developer.apple.com/swift)

![Animated Dipping GIF](cinnamon-pretzels-caramel-dipping.gif)
Expand Down Expand Up @@ -148,16 +148,25 @@ File an issue if you have any question. Pull requests are warmly welcome too.

## Installation

Since version 5.0.0 Dip is built with Swift 3.0. For Swift 2.2-2.3 compatible version use "swift2.3" branch.

You can install Dip using your favorite dependency manager:
Since version 5.0.0 Dip is built with Swift 3.0. You can install Dip using your favorite dependency manager:

<details>
<summary>CocoaPods</summary>

`pod "Dip"`

To build for Swift 2.3 add this code to the bottom of your Podfile

```ruby
pod "Dip"
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '2.3'
end
end
end
```

> You need at least 1.1.0.rc.2 version of CocoaPods.
</details>
Expand All @@ -169,6 +178,8 @@ pod "Dip"
github "AliSoftware/Dip"
```

To build for Swift 2.3 run Carthage with `--toolchain com.apple.dt.toolchain.Swift_2_3` option.

</details>

<details>
Expand Down
2 changes: 1 addition & 1 deletion Sources/AutoInjection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public final class Injected<T>: _InjectedPropertyBox<T>, AutoInjectedPropertyBox
}

///Wrapped value.
public var value: T? {
public internal(set) var value: T? {
didSet {
if let value = value { didInject(value) }
}
Expand Down
12 changes: 6 additions & 6 deletions Sources/Compatibility.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,23 @@

extension CollectionType where Index : RandomAccessIndexType {
@warn_unused_result
public func reversed() -> ReverseRandomAccessCollection<Self> {
func reversed() -> ReverseRandomAccessCollection<Self> {
return reverse()
}
}

extension SequenceType where Generator.Element == String {
@warn_unused_result
public func joined(separator aSeparator: String) -> String {
func joined(separator aSeparator: String) -> String {
return joinWithSeparator(aSeparator)
}
}

extension Array {
public mutating func append<C : CollectionType where C.Generator.Element == Element>(contentsOf newElements: C) {
mutating func append<C : CollectionType where C.Generator.Element == Element>(contentsOf newElements: C) {
appendContentsOf(newElements)
}
public mutating func append<S : SequenceType where S.Generator.Element == Element>(contentsOf newElements: S) {
mutating func append<S : SequenceType where S.Generator.Element == Element>(contentsOf newElements: S) {
appendContentsOf(newElements)
}
}
Expand All @@ -58,15 +58,15 @@

#if _runtime(_ObjC)
extension String {
public func has(prefix aPrefix: String) -> Bool {
func has(prefix aPrefix: String) -> Bool {
return hasPrefix(aPrefix)
}
}

#else

extension String {
public func has(prefix aPrefix: String) -> Bool {
func has(prefix aPrefix: String) -> Bool {
return aPrefix ==
String(self.characters.prefix(aPrefix.characters.count))
}
Expand Down

0 comments on commit 5eb0eec

Please sign in to comment.