-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathWhiteBackgroundAndCornerRadiusDecorationView.swift
54 lines (42 loc) · 1.39 KB
/
WhiteBackgroundAndCornerRadiusDecorationView.swift
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
51
52
53
54
//
// WhiteBackgroundAndCornerRadiusDecorationView.swift
// RakuyoKit
//
// Created by Rakuyo on 2024/4/9.
// Copyright © 2024 RakuyoKit. All rights reserved.
//
#if !os(watchOS) && !os(tvOS)
import UIKit
import RAKConfig
// MARK: - WhiteBackgroundAndCornerRadiusDecorationView
// A series of views for setting white background and corner radius for UICollectionView sections
open class WhiteBackgroundAndCornerRadiusDecorationView: WhiteBackgroundDecorationView {
override open func config() {
super.config()
layer.cornerRadius = 12
layer.masksToBounds = true
}
}
// MARK: - WhiteBackgroundAndTopCornerRadiusDecorationView
open class WhiteBackgroundAndTopCornerRadiusDecorationView: WhiteBackgroundAndCornerRadiusDecorationView {
override open func config() {
super.config()
// Top left & top right corners
layer.maskedCorners = [
.layerMinXMinYCorner,
.layerMaxXMinYCorner,
]
}
}
// MARK: - WhiteBackgroundAndBottomCornerRadiusDecorationView
open class WhiteBackgroundAndBottomCornerRadiusDecorationView: WhiteBackgroundAndCornerRadiusDecorationView {
override open func config() {
super.config()
// Bottom left & bottom right corners
layer.maskedCorners = [
.layerMinXMaxYCorner,
.layerMaxXMaxYCorner,
]
}
}
#endif