-
Notifications
You must be signed in to change notification settings - Fork 59
Home
#Next up
-
Create testcases for common UI layouts (UITabBar, UINavigationBar) and more complex layouts with CALayer styles (shadow path, shadow offset, sublayers etc).
-
Shrink PSD, maybe add zip compression
-
Support Landscape mode✓ Added by @jwalapr -
Loading indicator or spinner to present progress
The library has only been coded in a pretty short timeframe and only tested on a few apps so far. We desperately need more test cases to check whether the rendering works for different UI layouts.
The generated PSD is currently pretty large because each CALayer is rendered directly onto the root window layer. This has the benefit that we can let CoreGraphics handle the hard work of rendering but on the other hand, it also means that each CALayer occupies the size of the entire screen, even if it's just a tiny dot. CGPathGetBoundingBox should do the trick here.
Currently Layershots doesn't do any transformation calculations on the image contexts. This one should be straight forward.
The exported layers are currently all named "Layer" and attached to the root of the psd document. Would be way easier to move things around when the CALayer hierarchy would map to the PSD layers/groups, where
- a layer without sublayers would map to a PSD layer
- CALayers with sublayers would map to a group and their layer content mapped to the first layer within that group.
Regarding naming of the layers, a scheme as follows might work. Set PSD Layer name to:
- layer.name if set
- if layer.name not set, fall back to auto incrementing counter (like "Layer 1.2.1")
- If layer.delegate is set
- If layer.delegate is a know class, could do something smart ass lookup. E.g. for UIImage -> "Image", for UILabel, use label.text
- If delegate class unknown, name PSD layer based on class name (e.g. "ImageView 1.2.1")
- If layer.delegate is set
Alternatively might also be able to just use the accessibility label or key if available.