From 8bff1e5c245410308ab5955ef602c26fafb1e054 Mon Sep 17 00:00:00 2001 From: mrustaa Date: Sat, 23 Dec 2023 17:00:38 +0300 Subject: [PATCH 1/4] UI edits/corrections - for the new xcode version --- .../Base.lproj/Main.storyboard | 43 ++++++++++++------- ...mpleAddCollectionViewController.storyboard | 13 ++++-- .../ExampleAddCollectionViewController.swift | 1 + .../ExampleAddTableViewController.storyboard | 13 ++++-- .../ExampleAddTableViewController.swift | 2 + .../ExamplesSettingsViewController.swift | 2 + .../Maps/MapManager/MapViewManager.swift | 17 +++++--- .../ViewController.swift | 30 +++++++++++++ 8 files changed, 93 insertions(+), 28 deletions(-) diff --git a/Example/ContainerControllerSwift/Base.lproj/Main.storyboard b/Example/ContainerControllerSwift/Base.lproj/Main.storyboard index 0e5e5d9..fd228fa 100644 --- a/Example/ContainerControllerSwift/Base.lproj/Main.storyboard +++ b/Example/ContainerControllerSwift/Base.lproj/Main.storyboard @@ -1,33 +1,35 @@ - + - + + + - + - + - - + + - + + - @@ -39,20 +41,31 @@ - + - - - + + + + + + - + - + - + + + + + + + + + diff --git a/Example/ContainerControllerSwift/ExampleAddCollectionView/ExampleAddCollectionViewController.storyboard b/Example/ContainerControllerSwift/ExampleAddCollectionView/ExampleAddCollectionViewController.storyboard index 12294f8..9deb0d2 100644 --- a/Example/ContainerControllerSwift/ExampleAddCollectionView/ExampleAddCollectionViewController.storyboard +++ b/Example/ContainerControllerSwift/ExampleAddCollectionView/ExampleAddCollectionViewController.storyboard @@ -1,9 +1,11 @@ - + - + + + @@ -14,8 +16,8 @@ - + @@ -23,4 +25,9 @@ + + + + + diff --git a/Example/ContainerControllerSwift/ExampleAddCollectionView/ExampleAddCollectionViewController.swift b/Example/ContainerControllerSwift/ExampleAddCollectionView/ExampleAddCollectionViewController.swift index 30fe820..a6b8fd7 100644 --- a/Example/ContainerControllerSwift/ExampleAddCollectionView/ExampleAddCollectionViewController.swift +++ b/Example/ContainerControllerSwift/ExampleAddCollectionView/ExampleAddCollectionViewController.swift @@ -18,6 +18,7 @@ class ExampleAddCollectionViewController: StoryboardController { override func viewDidLoad() { super.viewDidLoad() + title = "Example Add CollectionView" let layoutC = ContainerLayout() layoutC.positions = ContainerPosition(top: 100, middle: 250, bottom: 70) diff --git a/Example/ContainerControllerSwift/ExamplesAddTableView/ExampleAddTableViewController.storyboard b/Example/ContainerControllerSwift/ExamplesAddTableView/ExampleAddTableViewController.storyboard index fbf62ed..73ca216 100644 --- a/Example/ContainerControllerSwift/ExamplesAddTableView/ExampleAddTableViewController.storyboard +++ b/Example/ContainerControllerSwift/ExamplesAddTableView/ExampleAddTableViewController.storyboard @@ -1,9 +1,11 @@ - + - + + + @@ -14,8 +16,8 @@ - + @@ -23,4 +25,9 @@ + + + + + diff --git a/Example/ContainerControllerSwift/ExamplesAddTableView/ExampleAddTableViewController.swift b/Example/ContainerControllerSwift/ExamplesAddTableView/ExampleAddTableViewController.swift index 7fd6d07..bde904d 100644 --- a/Example/ContainerControllerSwift/ExamplesAddTableView/ExampleAddTableViewController.swift +++ b/Example/ContainerControllerSwift/ExamplesAddTableView/ExampleAddTableViewController.swift @@ -18,6 +18,8 @@ class ExampleAddTableViewController: StoryboardController { override func viewDidLoad() { super.viewDidLoad() + title = "Example Add TableView" + let layout = ContainerLayout() layout.backgroundShadowShow = true layout.positions = ContainerPosition(top: 70, middle: 250, bottom: 100) diff --git a/Example/ContainerControllerSwift/ExamplesSettings/ExamplesSettingsViewController.swift b/Example/ContainerControllerSwift/ExamplesSettings/ExamplesSettingsViewController.swift index 35b2cc7..c985052 100644 --- a/Example/ContainerControllerSwift/ExamplesSettings/ExamplesSettingsViewController.swift +++ b/Example/ContainerControllerSwift/ExamplesSettings/ExamplesSettingsViewController.swift @@ -19,6 +19,8 @@ class ExamplesSettingsViewController: StoryboardController { override func viewDidLoad() { super.viewDidLoad() + title = "Example Add/Settings Container" + let barButtonAddItem = UIBarButtonItem(barButtonSystemItem: .add, target: self, action: #selector(navigationBarAddAction)) let barButtonCloseItem = UIBarButtonItem(barButtonSystemItem: .close, target: self, action: #selector(navigationBarCloseAction)) self.navigationItem.rightBarButtonItems = [ barButtonAddItem, barButtonCloseItem ] diff --git a/Example/ContainerControllerSwift/Maps/MapManager/MapViewManager.swift b/Example/ContainerControllerSwift/Maps/MapManager/MapViewManager.swift index 3da68de..ffda32b 100644 --- a/Example/ContainerControllerSwift/Maps/MapManager/MapViewManager.swift +++ b/Example/ContainerControllerSwift/Maps/MapManager/MapViewManager.swift @@ -44,13 +44,16 @@ class MapViewManager: NSObject { // MARK: - Location Manager func loadLocation() { - - if CLLocationManager.locationServicesEnabled() { - locationManager = CLLocationManager() - locationManager?.delegate = self - locationManager?.desiredAccuracy = kCLLocationAccuracyBest - locationManager?.requestAlwaysAuthorization() - locationManager?.startUpdatingLocation() + DispatchQueue.global().async { + if CLLocationManager.locationServicesEnabled() { + DispatchQueue.main.async { + self.locationManager = CLLocationManager() + self.locationManager?.delegate = self + self.locationManager?.desiredAccuracy = kCLLocationAccuracyBest + self.locationManager?.requestAlwaysAuthorization() + self.locationManager?.startUpdatingLocation() + } + } } } diff --git a/Example/ContainerControllerSwift/ViewController.swift b/Example/ContainerControllerSwift/ViewController.swift index b415997..cc5edf4 100644 --- a/Example/ContainerControllerSwift/ViewController.swift +++ b/Example/ContainerControllerSwift/ViewController.swift @@ -17,6 +17,8 @@ class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() + configureNavigationBar(largeTitleColor: .label, backgoundColor: .systemGroupedBackground, tintColor: .systemBlue, title: "ContainerController", preferredLargeTitle: false) + title = "ContainerController" navigationController?.interactivePopGestureRecognizer?.delegate = self @@ -46,6 +48,34 @@ class ViewController: UIViewController { } +extension ViewController { + func configureNavigationBar(largeTitleColor: UIColor, backgoundColor: UIColor, tintColor: UIColor, title: String, preferredLargeTitle: Bool) { + if #available(iOS 13.0, *) { + let navBarAppearance = UINavigationBarAppearance() + navBarAppearance.configureWithOpaqueBackground() + navBarAppearance.largeTitleTextAttributes = [.foregroundColor: largeTitleColor] + navBarAppearance.titleTextAttributes = [.foregroundColor: largeTitleColor] + navBarAppearance.backgroundColor = backgoundColor + + navigationController?.navigationBar.standardAppearance = navBarAppearance + navigationController?.navigationBar.compactAppearance = navBarAppearance + navigationController?.navigationBar.scrollEdgeAppearance = navBarAppearance + + navigationController?.navigationBar.prefersLargeTitles = preferredLargeTitle + navigationController?.navigationBar.isTranslucent = false + navigationController?.navigationBar.tintColor = tintColor + navigationItem.title = title + + } else { + // Fallback on earlier versions + navigationController?.navigationBar.barTintColor = backgoundColor + navigationController?.navigationBar.tintColor = tintColor + navigationController?.navigationBar.isTranslucent = false + navigationItem.title = title + } + } +} + extension ViewController: UIGestureRecognizerDelegate { func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldBeRequiredToFailBy otherGestureRecognizer: UIGestureRecognizer) -> Bool { From 831b2f144f1f8b11413510d69f4aef0b6f71cf4d Mon Sep 17 00:00:00 2001 From: mrustaa Date: Sun, 24 Dec 2023 00:43:06 +0300 Subject: [PATCH 2/4] Added support for the change isTranslucent NavigationBar --- ...mpleAddCollectionViewController.storyboard | 28 +++++++++++++++++-- .../ExampleAddCollectionViewController.swift | 13 +++++++++ .../ContainerController.swift | 22 ++++++++++++--- 3 files changed, 57 insertions(+), 6 deletions(-) diff --git a/Example/ContainerControllerSwift/ExampleAddCollectionView/ExampleAddCollectionViewController.storyboard b/Example/ContainerControllerSwift/ExampleAddCollectionView/ExampleAddCollectionViewController.storyboard index 9deb0d2..6b3ae3c 100644 --- a/Example/ContainerControllerSwift/ExampleAddCollectionView/ExampleAddCollectionViewController.storyboard +++ b/Example/ContainerControllerSwift/ExampleAddCollectionView/ExampleAddCollectionViewController.storyboard @@ -1,9 +1,9 @@ - + - + @@ -16,8 +16,29 @@ + + + + + + + @@ -29,5 +50,8 @@ + + + diff --git a/Example/ContainerControllerSwift/ExampleAddCollectionView/ExampleAddCollectionViewController.swift b/Example/ContainerControllerSwift/ExampleAddCollectionView/ExampleAddCollectionViewController.swift index a6b8fd7..0b88d66 100644 --- a/Example/ContainerControllerSwift/ExampleAddCollectionView/ExampleAddCollectionViewController.swift +++ b/Example/ContainerControllerSwift/ExampleAddCollectionView/ExampleAddCollectionViewController.swift @@ -31,9 +31,22 @@ class ExampleAddCollectionViewController: StoryboardController { override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) + navigationController?.navigationBar.isTranslucent = true + container.move(type: .middle) } + @IBAction func buttonChangeTranslucent(_ sender: UIButton) { + + guard let translucent = navigationController?.navigationBar.isTranslucent else { return } + + navigationController?.navigationBar.isTranslucent = !translucent + + container.move(type: container.moveType) + } + + + func addCollectionView() -> UICollectionView { let layout = UICollectionViewFlowLayout() diff --git a/Sources/ContainerController/ContainerController.swift b/Sources/ContainerController/ContainerController.swift index c857554..e714fbb 100644 --- a/Sources/ContainerController/ContainerController.swift +++ b/Sources/ContainerController/ContainerController.swift @@ -477,7 +477,11 @@ open class ContainerController: NSObject { transform.ty = ((positionTop / 2) + (transform.ty / 2)) } - let position = transform.ty + var position = transform.ty + if topTranslucent { + position = position + topBarHeight + } + let type: ContainerMoveType = moveType let from: ContainerFromType = .pan let animation = false @@ -555,7 +559,7 @@ open class ContainerController: NSObject { scrollInsetsBottom = 0.0 } - let top: CGFloat = layout.scrollInsets.top + var top: CGFloat = layout.scrollInsets.top let bottom: CGFloat = layout.scrollInsets.bottom + scrollInsetsBottom let indicatorTop: CGFloat = layout.scrollIndicatorInsets.top @@ -575,6 +579,10 @@ open class ContainerController: NSObject { height = 0 } + if topTranslucent { + height = height + topBarHeight + } + if animation , !isScrolling, footerView == nil, @@ -735,7 +743,10 @@ open class ContainerController: NSObject { from: ContainerFromType = .custom, completion: (() -> Void)? = nil) { - let position = positionMoveFrom(type: type) + var position = positionMoveFrom(type: type) + if topTranslucent { + position = position + topBarHeight + } move(position: position, animation: animation, @@ -1229,7 +1240,10 @@ extension ContainerController: UIScrollViewDelegate { scrollTransform = view.transform - let top: CGFloat = positionTop + var top: CGFloat = positionTop + if topTranslucent { + top = top + topBarHeight + } if gesture.state == .ended { scrollOnceBeginDragging = false From 0534cba5dfc9f0c9a82f02b6122919662afd93c7 Mon Sep 17 00:00:00 2001 From: mrustaa Date: Sun, 24 Dec 2023 14:23:18 +0300 Subject: [PATCH 3/4] update support isTranslucent --- .../Base.lproj/Main.storyboard | 6 ++-- ...mpleAddCollectionViewController.storyboard | 16 ++++++---- .../ExampleAddCollectionViewController.swift | 16 +++++++--- .../ExamplesContainerController.swift | 5 +++ .../UI/Cell/ExampleCellStyle.swift | 1 + .../Maps/MapsViewController.swift | 2 ++ .../ViewController.swift | 32 +------------------ .../ContainerController.swift | 6 ++-- .../ContainerControllerDelegate.swift | 22 +++---------- .../ContainerController/ContainerTypes.swift | 2 +- 10 files changed, 41 insertions(+), 67 deletions(-) diff --git a/Example/ContainerControllerSwift/Base.lproj/Main.storyboard b/Example/ContainerControllerSwift/Base.lproj/Main.storyboard index fd228fa..9c9da4c 100644 --- a/Example/ContainerControllerSwift/Base.lproj/Main.storyboard +++ b/Example/ContainerControllerSwift/Base.lproj/Main.storyboard @@ -1,9 +1,9 @@ - + - + @@ -62,7 +62,7 @@ - + diff --git a/Example/ContainerControllerSwift/ExampleAddCollectionView/ExampleAddCollectionViewController.storyboard b/Example/ContainerControllerSwift/ExampleAddCollectionView/ExampleAddCollectionViewController.storyboard index 6b3ae3c..bb5f783 100644 --- a/Example/ContainerControllerSwift/ExampleAddCollectionView/ExampleAddCollectionViewController.storyboard +++ b/Example/ContainerControllerSwift/ExampleAddCollectionView/ExampleAddCollectionViewController.storyboard @@ -18,18 +18,17 @@ @@ -40,6 +39,9 @@ + + + @@ -48,10 +50,10 @@ - + - + diff --git a/Example/ContainerControllerSwift/ExampleAddCollectionView/ExampleAddCollectionViewController.swift b/Example/ContainerControllerSwift/ExampleAddCollectionView/ExampleAddCollectionViewController.swift index 0b88d66..344a6a7 100644 --- a/Example/ContainerControllerSwift/ExampleAddCollectionView/ExampleAddCollectionViewController.swift +++ b/Example/ContainerControllerSwift/ExampleAddCollectionView/ExampleAddCollectionViewController.swift @@ -13,6 +13,7 @@ class ExampleAddCollectionViewController: StoryboardController { var container: ContainerController! + @IBOutlet var btnChangeTranslucent: UIButton! // MARK: - Init override func viewDidLoad() { @@ -20,6 +21,8 @@ class ExampleAddCollectionViewController: StoryboardController { title = "Example Add CollectionView" + btnUpdateText() + let layoutC = ContainerLayout() layoutC.positions = ContainerPosition(top: 100, middle: 250, bottom: 70) container = ContainerController(addTo: self, layout: layoutC) @@ -31,21 +34,26 @@ class ExampleAddCollectionViewController: StoryboardController { override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) - navigationController?.navigationBar.isTranslucent = true - container.move(type: .middle) } - @IBAction func buttonChangeTranslucent(_ sender: UIButton) { + @IBAction func btnChangeTranslucentAction(_ sender: UIButton) { guard let translucent = navigationController?.navigationBar.isTranslucent else { return } navigationController?.navigationBar.isTranslucent = !translucent + btnUpdateText() + container.move(type: container.moveType) } - + func btnUpdateText() { + + guard let translucent = navigationController?.navigationBar.isTranslucent else { return } + + btnChangeTranslucent.setTitle("NavBar isTranslucent \(translucent)", for: .normal) + } func addCollectionView() -> UICollectionView { diff --git a/Example/ContainerControllerSwift/ExamplesSettings/Container/ExamplesContainerController.swift b/Example/ContainerControllerSwift/ExamplesSettings/Container/ExamplesContainerController.swift index 3a8e45d..9b93837 100644 --- a/Example/ContainerControllerSwift/ExamplesSettings/Container/ExamplesContainerController.swift +++ b/Example/ContainerControllerSwift/ExamplesSettings/Container/ExamplesContainerController.swift @@ -70,6 +70,9 @@ class ExamplesContainerController: ContainerController, ExampleCellDelegate { ExampleSwitchCellItem(height: h, delegate: self, type: .shadowBackground, value: false), ExampleSliderCellItem(height: h, delegate: self, type: .shadowContainer, value: 0.2, maximumValue: 1.0), ExampleSliderCellItem(height: h, delegate: self, type: .cornerRadius, value: 15, maximumValue: 140), + + ExampleSwitchCellItem(height: h, delegate: self, type: .navbarTranslucent, value: false), + ExampleSwitchCellItem(height: h, delegate: self, type: .movingEnabled, value: true), ExampleSwitchCellItem(height: h, delegate: self, type: .trackingPosition, value: false), ExampleSliderCellItem(height: h, delegate: self, type: .footerPadding, value: 0, maximumValue: Float(ContainerDevice.screenMax)), @@ -122,6 +125,8 @@ class ExamplesContainerController: ContainerController, ExampleCellDelegate { case .shadowContainer: self.view.addShadow(opacity: value) + case .navbarTranslucent: self.controller?.navigationController?.navigationBar.isTranslucent = boolValue; move(type: moveType) + case .movingEnabled: set(movingEnabled: boolValue) case .trackingPosition: set(trackingPosition: boolValue) diff --git a/Example/ContainerControllerSwift/ExamplesSettings/UI/Cell/ExampleCellStyle.swift b/Example/ContainerControllerSwift/ExamplesSettings/UI/Cell/ExampleCellStyle.swift index 435898c..6c0c867 100644 --- a/Example/ContainerControllerSwift/ExamplesSettings/UI/Cell/ExampleCellStyle.swift +++ b/Example/ContainerControllerSwift/ExamplesSettings/UI/Cell/ExampleCellStyle.swift @@ -20,6 +20,7 @@ extension ExampleCell { public enum Style: String { case `default` = "" case shadowContainer = "ShadowContainer" + case navbarTranslucent = "NavbarTranslucent" case movingEnabled = "MovingEnabled" case cornerRadius = "CornerRadius" case footerPadding = "FooterView.Padding" diff --git a/Example/ContainerControllerSwift/Maps/MapsViewController.swift b/Example/ContainerControllerSwift/Maps/MapsViewController.swift index 69763d0..70b38fb 100644 --- a/Example/ContainerControllerSwift/Maps/MapsViewController.swift +++ b/Example/ContainerControllerSwift/Maps/MapsViewController.swift @@ -59,6 +59,8 @@ class MapsViewController: StoryboardController, MapsContainerControllerDelegate, override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) + navigationController?.navigationBar.isTranslucent = false + setNeedsStatusBarAppearanceUpdate() navBar(hide: true) diff --git a/Example/ContainerControllerSwift/ViewController.swift b/Example/ContainerControllerSwift/ViewController.swift index cc5edf4..512f2ed 100644 --- a/Example/ContainerControllerSwift/ViewController.swift +++ b/Example/ContainerControllerSwift/ViewController.swift @@ -17,13 +17,11 @@ class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() - configureNavigationBar(largeTitleColor: .label, backgoundColor: .systemGroupedBackground, tintColor: .systemBlue, title: "ContainerController", preferredLargeTitle: false) - title = "ContainerController" navigationController?.interactivePopGestureRecognizer?.delegate = self navigationController?.interactivePopGestureRecognizer?.isEnabled = true - + navigationController?.view.backgroundColor = .systemGroupedBackground items = [ TitleTextItem(title: "Maps.app", clss: MapsViewController.self), TitleTextItem(title: "Example. Settings", clss: ExamplesSettingsViewController.self), @@ -48,34 +46,6 @@ class ViewController: UIViewController { } -extension ViewController { - func configureNavigationBar(largeTitleColor: UIColor, backgoundColor: UIColor, tintColor: UIColor, title: String, preferredLargeTitle: Bool) { - if #available(iOS 13.0, *) { - let navBarAppearance = UINavigationBarAppearance() - navBarAppearance.configureWithOpaqueBackground() - navBarAppearance.largeTitleTextAttributes = [.foregroundColor: largeTitleColor] - navBarAppearance.titleTextAttributes = [.foregroundColor: largeTitleColor] - navBarAppearance.backgroundColor = backgoundColor - - navigationController?.navigationBar.standardAppearance = navBarAppearance - navigationController?.navigationBar.compactAppearance = navBarAppearance - navigationController?.navigationBar.scrollEdgeAppearance = navBarAppearance - - navigationController?.navigationBar.prefersLargeTitles = preferredLargeTitle - navigationController?.navigationBar.isTranslucent = false - navigationController?.navigationBar.tintColor = tintColor - navigationItem.title = title - - } else { - // Fallback on earlier versions - navigationController?.navigationBar.barTintColor = backgoundColor - navigationController?.navigationBar.tintColor = tintColor - navigationController?.navigationBar.isTranslucent = false - navigationItem.title = title - } - } -} - extension ViewController: UIGestureRecognizerDelegate { func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldBeRequiredToFailBy otherGestureRecognizer: UIGestureRecognizer) -> Bool { diff --git a/Sources/ContainerController/ContainerController.swift b/Sources/ContainerController/ContainerController.swift index e714fbb..3b5a13f 100644 --- a/Sources/ContainerController/ContainerController.swift +++ b/Sources/ContainerController/ContainerController.swift @@ -218,7 +218,7 @@ open class ContainerController: NSObject { shadowHiddenCheck() - delegate?.containerControllerRotation(self) + delegate?.containerControllerRotation?(self) calculationView() calculationScrollViewHeight(from: .rotation) @@ -357,7 +357,7 @@ open class ContainerController: NSObject { } @objc private func shadowButtonAction() { - delegate?.containerControllerShadowClick(self) + delegate?.containerControllerShadowClick?(self) } // MARK: - Create Container-View @@ -845,7 +845,7 @@ open class ContainerController: NSObject { type: ContainerMoveType, animation: Bool) { - delegate?.containerControllerMove(self, position: position, type: type, animation: animation) + delegate?.containerControllerMove?(self, position: position, type: type, animation: animation) } //MARK: - Shadow Alpha Level diff --git a/Sources/ContainerController/ContainerControllerDelegate.swift b/Sources/ContainerController/ContainerControllerDelegate.swift index 8391e34..ec4309d 100644 --- a/Sources/ContainerController/ContainerControllerDelegate.swift +++ b/Sources/ContainerController/ContainerControllerDelegate.swift @@ -9,30 +9,16 @@ import UIKit @available(iOS 13.0, *) -public protocol ContainerControllerDelegate { +@objc public protocol ContainerControllerDelegate { /// Reports rotation and orientation changes - func containerControllerRotation(_ containerController: ContainerController) + @objc optional func containerControllerRotation(_ containerController: ContainerController) /// Reports a click on the background shadow - func containerControllerShadowClick(_ containerController: ContainerController) + @objc optional func containerControllerShadowClick(_ containerController: ContainerController) /// Reports the changes current position of the container, after its use - func containerControllerMove(_ containerController: ContainerController, position: CGFloat, type: ContainerMoveType, animation: Bool) + @objc optional func containerControllerMove(_ containerController: ContainerController, position: CGFloat, type: ContainerMoveType, animation: Bool) } -@available(iOS 13.0, *) -public extension ContainerControllerDelegate { - - func containerControllerRotation(_ containerController: ContainerController) { - } - - - func containerControllerShadowClick(_ containerController: ContainerController) { - } - - func containerControllerMove(_ containerController: ContainerController, position: CGFloat, type: ContainerMoveType, animation: Bool) { - } -} - diff --git a/Sources/ContainerController/ContainerTypes.swift b/Sources/ContainerController/ContainerTypes.swift index 5dcec02..b253d61 100644 --- a/Sources/ContainerController/ContainerTypes.swift +++ b/Sources/ContainerController/ContainerTypes.swift @@ -10,7 +10,7 @@ import UIKit typealias ContainerCompletion = () -> Void -public enum ContainerMoveType { +@objc public enum ContainerMoveType: Int { case top case middle case bottom From f1fb89f203663fba67d21e19b9807599f5a1a520 Mon Sep 17 00:00:00 2001 From: Alex Marchant Date: Tue, 16 Jan 2024 16:57:30 +0000 Subject: [PATCH 4/4] Fix build error in Example project --- Example/ContainerControllerSwift.xcodeproj/project.pbxproj | 6 +++--- .../ContainerControllerSwift/Maps/MapsViewController.swift | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Example/ContainerControllerSwift.xcodeproj/project.pbxproj b/Example/ContainerControllerSwift.xcodeproj/project.pbxproj index d6fada8..0674811 100644 --- a/Example/ContainerControllerSwift.xcodeproj/project.pbxproj +++ b/Example/ContainerControllerSwift.xcodeproj/project.pbxproj @@ -962,7 +962,7 @@ TargetAttributes = { 607FACCF1AFB9204008FA782 = { CreatedOnToolsVersion = 6.3.1; - DevelopmentTeam = Y7546NLJW9; + DevelopmentTeam = YKFJWH4C9S; LastSwiftMigration = 0900; }; }; @@ -1303,7 +1303,7 @@ baseConfigurationReference = 0AA8BF39B9F182FE833C0178 /* Pods-ContainerControllerSwift_Example.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - DEVELOPMENT_TEAM = Y7546NLJW9; + DEVELOPMENT_TEAM = YKFJWH4C9S; INFOPLIST_FILE = ContainerControllerSwift/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MODULE_NAME = ExampleApp; @@ -1319,7 +1319,7 @@ baseConfigurationReference = 84550121AB9630F101ECE515 /* Pods-ContainerControllerSwift_Example.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - DEVELOPMENT_TEAM = Y7546NLJW9; + DEVELOPMENT_TEAM = YKFJWH4C9S; INFOPLIST_FILE = ContainerControllerSwift/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MODULE_NAME = ExampleApp; diff --git a/Example/ContainerControllerSwift/Maps/MapsViewController.swift b/Example/ContainerControllerSwift/Maps/MapsViewController.swift index 70b38fb..5db69cc 100644 --- a/Example/ContainerControllerSwift/Maps/MapsViewController.swift +++ b/Example/ContainerControllerSwift/Maps/MapsViewController.swift @@ -127,7 +127,7 @@ class MapsViewController: StoryboardController, MapsContainerControllerDelegate, let paddingStatusBar: CGFloat = (ContainerDevice.statusBarHeight + padding) switch ContainerDevice.orientation { - case .portrait: + case .portrait, .portraitUpsideDown: paddingTop = paddingStatusBar paddingRight = padding paddingWeatherTop = padding @@ -146,7 +146,7 @@ class MapsViewController: StoryboardController, MapsContainerControllerDelegate, switch ContainerDevice.orientation { - case .portrait: + case .portrait, .portraitUpsideDown: width = ContainerDevice.screenMin height = ContainerDevice.screenMax case .landscapeLeft,