Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
Code review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
radimhalfar committed Mar 7, 2018
1 parent 484cbfb commit d669557
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 37 deletions.
13 changes: 0 additions & 13 deletions Styles/Classes/UIElement+Extensions/UIView+Styles.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,6 @@ @implementation UIView (Styles)

SYNTHESIZE_PROPERTY_OBJ(ViewStyle, viewStyle, ViewStyle);

+ (void)load {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
Class class = [self class];
swizzle_instance_method(class, @selector(layoutSubviews), @selector(swizzle_layoutSubviews));
});
}

- (void)swizzle_layoutSubviews {
[self swizzle_layoutSubviews];
[self.viewStyle applyLayoutTo:self];
}

- (void)applyStyle {
[self.viewStyle applyTo:self];
}
Expand Down
24 changes: 0 additions & 24 deletions Styles/Classes/ViewStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,6 @@ public final class ViewStyle: NSObject {
}
}

var isLayout: Bool {
switch self {
case .backgroundColor:
return false
case .tintColor:
return false
case .borderColor:
return false
case .borderWidth:
return false
case .cornerRadius:
return true
case .opacity:
return false
}
}

var isLayerProperty: Bool {
switch self {
case .backgroundColor:
Expand Down Expand Up @@ -94,13 +77,6 @@ public final class ViewStyle: NSObject {
}
}

@objc public func applyLayout(to view: UIView) {
for property in properties {
guard property.isLayout else { continue }
property.apply(to: view)
}
}

public func updating(_ other: Property...) -> ViewStyle {
return ViewStyle(properties.updating(other))
}
Expand Down

0 comments on commit d669557

Please sign in to comment.