cs193p – Project #3 Assignment #3 Task #10

von Heptagon (Eigenes Werk) [GFDL (http://www.gnu.org/copyleft/fdl.html) oder CC BY-SA 4.0-3.0-2.5-2.0-1.0 (http://creativecommons.org/licenses/by-sa/4.0-3.0-2.5-2.0-1.0)], via Wikimedia Commons

Please note, this blog entry is from a previous course. You might want to check out the current one.

Your graphing view must be @IBDesignable and its scale must be @IBInspectable. The graphing view’s axes should appear in the storyboard at the inspected scale.

Add the respective keywords in the lines above the class and the property definitions:

@IBDesignable
class GraphView: UIView {
...
    @IBInspectable
    var scale: CGFloat = 50.0 { didSet { setNeedsDisplay() } }

… and you should see the axis in storyboard, and when inspecting the graph view see the new property scale:

cs193p - Project #3 Assignment #3 Task #10 - Live Graph View
cs193p – Project #3 Assignment #3 Task #10 – Live Graph View

The complete code for the task #10 is available on GitHub.

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

Leave a Reply

Your email address will not be published.