Skip to content

Commit 181b5eb

Browse files
authored
Merge branch 'master' into feature/sizeToFit
2 parents e8ef432 + 5c6097b commit 181b5eb

36 files changed

+212
-151
lines changed

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,8 @@ fastlane/report.xml
1414
fastlane/test_output
1515

1616
TestProjects/cocoapods/ios/PinLayout-iOS.xcworkspace/
17-
TestProjects/cocoapods/ios/Podfile.lock
1817
TestProjects/cocoapods/macos/PinLayout-macOS.xcworkspace/
19-
TestProjects/cocoapods/macos/Podfile.lock
2018
TestProjects/cocoapods/tvos/PinLayout-tvOS.xcworkspace/
21-
TestProjects/cocoapods/tvos/Podfile.lock
2219

2320
TestProjects/carthage/ios/Cartfile.resolved
2421
TestProjects/carthage/ios/Carthage/

.swiftlint.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ disabled_rules: # rule identifiers to exclude from running
2121
- identifier_name
2222
- line_length
2323
- empty_count
24+
- todo
25+
- private_over_fileprivate
2426

2527
excluded: # paths to ignore during linting. overridden by `included`.
2628
- Pods
29+
- Example/PinLayoutExampleMacOS
30+
- TestProjects

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@
77

88
# Change Log
99

10+
## [1.8.4](https://github.com/layoutBox/PinLayout/releases/tag/1.8.4)
11+
Released on 2018-09-25
12+
13+
#### Minor changes
14+
15+
* Cleanup .xcodeproj
16+
* Removed Swiftlint warnings
17+
* Fix an issue with PinLayoutSample app related to IntroRTLView example
18+
19+
* Added by [Luc Dion](https://github.com/lucdion) in Pull Request [#177](https://github.com/layoutBox/PinLayout/pull/177)
20+
1021
## [1.8.3](https://github.com/layoutBox/PinLayout/releases/tag/1.8.3)
1122
Released on 2018-08-28
1223

Example/PinLayoutSample.xcodeproj/project.pbxproj

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -104,20 +104,6 @@
104104
remoteInfo = "PinLayoutTests-tvOS";
105105
};
106106
/* End PBXContainerItemProxy section */
107-
108-
/* Begin PBXCopyFilesBuildPhase section */
109-
2468130D1F8D013600462E53 /* Embed App Extensions */ = {
110-
isa = PBXCopyFilesBuildPhase;
111-
buildActionMask = 2147483647;
112-
dstPath = "";
113-
dstSubfolderSpec = 13;
114-
files = (
115-
);
116-
name = "Embed App Extensions";
117-
runOnlyForDeploymentPostprocessing = 0;
118-
};
119-
/* End PBXCopyFilesBuildPhase section */
120-
121107
/* Begin PBXFileReference section */
122108
241637701F8E4BC200EE703A /* IntroObjectiveCViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntroObjectiveCViewController.h; sourceTree = "<group>"; };
123109
241637711F8E4BC200EE703A /* IntroObjectiveCViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IntroObjectiveCViewController.m; sourceTree = "<group>"; };
@@ -499,9 +485,8 @@
499485
249EFE3B1E64FAFE00165E39 /* Sources */,
500486
249EFE3C1E64FAFE00165E39 /* Frameworks */,
501487
249EFE3D1E64FAFE00165E39 /* Resources */,
502-
5D3C4568AFC08267110D9971 /* [CP] Embed Pods Frameworks */,
503488
24E6547E1E68F88D00A72A8B /* Run Swiftlint */,
504-
2468130D1F8D013600462E53 /* Embed App Extensions */,
489+
A57F7C48B21998F5C851B138 /* [CP] Embed Pods Frameworks */,
505490
);
506491
buildRules = (
507492
);
@@ -624,15 +609,15 @@
624609
shellPath = /bin/sh;
625610
shellScript = ../Pods/SwiftLint/swiftlint;
626611
};
627-
5D3C4568AFC08267110D9971 /* [CP] Embed Pods Frameworks */ = {
612+
A57F7C48B21998F5C851B138 /* [CP] Embed Pods Frameworks */ = {
628613
isa = PBXShellScriptBuildPhase;
629614
buildActionMask = 2147483647;
630615
files = (
631616
);
632617
inputPaths = (
633618
"${SRCROOT}/../Pods/Target Support Files/Pods-PinLayoutSample/Pods-PinLayoutSample-frameworks.sh",
634619
"${BUILT_PRODUCTS_DIR}/PinLayout/PinLayout.framework",
635-
"${PODS_ROOT}/Reveal-SDK/RevealServer-17/iOS/RevealServer.framework",
620+
"${PODS_ROOT}/Reveal-SDK/RevealServer-18/iOS/RevealServer.framework",
636621
);
637622
name = "[CP] Embed Pods Frameworks";
638623
outputPaths = (
@@ -848,6 +833,7 @@
848833
isa = XCBuildConfiguration;
849834
baseConfigurationReference = A35A00E6536E49A548E763E6 /* Pods-PinLayoutSample.debug.xcconfig */;
850835
buildSettings = {
836+
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)";
851837
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
852838
CODE_SIGN_IDENTITY = "iPhone Developer";
853839
DEVELOPMENT_TEAM = "";
@@ -865,6 +851,7 @@
865851
isa = XCBuildConfiguration;
866852
baseConfigurationReference = C589624E868FCB20F7C10918 /* Pods-PinLayoutSample.release.xcconfig */;
867853
buildSettings = {
854+
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)";
868855
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
869856
CODE_SIGN_IDENTITY = "iPhone Developer";
870857
DEVELOPMENT_TEAM = "";

Example/PinLayoutSample/UI/Common/BaseFormView.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ import PinLayout
2222

2323
class BaseFormView: UIView {
2424
let formScrollView = UIScrollView()
25-
25+
2626
init() {
2727
super.init(frame: .zero)
28-
28+
2929
formScrollView.showsVerticalScrollIndicator = false
3030
formScrollView.keyboardDismissMode = .onDrag
3131

@@ -35,7 +35,7 @@ class BaseFormView: UIView {
3535
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillShow), name: .UIKeyboardWillShow, object: nil)
3636
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillHide), name: .UIKeyboardWillHide, object: nil)
3737
}
38-
38+
3939
required init(coder aDecoder: NSCoder) {
4040
fatalError("init(coder:) has not been implemented")
4141
}
@@ -46,7 +46,7 @@ class BaseFormView: UIView {
4646

4747
override func layoutSubviews() {
4848
super.layoutSubviews()
49-
49+
5050
formScrollView.pin.all()
5151
}
5252

@@ -55,23 +55,23 @@ class BaseFormView: UIView {
5555
guard let sizeValue = notification.userInfo?[UIKeyboardFrameEndUserInfoKey] as? NSValue else { return }
5656
setFormScrollView(bottomInset: sizeValue.cgRectValue.height)
5757
}
58-
58+
5959
@objc
6060
internal func keyboardWillHide(notification: Notification) {
6161
resetScrollOffset()
6262
}
63-
63+
6464
@objc
6565
internal func didTapScrollView() {
6666
endEditing(true)
6767
resetScrollOffset()
6868
}
69-
69+
7070
private func resetScrollOffset() {
7171
guard formScrollView.contentInset != .zero else { return }
7272
setFormScrollView(bottomInset: 0)
7373
}
74-
74+
7575
private func setFormScrollView(bottomInset: CGFloat) {
7676
formScrollView.contentInset = UIEdgeInsets(top: formScrollView.contentInset.top, left: 0,
7777
bottom: bottomInset, right: 0)

Example/PinLayoutSample/UI/Common/BasicView.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ import UIKit
2121

2222
class BasicView: UIView {
2323
private let label = UILabel()
24-
24+
2525
init(text: String? = nil, color: UIColor) {
2626
super.init(frame: .zero)
2727

2828
backgroundColor = color
2929
layer.borderWidth = 1
3030
layer.borderColor = UIColor.lightGray.cgColor
31-
31+
3232
label.text = text
3333
label.font = .systemFont(ofSize: 7)
3434
label.textColor = .white
@@ -39,16 +39,16 @@ class BasicView: UIView {
3939
required init?(coder aDecoder: NSCoder) {
4040
fatalError("init(coder:) has not been implemented")
4141
}
42-
42+
4343
override func layoutSubviews() {
4444
super.layoutSubviews()
45-
45+
4646
label.pin.top().horizontally().margin(4).sizeToFit(.width)
4747
}
48-
48+
4949
var sizeThatFitsExpectedArea: CGFloat = 40 * 40
5050
var sizeThatFitSizeOffset: CGFloat = 0
51-
51+
5252
override func sizeThatFits(_ size: CGSize) -> CGSize {
5353
var newSize = CGSize()
5454
if size.width != CGFloat.greatestFiniteMagnitude && size.height != CGFloat.greatestFiniteMagnitude {
@@ -64,7 +64,7 @@ class BasicView: UIView {
6464
newSize.width = 40
6565
newSize.height = sizeThatFitsExpectedArea / newSize.width
6666
}
67-
67+
6868
return newSize
6969
}
7070
}

Example/PinLayoutSample/UI/Common/Stylesheet.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020
import UIKit
2121

2222
extension UIColor {
23-
class var pinLayoutColor: UIColor { return UIColor(red: 90.0 / 255.0, green: 171.0 / 255.0, blue: 243.0 / 255.0, alpha: 1.0) }
24-
class var lightColor: UIColor { return UIColor(red: 230.0 / 255.0, green: 240.0 / 255.0, blue: 255.0 / 255.0, alpha: 1.0) }
23+
class var pinLayoutColor: UIColor {
24+
return UIColor(red: 90.0 / 255.0, green: 171.0 / 255.0, blue: 243.0 / 255.0, alpha: 1.0)
25+
}
26+
27+
class var lightColor: UIColor {
28+
return UIColor(red: 230.0 / 255.0, green: 240.0 / 255.0, blue: 255.0 / 255.0, alpha: 1.0)
29+
}
2530
}

Example/PinLayoutSample/UI/Examples/AdjustToContainer/AdjustToContainerView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class AdjustToContainerView: UIView {
4040

4141
override func layoutSubviews() {
4242
super.layoutSubviews()
43-
43+
4444
languageSelectorView.pin.top(pin.safeArea).horizontally(pin.safeArea).sizeToFit(.width)
4545
swiftOpinionSelector.pin.below(of: languageSelectorView).horizontally(pin.safeArea).marginTop(10).sizeToFit(.width)
4646
swiftUsageSelector.pin.below(of: swiftOpinionSelector).horizontally(pin.safeArea).marginTop(10).sizeToFit(.width)

Example/PinLayoutSample/UI/Examples/AdjustToContainer/AdjustToContainerViewController.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ class AdjustToContainerViewController: UIViewController {
2626

2727
init(pageType: PageType) {
2828
super.init(nibName: nil, bundle: nil)
29-
29+
3030
title = pageType.title
3131
}
32-
32+
3333
required init?(coder aDecoder: NSCoder) {
3434
super.init(coder: aDecoder)
3535
}
36-
36+
3737
override func loadView() {
3838
view = AdjustToContainerView()
3939
}

Example/PinLayoutSample/UI/Examples/AdjustToContainer/Subviews/ChoiceSelectorView.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class ChoiceSelectorView: UIView {
2424

2525
private let textLabel = UILabel()
2626
private let segmentedControl = UISegmentedControl()
27-
27+
2828
init(text: String, choices: [String]) {
2929
super.init(frame: .zero)
3030

@@ -33,33 +33,33 @@ class ChoiceSelectorView: UIView {
3333
textLabel.numberOfLines = 0
3434
textLabel.lineBreakMode = .byWordWrapping
3535
addSubview(textLabel)
36-
36+
3737
choices.forEach({ segmentedControl.insertSegment(withTitle: $0, at: segmentedControl.numberOfSegments, animated: false) })
3838
segmentedControl.tintColor = .pinLayoutColor
3939
segmentedControl.sizeToFit()
4040
addSubview(segmentedControl)
4141
}
42-
42+
4343
required init?(coder aDecoder: NSCoder) {
4444
fatalError("init(coder:) has not been implemented")
4545
}
46-
46+
4747
override func layoutSubviews() {
4848
super.layoutSubviews()
4949
_ = layout()
5050
}
51-
51+
5252
override func sizeThatFits(_ size: CGSize) -> CGSize {
5353
// 1) Set the width to the specified width
5454
self.pin.width(size.width)
55-
55+
5656
// 2) Layout the contentView's controls
5757
return layout()
5858
}
59-
59+
6060
private func layout() -> CGSize {
6161
let margin: CGFloat = 12
62-
62+
6363
if frame.width > 500 {
6464
// The UISegmentedControl is at the top-right corner and the label takes the remaining horizontal space.
6565
segmentedControl.pin.top().right().margin(margin)
@@ -69,7 +69,7 @@ class ChoiceSelectorView: UIView {
6969
textLabel.pin.top().horizontally().margin(margin).sizeToFit(.width)
7070
segmentedControl.pin.below(of: textLabel).right().margin(margin)
7171
}
72-
72+
7373
return CGSize(width: frame.width, height: max(textLabel.frame.maxY, segmentedControl.frame.maxY) + margin)
7474
}
7575
}

0 commit comments

Comments
 (0)