Skip to content

Commit

Permalink
Adds some publicity
Browse files Browse the repository at this point in the history
  • Loading branch information
RamonGilabert authored and Ramon Gilabert Llop committed Nov 25, 2015
1 parent 33b66a0 commit 7b3a27a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
Binary file not shown.
14 changes: 12 additions & 2 deletions Source/WhisperFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ class WhisperFactory: NSObject {
self.whisperView.frame.size.height = WhisperView.Dimensions.height
for subview in self.whisperView.transformViews {
subview.frame.origin.y = 0

if subview == self.whisperView.complementImageView {
subview.frame.origin.y = (WhisperView.Dimensions.height - WhisperView.Dimensions.imageSize) / 2
}

subview.alpha = 1
}
})
Expand All @@ -111,6 +116,11 @@ class WhisperFactory: NSObject {
self.whisperView.frame.size.height = WhisperView.Dimensions.height
for subview in self.whisperView.transformViews {
subview.frame.origin.y = 0

if subview == self.whisperView.complementImageView {
subview.frame.origin.y = (WhisperView.Dimensions.height - WhisperView.Dimensions.imageSize) / 2
}

subview.alpha = 1
}
}, completion: { _ in
Expand Down Expand Up @@ -191,8 +201,8 @@ class WhisperFactory: NSObject {
edgeInsetHeight = down ? WhisperView.Dimensions.height : -WhisperView.Dimensions.height

UIView.animateWithDuration(AnimationTiming.movement, animations: {
self.performControllerMove(visibleController)
})
self.performControllerMove(visibleController)
})
}

func performControllerMove(viewController: UIViewController) {
Expand Down
8 changes: 4 additions & 4 deletions Source/WhisperView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class WhisperView: UIView {

lazy private(set) var transformViews: [UIView] = [self.titleLabel, self.complementImageView]

lazy var titleLabel: UILabel = {
public lazy var titleLabel: UILabel = {
let label = UILabel()
label.textAlignment = .Center
label.textColor = UIColor.whiteColor()
Expand Down Expand Up @@ -60,6 +60,7 @@ public class WhisperView: UIView {

titleLabel.sizeToFit()
setupFrames()
clipsToBounds = true
}

public required init?(coder aDecoder: NSCoder) {
Expand All @@ -80,11 +81,10 @@ extension WhisperView {
height: frame.height)

complementImageView.frame = CGRect(
x: titleLabel.frame.origin.y - Dimensions.imageSize - Dimensions.loaderTitleOffset,
y: (frame.height - Dimensions.imageSize) / 2,
x: titleLabel.frame.origin.x - Dimensions.imageSize - Dimensions.loaderTitleOffset,
y: (Dimensions.height - Dimensions.imageSize) / 2,
width: Dimensions.imageSize,
height: Dimensions.imageSize)

} else {
titleLabel.frame = CGRect(
x: (frame.width - titleLabel.frame.width) / 2,
Expand Down

0 comments on commit 7b3a27a

Please sign in to comment.