Skip to content

Commit

Permalink
Updates to Swift 5.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Zebulon Frantzich committed Oct 14, 2019
1 parent d7d3747 commit d83b66e
Show file tree
Hide file tree
Showing 35 changed files with 66 additions and 4,429 deletions.
319 changes: 27 additions & 292 deletions Haneke.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

24 changes: 10 additions & 14 deletions Haneke.xcodeproj/xcshareddata/xcschemes/Haneke-iOS.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0830"
LastUpgradeVersion = "1110"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -42,6 +42,15 @@
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A095C9551980418C00CD0F4C"
BuildableName = "Haneke.framework"
BlueprintName = "Haneke-iOS"
ReferencedContainer = "container:Haneke.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -54,17 +63,6 @@
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A095C9551980418C00CD0F4C"
BuildableName = "Haneke.framework"
BlueprintName = "Haneke-iOS"
ReferencedContainer = "container:Haneke.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -85,8 +83,6 @@
ReferencedContainer = "container:Haneke.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
24 changes: 10 additions & 14 deletions Haneke.xcodeproj/xcshareddata/xcschemes/Haneke-tvOS.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0830"
LastUpgradeVersion = "1110"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -27,6 +27,15 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6393C5DA1C3B229200EB1FD8"
BuildableName = "Haneke.framework"
BlueprintName = "Haneke-tvOS"
ReferencedContainer = "container:Haneke.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -39,17 +48,6 @@
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6393C5DA1C3B229200EB1FD8"
BuildableName = "Haneke.framework"
BlueprintName = "Haneke-tvOS"
ReferencedContainer = "container:Haneke.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -70,8 +68,6 @@
ReferencedContainer = "container:Haneke.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
24 changes: 10 additions & 14 deletions Haneke.xcodeproj/xcshareddata/xcschemes/HanekeDemo.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0830"
LastUpgradeVersion = "1110"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -41,6 +41,15 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A0026E9919C9BFBC004DE0C6"
BuildableName = "HanekeDemo.app"
BlueprintName = "HanekeDemo"
ReferencedContainer = "container:Haneke.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -53,17 +62,6 @@
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A0026E9919C9BFBC004DE0C6"
BuildableName = "HanekeDemo.app"
BlueprintName = "HanekeDemo"
ReferencedContainer = "container:Haneke.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -85,8 +83,6 @@
ReferencedContainer = "container:Haneke.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
2 changes: 1 addition & 1 deletion Haneke/Cache.swift
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ open class Cache<T: DataConvertible> where T.Result == T, T : DataRepresentable
// Ideally we would put each of these in the respective fetcher file as a Cache extension. Unfortunately, this fails to link when using the framework in a project as of Xcode 6.1.

open func fetch(key: String, value getValue : @autoclosure @escaping () -> T.Result, formatName: String = HanekeGlobals.Cache.OriginalFormatName, success succeed : Fetch<T>.Succeeder? = nil) -> Fetch<T> {
let fetcher = SimpleFetcher<T>(key: key, value: getValue)
let fetcher = SimpleFetcher<T>(key: key, value: getValue())
return self.fetch(fetcher: fetcher, formatName: formatName, success: succeed)
}

Expand Down
4 changes: 2 additions & 2 deletions Haneke/CryptoSwiftMD5.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ func arrayOfBytes<T>(value:T, length:Int? = nil) -> [UInt8] {
bytes[totalBytes - 1 - j] = (bytesPointer + j).pointee
}

valuePointer.deinitialize()
valuePointer.deallocate(capacity: 1)
valuePointer.deinitialize(count: 1) //deinitialize()
valuePointer.deallocate()

return bytes
}
Expand Down
2 changes: 1 addition & 1 deletion Haneke/Data.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ extension UIImage : DataConvertible, DataRepresentable {
}

public func asData() -> Data! {
return self.hnk_data() as Data!
return self.hnk_data() as Data?
}

fileprivate static let scale = UIScreen.main.scale
Expand Down
2 changes: 1 addition & 1 deletion Haneke/DiskCache.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ open class DiskCache {
return basePath
}

open let path: String
public let path: String

open var size : UInt64 = 0

Expand Down
2 changes: 1 addition & 1 deletion Haneke/Fetch.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,6 @@ open class Fetch<T> {
}

open class Wrapper<T> {
open let value: T
public let value: T
public init(_ value: T) { self.value = value }
}
2 changes: 1 addition & 1 deletion Haneke/Fetcher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import UIKit
// See: http://stackoverflow.com/questions/25915306/generic-closure-in-protocol
open class Fetcher<T : DataConvertible> {

open let key: String
public let key: String

public init(key: String) {
self.key = key
Expand Down
2 changes: 1 addition & 1 deletion Haneke/Log.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ struct Log {
}

static func error(message: @autoclosure () -> String, error: Error? = nil) {
log(.Error, message, error)
log(.Error, message(), error)
}

}
2 changes: 1 addition & 1 deletion Haneke/UIImageView+Haneke.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public extension UIImageView {
}

public func hnk_setImage( _ image: @autoclosure @escaping () -> UIImage, key: String, placeholder : UIImage? = nil, format : Format<UIImage>? = nil, success succeed : ((UIImage) -> ())? = nil) {
let fetcher = SimpleFetcher<UIImage>(key: key, value: image)
let fetcher = SimpleFetcher<UIImage>(key: key, value: image())
self.hnk_setImage(fromFetcher: fetcher, placeholder: placeholder, format: format, success: succeed)
}

Expand Down
32 changes: 0 additions & 32 deletions HanekeTests/AsyncFetcher.swift

This file was deleted.

28 changes: 0 additions & 28 deletions HanekeTests/CGSize+HanekeTests.swift

This file was deleted.

Loading

0 comments on commit d83b66e

Please sign in to comment.