Skip to content

Commit 95acbae

Browse files
author
蔡龙君
committed
feat |> 添加配置类
1 parent cb824d3 commit 95acbae

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

Example/Pods/Pods.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
//
2+
// SFAlertControllerConfiguration.swift
3+
// SFAlertController
4+
//
5+
// Created by 蔡龙君 on 2019/8/30.
6+
//
7+
8+
import UIKit
9+
10+
public struct SFAlertControllerConfiguration {
11+
/// 内容距离上下左右间距
12+
var insets: UIEdgeInsets = UIEdgeInsets(top: 8, left: 8, bottom: 8, right: 8)
13+
/// 标题颜色
14+
var titleColor: UIColor = UIColor.black
15+
/// 标题字体
16+
var titleFont: UIFont = UIFont.systemFont(ofSize: 17, weight: .medium)
17+
/// message颜色
18+
var messageColor: UIColor = UIColor.black
19+
/// message字体
20+
var messageFont: UIFont = UIFont.systemFont(ofSize: 13, weight: .regular)
21+
/// 分割线颜色
22+
var separatorColor: UIColor = UIColor(red: 0, green: 0, blue: 0.31, alpha: 0.05)
23+
/// defaultButtonColor
24+
var defaultButtonColor: UIColor = UIColor(red: 0, green: 0.48, blue: 1, alpha: 1)
25+
/// cancelButtonColor
26+
var cancelButtonColor: UIColor = UIColor(red: 0, green: 0.48, blue: 1, alpha: 1)
27+
/// destructiveButtonColor
28+
var destructiveButtonColor: UIColor = UIColor(red: 1, green: 0.23, blue: 0.19, alpha: 1)
29+
/// 子控件间距
30+
var subviewSpacing: CGFloat = 10
31+
32+
init(insets: UIEdgeInsets = UIEdgeInsets(top: 8, left: 8, bottom: 8, right: 8),
33+
titleColor: UIColor = UIColor.black,
34+
titleFont: UIFont = UIFont.systemFont(ofSize: 17, weight: .medium),
35+
messageColor: UIColor = UIColor.black,
36+
messageFont: UIFont = UIFont.systemFont(ofSize: 13, weight: .regular),
37+
separatorColor: UIColor = UIColor(red: 0, green: 0, blue: 0.31, alpha: 0.05),
38+
defaultButtonColor: UIColor = UIColor(red: 0, green: 0.48, blue: 1, alpha: 1),
39+
cancelButtonColor: UIColor = UIColor(red: 0, green: 0.48, blue: 1, alpha: 1),
40+
destructiveButtonColor: UIColor = UIColor(red: 1, green: 0.23, blue: 0.19, alpha: 1),
41+
subviewSpacing: CGFloat = 10
42+
) {
43+
self.insets = insets
44+
self.titleColor = titleColor
45+
self.titleFont = titleFont
46+
self.messageColor = messageColor
47+
self.messageFont = messageFont
48+
self.separatorColor = separatorColor
49+
self.defaultButtonColor = defaultButtonColor
50+
self.cancelButtonColor = cancelButtonColor
51+
self.destructiveButtonColor = destructiveButtonColor
52+
self.subviewSpacing = subviewSpacing
53+
}
54+
}

0 commit comments

Comments
 (0)