Skip to content

Commit

Permalink
Fix word overbounds (closes #16)
Browse files Browse the repository at this point in the history
  • Loading branch information
serejahh committed Jan 17, 2017
1 parent 51f0891 commit 8a21e29
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 27 deletions.
2 changes: 1 addition & 1 deletion Segmentio.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = "Segmentio"
spec.version = "2.1.1"
spec.version = "2.1.2"

spec.homepage = "https://github.com/Yalantis/Segmentio"
spec.summary = "Animated top/bottom segmented control written in Swift!"
Expand Down
57 changes: 31 additions & 26 deletions Segmentio/Source/Cells/SegmentioCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -173,38 +173,43 @@ class SegmentioCell: UICollectionViewCell {
// MARK: - Private functions

fileprivate func setupContainerConstraints() {
guard let segmentTitleLabel = segmentTitleLabel else {
return
}
guard let containerView = containerView else {
guard let segmentTitleLabel = segmentTitleLabel, let containerView = containerView else {
return
}

let segmentTitleLabelHorizontalCenterConstraint =
NSLayoutConstraint(
item: segmentTitleLabel,
attribute: .centerX,
relatedBy: .equal,
toItem: containerView,
attribute: .centerX,
multiplier: 1,
constant: 0
let segmentTitleLabelVerticalCenterConstraint = NSLayoutConstraint(
item: segmentTitleLabel,
attribute: .centerY,
relatedBy: .equal,
toItem: containerView,
attribute: .centerY,
multiplier: 1,
constant: 0
)

let segmentTitleLabelVerticalCenterConstraint =
NSLayoutConstraint(
item: segmentTitleLabel,
attribute: .centerY,
relatedBy: .equal,
toItem: containerView,
attribute: .centerY,
multiplier: 1,
constant: 0
let segmentTitleLabelTrailingConstraint = NSLayoutConstraint(
item: segmentTitleLabel,
attribute: .trailing,
relatedBy: .equal,
toItem: containerView,
attribute: .trailingMargin,
multiplier: 1.0,
constant: 0
)
let segmentTitleLabelLeadingConstraint = NSLayoutConstraint(
item: segmentTitleLabel,
attribute: .leading,
relatedBy: .equal,
toItem: containerView,
attribute: .leadingMargin,
multiplier: 1.0,
constant: 0
)

addConstraints([
segmentTitleLabelHorizontalCenterConstraint,
segmentTitleLabelVerticalCenterConstraint
])
segmentTitleLabelTrailingConstraint,
segmentTitleLabelVerticalCenterConstraint,
segmentTitleLabelLeadingConstraint
])
}

fileprivate func setupImageContainerConstraints() {
Expand Down

0 comments on commit 8a21e29

Please sign in to comment.