Skip to content

Commit 8bff1e5

Browse files
committed
UI edits/corrections - for the new xcode version
1 parent 4f1ca81 commit 8bff1e5

File tree

8 files changed

+93
-28
lines changed

8 files changed

+93
-28
lines changed
Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,35 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="aV9-EX-QWJ">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22155" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="cIu-62-xtU">
33
<device id="retina4_7" orientation="portrait" appearance="light"/>
44
<dependencies>
5-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
5+
<deployment identifier="iOS"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22131"/>
67
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
8+
<capability name="System colors in document resources" minToolsVersion="11.0"/>
79
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
810
</dependencies>
911
<scenes>
1012
<!--View Controller-->
1113
<scene sceneID="tne-QT-ifu">
1214
<objects>
13-
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="ContainerControllerSwift_Example" customModuleProvider="target" sceneMemberID="viewController">
15+
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="ContainerController" customModuleProvider="target" sceneMemberID="viewController">
1416
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
15-
<rect key="frame" x="0.0" y="0.0" width="375" height="623"/>
17+
<rect key="frame" x="0.0" y="0.0" width="375" height="603"/>
1618
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
1719
<subviews>
1820
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="UYm-tY-WGa" customClass="TableAdapterView" customModule="ContainerControllerSwift">
19-
<rect key="frame" x="0.0" y="0.0" width="375" height="623"/>
20-
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
21+
<rect key="frame" x="0.0" y="0.0" width="375" height="603"/>
22+
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
2123
</tableView>
2224
</subviews>
23-
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
25+
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
26+
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
2427
<constraints>
2528
<constraint firstItem="6Tk-OE-BBY" firstAttribute="bottom" secondItem="UYm-tY-WGa" secondAttribute="bottom" id="Usw-ep-vba"/>
2629
<constraint firstItem="UYm-tY-WGa" firstAttribute="top" secondItem="6Tk-OE-BBY" secondAttribute="top" id="qmS-hQ-rSa"/>
2730
<constraint firstItem="6Tk-OE-BBY" firstAttribute="trailing" secondItem="UYm-tY-WGa" secondAttribute="trailing" id="vQK-T0-eQf"/>
2831
<constraint firstItem="UYm-tY-WGa" firstAttribute="leading" secondItem="6Tk-OE-BBY" secondAttribute="leading" id="wXp-OO-MUn"/>
2932
</constraints>
30-
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
3133
</view>
3234
<navigationItem key="navigationItem" id="x48-lm-dG7"/>
3335
<connections>
@@ -39,20 +41,31 @@
3941
<point key="canvasLocation" x="132" y="137.18140929535232"/>
4042
</scene>
4143
<!--Navigation Controller-->
42-
<scene sceneID="2WA-6t-2aK">
44+
<scene sceneID="jWl-Kd-Y9J">
4345
<objects>
44-
<navigationController id="aV9-EX-QWJ" sceneMemberID="viewController">
45-
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" translucent="NO" id="QWK-gZ-mYK">
46-
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
46+
<navigationController id="cIu-62-xtU" sceneMemberID="viewController">
47+
<navigationBar key="navigationBar" contentMode="scaleToFill" translucent="NO" id="y83-TR-htY">
48+
<rect key="frame" x="0.0" y="20" width="375" height="44"/>
4749
<autoresizingMask key="autoresizingMask"/>
50+
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
51+
<color key="barTintColor" systemColor="secondaryLabelColor"/>
52+
<navigationBarAppearance key="compactAppearance"/>
4853
</navigationBar>
4954
<connections>
50-
<segue destination="BYZ-38-t0r" kind="relationship" relationship="rootViewController" id="SPa-ED-zkK"/>
55+
<segue destination="BYZ-38-t0r" kind="relationship" relationship="rootViewController" id="Lpq-ZC-BiY"/>
5156
</connections>
5257
</navigationController>
53-
<placeholder placeholderIdentifier="IBFirstResponder" id="Uhq-S7-WHN" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
58+
<placeholder placeholderIdentifier="IBFirstResponder" id="bJL-5a-VyA" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
5459
</objects>
55-
<point key="canvasLocation" x="-631" y="137"/>
60+
<point key="canvasLocation" x="-855" y="137"/>
5661
</scene>
5762
</scenes>
63+
<resources>
64+
<systemColor name="secondaryLabelColor">
65+
<color red="0.23529411759999999" green="0.23529411759999999" blue="0.26274509800000001" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
66+
</systemColor>
67+
<systemColor name="systemBackgroundColor">
68+
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
69+
</systemColor>
70+
</resources>
5871
</document>
Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22155" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
33
<device id="retina4_7" orientation="portrait" appearance="light"/>
44
<dependencies>
5-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
5+
<deployment identifier="iOS"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22131"/>
67
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
8+
<capability name="System colors in document resources" minToolsVersion="11.0"/>
79
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
810
</dependencies>
911
<scenes>
@@ -14,13 +16,18 @@
1416
<view key="view" contentMode="scaleToFill" id="jmi-Lo-St4">
1517
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
1618
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
17-
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
1819
<viewLayoutGuide key="safeArea" id="QCP-uk-H24"/>
20+
<color key="backgroundColor" systemColor="opaqueSeparatorColor"/>
1921
</view>
2022
</viewController>
2123
<placeholder placeholderIdentifier="IBFirstResponder" id="Uzt-sR-4xA" sceneMemberID="firstResponder"/>
2224
</objects>
2325
<point key="canvasLocation" x="781.15942028985512" y="43.526785714285715"/>
2426
</scene>
2527
</scenes>
28+
<resources>
29+
<systemColor name="opaqueSeparatorColor">
30+
<color red="0.77647058820000003" green="0.77647058820000003" blue="0.7843137255" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
31+
</systemColor>
32+
</resources>
2633
</document>

Example/ContainerControllerSwift/ExampleAddCollectionView/ExampleAddCollectionViewController.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class ExampleAddCollectionViewController: StoryboardController {
1818
override func viewDidLoad() {
1919
super.viewDidLoad()
2020

21+
title = "Example Add CollectionView"
2122

2223
let layoutC = ContainerLayout()
2324
layoutC.positions = ContainerPosition(top: 100, middle: 250, bottom: 70)
Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22155" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
33
<device id="retina4_7" orientation="portrait" appearance="light"/>
44
<dependencies>
5-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
5+
<deployment identifier="iOS"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22131"/>
67
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
8+
<capability name="System colors in document resources" minToolsVersion="11.0"/>
79
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
810
</dependencies>
911
<scenes>
@@ -14,13 +16,18 @@
1416
<view key="view" contentMode="scaleToFill" id="jmi-Lo-St4">
1517
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
1618
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
17-
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
1819
<viewLayoutGuide key="safeArea" id="QCP-uk-H24"/>
20+
<color key="backgroundColor" systemColor="opaqueSeparatorColor"/>
1921
</view>
2022
</viewController>
2123
<placeholder placeholderIdentifier="IBFirstResponder" id="Uzt-sR-4xA" sceneMemberID="firstResponder"/>
2224
</objects>
2325
<point key="canvasLocation" x="781.15942028985512" y="43.526785714285715"/>
2426
</scene>
2527
</scenes>
28+
<resources>
29+
<systemColor name="opaqueSeparatorColor">
30+
<color red="0.77647058820000003" green="0.77647058820000003" blue="0.7843137255" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
31+
</systemColor>
32+
</resources>
2633
</document>

Example/ContainerControllerSwift/ExamplesAddTableView/ExampleAddTableViewController.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ class ExampleAddTableViewController: StoryboardController {
1818
override func viewDidLoad() {
1919
super.viewDidLoad()
2020

21+
title = "Example Add TableView"
22+
2123
let layout = ContainerLayout()
2224
layout.backgroundShadowShow = true
2325
layout.positions = ContainerPosition(top: 70, middle: 250, bottom: 100)

Example/ContainerControllerSwift/ExamplesSettings/ExamplesSettingsViewController.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ class ExamplesSettingsViewController: StoryboardController {
1919
override func viewDidLoad() {
2020
super.viewDidLoad()
2121

22+
title = "Example Add/Settings Container"
23+
2224
let barButtonAddItem = UIBarButtonItem(barButtonSystemItem: .add, target: self, action: #selector(navigationBarAddAction))
2325
let barButtonCloseItem = UIBarButtonItem(barButtonSystemItem: .close, target: self, action: #selector(navigationBarCloseAction))
2426
self.navigationItem.rightBarButtonItems = [ barButtonAddItem, barButtonCloseItem ]

Example/ContainerControllerSwift/Maps/MapManager/MapViewManager.swift

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,16 @@ class MapViewManager: NSObject {
4444
// MARK: - Location Manager
4545

4646
func loadLocation() {
47-
48-
if CLLocationManager.locationServicesEnabled() {
49-
locationManager = CLLocationManager()
50-
locationManager?.delegate = self
51-
locationManager?.desiredAccuracy = kCLLocationAccuracyBest
52-
locationManager?.requestAlwaysAuthorization()
53-
locationManager?.startUpdatingLocation()
47+
DispatchQueue.global().async {
48+
if CLLocationManager.locationServicesEnabled() {
49+
DispatchQueue.main.async {
50+
self.locationManager = CLLocationManager()
51+
self.locationManager?.delegate = self
52+
self.locationManager?.desiredAccuracy = kCLLocationAccuracyBest
53+
self.locationManager?.requestAlwaysAuthorization()
54+
self.locationManager?.startUpdatingLocation()
55+
}
56+
}
5457
}
5558
}
5659

Example/ContainerControllerSwift/ViewController.swift

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ class ViewController: UIViewController {
1717
override func viewDidLoad() {
1818
super.viewDidLoad()
1919

20+
configureNavigationBar(largeTitleColor: .label, backgoundColor: .systemGroupedBackground, tintColor: .systemBlue, title: "ContainerController", preferredLargeTitle: false)
21+
2022
title = "ContainerController"
2123

2224
navigationController?.interactivePopGestureRecognizer?.delegate = self
@@ -46,6 +48,34 @@ class ViewController: UIViewController {
4648

4749
}
4850

51+
extension ViewController {
52+
func configureNavigationBar(largeTitleColor: UIColor, backgoundColor: UIColor, tintColor: UIColor, title: String, preferredLargeTitle: Bool) {
53+
if #available(iOS 13.0, *) {
54+
let navBarAppearance = UINavigationBarAppearance()
55+
navBarAppearance.configureWithOpaqueBackground()
56+
navBarAppearance.largeTitleTextAttributes = [.foregroundColor: largeTitleColor]
57+
navBarAppearance.titleTextAttributes = [.foregroundColor: largeTitleColor]
58+
navBarAppearance.backgroundColor = backgoundColor
59+
60+
navigationController?.navigationBar.standardAppearance = navBarAppearance
61+
navigationController?.navigationBar.compactAppearance = navBarAppearance
62+
navigationController?.navigationBar.scrollEdgeAppearance = navBarAppearance
63+
64+
navigationController?.navigationBar.prefersLargeTitles = preferredLargeTitle
65+
navigationController?.navigationBar.isTranslucent = false
66+
navigationController?.navigationBar.tintColor = tintColor
67+
navigationItem.title = title
68+
69+
} else {
70+
// Fallback on earlier versions
71+
navigationController?.navigationBar.barTintColor = backgoundColor
72+
navigationController?.navigationBar.tintColor = tintColor
73+
navigationController?.navigationBar.isTranslucent = false
74+
navigationItem.title = title
75+
}
76+
}
77+
}
78+
4979
extension ViewController: UIGestureRecognizerDelegate {
5080

5181
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldBeRequiredToFailBy otherGestureRecognizer: UIGestureRecognizer) -> Bool {

0 commit comments

Comments
 (0)