title: How to snap-to-grid in macOS via Swift?
body: <p>I'm developing simple app for macOS using Swift 2. How can I snap a CGPoint to grid (5-pixel distance for example) pressing a keyboard shortcut? I need such kind of point snapping as it's found in AutoCAD. </p>
  
  <p>I am looking for a solution for final project not Interface Builder.</p>