You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First off, I want to say that this library is fantastic!
On to the problem:
I am using a stack of custom cards, one of which simply has a chart view embedded inside (taken from the iOS Charts library). However, using this card will cause the app to freeze unless I set the left and right margins to nonzero in the CardsViewController, e.g. with the following application:
However, doing so means that the cards cannot hug the edge of the screen. As mentioned previously, setting the insets to default (0 for left and right) causes the app to freeze.
See snippet for my custom card below, which has a chart embedded inside:
public class PAChartCardPartView : UIView, CardPartView {
var chart:CombinedChartView?
public init() {
super.init(frame: CGRect.zero)
self.chart = CombinedChartView(frame: CGRect.zero)
self.chart?.translatesAutoresizingMaskIntoConstraints = false
self.view.addSubview(self.chart!)
self.chart?.topAnchor.constraint(equalTo: self.view.topAnchor, constant: 0).isActive = true
self.chart?.bottomAnchor.constraint(equalTo: (self.view.bottomAnchor), constant: 0).isActive = true
self.chart?.leadingAnchor.constraint(equalTo: (self.view.leadingAnchor), constant: 0).isActive = true
self.chart?.trailingAnchor.constraint(equalTo: (self.view.trailingAnchor), constant: 0).isActive = true
}
required public init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
Is it possible to use this card without having to use nonzero left and right insets? Any help or insight would be greatly appreciated. Thanks!
The text was updated successfully, but these errors were encountered:
I'd also like to add that making the chart the CardPart (instead of creating a general UIView CardPart and embedding the chart inside) also creates the same problem. Works fine on the default Mint theme in which the left and right insets are nonzero, but will freeze on the Turbo theme where the left and right insets are zero.
class ChartCardPartView : CombinedChartView, CardPartView {
public var margins: UIEdgeInsets = CardParts.theme.cardPartMargins
public init() {
super.init(frame: CGRect.zero)
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
See the resulting chart implementation in the CardsViewController:
First off, I want to say that this library is fantastic!
On to the problem:
I am using a stack of custom cards, one of which simply has a chart view embedded inside (taken from the iOS Charts library). However, using this card will cause the app to freeze unless I set the left and right margins to nonzero in the CardsViewController, e.g. with the following application:
However, doing so means that the cards cannot hug the edge of the screen. As mentioned previously, setting the insets to default (0 for left and right) causes the app to freeze.
See snippet for my custom card below, which has a chart embedded inside:
Is it possible to use this card without having to use nonzero left and right insets? Any help or insight would be greatly appreciated. Thanks!
The text was updated successfully, but these errors were encountered: