Consider the humble line—just a straight sequence of pixels connecting two points. There are well-known algorithms you can use to do your own drawing, but these days, we have toolkits to do the hard work.
You need to interact with the current Core Graphics context in some manner to actually draw stuff, so it’s good to get comfortable with it, what it does, and why it’s there.
Core Graphics, also known by its marketing name “Quartz,” is one of the oldest graphics-related APIs on the platforms. Quartz forms the foundation of most things 2-D. Want to draw shapes, fill them with gradients and give them shadows? That’s Core Graphics. Compositing images on the screen? Those go through Core Graphics. Creating a PDF? Core Graphics again.
January 29, 2018 | iOS
Learn how to be more proficient with Swift by using the Compiler. Big Nerd Ranch shares lessons learned from nerdcamp.
In Core Graphics, a path is a step-by-step description of some kind of shape. It could be a circle, a square, a valentine heart, a word frequency histogram or maybe a happy face.
Is it possible to ask a question that leads you directly to fixing a bug? If so, how do you find those questions to ask them?
Imagine that one day you’re feeding some innocuous looking code to a Swift compiler, and then you get a smackdown of an error. Where’d it go? It got renamed.
The `selector` is key to Objective-C’s dynamic runtime nature. It’s just a name that’s used, at runtime, as a key into a dictionary of function pointers. Whenever you send a message to an Objective-C object, you’re actually using a selector to look up a function to call. Sometimes selectors bubble up in Cocoa/CocoaTouch API, and you will need to deal with them in Swift.