Skip to content

Commit 5a694d1

Browse files
author
Luc Dion
authored
Merge pull request #73 from mirego/rename_sizeToFit_to_fitSize
Rename sizeToFit to fitSize
2 parents 1093448 + 5839807 commit 5a694d1

26 files changed

+412
-302
lines changed

Example/PinLayoutSample/UI/Common/BaseFormView.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,19 @@ class BaseFormView: BaseView {
6161
formScrollView.contentOffset = CGPoint(x: 0, y: topLayoutGuide)
6262
}
6363

64-
@objc internal func keyboardWillShow(notification: Notification) {
64+
@objc
65+
internal func keyboardWillShow(notification: Notification) {
6566
guard let sizeValue = notification.userInfo?[UIKeyboardFrameEndUserInfoKey] as? NSValue else { return }
6667
setFormScrollView(bottomInset: sizeValue.cgRectValue.height)
6768
}
6869

69-
@objc internal func keyboardWillHide(notification: Notification) {
70+
@objc
71+
internal func keyboardWillHide(notification: Notification) {
7072
resetScrollOffset()
7173
}
7274

73-
@objc internal func didTapScrollView() {
75+
@objc
76+
internal func didTapScrollView() {
7477
endEditing(true)
7578
resetScrollOffset()
7679
}

Example/PinLayoutSample/UI/Common/BasicView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class BasicView: UIView {
5151
override func layoutSubviews() {
5252
super.layoutSubviews()
5353

54-
label.pin.topLeft().right().margin(4).sizeToFit()
54+
label.pin.topLeft().right().margin(4).fitSize()
5555
}
5656

5757
var sizeThatFitsExpectedArea: CGFloat = 40 * 40

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ class AdjustToContainerView: BaseView {
4949
override func layoutSubviews() {
5050
super.layoutSubviews()
5151

52-
languageSelectorView.pin.top(topLayoutGuide).left().right().sizeToFit()
53-
swiftOpinionSelectorView.pin.below(of: languageSelectorView, aligned: .left).right().marginTop(10).sizeToFit()
54-
swiftUsageSelectorView.pin.below(of: swiftOpinionSelectorView, aligned: .left).right().marginTop(10).sizeToFit()
52+
languageSelectorView.pin.top(topLayoutGuide).left().right().fitSize()
53+
swiftOpinionSelectorView.pin.below(of: languageSelectorView, aligned: .left).right().marginTop(10).fitSize()
54+
swiftUsageSelectorView.pin.below(of: swiftOpinionSelectorView, aligned: .left).right().marginTop(10).fitSize()
5555
}
5656
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ class ChoiceSelectorView: UIView {
6868
if frame.width > 500 {
6969
// The UISegmentedControl is at the top-right corner and the label takes the remaining horizontal space.
7070
segmentedControl.pin.topRight().margin(margin)
71-
textLabel.pin.top().left().left(of: segmentedControl).margin(margin).sizeToFit()
71+
textLabel.pin.top().left().left(of: segmentedControl).margin(margin).fitSize()
7272
} else {
7373
// The UISegmentedControl is placed below the label.
74-
textLabel.pin.top().left().right().margin(margin).sizeToFit()
74+
textLabel.pin.top().left().right().margin(margin).fitSize()
7575
segmentedControl.pin.below(of: textLabel).right().margin(margin)
7676
}
7777

Example/PinLayoutSample/UI/Tests/Form/FormView.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ class FormView: BaseFormView {
110110
formScrollView.contentSize = formContainerView.frame.size
111111
}
112112

113-
@objc internal func didChangeAgeSwitch(uiSwitch: UISwitch) {
113+
@objc
114+
internal func didChangeAgeSwitch(uiSwitch: UISwitch) {
114115
// Animate the appearance/disapearance of the age UITextField
115116
UIView.animate(withDuration: 0.2) {
116117
self.ageField.alpha = uiSwitch.isOn ? 1 : 0

Example/PinLayoutSample/UI/Tests/Intro/IntroView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class IntroView: BaseView {
6666

6767
logo.pin.top().left().size(100).margin(topLayoutGuide + 10, 10, 10)
6868
segmented.pin.right(of: logo, aligned: .top).right().marginHorizontal(10)
69-
textLabel.pin.below(of: segmented, aligned: .left).width(of: segmented).pinEdges().marginTop(10).sizeToFit()
69+
textLabel.pin.below(of: segmented, aligned: .left).width(of: segmented).pinEdges().marginTop(10).fitSize()
7070
separatorView.pin.below(of: [logo, textLabel], aligned: .left).right(to: segmented.edge.right).marginTop(10)
7171
}
7272
}

Example/PinLayoutSample/UI/Tests/IntroRTL/IntroRTLView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class IntroRTLView: BaseView {
7171

7272
logo.pin.top().start().size(100).margin(topLayoutGuide + 10, 10, 10, 10)
7373
segmented.pin.after(of: logo, aligned: .top).end().marginHorizontal(10)
74-
textLabel.pin.below(of: segmented, aligned: .start).width(of: segmented).pinEdges().marginTop(10).sizeToFit()
74+
textLabel.pin.below(of: segmented, aligned: .start).width(of: segmented).pinEdges().marginTop(10).fitSize()
7575
separatorView.pin.below(of: [logo, textLabel], aligned: .start).end(to: segmented.edge.end).marginTop(10)
7676
}
7777
}

Example/PinLayoutSample/UI/Tests/TableViewExample/Cells/MethodCell.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ class MethodCell: UITableViewCell {
4747
let margin: CGFloat = 10
4848

4949
iconImageView.pin.topLeft().size(30).margin(margin)
50-
nameLabel.pin.right(of: iconImageView, aligned: .center).right().marginHorizontal(margin).sizeToFit()
51-
descriptionLabel.pin.below(of: [iconImageView, nameLabel]).left().right().margin(margin).sizeToFit()
50+
nameLabel.pin.right(of: iconImageView, aligned: .center).right().marginHorizontal(margin).fitSize()
51+
descriptionLabel.pin.below(of: [iconImageView, nameLabel]).left().right().margin(margin).fitSize()
5252

5353
return CGSize(width: frame.width, height: descriptionLabel.frame.maxY + margin)
5454
}

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
source 'https://rubygems.org'
22
gem 'synx'
33
gem 'cocoapods', '~> 1.2.1'
4+
gem 'jazzy'

Gemfile.lock

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,23 +45,49 @@ GEM
4545
colored2 (3.1.2)
4646
colorize (0.8.1)
4747
escape (0.0.4)
48+
ffi (1.9.18)
4849
fourflusher (2.0.1)
4950
fuzzy_match (2.0.4)
5051
gh_inspector (1.0.3)
5152
i18n (0.8.6)
53+
jazzy (0.8.3)
54+
cocoapods (~> 1.0)
55+
mustache (~> 0.99)
56+
open4
57+
redcarpet (~> 3.2)
58+
rouge (~> 1.5)
59+
sass (~> 3.4)
60+
sqlite3 (~> 1.3)
61+
xcinvoke (~> 0.3.0)
62+
liferaft (0.0.6)
5263
minitest (5.10.2)
5364
molinillo (0.5.7)
65+
mustache (0.99.8)
5466
nanaimo (0.2.3)
5567
nap (1.1.0)
5668
netrc (0.7.8)
69+
open4 (1.3.4)
70+
rb-fsevent (0.10.2)
71+
rb-inotify (0.9.10)
72+
ffi (>= 0.5.0, < 2)
73+
redcarpet (3.4.0)
74+
rouge (1.11.1)
5775
ruby-macho (1.1.0)
76+
sass (3.5.1)
77+
sass-listen (~> 4.0.0)
78+
sass-listen (4.0.0)
79+
rb-fsevent (~> 0.9, >= 0.9.4)
80+
rb-inotify (~> 0.9, >= 0.9.7)
81+
sqlite3 (1.3.13)
5882
synx (0.2.1)
5983
clamp (~> 0.6)
6084
colorize (~> 0.7)
6185
xcodeproj (~> 1.0)
6286
thread_safe (0.3.6)
6387
tzinfo (1.2.3)
6488
thread_safe (~> 0.1)
89+
xcinvoke (0.3.0)
90+
liferaft (~> 0.0.6)
6591
xcodeproj (1.5.0)
6692
CFPropertyList (~> 2.3.3)
6793
claide (>= 1.0.2, < 2.0)
@@ -73,7 +99,8 @@ PLATFORMS
7399

74100
DEPENDENCIES
75101
cocoapods (~> 1.2.1)
102+
jazzy
76103
synx
77104

78105
BUNDLED WITH
79-
1.13.1
106+
1.13.6

0 commit comments

Comments
 (0)