-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #177 from 0xLeif/develop
Release 3.0.0
- Loading branch information
Showing
87 changed files
with
3,858 additions
and
887 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 0 additions & 21 deletions
21
Sources/SwiftUIKit/Extensions/NSObjectProtocol+SwiftUIKit.swift
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// | ||
// SwiftFu+.swift | ||
// | ||
// | ||
// Created by Leif on 3/16/21. | ||
// | ||
|
||
import SwiftFu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
// | ||
// UIView+Chain.swift | ||
// SwiftUIKit | ||
// | ||
// Created by Zach Eriksen on 8/26/20. | ||
// | ||
|
||
import E | ||
import UIKit | ||
import Chain | ||
|
||
@available(iOS 9.0, *) | ||
private extension UIView { | ||
static func chain( | ||
link: Chain, | ||
update: @escaping (UIView) -> Void, | ||
shouldBackground: Bool = false, | ||
centeredLoadingView: UIView? = nil, | ||
embeddedLoadingView: UIView? = nil | ||
) -> UIView { | ||
let view = UIView() | ||
|
||
if let embeddedLoadingView = embeddedLoadingView { | ||
view.embed { | ||
embeddedLoadingView | ||
} | ||
} else { | ||
view.center { | ||
centeredLoadingView ?? LoadingView().start() | ||
} | ||
} | ||
|
||
let chainEnd: Chain = .complete( | ||
.void { | ||
update(view) | ||
} | ||
) | ||
|
||
var output = Variable.void | ||
|
||
if shouldBackground { | ||
output = Chain.background( | ||
.out { | ||
link.run() | ||
}, | ||
chainEnd | ||
) | ||
.run() | ||
} else { | ||
output = Chain.link( | ||
.out { | ||
link.run() | ||
}, | ||
chainEnd | ||
) | ||
.run() | ||
} | ||
|
||
print("\(#function): \(output)") | ||
|
||
return view | ||
} | ||
} | ||
|
||
@available(iOS 9.0, *) | ||
public extension UIView { | ||
static func chain( | ||
link: Chain, | ||
update: @escaping (UIView) -> Void, | ||
centeredLoadingView: UIView? = nil | ||
) -> UIView { | ||
chain(link: link, | ||
update: update, | ||
shouldBackground: false, | ||
centeredLoadingView: centeredLoadingView, | ||
embeddedLoadingView: nil) | ||
} | ||
|
||
static func chain( | ||
link: Chain, | ||
update: @escaping (UIView) -> Void, | ||
embeddedLoadingView: UIView | ||
) -> UIView { | ||
chain(link: link, | ||
update: update, | ||
shouldBackground: false, | ||
centeredLoadingView: nil, | ||
embeddedLoadingView: embeddedLoadingView) | ||
} | ||
|
||
static func background( | ||
link: Chain, | ||
update: @escaping (UIView) -> Void, | ||
centeredLoadingView: UIView? = nil | ||
) -> UIView { | ||
chain(link: link, | ||
update: update, | ||
shouldBackground: true, | ||
centeredLoadingView: centeredLoadingView, | ||
embeddedLoadingView: nil) | ||
} | ||
|
||
static func background( | ||
link: Chain, | ||
update: @escaping (UIView) -> Void, | ||
embeddedLoadingView: UIView | ||
) -> UIView { | ||
chain(link: link, | ||
update: update, | ||
shouldBackground: true, | ||
centeredLoadingView: nil, | ||
embeddedLoadingView: embeddedLoadingView) | ||
} | ||
} |
Oops, something went wrong.