Commit b1e47781 by Daniel Dahan

development: minor tweaks to Card types for code clarity

parent e2709f63
Pod::Spec.new do |s|
s.name = 'Material'
s.version = '2.3.15'
s.version = '2.3.16'
s.license = 'BSD-3-Clause'
s.summary = 'Material is an animation and graphics framework that is used to create beautiful applications.'
s.homepage = 'http://materialswift.com'
......
......@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.3.15</string>
<string>2.3.16</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
......
......@@ -209,9 +209,6 @@ open class Card: PulseView {
container.height = h
bounds.size.height = h
container.height = h
bounds.size.height = h
}
/**
......@@ -237,26 +234,22 @@ open class Card: PulseView {
- Returns: A CGFloat.
*/
@discardableResult
open func prepare(view: UIView?, with insets: EdgeInsets, from top: CGFloat) -> CGFloat {
guard let v = view else {
return top
}
open func prepare(view: UIView, with insets: EdgeInsets, from top: CGFloat) -> CGFloat {
let t = insets.top + top
v.y = t
v.x = insets.left
view.y = t
view.x = insets.left
let w = container.width - insets.left - insets.right
var h = v.height
var h = view.height
if 0 == h {
(v as? UILabel)?.sizeToFit()
h = v.sizeThatFits(CGSize(width: w, height: CGFloat.greatestFiniteMagnitude)).height
(view as? UILabel)?.sizeToFit()
h = view.sizeThatFits(CGSize(width: w, height: CGFloat.greatestFiniteMagnitude)).height
}
v.width = w
v.height = h
view.width = w
view.height = h
return t + h + insets.bottom
}
......
......@@ -87,12 +87,10 @@ open class ImageCard: Card {
if let v = contentView {
h = prepare(view: v, with: contentViewEdgeInsets, from: h)
container.sendSubview(toBack: v)
}
if let v = bottomBar {
h = prepare(view: v, with: bottomBarEdgeInsets, from: h)
container.sendSubview(toBack: v)
}
container.height = h
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment