Targeted for iOS, I made a quick an dirty 8x8 grid with a 4x4 subgrid to serve 
as an overlay to help in aligning items.  
There is a major thicker separator every 10 segments.  
The subgrid can have different colors.
Transparency can be adjusted.

It’s NOT the most elegant code but for an alignment tool it’s fast enough.

Here’s how you invoke it.

//    self.view.addSubview(Grid())
//
// or
//
//    let gridView = Grid()
//    gridView.enable4x4grid = true
//    gridView.detailGridColor = .yellow // .cyan, .black, .white, .red
//    gridView.transparency = 0.4 // 0…1
//    self.view.addSubview(gridView)

It’s easy to change to a 5x5 grid or 10x10 grid.

Here’s what it looks like.



If anyone wants, I’ll forward the class or put it up on gitHub.

Hope someone finds this useful.
Alex Zavatone
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to