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
2025-02-04 17:41:05 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
81238c631e6b670e381bd98da057244d8daedb0f
81238c63
1 parent
21913e96
CouponBarcodeViewController accessibilities
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
0 deletions
SwiftWarplyFramework/SwiftWarplyFramework/CouponBarcodeViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/CouponBarcodeViewController.swift
View file @
81238c6
...
...
@@ -91,6 +91,9 @@ import AVFoundation
setBackButton
()
setNavigationTitle
(
"Εκπτωτικό κουπόνι"
)
// Temporarily disable the table view's accessibility to prevent immediate focus shift
self
.
mainView
.
accessibilityElementsHidden
=
true
// backgroundImage.image = UIImage(named: "coupons_scrollview_white", in: Bundle(for: MyEmptyClass.self), compatibleWith: nil)
backgroundImage
.
image
=
UIImage
(
named
:
"coupons_scrollview_white"
,
in
:
MyEmptyClass
.
resourceBundle
(),
compatibleWith
:
nil
)
...
...
@@ -552,6 +555,7 @@ import AVFoundation
print
(
"Coupon Description: "
+
(
couponSetData
?
.
short_description
??
""
))
print
(
"Coupon Expiration: "
+
(
coupon
?
.
expiration
??
""
))
setupAccessibilty
()
}
public
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
...
...
@@ -562,6 +566,19 @@ import AVFoundation
self
.
navigationController
?
.
hideHairline
()
}
public
override
func
viewDidAppear
(
_
animated
:
Bool
)
{
super
.
viewDidAppear
(
animated
)
// DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
UIAccessibility
.
post
(
notification
:
.
screenChanged
,
argument
:
self
.
navigationItem
.
titleView
)
// }
// Re-enable table view accessibility after the announcement
DispatchQueue
.
main
.
asyncAfter
(
deadline
:
.
now
()
+
1.0
)
{
self
.
mainView
.
accessibilityElementsHidden
=
false
}
}
public
func
textView
(
_
textView
:
UITextView
,
shouldInteractWith
URL
:
URL
,
in
characterRange
:
NSRange
,
interaction
:
UITextItemInteraction
)
->
Bool
{
UIApplication
.
shared
.
open
(
URL
)
...
...
@@ -571,6 +588,44 @@ import AVFoundation
// MARK: - Functions
func
setupAccessibilty
()
{
couponImage
.
isAccessibilityElement
=
true
couponImage
.
accessibilityLabel
=
"Φωτογραφία εκπτωτικού κουπονιού"
couponImage
.
accessibilityTraits
=
.
image
var
formatedExpiration
=
""
let
dateFormatter
=
DateFormatter
()
// dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
dateFormatter
.
locale
=
Locale
(
identifier
:
"en_US_POSIX"
)
if
let
date
=
coupon
?
.
expirationDate
{
// Set output format in Greek
dateFormatter
.
locale
=
Locale
(
identifier
:
"el_GR"
)
// Greek locale
dateFormatter
.
dateFormat
=
"d MMMM yyyy"
let
resultString
=
dateFormatter
.
string
(
from
:
date
)
formatedExpiration
=
"Ισχύει έως "
+
resultString
}
else
{
formatedExpiration
=
"Ισχύει έως "
+
(
coupon
?
.
expiration
??
""
)
}
expirationLabel
.
isAccessibilityElement
=
true
expirationLabel
.
accessibilityLabel
=
formatedExpiration
redeemButton
.
isAccessibilityElement
=
true
redeemButton
.
accessibilityLabel
=
redeemButton
.
title
(
for
:
.
normal
)
redeemButton
.
accessibilityHint
=
"Διπλό πάτημα για άνοιγμα"
redeemButton
.
accessibilityTraits
=
.
button
mapButton
.
isAccessibilityElement
=
true
mapButton
.
accessibilityLabel
=
mapButton
.
title
(
for
:
.
normal
)
mapButton
.
accessibilityHint
=
"Διπλό πάτημα για άνοιγμα"
mapButton
.
accessibilityTraits
=
.
button
termsButton
.
isAccessibilityElement
=
true
termsButton
.
accessibilityLabel
=
termsButton
.
title
(
for
:
.
normal
)
termsButton
.
accessibilityHint
=
"Διπλό πάτημα για εμφάνιση"
termsButton
.
accessibilityTraits
=
.
button
termsButton
.
accessibilityValue
=
"Συμπτυγμένο"
}
func
toggleTerms
()
{
if
(
termsVisible
)
{
termsTextView
.
isHidden
=
false
...
...
@@ -578,11 +633,18 @@ import AVFoundation
termsTextViewHeight
.
constant
=
termsTextView
.
sizeThatFits
(
targetSize
)
.
height
termsButton
.
setImage
(
UIImage
(
named
:
"ic_up_dark_2.png"
,
in
:
MyEmptyClass
.
resourceBundle
(),
compatibleWith
:
nil
),
for
:
.
normal
)
termsButton
.
accessibilityValue
=
"Ανεπτυγμένο"
termsButton
.
accessibilityHint
=
"Διπλό πάτημα για απόκρυψη"
}
else
{
termsTextView
.
isHidden
=
true
termsTextViewHeight
.
constant
=
CGFloat
(
0
)
termsButton
.
setImage
(
UIImage
(
named
:
"ic_down_dark_2.png"
,
in
:
MyEmptyClass
.
resourceBundle
(),
compatibleWith
:
nil
),
for
:
.
normal
)
termsButton
.
accessibilityValue
=
"Συμπτυγμένο"
termsButton
.
accessibilityHint
=
"Διπλό πάτημα για εμφάνιση"
}
}
...
...
Please
register
or
login
to post a comment