Skip to content

Commit

Permalink
frame is a better override than bounds. bounds is weird! (Fixed issue #…
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgindi committed Apr 30, 2015
1 parent 859bb14 commit fdfa34a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Charts/Classes/Charts/ChartViewBase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -748,19 +748,19 @@ public class ChartViewBase: UIView, ChartAnimatorDelegate
internal typealias VoidClosureType = () -> ()
internal var _sizeChangeEventActions = [VoidClosureType]()

public override var bounds: CGRect
public override var frame: CGRect
{
get
{
return super.bounds;
return super.frame;
}
set
{
super.bounds = newValue;
super.frame = newValue;

if (_viewPortHandler !== nil)
{
_viewPortHandler.setChartDimens(width: newValue.size.width, height: newValue.size.height);
_viewPortHandler.setChartDimens(width: self.bounds.size.width, height: self.bounds.size.height);

// Finish any pending viewport changes
while (!_sizeChangeEventActions.isEmpty)
Expand Down

2 comments on commit fdfa34a

@westerlund
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

@danielgindi
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And there's another commit that improves it. Apparantly bounds/frames overrides are not behaving on iOS 8

Please sign in to comment.