This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Daniel Caine
Posted Apr 07 - Read on Facebook

If you want to use Sketch layers inside of a custom class, how do you do this? I've tried the following (which doesn't work):

# Store our detail view layers from Sketch
detailViews = [$.detailView, $.detailView1, $.detailView2, $.detailView3]

class detailView extends Layer
constructor: (options={}) ->

options.size = Screen.size

# Get default layer functionality
super(options)

for detailView in detailViews
detailView.properties =
parent: @
frame: detailView.frame
x: 0
y: 0

print detailView // prints the detailViews array fine

testDetailPage = new detailView()