This PR contains all the work related to setting up this project as required to implement the [Assignment](https://repo.rock-n-code.com/rock-n-code/deep-linking-assignment/wiki/Assignment) on top, as intended. To summarise this work: - [x] created a new **Xcode** project; - [x] cloned the `Wikipedia` app and inserted it into the **Xcode** project; - [x] created the `Locations` app and also, its `Libraries` package; - [x] created the `Shared` package to share dependencies between the apps; - [x] added a `Makefile` file and implemented some **environment** and **help** commands. Co-authored-by: Javier Cicchelli <javier@rock-n-code.com> Reviewed-on: rock-n-code/deep-linking-assignment#1
57 lines
1.5 KiB
Objective-C
57 lines
1.5 KiB
Objective-C
#import "WMFGradientView.h"
|
|
|
|
@interface WMFGradientView ()
|
|
// These were IBInspectable but causing instability in Interface Builder, so make them private for now
|
|
@property (nonatomic, strong) UIColor *startColor;
|
|
@property (nonatomic, strong) UIColor *endColor;
|
|
@end
|
|
|
|
@implementation WMFGradientView
|
|
|
|
- (instancetype)initWithFrame:(CGRect)frame {
|
|
self = [super initWithFrame:frame];
|
|
if (self) {
|
|
[self.gradientLayer setLocations:@[@0, @1]];
|
|
}
|
|
return self;
|
|
}
|
|
|
|
- (void)setStartColor:(UIColor *)startColor endColor:(UIColor *)endColor {
|
|
_startColor = startColor;
|
|
_endColor = endColor;
|
|
// HAX: need to provide clearColor defaults since IB might pass nil by setting
|
|
// start/end separately
|
|
[self.gradientLayer setColors:@[(id)startColor.CGColor ?: [UIColor clearColor],
|
|
(id)endColor.CGColor ?: [UIColor clearColor]]];
|
|
}
|
|
|
|
- (void)setStartColor:(UIColor *)startColor {
|
|
// need to support this for changes in IB
|
|
[self setStartColor:startColor endColor:self.endColor];
|
|
}
|
|
|
|
- (void)setEndColor:(UIColor *)endColor {
|
|
// need to support this for changes in IB
|
|
[self setStartColor:self.startColor endColor:endColor];
|
|
}
|
|
|
|
- (void)setStartPoint:(CGPoint)startPoint {
|
|
[self.gradientLayer setStartPoint:startPoint];
|
|
}
|
|
|
|
- (void)setEndPoint:(CGPoint)endPoint {
|
|
[self.gradientLayer setEndPoint:endPoint];
|
|
}
|
|
|
|
#pragma mark - UIView
|
|
|
|
+ (Class)layerClass {
|
|
return [CAGradientLayer class];
|
|
}
|
|
|
|
- (CAGradientLayer *)gradientLayer {
|
|
return (CAGradientLayer *)self.layer;
|
|
}
|
|
|
|
@end
|