FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
SimpleButton/Example/DesignableButton.swift at master · bbombb/SimpleButton · GitHub
bbombb
/
SimpleButton
Public
forked from
aloco/SimpleButton
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
SimpleButton
/
Example
/
DesignableButton.swift
Copy path
More file actions
More file actions
Latest commit
History
History
History
55 lines (45 loc) · 1.66 KB
Breadcrumbs
SimpleButton
/
Example
/
DesignableButton.swift
Copy path
File metadata and controls
55 lines (45 loc) · 1.66 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
55
//
// DesignableButton.swift
// Example
//
// Created by Gunter Hager on 03.06.16.
// Copyright © 2016 all about apps. All rights reserved.
//
import
UIKit
import
SimpleButton
@
IBDesignable
class
DesignableButton
:
SimpleButton
{
/// Background color for normal state.
@
IBInspectable
var
backgroundColorNormal
:
UIColor
?
@
IBInspectable
var
backgroundColorHighlight
:
UIColor
?
@
IBInspectable
var
titleColorNormal
:
UIColor
?
@
IBInspectable
var
titleColorHighlighted
:
UIColor
?
@
IBInspectable
var
shadow
:
Bool
=
false
@
IBInspectable
var
shadowColor
:
UIColor
?
@
IBInspectable
var
shadowOffset
:
CGSize
=
CGSize
.
zero
@
IBInspectable
var
shadowRadius
:
CGFloat
=
0
@
IBInspectable
var
shadowOpacity
:
Float
=
0
override
func
configureButtonStyles
(
)
{
super
.
configureButtonStyles
(
)
if
let
backgroundColorNormal
=
backgroundColorNormal
{
setBackgroundColor
(
backgroundColorNormal
,
for
:
.
normal
)
}
if
let
backgroundColorHighlight
=
backgroundColorHighlight
{
setBackgroundColor
(
backgroundColorHighlight
,
for
:
.
highlighted
)
}
if
let
titleColorNormal
=
titleColorNormal
{
setTitleColor
(
titleColorNormal
,
for
:
.
normal
)
}
if
let
titleColorHighlighted
=
titleColorHighlighted
{
setTitleColor
(
titleColorHighlighted
,
for
:
.
highlighted
)
}
if
shadow
{
if
let
shadowColor
=
shadowColor
{
setShadowColor
(
shadowColor
)
}
setShadowOffset
(
shadowOffset
)
setShadowRadius
(
shadowRadius
)
setShadowOpacity
(
shadowOpacity
)
}
}
}
Back
|
FazBrowse Home
|
New Git URL