Commit 1d287d03 by Daniel Dahan

development: update issue when setting containers to nil in cards

parent ef06acfd
......@@ -245,6 +245,7 @@ public class BasicCardView : MaterialCardView, Comparable {
t.textColor = MaterialTheme.white.color
} else {
titleLabelContainer?.removeFromSuperview()
titleLabelContainer = nil
}
prepareCard()
}
......@@ -288,6 +289,7 @@ public class BasicCardView : MaterialCardView, Comparable {
l.lineBreakMode = .ByTruncatingTail
} else {
detailLabelContainer?.removeFromSuperview()
detailLabelContainer = nil
}
prepareCard()
}
......@@ -321,6 +323,7 @@ public class BasicCardView : MaterialCardView, Comparable {
didSet {
if nil == rightButtons && nil == leftButtons {
buttonsContainer?.removeFromSuperview()
buttonsContainer = nil
} else if nil == buttonsContainer {
buttonsContainer = UIView()
buttonsContainer!.translatesAutoresizingMaskIntoConstraints = false
......@@ -338,6 +341,7 @@ public class BasicCardView : MaterialCardView, Comparable {
didSet {
if nil == rightButtons && nil == leftButtons {
buttonsContainer?.removeFromSuperview()
buttonsContainer = nil
} else if nil == buttonsContainer {
buttonsContainer = UIView()
buttonsContainer!.translatesAutoresizingMaskIntoConstraints = false
......
......@@ -305,6 +305,7 @@ public class ImageCardView : MaterialCardView, Comparable {
}
} else {
imageViewContainer?.removeFromSuperview()
imageViewContainer = nil
}
prepareCard()
}
......@@ -355,6 +356,7 @@ public class ImageCardView : MaterialCardView, Comparable {
}
} else {
titleLabelContainer?.removeFromSuperview()
titleLabelContainer = nil
}
prepareCard()
}
......@@ -398,6 +400,7 @@ public class ImageCardView : MaterialCardView, Comparable {
l.lineBreakMode = .ByTruncatingTail
} else {
detailLabelContainer?.removeFromSuperview()
detailLabelContainer = nil
}
prepareCard()
}
......@@ -431,6 +434,7 @@ public class ImageCardView : MaterialCardView, Comparable {
didSet {
if nil == rightButtons && nil == leftButtons {
buttonsContainer?.removeFromSuperview()
buttonsContainer = nil
} else if nil == buttonsContainer {
buttonsContainer = UIView()
buttonsContainer!.translatesAutoresizingMaskIntoConstraints = false
......@@ -448,6 +452,7 @@ public class ImageCardView : MaterialCardView, Comparable {
didSet {
if nil == rightButtons && nil == leftButtons {
buttonsContainer?.removeFromSuperview()
buttonsContainer = nil
} else if nil == buttonsContainer {
buttonsContainer = UIView()
buttonsContainer!.translatesAutoresizingMaskIntoConstraints = false
......
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