Skip to content

Commit

Permalink
Fix #11: Improved title, details label sizing
Browse files Browse the repository at this point in the history
  • Loading branch information
rahuliyer95 committed Dec 9, 2016
1 parent d011152 commit 47155b8
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Source/iShowcase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,8 @@ import Foundation
}

fileprivate func setupText() {
titleLabel.bounds.size = containerView.bounds.size
detailsLabel.bounds.size = containerView.bounds.size
titleLabel.frame = containerView.frame
detailsLabel.frame = containerView.frame

titleLabel.sizeToFit()
detailsLabel.sizeToFit()
Expand All @@ -374,15 +374,16 @@ import Foundation
? showcaseRect.size.width
: 0),
height: titleLabel.frame.size.height)

titleLabel.sizeToFit()

detailsLabel.frame = CGRect(
x: containerView.bounds.size.width / 2.0 - detailsLabel.frame.size.width / 2.0,
y: detailsLabel.frame.origin.y,
y: detailsLabel.frame.origin.y + titleLabel.frame.size.height / 2,
width: detailsLabel.frame.size.width - (region == .left || region == .right
? showcaseRect.size.width
: 0),
height: detailsLabel.frame.size.height)

detailsLabel.sizeToFit()
}

fileprivate func getBestPositionOfTitle(withTitleSize titleSize: CGSize,
Expand Down

0 comments on commit 47155b8

Please sign in to comment.