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
Vasilis
2022-04-27 17:17:19 +0300
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
f9af4cf749dc4c37f53c08de2c7fbee4a1909048
f9af4cf7
2 parents
0c4fc8a9
68463f70
Merge branch 'master' of
https://git.warp.ly/open-source/warply_sdk_framework
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
4 deletions
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS/CouponBarcodeView.swift
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
View file @
f9af4cf
No preview for this file type
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS/CouponBarcodeView.swift
View file @
f9af4cf
...
...
@@ -10,8 +10,8 @@ import SwiftUI
import
Combine
import
Foundation
import
UIKit
//import RSBarcodes_Swift
//import AVFoundation
//
import RSBarcodes_Swift
//
import AVFoundation
extension
CouponBarcodeView
{
...
...
@@ -146,7 +146,7 @@ extension CouponBarcodeView {
}
.
frame
(
maxWidth
:
.
infinity
)
if
(
CharacterSet
.
decimalDigits
.
isSuperset
(
of
:
CharacterSet
(
charactersIn
:
"123456789101112
"
)))
{
if
(
CharacterSet
.
decimalDigits
.
isSuperset
(
of
:
CharacterSet
(
charactersIn
:
coupon
[
"coupon"
]
as?
String
??
"
"
)))
{
VStack
(
alignment
:
.
center
)
{
VStack
{}
.
frame
(
height
:
1
)
...
...
@@ -157,13 +157,44 @@ extension CouponBarcodeView {
.
padding
(
.
top
,
self
.
uiscreen
.
height
*
0.015
)
// TODO: Add the barcode
// Image(uiImage: UIImage(ciImage: output))
// let isValid = RSUnifiedCodeValidator.shared.isValid("1234567891234", machineReadableCodeObjectType: AVMetadataObject.ObjectType.ean13.rawValue)
// if let barcodeImage = RSUnifiedCodeGenerator.shared.generateCode("1234567891234", machineReadableCodeObjectType: AVMetadataObject.ObjectType.ean13.rawValue, targetSize: CGSize(width: 300, height: 300)) {
// VStack(alignment: .center) {
// Image(uiImage: image)
// .resizable()
// .aspectRatio(contentMode: .fit)
// .frame(width: self.uiscreen.width * 0.8, height: self.uiscreen.height * 0.05)
//
// }
// .frame(maxWidth: .infinity)
// .padding(.top, self.uiscreen.height * 0.01)
// Image(uiImage: UIImage(named: "ic_back")!)
// .renderingMode(.original)
// .resizable()
// .aspectRatio(contentMode: .fit)
// .frame(width: 300, height: 300)
// Image(uiImage: barcodeImage)
// .renderingMode(.original)
// .resizable()
// .aspectRatio(contentMode: .fit)
// .frame(width: 300, height: 300)
// .frame(width: self.uiscreen.width * 0.8, height: self.uiscreen.height * 0.05)
// }
// generateBarcode(from: "1234567891234")
// ?
// .resizable()
// .aspectRatio(contentMode: .fit)
// .frame(width: self.uiscreen.width, height: self.uiscreen.height * 0.1)
Text
(
"123456789101112
"
)
Text
(
coupon
[
"coupon"
]
as?
String
??
"
"
)
.
fontWeight
(
.
regular
)
.
font
(
.
system
(
size
:
22
))
.
foregroundColor
(
Color
(
red
:
0.2549019607843137
,
green
:
0.3333333333333333
,
blue
:
0.39215686274509803
))
...
...
Please
register
or
login
to post a comment