Quick and dirty alignment grid.
Quick and dirty alignment grid.
- Subject: Quick and dirty alignment grid.
- From: Alex Zavatone via Cocoa-dev <email@hidden>
- Date: Wed, 8 Sep 2021 10:24:37 -0500
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 (email@hidden)
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:
This email sent to email@hidden