/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.

Primary LanguageObjective-CApache License 2.0Apache-2.0

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