Reputation: 6933
So, I am converting one of my projects that uses CorePlot to Swift. I have a graph that in addition to regular x- and y-axis I add two more. By default, the axis were hidden by the graph. I used the following code in Objective-C to show them over graph:
graph.plotAreaFrame.plotArea.topDownLayerOrder = @[@(CPTGraphLayerTypeAxisLines)];
I was wondering how do I do that in Swift? I can't seem to set topDownLayerOrder without getting some sort of "can't assign to [AnyObject]!" message
Upvotes: 1
Views: 96
Reputation: 6933
With the help of the co-worker, this is what we came up with:
graph.plotAreaFrame.plotArea.topDownLayerOrder = [CPTGraphLayerType.AxisLines.rawValue]
Upvotes: 1
Reputation: 10479
Try this:
graph.plotAreaFrame.plotArea.topDownLayerOrder = [CPTGraphLayerType.AxisLines.rawValue]
Upvotes: 3