hugocroch / dspec-iOS

A simple way to define and render UI specs on top of your iOS UI inspired by the Android library dspec from Lucas Rocha.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dspec-iOS

A simple way to define and render UI specs on top of your iOS UI inspired by the Android library dspec from Lucas Rocha. https://github.com/lucasr/dspec

sample1

There two way to add dspec :

DesignSpecView *designView;

- (void)viewWillAppear:(BOOL)animated {
	[super viewWillAppear:animated];
	DesignSpecView *designView = [[DesignSpecView alloc] 	initWithFrame:self.view.frame];
	[[[[UIApplication sharedApplication] windows] objectAtIndex:0] addSubview:designView];
    [designView.designSpec loadSpecFromFileName:@"main_activity_spec"];
}

- (void)viewWillDisappear:(BOOL)animated {
	[designView removeFromSuperview];
}

Or you can simply add a UIView in your controller above everything.

sample2

NOTE In storyBoard, don't forget to set the background clearColor if you want a beautiful live preview of the baseline grid.

sample3

About

A simple way to define and render UI specs on top of your iOS UI inspired by the Android library dspec from Lucas Rocha.

License:Apache License 2.0


Languages

Language:Objective-C 100.0%