Skip to content

Commit

Permalink
Merge branch 'release/3.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
notbenoit committed Aug 17, 2022
2 parents 51549d6 + 8548346 commit 495f361
Show file tree
Hide file tree
Showing 115 changed files with 5,660 additions and 1,907 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @stephanecopin @metatheoretic @heymansmile @notbenoit
3 changes: 3 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ignore:
- "Pods"
- "Tests"
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ playground.xcworkspace
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
# Pods/
Pods/

# Carthage
#
Expand Down
51 changes: 51 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
## Main

##### New Features/Enhancements

- Add `ActionProtocol`
- Add `AnyAction`, allowing to type-erase any actions represented by a `ActionProtocol`
- Add `CoalescingAction` & `OverridingAction`
- Add a `CombineExtensions` & `CombineExtensionsProvider` protocol, replicating the `.reactive` of ReactiveSwift (so as not to pollute too much the global namespace)
- All `NSObject` now can have a `cancellables` object attached to them via `<object>.combineExtensions.cancellables`. It's created lazily, so there's impact if not used.
- Extend `Publisher.handleEvents` to add two new hooks:
- `receiveTermination`: When either a completion or a cancellation is received
- `receiveResult`: Takes a `Result`, and called when either values are received or an error is received
- Add `Publisher.promoteOptional()`
- Add `then(receiveResult:)`, which takes a closure with a `Result`, allowing to handle values & error in the same place
- Add `sinkForLifetimeOf(_:)` methods family, allowing to sink on a publisher and link to the lifetime of a given `CombineExtensionsProvider & AnyObject`. The goal of this is to avoid having to write the classic boilerplate code in Combine handling with having to create `cancellables` for every single object (this used the `cancellables` extension mentioned above).
- Add `performDuringLifetimeOf(_:action:)`, allowing to link an action with the lifetime of an object. This act as an equivalent for `makeBindingTarget` from `ReactiveSwift` when calling functions or assigning multiple variables.
- Add `assign(to:forLifetimeOf:)`, allowing to assign the output of the producer to a keyPath, keeping it alive until the specified object is deallocated.
- Add `TapAction` and `<UIControl>.combineExtensions.tapped`, allowing to link an `Action` to a button, without having to do the bindings manually (similar to `UIButton.reactive.pressed` in ReactiveCocoa)
- Add `<UIControl>.publisherForControlEvent(_:)`, to get a publisher that triggers on any control events.
- Add `(UITextField/UITextView).(textValues|continuousTextValues)`, which are equivalent to same thing as for ReactiveCocoa.
[Stéphane Copin](https://github.com/stephanecopin)
[#54](https://github.com/Fueled/ios-utilities/pull/54)

- Add an optional `insets` parameter to `addAndFitSubview()`
- Make `removeArrangedSubviews()`'s `removeFromHierachy` parameter default to `true`
- Add `tapped` helper to link any `ReactiveActionProtocol` to any `UIControl`
- Add `AnyIdentifiable` & `AnyAction` for type-erased `Identifiable` & `ReactiveActionProtocol` respectively
- Add `OverridingAction`, a new `Action` that if executed when already executing, will cancel the previous producer and start a new one
- Make `OrderedSet` conform to `SetAlgebra`
[Stéphane Copin](https://github.com/stephanecopin)
[#53](https://github.com/Fueled/ios-utilities/pull/53)

##### Bug Fixes

- Fix a bug in `CombineLatestMany` where cancelling the resulting publisher would not cancel the array of publishers themselves.
[Stéphane Copin](https://github.com/stephanecopin)
[#55](https://github.com/Fueled/ios-utilities/pull/55)

- Fix a bug in `Action` where a cancellation would be ignored and not set `isExecuting` to `false`
[Stéphane Copin](https://github.com/stephanecopin)
[#54](https://github.com/Fueled/ios-utilities/pull/54)

- Fix an internal state corruption issue in `OrderedSet`
[Stéphane Copin](https://github.com/stephanecopin)
[#53](https://github.com/Fueled/ios-utilities/pull/53)

##### Breaking changes

- The original `TapAction`, `OverridingAction` and `AnyAction` were all prefixed with `Reactive`.
[Stéphane Copin](https://github.com/stephanecopin)
[#54](https://github.com/Fueled/ios-utilities/pull/54)
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ In order to properly clone the project and be ready to submit bug fixes/new feat
```shell
git submodule update --init --recursive
```
2. Open `FueledUtils.xcworkspace`
2. Open `Test/FueledUtils.xcworkspace` and update the *FueledUtils* Pod in `Development Pods`
3. You're ready to go!

## How to contribute
Expand Down
2 changes: 0 additions & 2 deletions Cartfile

This file was deleted.

2 changes: 0 additions & 2 deletions Cartfile.private

This file was deleted.

4 changes: 0 additions & 4 deletions Cartfile.resolved

This file was deleted.

1 change: 0 additions & 1 deletion Carthage/Checkouts/Nimble
Submodule Nimble deleted from 6abeb3
1 change: 0 additions & 1 deletion Carthage/Checkouts/Quick
Submodule Quick deleted from 33682c
1 change: 0 additions & 1 deletion Carthage/Checkouts/ReactiveCocoa
Submodule ReactiveCocoa deleted from 21deb6
1 change: 0 additions & 1 deletion Carthage/Checkouts/ReactiveSwift
Submodule ReactiveSwift deleted from b772fa
15 changes: 15 additions & 0 deletions Dangerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# frozen_string_literal: true

has_app_changes = !git.modified_files.grep(/FueledUtils/).empty?
if !git.modified_files.include?('CHANGELOG.md') && has_app_changes
warn("Please include a CHANGELOG entry to credit yourself! \nYou can find it at [CHANGELOG.md](https://github.com/Fueled/ios-utilities/blob/develop/CHANGELOG.md).", :sticky => false)
markdown <<-MARKDOWN
Here's an example of your CHANGELOG entry:
```markdown
- #{github.pr_title}\s\s
[#{github.pr_author}](https://github.com/#{github.pr_author})
[#pull_request_number](https://github.com/Fueled/ios-utilities/pulls/pull_request_number)
```
*note*: There are two invisible spaces after the entry's text.
MARKDOWN
end
12 changes: 0 additions & 12 deletions FueledUtils.playground/Contents.swift

This file was deleted.

4 changes: 0 additions & 4 deletions FueledUtils.playground/contents.xcplayground

This file was deleted.

120 changes: 95 additions & 25 deletions FueledUtils.podspec
Original file line number Diff line number Diff line change
@@ -1,27 +1,97 @@
# frozen_string_literal: true

Pod::Spec.new do |s|
s.name = 'FueledUtils'
s.version = '2.0.3'
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'

s.homepage = 'https://github.com/Fueled/ios-utilities'
s.license = { :type => 'Apache License, Version 2.0', :file => 'LICENSE' }
s.author = { 'Vadim-Yelagin' => 'vadim.yelagin@gmail.com', 'stephanecopin' => 'stephane@fueled.com', 'leontiy' => 'leonty@fueled.com', 'bastienFalcou' => 'bastien@fueled.com', 'heymansmile' => 'ivan@fueled.com', 'thib4ult' => 'thibault@fueled.com', 'notbenoit' => 'benoit@fueled.com' }
s.source = { :git => 'https://github.com/Fueled/ios-utilities.git', :tag => s.version.to_s }
s.documentation_url = 'https://cdn.rawgit.com/Fueled/ios-utilities/master/docs/index.html'

s.ios.deployment_target = '8.0'
s.osx.deployment_target = '10.9'
s.watchos.deployment_target = '2.0'
s.tvos.deployment_target = '9.0'

s.source_files = 'FueledUtils/**/*.swift'
s.osx.exclude_files = ['FueledUtils/FueledUtils.h', 'FueledUtils/ButtonWithTitleAdjustment.swift', 'FueledUtils/DecoratingTextFieldDelegate.swift', 'FueledUtils/DimmingButton.swift', 'FueledUtils/HairlineView.swift', 'FueledUtils/HairlineView.swift', 'FueledUtils/KeyboardInsetHelper.swift', 'FueledUtils/LabelWithTitleAdjustment.swift', 'FueledUtils/ReactiveCocoaExtensions.swift', 'FueledUtils/ScrollViewPage.swift', 'FueledUtils/SetRootViewController.swift', 'FueledUtils/SignalingAlert.swift', 'FueledUtils/UIExtensions.swift', 'FueledUtils/GradientView.swift']
s.ios.exclude_files = ['FueledUtils/FueledUtils.h']
s.watchos.exclude_files = ['FueledUtils/FueledUtils.h', 'FueledUtils/ButtonWithTitleAdjustment.swift', 'FueledUtils/DecoratingTextFieldDelegate.swift', 'FueledUtils/DimmingButton.swift', 'FueledUtils/HairlineView.swift', 'FueledUtils/HairlineView.swift', 'FueledUtils/KeyboardInsetHelper.swift', 'FueledUtils/LabelWithTitleAdjustment.swift', 'FueledUtils/ReactiveCocoaExtensions.swift', 'FueledUtils/ScrollViewPage.swift', 'FueledUtils/SetRootViewController.swift', 'FueledUtils/SignalingAlert.swift', 'FueledUtils/UIExtensions.swift', 'FueledUtils/GradientView.swift']
s.tvos.exclude_files = ['FueledUtils/FueledUtils.h', 'FueledUtils/KeyboardInsetHelper.swift']

s.dependency 'ReactiveSwift', '~> 6.0'
s.dependency 'ReactiveCocoa', '~> 10.0'
s.name = 'FueledUtils'
s.version = '3.0.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'

s.homepage = 'https://github.com/Fueled/ios-utilities'
s.license = { type: 'Apache License, Version 2.0', file: 'LICENSE' }
s.author = { 'Vadim-Yelagin' => 'vadim.yelagin@gmail.com', 'stephanecopin' => 'stephane@fueled.com', 'leontiy' => 'leonty@fueled.com', 'bastienFalcou' => 'bastien@fueled.com', 'heymansmile' => 'ivan@fueled.com', 'thib4ult' => 'thibault@fueled.com', 'notbenoit' => 'benoit@fueled.com' }
s.source = { git: 'https://github.com/Fueled/ios-utilities.git', tag: s.version.to_s }
s.documentation_url = 'https://cdn.rawgit.com/Fueled/ios-utilities/master/docs/index.html'

s.ios.deployment_target = '9.0'
s.osx.deployment_target = '10.12'
s.watchos.deployment_target = '2.0'
s.tvos.deployment_target = '9.0'

s.subspec 'Core' do |s|
s.source_files = 'FueledUtils/Core/**/*.swift'
end

s.subspec 'ReactiveCommon' do |s|
s.source_files = 'FueledUtils/ReactiveCommon/**/*.swift'

s.dependency 'FueledUtils/Core'
end

s.subspec 'ReactiveSwift' do |s|
s.dependency 'FueledUtils/ReactiveCommon'
s.dependency 'ReactiveSwift', '~> 6.0'
s.dependency 'ReactiveCocoa', '~> 10.0'

s.source_files = 'FueledUtils/ReactiveSwift/**/*.swift'
end

s.subspec 'UIKit' do |s|
s.dependency 'FueledUtils/Core'
s.ios.source_files = 'FueledUtils/UIKit/**/*.swift'
end

s.subspec 'ReactiveSwiftUIKit' do |s|
s.dependency 'FueledUtils/ReactiveSwift'
s.dependency 'FueledUtils/UIKit'

s.ios.source_files = 'FueledUtils/ReactiveSwiftUIKit/**/*.swift'
end

s.subspec 'Combine' do |s|
# Update the above with the following versions when we drop support for iOS < 13.0 or
# uncomment below if https://github.com/CocoaPods/CocoaPods/issues/7333 is implemented
# s.ios.deployment_target = '13.0'
# s.osx.deployment_target = '10.15'
# s.watchos.deployment_target = '6.0'
# s.tvos.deployment_target = '13.0'

s.dependency 'FueledUtils/ReactiveCommon'

s.source_files = 'FueledUtils/Combine/**/*.swift'
end

s.subspec 'CombineOperators' do |s|
s.dependency 'FueledUtils/Combine'

s.source_files = 'FueledUtils/CombineOperators/**/*.swift'
end

s.subspec 'CombineUIKit' do |s|
s.dependency 'FueledUtils/Combine'
s.dependency 'FueledUtils/UIKit'

s.ios.source_files = 'FueledUtils/CombineUIKit/**/*.swift'
end

s.subspec 'SwiftUI' do |s|
s.dependency 'FueledUtils/Core'
s.dependency 'FueledUtils/Combine'

s.source_files = 'FueledUtils/SwiftUI/**/*.swift'
end

s.subspec 'ReactiveCombineBridge' do |s|
s.dependency 'FueledUtils/ReactiveSwift'
s.dependency 'FueledUtils/Combine'

s.source_files = 'FueledUtils/ReactiveCombineBridge/**/*.swift'
end

s.osx.exclude_files = ['FueledUtils/FueledUtils.h', 'FueledUtils/ButtonWithTitleAdjustment.swift', 'FueledUtils/DecoratingTextFieldDelegate.swift', 'FueledUtils/DimmingButton.swift', 'FueledUtils/HairlineView.swift', 'FueledUtils/HairlineView.swift', 'FueledUtils/KeyboardInsetHelper.swift', 'FueledUtils/LabelWithTitleAdjustment.swift', 'FueledUtils/ReactiveCocoaExtensions.swift', 'FueledUtils/ScrollViewPage.swift', 'FueledUtils/SetRootViewController.swift', 'FueledUtils/SignalingAlert.swift', 'FueledUtils/UIExtensions.swift', 'FueledUtils/GradientView.swift']
s.ios.exclude_files = ['FueledUtils/FueledUtils.h']
s.watchos.exclude_files = ['FueledUtils/FueledUtils.h', 'FueledUtils/ButtonWithTitleAdjustment.swift', 'FueledUtils/DecoratingTextFieldDelegate.swift', 'FueledUtils/DimmingButton.swift', 'FueledUtils/HairlineView.swift', 'FueledUtils/HairlineView.swift', 'FueledUtils/KeyboardInsetHelper.swift', 'FueledUtils/LabelWithTitleAdjustment.swift', 'FueledUtils/ReactiveCocoaExtensions.swift', 'FueledUtils/ScrollViewPage.swift', 'FueledUtils/SetRootViewController.swift', 'FueledUtils/SignalingAlert.swift', 'FueledUtils/UIExtensions.swift', 'FueledUtils/GradientView.swift']
s.tvos.exclude_files = ['FueledUtils/FueledUtils.h', 'FueledUtils/KeyboardInsetHelper.swift']

s.default_subspecs = 'Core'
end
Loading

0 comments on commit 495f361

Please sign in to comment.