FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Passcode/Passcode/PasscodeVC/Cells/KeyPadCell.swift at master · mehulmodihb/Passcode · GitHub
mehulmodihb
/
Passcode
Public
Notifications
You must be signed in to change notification settings
Fork
5
Star
6
Code
Issues
1
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Passcode
/
Passcode
/
PasscodeVC
/
Cells
/
KeyPadCell.swift
Copy path
More file actions
More file actions
Latest commit
History
History
History
42 lines (33 loc) · 1.24 KB
Breadcrumbs
Passcode
/
Passcode
/
PasscodeVC
/
Cells
/
KeyPadCell.swift
Copy path
File metadata and controls
42 lines (33 loc) · 1.24 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
//
// KeyPadCell.swift
// Passcode
//
// Created by hb on 08/05/20.
// Copyright © 2020 hb. All rights reserved.
//
import
UIKit
class
KeyPadCell
:
UICollectionViewCell
{
static
let
cellIdentifier
=
"
kKeyPadCell
"
static
let
cellNib
=
UINib
.
init
(
nibName
:
"
KeyPadCell
"
,
bundle
:
Bundle
.
main
)
@
IBOutlet
weak
var
keyBtn
:
UIButton
!
override
func
awakeFromNib
(
)
{
super
.
awakeFromNib
(
)
// Initialization code
}
override
func
layoutSubviews
(
)
{
super
.
layoutSubviews
(
)
keyBtn
.
tintColor
=
PasscodeViewController
.
config
.
keyTintColor
keyBtn
.
layer
.
cornerRadius
=
(
min
(
keyBtn
.
frame
.
size
.
width
,
keyBtn
.
frame
.
size
.
height
)
/
2.0
)
keyBtn
.
clipsToBounds
=
true
}
override
var
isHighlighted
:
Bool
{
didSet
{
keyBtn
.
backgroundColor
=
isHighlighted
?
PasscodeViewController
.
config
.
keyHighlitedBackgroundColor
:
nil
keyBtn
.
tintColor
=
isHighlighted
?
PasscodeViewController
.
config
.
keyHighlitedTintColor
:
PasscodeViewController
.
config
.
keyTintColor
}
}
func
setContent
(
title
:
String
?
,
image
:
UIImage
?
)
{
keyBtn
.
setTitle
(
title
,
for
:
.
normal
)
keyBtn
.
setImage
(
image
?
.
withRenderingMode
(
.
alwaysTemplate
)
,
for
:
.
normal
)
}
}
Back
|
FazBrowse Home
|
New Git URL