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-04-27 10:32:28 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3e44c763e181aaada7d5d3d05375ce181fdcbaae
3e44c763
1 parent
8a024eaa
CouponBarcodeView changes
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
4 deletions
WarplySDKFrameworkIOS/.DS_Store
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS/CouponBarcodeView.swift
WarplySDKFrameworkIOS/.DS_Store
View file @
3e44c76
No preview for this file type
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
View file @
3e44c76
No preview for this file type
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS/CouponBarcodeView.swift
View file @
3e44c76
...
...
@@ -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
:
"1234567891
01112
"
)))
{
if
(
CharacterSet
.
decimalDigits
.
isSuperset
(
of
:
CharacterSet
(
charactersIn
:
"1234567891
234
"
)))
{
VStack
(
alignment
:
.
center
)
{
VStack
{}
.
frame
(
height
:
1
)
...
...
@@ -157,13 +157,41 @@ 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
gen
=
RSUnifiedCodeGenerator
.
shared
{
// gen.fillColor = UIColor.white
// gen.strokeColor = UIColor.black
if
let
image
=
gen
.
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
:
image
)
// .resizable()
// .aspectRatio(contentMode: .fit)
// .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
(
"1234567891
01112
"
)
Text
(
"1234567891
234
"
)
.
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