Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to snap instance of view? #4

Open
aunnnn opened this issue Jun 1, 2018 · 1 comment
Open

Add the ability to snap instance of view? #4

aunnnn opened this issue Jun 1, 2018 · 1 comment

Comments

@aunnnn
Copy link

aunnnn commented Jun 1, 2018

First of all, thanks for the hard work!

Would like to know your opinion on adding new set of APIs to Salsa for capturing UIView instance conveniently. Seems like the current code forces us to instantiate new UIView instances and return them via static function:

static func artboardElements() -> [[ArtboardElement]] 

One usecase of this is to allow it to snap views during the UI automation. I experimented with it to generate Sketch file as visual documentation of an app (removing filtering/purging to keep exact copy of view hierarchies).

The additional APIs could be something like what I did there:
https://github.com/aunnnn/salsa-AutoSketch/blob/master/Salsa/Salsa%2BAutoSketch.swift

@mrabiciu
Copy link
Contributor

mrabiciu commented Jun 1, 2018

Woah I love this!

At some point I had something like:

extension UIWindow {
  func makeArtboard(name: String) -> Artboard {
    return Artboard(name: name, layers: [makeSketchGroup()], frame: group.frame, color: .white)
  }
}

for snapshotting the current window, but wasn't sure if it would be useful to include in the library.
What you have looks like a more refined version of that!

I'd love to include this in Salsa! I'd be happy to take a pull request 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants