Skip to content
This repository has been archived by the owner on May 23, 2022. It is now read-only.

Commit

Permalink
Merge pull request #11 from morizotter/morizotter/rotation
Browse files Browse the repository at this point in the history
Rotation
  • Loading branch information
morizotter committed Jun 25, 2015
2 parents 2920902 + 978c035 commit aa42ef1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion SwiftyDrop.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "SwiftyDrop"
s.version = "1.0.3"
s.version = "1.0.4"
s.summary = "SwiftyDrop is a lightweight pure Swift simple and beautiful dropdown message."

s.description = <<-DESC
Expand Down
28 changes: 17 additions & 11 deletions SwiftyDrop/Drop.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ public final class Drop: UIView {
s.removeFromSuperview()
}
}

NSNotificationCenter.defaultCenter().addObserverForName(UIDeviceOrientationDidChangeNotification, object: nil, queue: nil) { [weak self] notification in
if let s = self {
s.updateHeight()
}
}
}

required public init(coder aDecoder: NSCoder) {
Expand Down Expand Up @@ -248,7 +254,7 @@ extension Drop {
toItem: visualEffectView.contentView,
attribute: .Top,
multiplier: 1.0,
constant: UIScreen.mainScreen().bounds.height + Drop.statusBarHeight() + statusTopMargin
constant: 0.0
)
let vibrancyBottom = NSLayoutConstraint(
item: vibrancyEffectView,
Expand Down Expand Up @@ -282,16 +288,16 @@ extension Drop {
multiplier: 1.0,
constant: 0.0
)
let statusTop = NSLayoutConstraint(
let statusBottom = NSLayoutConstraint(
item: statusLabel,
attribute: .Top,
attribute: .Bottom,
relatedBy: .Equal,
toItem: vibrancyEffectView.contentView,
attribute: .Top,
attribute: .Bottom,
multiplier: 1.0,
constant: 0.0
constant: -statusBottomMargin
)
vibrancyEffectView.contentView.addConstraints([statusTop, statusRight, statusLeft])
vibrancyEffectView.contentView.addConstraints([statusRight, statusLeft, statusBottom])
self.statusLabel = statusLabel
}

Expand Down Expand Up @@ -349,16 +355,16 @@ extension Drop {
multiplier: 1.0,
constant: 0.0
)
let statusTop = NSLayoutConstraint(
let statusBottom = NSLayoutConstraint(
item: statusLabel,
attribute: .Top,
attribute: .Bottom,
relatedBy: .Equal,
toItem: self,
attribute: .Top,
attribute: .Bottom,
multiplier: 1.0,
constant: Drop.statusBarHeight() + statusTopMargin
constant: -statusBottomMargin
)
self.addConstraints([statusLeft, statusRight, statusTop])
self.addConstraints([statusLeft, statusRight, statusBottom])
self.statusLabel = statusLabel
}

Expand Down

0 comments on commit aa42ef1

Please sign in to comment.