You haven't shown the errors messages. Show what you've tried, what you expected to happen, what actually happened. Please post code as text (formatted as a code block), it makes it easier for us to quote later - screenshots are only useful for graphics.
From the screenshot "makePieChart" creates an instance of a PieChartView named pieChartView". Which suggests there is some code somewhere which calls makePieChart and names the resulting view, like this:
let pieChartView = makePieChart()
"PieChartView has one property named wedges, an array of PieWedgeInstances. Assign an array
pieChartView.wedges = [ PieWedge(proportion: 3, color: .black, scale: 0.5, offset: 0.5),
PieWedge(proportion: 3, color: .black, scale: 0.5, offset: 0.5),
PieWedge(proportion: 3, color: .red) ]
or use the append method of Array to add them one at a time
pieChartView.wedges.append(PieWedge(proportion: 3, color: .black, scale: 0.5, offset: 0.5))
pieChartView.wedges.append(PieWedge(proportion: 3, color: .black, scale: 0.5, offset: 0.5))
pieChartView.wedges.append(PieWedge(proportion: 3, color: .red)
I hope this helps. Stick at it!
Topic:
Programming Languages
SubTopic:
Swift
Tags: