Skip to content

Commit

Permalink
Fix for iPad split view bug (#173)
Browse files Browse the repository at this point in the history
* Fixed the iPad animation bug when bulletin shown, also couple deprecation warnings

* Updated Changelog

* Corrected the available -check
  • Loading branch information
Piidro authored May 14, 2020
1 parent bf67b0b commit e8272e3
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
- Remove testing dependencies from the Cartfile
[#166](https://github.com/alexaubry/BulletinBoard/pull/166)

## Unreleased
### Fixes
- Fix for iPad split view bug
[#173] (https://github.com/alexaubry/BulletinBoard/pull/173)

## 🔖 v4.0.0
### Fixes
- Upgrade to Swift 5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ class BulletinDismissAnimationController: NSObject, UIViewControllerAnimatedTran
snapshotActivityIndicator.rightAnchor.constraint(equalTo: snapshot.rightAnchor).isActive = true
snapshotActivityIndicator.bottomAnchor.constraint(equalTo: snapshot.bottomAnchor).isActive = true

snapshotActivityIndicator.style = .whiteLarge
if #available(iOS 13.0, *) {
snapshotActivityIndicator.style = UIActivityIndicatorView.Style.large
} else {
snapshotActivityIndicator.style = .whiteLarge
}
snapshotActivityIndicator.color = .black
snapshotActivityIndicator.isUserInteractionEnabled = false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ class BulletinPresentationAnimationController: NSObject, UIViewControllerAnimate
return
}

// Fix the frame (Needed for iPad app running in split view)
if let fromFrame = transitionContext.viewController(forKey: .from)?.view.frame {
toVC.view.frame = fromFrame
}

let rootView = toVC.view!
let contentView = toVC.contentView
let backgroundView = toVC.backgroundView!
Expand Down
6 changes: 5 additions & 1 deletion Sources/Support/BulletinViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,11 @@ extension BulletinViewController {
activityIndicator.topAnchor.constraint(equalTo: contentView.topAnchor).isActive = true
activityIndicator.bottomAnchor.constraint(equalTo: contentView.bottomAnchor).isActive = true

activityIndicator.style = .whiteLarge
if #available(iOS 13.0, *) {
activityIndicator.style = UIActivityIndicatorView.Style.large
} else {
activityIndicator.style = .whiteLarge
}
activityIndicator.color = .black
activityIndicator.isUserInteractionEnabled = false

Expand Down

0 comments on commit e8272e3

Please sign in to comment.