-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathDayNightSwitch.h
34 lines (24 loc) · 919 Bytes
/
DayNightSwitch.h
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
//
// DayNightSwitch.h
// DayNightSwitch
//
// Created by Finn Gaida on 03.09.16.
// Copyright © 2016 Finn Gaida. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface DayNightSwitch : UIView
/// Called as soon as the value changes (probably because the user tapped it)
@property (nonatomic, copy, nullable) void (^changeAction)(BOOL);
/// Determines the state of the button, animates changes
@property (nonatomic) BOOL on;
/// Dark blue border layer
@property (nonatomic, nonnull) CAShapeLayer *offBorder;
/// Light blue layer below the `offBorder`
@property (nonatomic, nonnull) CAShapeLayer *onBorder;
/// Small white dots on the off state background
@property (nonatomic, nullable) NSArray<UIView *> *stars;
/// Cloud image visible on top of the on state knob
@property (nonatomic, nonnull) UIImageView *cloud;
- (CGFloat)knobMargin;
- (nonnull instancetype)initWithCenter:(CGPoint)center;
@end