Skip to content

Commit

Permalink
Merge branch 'release/3.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
notbenoit committed Aug 18, 2022
2 parents 495f361 + 2a76244 commit 354c35e
Show file tree
Hide file tree
Showing 52 changed files with 496 additions and 47 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/pr_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: PR Check
on: [pull_request]
concurrency:
group: ${{ github.head_ref }}
cancel-in-progress: true
jobs:
pr_check:
runs-on: macOS-11
if: github.event.pull_request.draft == false
steps:
- name: Checkout Project
uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Danger
env:
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bundle exec danger
- name: Test
run: swift test

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ xcuserdata/
*.moved-aside
*.xcuserstate
*.xcscmblueprint
.DS_Store

## Obj-C/Swift specific
*.hmap
Expand Down Expand Up @@ -53,6 +54,9 @@ Pods/

Carthage/Build

# SwiftPM
.swiftpm/

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
Expand Down
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.7.1
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
## Main

##### New Features/Enhancements
- Add Swift Package Manager Support
[notbenoit](https://github.com/notbenoit)
[#73](https://github.com/Fueled/ios-utilities/pulls/73)

- Add `ActionProtocol`
- Add `AnyAction`, allowing to type-erase any actions represented by a `ActionProtocol`
Expand Down
2 changes: 1 addition & 1 deletion FueledUtils.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Pod::Spec.new do |s|
s.name = 'FueledUtils'
s.version = '3.0.0'
s.version = '3.1.0'
s.summary = 'A collection of utilities used at Fueled'
s.description = 'This is a collection of classes, extensions, methods and functions used within Fueled projects that aims at decomplexifying tasks that should be easy.'
s.swift_version = '5'
Expand Down
4 changes: 4 additions & 0 deletions FueledUtils/Combine/Action.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@

#if canImport(Combine)
import Combine
#if canImport(FueledUtilsReactiveCommon)
import FueledUtilsCore
import FueledUtilsReactiveCommon
#endif

@available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *)
public final class Action<Input, Output, Failure: Swift.Error> {
Expand Down
4 changes: 4 additions & 0 deletions FueledUtils/Combine/ActionError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#if canImport(FueledUtilsReactiveCommon)
import FueledUtilsReactiveCommon
#endif

@available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *)
public enum ActionError<Error: Swift.Error>: Swift.Error {
case disabled
Expand Down
5 changes: 4 additions & 1 deletion FueledUtils/Combine/AnyCurrentValuePublisher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

#if canImport(Combine)
import Combine
#if canImport(FueledUtilsReactiveCommon)
import FueledUtilsReactiveCommon
#endif

///
/// A type-erasing current value publisher.
Expand All @@ -35,7 +38,7 @@ public struct AnyCurrentValuePublisher<Output, Failure: Swift.Error>: CurrentVal
self.receiveSubcriberClosure = { _ = $0.receive(value) }
}

public init<CurrentValuePublisher: FueledUtils.CurrentValuePublisher>(_ publisher: CurrentValuePublisher) where CurrentValuePublisher.Output == Output, CurrentValuePublisher.Failure == Failure {
public init<Publisher: CurrentValuePublisher>(_ publisher: Publisher) where Publisher.Output == Output, Publisher.Failure == Failure {
self.valueGetter = { publisher.value }
self.receiveSubcriberClosure = { publisher.receive(subscriber: $0) }
}
Expand Down
4 changes: 4 additions & 0 deletions FueledUtils/Combine/CoalescingAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@

#if canImport(Combine)
import Combine
#if canImport(FueledUtilsReactiveCommon)
import FueledUtilsCore
import FueledUtilsReactiveCommon
#endif

///
/// Similar to `Action`, except if the action is already executing, subsequent `apply()` call will not fail,
Expand Down
5 changes: 5 additions & 0 deletions FueledUtils/Combine/CombineExtensions+Cancellables.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@

#if canImport(Combine)
import Combine
#if canImport(FueledUtilsReactiveCommon)
import Foundation
import FueledUtilsCore
import FueledUtilsReactiveCommon
#endif

private var cancellablesKey: UInt8 = 0

Expand Down
5 changes: 5 additions & 0 deletions FueledUtils/Combine/ObservableObjectExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@

#if canImport(Combine)
import Combine
#if canImport(FueledUtilsReactiveCommon)
import Foundation
import FueledUtilsCore
import FueledUtilsReactiveCommon
#endif

@available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *)
extension ObservableObject where Self.ObjectWillChangePublisher == ObservableObjectPublisher {
Expand Down
4 changes: 4 additions & 0 deletions FueledUtils/Combine/Publisher+TransferState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@

#if canImport(Combine)
import Combine
#if canImport(FueledUtilsReactiveCommon)
import FueledUtilsCore
import FueledUtilsReactiveCommon
#endif

@available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *)
extension Publisher where Output: TransferStateProtocol {
Expand Down
4 changes: 4 additions & 0 deletions FueledUtils/Combine/PublisherExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@

#if canImport(Combine)
import Combine
#if canImport(FueledUtilsReactiveCommon)
import FueledUtilsCore
import FueledUtilsReactiveCommon
#endif

@available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *)
extension Publisher {
Expand Down
4 changes: 4 additions & 0 deletions FueledUtils/Combine/PublishersExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@

#if canImport(Combine)
import Combine
#if canImport(FueledUtilsReactiveCommon)
import FueledUtilsCore
import FueledUtilsReactiveCommon
#endif

@available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *)
extension Publishers {
Expand Down
6 changes: 6 additions & 0 deletions FueledUtils/CombineOperators/Combine+Operators.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@

#if canImport(Combine)
import Combine
#if canImport(FueledUtilsCombine)
import FueledUtilsCombine
import FueledUtilsCore
import FueledUtilsReactiveCommon
public typealias OptionalProtocol = FueledUtilsCore.OptionalProtocol
#endif

// swiftlint:disable generic_type_name

Expand Down
4 changes: 4 additions & 0 deletions FueledUtils/CombineUIKit/ControlProtocol+Tapped.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@

#if canImport(UIKit) && !os(watchOS) && canImport(Combine)
import Combine
#if canImport(FueledUtilsUIKit)
import Foundation
import FueledUtilsUIKit
#endif

private var tapActionStorage: UInt8 = 0
private var tapActionKey: UInt8 = 0
Expand Down
5 changes: 5 additions & 0 deletions FueledUtils/CombineUIKit/TapAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,14 @@
// limitations under the License.

#if canImport(UIKit) && !os(watchOS)
import Foundation
import UIKit
#if canImport(Combine)
import Combine
#endif
#if canImport(FueledUtilsCombine)
import FueledUtilsCombine
#endif

///
/// `TapAction` wraps a `ActionProtocol` for use by any `ControlProtocol`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
#if canImport(UIKit) && !os(watchOS) && canImport(Combine)
import Combine
import UIKit
#if canImport(FueledUtilsUIKit)
import Foundation
import FueledUtilsUIKit
#endif

private var publisherControlEventsProcessorsHolderKey: UInt8 = 0

Expand Down
6 changes: 6 additions & 0 deletions FueledUtils/CombineUIKit/UITextInput+Combine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@

#if canImport(UIKit) && !os(watchOS) && canImport(Combine)
import Combine
#if canImport(FueledUtilsCombine)
import FueledUtilsCombine
#endif
#if canImport(FueledUtilsUIKit)
import FueledUtilsUIKit
#endif
import UIKit

@available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#if canImport(FueledUtilsReactiveCommon)
import FueledUtilsReactiveCommon
#endif
import ReactiveSwift

extension ReactiveSwift.ActionError: ActionErrorProtocol {
Expand Down
3 changes: 3 additions & 0 deletions FueledUtils/ReactiveSwift/ReactiveCoalescingAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#if canImport(FueledUtilsCore)
import FueledUtilsCore
#endif
import ReactiveSwift

///
Expand Down
7 changes: 6 additions & 1 deletion FueledUtils/ReactiveSwift/ReactiveCocoaExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@
// limitations under the License.

import Foundation
#if canImport(FueledUtilsReactiveCommon)
import FueledUtilsCore
import FueledUtilsReactiveCommon
#endif
import ReactiveCocoa
import ReactiveSwift
#if canImport(UIKit)
#if canImport(UIKit) && !os(watchOS)
import UIKit
#elseif canImport(AppKit)
import AppKit
#endif

///
Expand Down
3 changes: 3 additions & 0 deletions FueledUtils/ReactiveSwift/TransferState+Reactive.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#if canImport(FueledUtilsCore)
import FueledUtilsCore
#endif
import ReactiveSwift

extension SignalProtocol {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import Foundation
#if canImport(UIKit) && !os(watchOS)
import ReactiveCocoa
import ReactiveSwift
#if canImport(FueledUtilsUIKit)
import FueledUtilsUIKit
#endif

private var tapActionStorage: UInt8 = 0
private var tapActionKey: UInt8 = 0
Expand Down
5 changes: 5 additions & 0 deletions FueledUtils/ReactiveSwiftUIKit/ReactiveTapAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@

#if canImport(UIKit) && !os(watchOS)
import ReactiveSwift
import Foundation
#if canImport(FueledUtilsUIKit)
import FueledUtilsUIKit
import FueledUtilsReactiveSwift
#endif

///
/// `ReactiveTapAction` wraps a `ReactiveActionProtocol` for use by any `ButtonProtocol`
Expand Down
2 changes: 2 additions & 0 deletions FueledUtils/ReactiveSwiftUIKit/SignalingAlert.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#if canImport(UIKit) && !os(watchOS)
import Foundation
import ReactiveCocoa
import ReactiveSwift
Expand Down Expand Up @@ -107,3 +108,4 @@ public final class SignalingAlert<T> {
}
}
}
#endif
5 changes: 5 additions & 0 deletions FueledUtils/ReactiveSwiftUIKit/UIReactiveExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#if canImport(UIKit)
import Foundation
import ReactiveSwift
import UIKit
#if canImport(FueledUtilsUIKit)
import FueledUtilsUIKit
#endif

extension Reactive where Base: UILabel {
///
Expand All @@ -34,3 +38,4 @@ extension Reactive where Base: UILabel {
}
}
}
#endif
3 changes: 2 additions & 1 deletion FueledUtils/UIKit/ButtonWithTitleAdjustment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#if canImport(UIKit) && !os(watchOS)
import UIKit

///
Expand Down Expand Up @@ -108,3 +108,4 @@ open class ButtonWithTitleAdjustment: UIButton {
self.setAttributedTitle(adjustedString, for: state)
}
}
#endif
5 changes: 5 additions & 0 deletions FueledUtils/UIKit/DecoratingTextFieldDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#if canImport(UIKit) && !os(watchOS)
import UIKit
import Foundation
#if canImport(FueledUtilsCore)
import FueledUtilsCore
#endif

///
/// Adds formatting (decoration) characters to text field's content according to a variable pattern. Can be used for
Expand Down Expand Up @@ -192,3 +196,4 @@ extension DecoratingTextFieldDelegate: UITextFieldDelegate {
return false
}
}
#endif
2 changes: 2 additions & 0 deletions FueledUtils/UIKit/DimmingButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#if canImport(UIKit) && !os(watchOS)
import Foundation
import UIKit

Expand Down Expand Up @@ -58,3 +59,4 @@ public final class DimmingButton: UIButton {
(view ?? self).alpha = dimmedAlpha
}
}
#endif
2 changes: 2 additions & 0 deletions FueledUtils/UIKit/GradientView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#if canImport(UIKit) && !os(watchOS)
import UIKit

///
Expand Down Expand Up @@ -274,3 +275,4 @@ extension CGPoint {
return CGPoint(x: 1.0, y: 0.0)
}
}
#endif
Loading

0 comments on commit 354c35e

Please sign in to comment.