• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Quick and dirty alignment grid.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: Accessing a property of a view via its controller doesn't work
  • Next by Date: iOS key or command key equivalent for testing in the Simulator.
  • Previous by thread: Re: Accessing a property of a view via its controller doesn't work
  • Next by thread: iOS key or command key equivalent for testing in the Simulator.
  • Index(es):
    • Date
    • Thread