Skip to content

Commit 6523567

Browse files
Merge pull request #7 from AlexanderMarchant/master
Merge latest source repo changes into our fork
2 parents 66351f6 + f1fb89f commit 6523567

File tree

15 files changed

+150
-47
lines changed

15 files changed

+150
-47
lines changed

Example/ContainerControllerSwift.xcodeproj/project.pbxproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,7 @@
962962
TargetAttributes = {
963963
607FACCF1AFB9204008FA782 = {
964964
CreatedOnToolsVersion = 6.3.1;
965-
DevelopmentTeam = Y7546NLJW9;
965+
DevelopmentTeam = YKFJWH4C9S;
966966
LastSwiftMigration = 0900;
967967
};
968968
};
@@ -1303,7 +1303,7 @@
13031303
baseConfigurationReference = 0AA8BF39B9F182FE833C0178 /* Pods-ContainerControllerSwift_Example.debug.xcconfig */;
13041304
buildSettings = {
13051305
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
1306-
DEVELOPMENT_TEAM = Y7546NLJW9;
1306+
DEVELOPMENT_TEAM = YKFJWH4C9S;
13071307
INFOPLIST_FILE = ContainerControllerSwift/Info.plist;
13081308
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
13091309
MODULE_NAME = ExampleApp;
@@ -1319,7 +1319,7 @@
13191319
baseConfigurationReference = 84550121AB9630F101ECE515 /* Pods-ContainerControllerSwift_Example.release.xcconfig */;
13201320
buildSettings = {
13211321
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
1322-
DEVELOPMENT_TEAM = Y7546NLJW9;
1322+
DEVELOPMENT_TEAM = YKFJWH4C9S;
13231323
INFOPLIST_FILE = ContainerControllerSwift/Info.plist;
13241324
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
13251325
MODULE_NAME = ExampleApp;
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="22505" 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="22504"/>
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.23529411764705882" green="0.23529411764705882" blue="0.2627450980392157" 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: 36 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="22505" 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="22504"/>
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,44 @@
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"/>
19+
<subviews>
20+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="gqJ-oN-JCK">
21+
<rect key="frame" x="110.5" y="50" width="154" height="50"/>
22+
<constraints>
23+
<constraint firstAttribute="height" constant="50" id="MXC-rS-qfY"/>
24+
</constraints>
25+
<fontDescription key="fontDescription" name="HelveticaNeue-Bold" family="Helvetica Neue" pointSize="18"/>
26+
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
27+
<state key="normal" title="isTranslucent true">
28+
<color key="titleColor" systemColor="systemBlueColor"/>
29+
</state>
30+
<connections>
31+
<action selector="btnChangeTranslucentAction:" destination="p3c-kf-PfN" eventType="touchUpInside" id="hjO-rR-Ij1"/>
32+
</connections>
33+
</button>
34+
</subviews>
1835
<viewLayoutGuide key="safeArea" id="QCP-uk-H24"/>
36+
<color key="backgroundColor" systemColor="opaqueSeparatorColor"/>
37+
<constraints>
38+
<constraint firstItem="gqJ-oN-JCK" firstAttribute="top" secondItem="QCP-uk-H24" secondAttribute="top" constant="30" id="2Vg-iw-6Rl"/>
39+
<constraint firstItem="gqJ-oN-JCK" firstAttribute="centerX" secondItem="jmi-Lo-St4" secondAttribute="centerX" id="Crs-BD-puY"/>
40+
</constraints>
1941
</view>
42+
<connections>
43+
<outlet property="btnChangeTranslucent" destination="gqJ-oN-JCK" id="34t-Kh-blv"/>
44+
</connections>
2045
</viewController>
2146
<placeholder placeholderIdentifier="IBFirstResponder" id="Uzt-sR-4xA" sceneMemberID="firstResponder"/>
2247
</objects>
2348
<point key="canvasLocation" x="781.15942028985512" y="43.526785714285715"/>
2449
</scene>
2550
</scenes>
51+
<resources>
52+
<systemColor name="opaqueSeparatorColor">
53+
<color red="0.77647058823529413" green="0.77647058823529413" blue="0.78431372549019607" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
54+
</systemColor>
55+
<systemColor name="systemBlueColor">
56+
<color red="0.0" green="0.47843137254901963" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
57+
</systemColor>
58+
</resources>
2659
</document>

Example/ContainerControllerSwift/ExampleAddCollectionView/ExampleAddCollectionViewController.swift

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,15 @@ class ExampleAddCollectionViewController: StoryboardController {
1313

1414
var container: ContainerController!
1515

16+
@IBOutlet var btnChangeTranslucent: UIButton!
1617
// MARK: - Init
1718

1819
override func viewDidLoad() {
1920
super.viewDidLoad()
2021

22+
title = "Example Add CollectionView"
23+
24+
btnUpdateText()
2125

2226
let layoutC = ContainerLayout()
2327
layoutC.positions = ContainerPosition(top: 100, middle: 250, bottom: 70)
@@ -33,6 +37,24 @@ class ExampleAddCollectionViewController: StoryboardController {
3337
container.move(type: .middle)
3438
}
3539

40+
@IBAction func btnChangeTranslucentAction(_ sender: UIButton) {
41+
42+
guard let translucent = navigationController?.navigationBar.isTranslucent else { return }
43+
44+
navigationController?.navigationBar.isTranslucent = !translucent
45+
46+
btnUpdateText()
47+
48+
container.move(type: container.moveType)
49+
}
50+
51+
func btnUpdateText() {
52+
53+
guard let translucent = navigationController?.navigationBar.isTranslucent else { return }
54+
55+
btnChangeTranslucent.setTitle("NavBar isTranslucent \(translucent)", for: .normal)
56+
}
57+
3658
func addCollectionView() -> UICollectionView {
3759

3860
let layout = UICollectionViewFlowLayout()
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/Container/ExamplesContainerController.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ class ExamplesContainerController: ContainerController, ExampleCellDelegate {
7070
ExampleSwitchCellItem(height: h, delegate: self, type: .shadowBackground, value: false),
7171
ExampleSliderCellItem(height: h, delegate: self, type: .shadowContainer, value: 0.2, maximumValue: 1.0),
7272
ExampleSliderCellItem(height: h, delegate: self, type: .cornerRadius, value: 15, maximumValue: 140),
73+
74+
ExampleSwitchCellItem(height: h, delegate: self, type: .navbarTranslucent, value: false),
75+
7376
ExampleSwitchCellItem(height: h, delegate: self, type: .movingEnabled, value: true),
7477
ExampleSwitchCellItem(height: h, delegate: self, type: .trackingPosition, value: false),
7578
ExampleSliderCellItem(height: h, delegate: self, type: .footerPadding, value: 0, maximumValue: Float(ContainerDevice.screenMax)),
@@ -122,6 +125,8 @@ class ExamplesContainerController: ContainerController, ExampleCellDelegate {
122125

123126
case .shadowContainer: self.view.addShadow(opacity: value)
124127

128+
case .navbarTranslucent: self.controller?.navigationController?.navigationBar.isTranslucent = boolValue; move(type: moveType)
129+
125130
case .movingEnabled: set(movingEnabled: boolValue)
126131

127132
case .trackingPosition: set(trackingPosition: boolValue)

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/ExamplesSettings/UI/Cell/ExampleCellStyle.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ extension ExampleCell {
2020
public enum Style: String {
2121
case `default` = ""
2222
case shadowContainer = "ShadowContainer"
23+
case navbarTranslucent = "NavbarTranslucent"
2324
case movingEnabled = "MovingEnabled"
2425
case cornerRadius = "CornerRadius"
2526
case footerPadding = "FooterView.Padding"

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

0 commit comments

Comments
 (0)