-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUIView+DLSDescribable.m
More file actions
50 lines (44 loc) · 2.25 KB
/
Copy pathUIView+DLSDescribable.m
File metadata and controls
50 lines (44 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//
// UIView+DLSDescribable.m
// Dials-iOS
//
// Created by Akiva Leffert on 3/14/15.
// Copyright (c) 2015 Akiva Leffert. All rights reserved.
//
#import "UIView+DLSDescribable.h"
#import "DLSActionEditor.h"
#import "DLSColorEditor.h"
#import "DLSConstraintsEditor.h"
#import "DLSConstraintsExchanger.h"
#import "DLSDescriptionContext.h"
#import "DLSFloatArrayEditor.h"
#import "DLSPropertyDescription.h"
#import "DLSSliderEditor.h"
#import "DLSStepperEditor.h"
#import "DLSTextFieldEditor.h"
#import "DLSToggleEditor.h"
#import "DLSValueExchanger.h"
@implementation UIView (DLSDescribable)
+ (void)dls_describe:(id <DLSDescriptionContext>)context {
[context addGroupWithName:@"Layer"
properties: @[
DLSProperty(@"layer.cornerRadius", [DLSStepperEditor editor]),
DLSProperty(@"layer.borderWidth", [DLSStepperEditor editor]),
DLSProperty(@"layer.borderColor", [DLSCGColorEditor editor])
]];
[context addGroupWithName:@"View"
properties: @[
DLSProperty(@"dials.controller", [DLSTextFieldEditor label]).setExchanger([[DLSViewControllerClassExchanger alloc] init]),
DLSProperty(@"dials.triggerLayout", [[DLSActionEditor alloc] init]).setExchanger([[DLSTriggerLayoutExchanger alloc] init]),
DLSProperty(@"backgroundColor", [DLSColorEditor editor]).setLabel(@"Background"),
DLSProperty(@"tintColor", [DLSColorEditor editor]),
DLSProperty(@"alpha", [DLSSliderEditor zeroOneSlider]),
DLSProperty(@"hidden", [DLSToggleEditor editor]),
DLSProperty(@"userInteractionEnabled", [DLSToggleEditor editor]),
DLSProperty(@"frame", [[DLSRectEditor alloc] init]),
DLSProperty(@"bounds", [[DLSRectEditor alloc] init]),
DLSProperty(@"center", [[DLSPointEditor alloc] init]),
DLSProperty(@"clipsToBounds", [DLSToggleEditor editor]),
]];
}
@end