I have the following code
let moveDirections = ["East": CGPoint(x: 1.0, y: 0.0),
"North": CGPoint(x: 0.0, y: 1.0),
"South": CGPoint(x: 0.0, y: -1.0),
"West": CGPoint(x: -1.0, y: 0.0),
]
let direction = "South"
let cdx = moveDirections[direction]?.x
Why does it insert the ? Surely the moveDirections variable contents is not optional.