add presentation mode property

This commit is contained in:
Sergey Kopytov 2019-10-04 14:19:05 +03:00
parent 090c066a75
commit cdebfbebdd
2 changed files with 10 additions and 7 deletions

View File

@ -1,7 +1,7 @@
# Changelog
### 0.9.28
- **Add**: method `presentFullScreen(_ viewController:animated:completion:)` for `UIViewController` that present `viewController` in full screen mode (avoid problems with *iOS13* default prsentation mode changed to `.automatic` stork)
- **Add**: method `presentFullScreen(_ viewController:presentationStyle:animated:completion:)` for `UIViewController` that present any `viewController` modally in full screen mode by default (avoid problems with *iOS13* default presentation mode changed to `.automatic` stork)
### 0.9.27
- **Add**: method `date(from string:formats:parsedIn:)` method for `DateFormattingService` that parses date from string in one of the given formats with current region.

View File

@ -1,15 +1,18 @@
import UIkit
public extension UIViewController {
/// Method present new ViewController modally in full screen mode
/// Method present new ViewController modally in full screen mode by default
///
/// - Parameters:
/// - viewController: ViewController to present
/// - animated: ppresent with animation
/// - completion: completion block after present ended
func presentFullScreen(_ viewController: UIViewController,
animated: Bool = true,
completion: (() -> Void)? = nil) {
/// - presentationStyle: presentation style (default is `fullScreen`
/// - animated: present with animation or not
/// - completion: completion block after present finish
func presentModal(_ viewController: UIViewController,
presentationStyle: UIModalPresentationStyle = .fullScreen,
animated: Bool = true,
completion: (() -> Void)? = nil) {
viewController.modalPresentationStyle = .fullScreen
present(viewController, animated: animated, completion: completion)