Skip to content

Commit

Permalink
Merge pull request #57 from iZettle/revert-isCollapsed-initial-value-…
Browse files Browse the repository at this point in the history
…change

Revert is collapsed initial value change
  • Loading branch information
nataliq-pp authored Sep 23, 2019
2 parents e564273 + 775d6ca commit 93974b6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 19 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 1.8.1
- [Bug fix] Revert a change of the default SplitVC delegate `isCollapsed` value that doesn't work as expected because it's used before the vc is added to the screen and the value is not reliable

# 1.8.0
- [Bug fix] Fixed a recursive delegate call issue in modal presentstions.
- [Bug fix] Added a workaround for a navigation bar layout issue in iOS 13.
Expand Down
18 changes: 2 additions & 16 deletions Presentation/DualNavigationControllersSplitDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,7 @@ import Flow
/// A split controller delegate (`UISplitViewControllerDelegate`), that manages navigation controllers for the master and detail view,
/// as well as moving view controllers between these while expanding or collapsing.
open class DualNavigationControllersSplitDelegate: NSObject, UISplitViewControllerDelegate {

@available(*, deprecated, message: "use `init(initialCollapsedState:)` instead")
public convenience override init() {
self.init(initialCollapsedState: true)
}

/// Creates a delegate that will manage a split view controller with the specified initial collapsed state
/// - Parameter initialCollapsedState: The initial state of `isCollapsed` of the managed split view controller
/// so that the delegate can provide correct information through its `isCollapsedSignal`
public init(initialCollapsedState: Bool) {
isCollapsedProperty = ReadWriteSignal(initialCollapsedState)
super.init()
}

private let isCollapsedProperty: ReadWriteSignal<Bool>
private let isCollapsedProperty = ReadWriteSignal(true)
private var detailBag: Disposable?

/// Customization point for construction of the navigation controllers managed by `self`
Expand Down Expand Up @@ -126,7 +112,7 @@ open class DualNavigationControllersSplitDelegate: NSObject, UISplitViewControll
public extension UISplitViewController {
/// Creates and returns a new split delegate that will be set as `self`'s delegate until `bag` is disposed.
func setupSplitDelegate(ownedBy bag: DisposeBag) -> DualNavigationControllersSplitDelegate {
let splitDelegate = DualNavigationControllersSplitDelegate(initialCollapsedState: isCollapsed)
let splitDelegate = DualNavigationControllersSplitDelegate()
delegate = splitDelegate
bag += {
_ = splitDelegate
Expand Down
2 changes: 1 addition & 1 deletion Presentation/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.8.0</string>
<string>1.8.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
2 changes: 1 addition & 1 deletion PresentationFramework.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "PresentationFramework"
s.version = "1.8.0"
s.version = "1.8.1"
s.module_name = "Presentation"
s.summary = "Driving presentations from model to result"
s.description = <<-DESC
Expand Down
2 changes: 1 addition & 1 deletion PresentationTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.8.0</string>
<string>1.8.1</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
Expand Down

0 comments on commit 93974b6

Please sign in to comment.