diff --git a/.gitignore b/.gitignore index 8615121..624ccbf 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ DerivedData *.hmap *.ipa *.xcuserstate +.DS_Store # CocoaPods # diff --git a/TZStackView/TZStackView.swift b/TZStackView/TZStackView.swift index 2fd77a8..d411178 100755 --- a/TZStackView/TZStackView.swift +++ b/TZStackView/TZStackView.swift @@ -605,4 +605,29 @@ public class TZStackView: UIView { } return animatingToHiddenViews.indexOf(view) != nil } + + // Disables setting the background color to mimic an actual UIStackView which is a non-drawing view. + override public class func layerClass() -> AnyClass { + return CATransformLayer.self + } + + // Suppress the warning of "changing property backgroundColor in transform-only layer, will have no effect" + override public var backgroundColor: UIColor? { + get { + return nil + } + set { + + } + } + + // Suppress the warning of "changing property opaque in transform-only layer, will have no effect" + override public var opaque: Bool { + get { + return true + } + set { + + } + } }