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-08-09 18:30:09 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
28c44bd9108cc4bdc045bba904da819c4e3670bc
28c44bd9
1 parent
1fc3fac1
add toggleBarcode btn at CouponBarcodeVC
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
70 additions
and
2 deletions
SwiftWarplyFramework/Pods/Pods.xcodeproj/xcuserdata/manos.xcuserdatad/xcschemes/xcschememanagement.plist
SwiftWarplyFramework/SwiftWarplyFramework.xcodeproj/xcuserdata/manos.xcuserdatad/xcschemes/xcschememanagement.plist
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
SwiftWarplyFramework/SwiftWarplyFramework/CouponBarcodeViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/Main.storyboard
SwiftWarplyFramework/Pods/Pods.xcodeproj/xcuserdata/manos.xcuserdatad/xcschemes/xcschememanagement.plist
View file @
28c44bd
...
...
@@ -7,7 +7,7 @@
<key>
Pods-SwiftWarplyFramework.xcscheme_^#shared#^_
</key>
<dict>
<key>
orderHint
</key>
<integer>
0
</integer>
<integer>
1
</integer>
</dict>
</dict>
</dict>
...
...
SwiftWarplyFramework/SwiftWarplyFramework.xcodeproj/xcuserdata/manos.xcuserdatad/xcschemes/xcschememanagement.plist
View file @
28c44bd
...
...
@@ -7,7 +7,7 @@
<key>
SwiftWarplyFramework.xcscheme_^#shared#^_
</key>
<dict>
<key>
orderHint
</key>
<integer>
1
</integer>
<integer>
0
</integer>
</dict>
</dict>
</dict>
...
...
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
View file @
28c44bd
No preview for this file type
SwiftWarplyFramework/SwiftWarplyFramework/CouponBarcodeViewController.swift
View file @
28c44bd
...
...
@@ -23,15 +23,25 @@ import AVFoundation
@IBOutlet
weak
var
barcodeImage
:
UIImageView
!
@IBOutlet
weak
var
barcodeImageHeight
:
NSLayoutConstraint
!
@IBOutlet
weak
var
barcodeLabel
:
UILabel
!
@IBOutlet
weak
var
barcodeLabelHeight
:
NSLayoutConstraint
!
@IBOutlet
weak
var
showBarcodeButton
:
UIButton
!
@IBOutlet
weak
var
expirationLabel
:
UILabel
!
@IBOutlet
weak
var
redeemButton
:
UIButton
!
@IBOutlet
weak
var
termsButton
:
UIButton
!
@IBOutlet
weak
var
termsTextView
:
UITextView
!
@IBOutlet
weak
var
termsTextViewHeight
:
NSLayoutConstraint
!
@IBOutlet
weak
var
borderViewHeight
:
NSLayoutConstraint
!
@IBOutlet
weak
var
borderView2Height
:
NSLayoutConstraint
!
@IBOutlet
weak
var
border1TopSpace
:
NSLayoutConstraint
!
@IBOutlet
weak
var
barcodeImageTopSpace
:
NSLayoutConstraint
!
@IBOutlet
weak
var
barcodeLabelTopSpace
:
NSLayoutConstraint
!
@IBOutlet
weak
var
border2TopSpace
:
NSLayoutConstraint
!
@IBOutlet
weak
var
mapButton
:
UIButton
!
let
uiscreen
:
CGRect
=
UIScreen
.
main
.
bounds
var
termsVisible
:
Bool
=
false
;
var
barcodeVisible
:
Bool
=
false
;
public
var
coupon
:
swiftApi
.
CouponItemModel
?
...
...
@@ -83,6 +93,12 @@ import AVFoundation
redeemButton
.
setTitleColor
(
.
white
,
for
:
.
normal
)
redeemButton
.
backgroundColor
=
UIColor
(
red
:
0.47
,
green
:
0.75
,
blue
:
0.08
,
alpha
:
1.00
)
redeemButton
.
layer
.
cornerRadius
=
12.0
mapButton
.
titleLabel
?
.
font
=
UIFont
.
systemFont
(
ofSize
:
15
,
weight
:
.
semibold
)
mapButton
.
setTitle
(
"Δες τα καταστήματα"
,
for
:
.
normal
)
mapButton
.
setTitleColor
(
UIColor
(
red
:
0.31
,
green
:
0.62
,
blue
:
0.18
,
alpha
:
1.00
),
for
:
.
normal
)
mapButton
.
backgroundColor
=
UIColor
(
red
:
0.90
,
green
:
0.90
,
blue
:
0.90
,
alpha
:
1.00
)
mapButton
.
layer
.
cornerRadius
=
12.0
termsButton
.
titleLabel
?
.
font
=
.
systemFont
(
ofSize
:
15.0
,
weight
:
.
medium
)
// termsButton.imageView?.layer.transform = CATransform3DMakeScale(1.5, 1.5, 1.5)
...
...
@@ -102,6 +118,7 @@ import AVFoundation
termsTextView
.
isScrollEnabled
=
false
toggleTerms
()
toggleBarcode
()
// Logs
print
(
"Coupon: "
+
(
coupon
?
.
coupon
??
""
))
...
...
@@ -126,6 +143,48 @@ import AVFoundation
termsButton
.
setImage
(
UIImage
(
named
:
"ic_down_dark.png"
,
in
:
Bundle
(
for
:
MyEmptyClass
.
self
),
compatibleWith
:
nil
),
for
:
.
normal
)
}
}
func
toggleBarcode
()
{
if
(
barcodeVisible
)
{
barcodeImage
.
isHidden
=
false
if
(
barcodeImage
.
image
==
nil
)
{
barcodeImageHeight
.
constant
=
CGFloat
(
0
)
}
else
{
barcodeImageHeight
.
constant
=
self
.
uiscreen
.
height
*
0.1
}
barcodeLabel
.
isHidden
=
false
let
targetSize
=
CGSize
(
width
:
barcodeLabel
.
frame
.
width
,
height
:
CGFloat
(
MAXFLOAT
))
barcodeLabelHeight
.
constant
=
barcodeLabel
.
sizeThatFits
(
targetSize
)
.
height
borderViewHeight
.
constant
=
CGFloat
(
1
)
borderView2Height
.
constant
=
CGFloat
(
1
)
border1TopSpace
.
constant
=
CGFloat
(
20
)
// 20
barcodeImageTopSpace
.
constant
=
CGFloat
(
10
)
// 10
barcodeLabelTopSpace
.
constant
=
CGFloat
(
10
)
// 10
border2TopSpace
.
constant
=
CGFloat
(
15
)
// 15
showBarcodeButton
.
setTitle
(
"Απόκρυψη barcode"
,
for
:
.
normal
)
showBarcodeButton
.
setImage
(
UIImage
(
named
:
"ic_up_dark.png"
,
in
:
Bundle
(
for
:
MyEmptyClass
.
self
),
compatibleWith
:
nil
),
for
:
.
normal
)
}
else
{
barcodeImage
.
isHidden
=
true
barcodeImageHeight
.
constant
=
CGFloat
(
0
)
barcodeLabel
.
isHidden
=
true
barcodeLabelHeight
.
constant
=
CGFloat
(
0
)
borderViewHeight
.
constant
=
CGFloat
(
0
)
borderView2Height
.
constant
=
CGFloat
(
0
)
border1TopSpace
.
constant
=
CGFloat
(
0
)
// 20
barcodeImageTopSpace
.
constant
=
CGFloat
(
0
)
// 10
barcodeLabelTopSpace
.
constant
=
CGFloat
(
0
)
// 10
border2TopSpace
.
constant
=
CGFloat
(
0
)
// 15
showBarcodeButton
.
setTitle
(
"Εμφάνιση barcode"
,
for
:
.
normal
)
showBarcodeButton
.
setImage
(
UIImage
(
named
:
"ic_down_dark.png"
,
in
:
Bundle
(
for
:
MyEmptyClass
.
self
),
compatibleWith
:
nil
),
for
:
.
normal
)
}
}
func
constructBarcode
()
->
String
?
{
// EAN 13 barcode construction
...
...
@@ -169,9 +228,18 @@ import AVFoundation
vc
.
coupon
=
self
.
coupon
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
@IBAction
func
showBarcodeAction
(
_
sender
:
Any
)
{
barcodeVisible
=
!
barcodeVisible
toggleBarcode
()
}
@IBAction
func
termsButtonAction
(
_
sender
:
Any
)
{
termsVisible
=
!
termsVisible
toggleTerms
()
}
@IBAction
func
mapButtonAction
(
_
sender
:
Any
)
{
// TODO: open MapVC
}
}
...
...
SwiftWarplyFramework/SwiftWarplyFramework/Main.storyboard
View file @
28c44bd
This diff is collapsed. Click to expand it.
Please
register
or
login
to post a comment