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-29 14:53:44 +0300
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
c12306aefcda2c758839bb72f2a0e4121d8a8a9e
c12306ae
2 parents
6c0c7bd0
9a72486e
Merge branch 'master' of
https://git.warp.ly/open-source/warply_sdk_framework
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
60 deletions
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS.xcodeproj/project.pbxproj
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS.xcworkspace/xcshareddata/swiftpm/Package.resolved
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS/CouponBarcodeView.swift
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS.xcodeproj/project.pbxproj
View file @
c12306a
...
...
@@ -15,6 +15,7 @@
1E879E27281AC99F0089F489 /* OldCouponsViewInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E879E26281AC99F0089F489 /* OldCouponsViewInterface.swift */; };
1E98EC1428199C4F007524A0 /* AllGiftsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E98EC1328199C4F007524A0 /* AllGiftsView.swift */; };
1E98EC1628199C86007524A0 /* AllGiftsViewInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E98EC1528199C86007524A0 /* AllGiftsViewInterface.swift */; };
1EBB036F281BE3610062F663 /* RSBarcodes_Swift in Frameworks */ = {isa = PBXBuildFile; productRef = 1EBB036E281BE3610062F663 /* RSBarcodes_Swift */; };
1EBEB02D280D69D800BF802C /* GiftsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EBEB02C280D69D800BF802C /* GiftsView.swift */; };
1EBEB02F280D6AA500BF802C /* GiftsViewInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EBEB02E280D6AA500BF802C /* GiftsViewInterface.swift */; };
260C6A1AFF7560C32E212F20 /* Pods_WarplySDKFrameworkIOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1353B8C484CC0649CAC2EB74 /* Pods_WarplySDKFrameworkIOS.framework */; };
...
...
@@ -292,6 +293,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
1EBB036F281BE3610062F663 /* RSBarcodes_Swift in Frameworks */,
260C6A1AFF7560C32E212F20 /* Pods_WarplySDKFrameworkIOS.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
...
...
@@ -671,6 +673,9 @@
dependencies = (
);
name = WarplySDKFrameworkIOS;
packageProductDependencies = (
1EBB036E281BE3610062F663 /* RSBarcodes_Swift */,
);
productName = WarplySDKFrameworkIOS;
productReference = E6D8DE6827A942010006A3A9 /* WarplySDKFrameworkIOS.framework */;
productType = "com.apple.product-type.framework";
...
...
@@ -699,6 +704,9 @@
Base,
);
mainGroup = E6D8DE5E27A942000006A3A9;
packageReferences = (
1EBB036D281BE3610062F663 /* XCRemoteSwiftPackageReference "RSBarcodes_Swift" */,
);
productRefGroup = E6D8DE6927A942010006A3A9 /* Products */;
projectDirPath = "";
projectRoot = "";
...
...
@@ -1045,6 +1053,25 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
/* Begin XCRemoteSwiftPackageReference section */
1EBB036D281BE3610062F663 /* XCRemoteSwiftPackageReference "RSBarcodes_Swift" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/yeahdongcn/RSBarcodes_Swift";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 5.0.0;
};
};
/* End XCRemoteSwiftPackageReference section */
/* Begin XCSwiftPackageProductDependency section */
1EBB036E281BE3610062F663 /* RSBarcodes_Swift */ = {
isa = XCSwiftPackageProductDependency;
package = 1EBB036D281BE3610062F663 /* XCRemoteSwiftPackageReference "RSBarcodes_Swift" */;
productName = RSBarcodes_Swift;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = E6D8DE5F27A942010006A3A9 /* Project object */;
}
...
...
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS.xcworkspace/xcshareddata/swiftpm/Package.resolved
0 → 100644
View file @
c12306a
{
"object"
:
{
"pins"
:
[
{
"package"
:
"RSBarcodes_Swift"
,
"repositoryURL"
:
"https://github.com/yeahdongcn/RSBarcodes_Swift"
,
"state"
:
{
"branch"
:
null
,
"revision"
:
"86d8b1a1439e7edb19793d17732b15fd784a0a15"
,
"version"
:
"5.1.1"
}
}
]
},
"version"
:
1
}
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
View file @
c12306a
No preview for this file type
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS/CouponBarcodeView.swift
View file @
c12306a
...
...
@@ -10,8 +10,9 @@ import SwiftUI
import
Combine
import
Foundation
import
UIKit
// import RSBarcodes_Swift
// import AVFoundation
// TODO: Uncomment for barcode
//import RSBarcodes_Swift
//import AVFoundation
...
...
@@ -95,35 +96,6 @@ extension CouponBarcodeView {
}
func
generateBarcode
(
from
string
:
String
)
->
Image
?
{
let
data
=
string
.
data
(
using
:
String
.
Encoding
.
ascii
)
if
let
filter
=
CIFilter
(
name
:
"CICode128BarcodeGenerator"
)
{
filter
.
setValue
(
data
,
forKey
:
"inputMessage"
)
// let transform = CGAffineTransform(scaleX: 3, y: 3)
// if let output = filter.outputImage?.transformed(by: transform) {
if
let
output
=
filter
.
outputImage
{
// // Change the color using CIFilter
// let colorParameters = [
// "inputColor0": CIColor(color: UIColor.black), // Foreground
// "inputColor1": CIColor(color: UIColor.clear) // Background
// ]
// let colored = output.applyingFilter("CIFalseColor", parameters: colorParameters)
let
image
=
Image
(
uiImage
:
UIImage
(
ciImage
:
output
))
// return UIImage(ciImage: output)
return
image
}
}
return
nil
}
func
constructBarcode
()
->
String
?
{
// EAN 13 barcode construction
let
couponData
=
coupon
[
"coupon_data"
]
as?
[
String
:
Any
]
??
[
""
:
""
]
...
...
@@ -161,6 +133,7 @@ extension CouponBarcodeView {
var
body
:
some
View
{
let
couponData
=
coupon
[
"coupon_data"
]
as?
[
String
:
Any
]
??
[
""
:
""
]
let
barcodeString
=
constructBarcode
()
??
""
GeometryReader
{
geometry
in
ScrollView
(
showsIndicators
:
false
)
{
...
...
@@ -222,45 +195,24 @@ extension CouponBarcodeView {
.
frame
(
maxWidth
:
.
infinity
)
.
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)) {
// let isValid = RSUnifiedCodeValidator.shared.isValid(barcodeString, machineReadableCodeObjectType: AVMetadataObject.ObjectType.ean13.rawValue)
// TODO: Uncomment for barcode
// if let barcodeImage = RSUnifiedCodeGenerator.shared.generateCode(barcodeString, machineReadableCodeObjectType: AVMetadataObject.ObjectType.ean13.rawValue, targetSize: CGSize(width: self.uiscreen.width * 0.8, height: self.uiscreen.height * 0.1)) {
//
////
// VStack(alignment: .center) {
//
Image(uiImage: i
mage)
//
Image(uiImage: barcodeI
mage)
// .resizable()
// .aspectRatio(contentMode: .fit)
// .frame(width: self.uiscreen.width * 0.8, height: self.uiscreen.height * 0.05)
//
// .frame(width: self.uiscreen.width * 0.8, height: self.uiscreen.height * 0.1)
// }
// .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
(
constructBarcode
()
??
""
)
Text
(
barcodeString
)
.
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