Skip to content

Instantly share code, notes, and snippets.

@gngrwzrd
Created June 1, 2021 00:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gngrwzrd/cb5b4f82295bc237b9205f7c72bf8718 to your computer and use it in GitHub Desktop.
Save gngrwzrd/cb5b4f82295bc237b9205f7c72bf8718 to your computer and use it in GitHub Desktop.
inputs.sort { view1, view2 in
let view1Frame = view1.convert(CGPoint.zero, to: nil)
let view2Frame = view2.convert(CGPoint.zero, to: nil)
if view1Frame.y == view2Frame.y {
return view1Frame.x < view2Frame.x
}
return view1Frame.y < view2Frame.y
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment