Toggle navigation
Toggle navigation
This project
Loading...
Sign in
open-source
/
warply_sdk_framework
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
Manos Chorianopoulos
2022-09-15 13:03:34 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b8f64edfe98f0e972054ea65822542363e96a6d6
b8f64edf
1 parent
fcd0d9e5
add done button at keyboard at shareVC
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
0 deletions
SwiftWarplyFramework/SwiftWarplyFramework/ShareViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/ViewControllerExtensions.swift
SwiftWarplyFramework/SwiftWarplyFramework/ShareViewController.swift
View file @
b8f64ed
...
...
@@ -78,6 +78,7 @@ import SwiftEventBus
numberTextField
.
textColor
=
UIColor
(
red
:
0.25
,
green
:
0.33
,
blue
:
0.39
,
alpha
:
1.00
)
numberTextField
.
attributedPlaceholder
=
NSAttributedString
(
string
:
"Καταχώρηση τηλεφώνου"
,
attributes
:
[
NSAttributedString
.
Key
.
foregroundColor
:
UIColor
(
red
:
0.68
,
green
:
0.68
,
blue
:
0.68
,
alpha
:
1.00
)])
numberTextField
.
keyboardType
=
.
asciiCapableNumberPad
numberTextField
.
addDoneButtonOnKeyboard
()
redeemButton
.
titleLabel
?
.
font
=
UIFont
(
name
:
"PFSquareSansPro-Medium"
,
size
:
16
)
redeemButton
.
setTitle
(
"Αποστολή με SMS"
,
for
:
.
normal
)
...
...
SwiftWarplyFramework/SwiftWarplyFramework/ViewControllerExtensions.swift
View file @
b8f64ed
...
...
@@ -299,3 +299,36 @@ public extension CGPoint {
}
}
}
extension
UITextField
{
@IBInspectable
var
doneAccessory
:
Bool
{
get
{
return
self
.
doneAccessory
}
set
(
hasDone
)
{
if
hasDone
{
addDoneButtonOnKeyboard
()
}
}
}
func
addDoneButtonOnKeyboard
()
{
let
doneToolbar
:
UIToolbar
=
UIToolbar
(
frame
:
CGRect
.
init
(
x
:
0
,
y
:
0
,
width
:
UIScreen
.
main
.
bounds
.
width
,
height
:
50
))
doneToolbar
.
barStyle
=
.
default
let
flexSpace
=
UIBarButtonItem
(
barButtonSystemItem
:
.
flexibleSpace
,
target
:
nil
,
action
:
nil
)
let
done
:
UIBarButtonItem
=
UIBarButtonItem
(
title
:
"Done"
,
style
:
.
done
,
target
:
self
,
action
:
#selector(
self.doneButtonAction
)
)
let
items
=
[
flexSpace
,
done
]
doneToolbar
.
items
=
items
doneToolbar
.
sizeToFit
()
self
.
inputAccessoryView
=
doneToolbar
}
@objc
func
doneButtonAction
()
{
self
.
resignFirstResponder
()
}
}
...
...
Please
register
or
login
to post a comment