Below is a simple incremental extension for SKSpriteNode that allows you to draw a border of a given color around your node.
import SpriteKit extension SKSpriteNode { func drawBorder(color: UIColor, width: CGFloat) { let shapeNode = SKShapeNode(rect: frame) shapeNode.fillColor = .clear shapeNode.strokeColor = color shapeNode.lineWidth = width addChild(shapeNode) } }
source share