Skip to content

Commit

Permalink
feat: update example app to v1.0.8
Browse files Browse the repository at this point in the history
Using the Anyline Tire Tread SDK v3.0.0
  • Loading branch information
ricardocolombo committed Dec 28, 2023
1 parent 3d0625f commit 54508d5
Show file tree
Hide file tree
Showing 41 changed files with 2,246 additions and 1,370 deletions.
1,076 changes: 545 additions & 531 deletions Anyline Tire Demo.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/Alamofire/Alamofire",
"state" : {
"revision" : "bc268c28fb170f494de9e9927c371b8342979ece",
"version" : "5.7.1"
}
},
{
"identity" : "anyline-tiretread-spm-module",
"kind" : "remoteSourceControl",
"location" : "https://github.com/Anyline/anyline-tiretread-spm-module",
"state" : {
"revision" : "b805e64cc1cdc55c3d67d9450c457724741eee3d",
"version" : "2.1.0"
"revision" : "3dc6a42c7727c49bf26508e29b0a0b35f9c7e1ad",
"version" : "5.8.1"
}
},
{
Expand All @@ -24,7 +15,7 @@
"location" : "https://github.com/evgenyneu/keychain-swift.git",
"state" : {
"branch" : "master",
"revision" : "c1fde55798b164cad44b5e23cfa2f0f1ebcd76af"
"revision" : "95219e66c94b6ba25e7d6ece7aecf1ea13134174"
}
},
{
Expand All @@ -33,7 +24,7 @@
"location" : "https://github.com/SnapKit/SnapKit.git",
"state" : {
"branch" : "develop",
"revision" : "58320fe80522414bf3a7e24c88123581dc586752"
"revision" : "4d52cc3768ec5d345827b063dfa59e98a929965d"
}
}
],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1200"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
runPostActionsOnFailure = "NO">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "NO"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "YES"
buildForAnalyzing = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4970B307CD8FFCB7C0762116"
BuildableName = "Anyline Tire Demo.app"
BlueprintName = "Anyline Tire Demo"
ReferencedContainer = "container:Anyline Tire Demo.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
onlyGenerateCoverageForSpecifiedTargets = "NO">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4970B307CD8FFCB7C0762116"
BuildableName = "Anyline Tire Demo.app"
BlueprintName = "Anyline Tire Demo"
ReferencedContainer = "container:Anyline Tire Demo.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4970B307CD8FFCB7C0762116"
BuildableName = "Anyline Tire Demo.app"
BlueprintName = "Anyline Tire Demo"
ReferencedContainer = "container:Anyline Tire Demo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<CommandLineArguments>
</CommandLineArguments>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4970B307CD8FFCB7C0762116"
BuildableName = "Anyline Tire Demo.app"
BlueprintName = "Anyline Tire Demo"
ReferencedContainer = "container:Anyline Tire Demo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "QR Code Icon.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions Anyline Tire Demo/DataStorage/UserDefaultsManager.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Foundation
import AnylineTireTreadSdk

struct UserDefaultsManager {
static var shared = UserDefaultsManager()
Expand Down Expand Up @@ -39,4 +40,20 @@ struct UserDefaultsManager {
UserDefaults.standard.set(newValue, forKey: "imperialSystem")
}
}

var scanSpeed: ScanSpeed {
get {
switch Int32(UserDefaults.standard.integer(forKey: "scanSpeed")) {
case ScanSpeed.fast.ordinal:
return .fast
case ScanSpeed.slow.ordinal:
return .slow
default:
return .slow
}
}
set {
UserDefaults.standard.setValue(newValue.ordinal, forKey: "scanSpeed")
}
}
}
20 changes: 18 additions & 2 deletions Anyline Tire Demo/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,29 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>UIAppFonts</key>
<array>
<string>ProximaNova-Bold.otf</string>
<string>ProximaNova-Light.otf</string>
<string>ProximaNova-Regular.otf</string>
<string>ProximaNova-Light.otf</string>
<string>ProximaNova-Bold.otf</string>
</array>
<key>UIApplicationSceneManifest</key>
<dict>
Expand Down
13 changes: 10 additions & 3 deletions Anyline Tire Demo/Presentation/Components/ATDSideButton.swift
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
import UIKit

final class ATDSideButton: UIButton {

// MARK: - Private Properties
private let cornerRadius: CGFloat = 15

// MARK: - Init
init(title: String) {
super.init(frame: .zero)
setup(title: title)
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

override var isEnabled: Bool {
didSet {
backgroundColor = isEnabled ? ColorStruct.anylineBlue : ColorStruct.skyGrey
}
}
}

// MARK: - Private func
private extension ATDSideButton {
func setup(title: String) {
setTitle(title, for: .normal)
setTitleColor(ColorStruct.snowWhite, for: .normal)
setTitleColor(ColorStruct.skyGrey, for: .highlighted)
backgroundColor = ColorStruct.anylineBlue
contentHorizontalAlignment = .center
layer.maskedCorners = [.layerMinXMinYCorner, .layerMinXMaxYCorner]
Expand Down
20 changes: 10 additions & 10 deletions Anyline Tire Demo/Presentation/Components/ATDTopView.swift
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import UIKit

class ATDTopView: UIView {

// MARK: - UI Properties
private lazy var logoImageView: UIImageView = {
let imageView = UIImageView()
imageView.image = UIImage(named: "anyline_logo_black")
imageView.image = UIImage(named: "anyline_Logo_Black")
imageView.contentMode = .scaleAspectFit
imageView.tintColor = .white
return imageView
}()

lazy var appNameLabel: UILabel = {
let label = UILabel()
let boldText = "TIRE TREAD"
Expand All @@ -25,7 +25,7 @@ class ATDTopView: UIView {
label.translatesAutoresizingMaskIntoConstraints = false
return label
}()

// MARK: - Private Properties

// MARK: - Init
Expand All @@ -45,27 +45,27 @@ class ATDTopView: UIView {

// MARK: - Private functions
private extension ATDTopView {

// MARK: - Setup UI
func configureView() {
backgroundColor = ColorStruct.stoneGrey
}

func addSubviews() {
self.addSubview(logoImageView)
self.addSubview(appNameLabel)
}

func setupLayout() {

self.logoImageView.snp.makeConstraints { make in
make.height.equalTo(35)
make.width.equalTo(150)
make.leading.equalTo(25)
make.top.equalTo(9)
make.bottom.equalTo(-9)
make.bottom.greaterThanOrEqualTo(-9)
}

self.appNameLabel.snp.makeConstraints { make in
make.width.equalTo(300)
make.trailing.equalTo(16)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ extension FeedbackViewController: FeedbackButtonActionsDelegate {
let safeMiddleValue = Double(middleValue),
let safeRightValue = Double(rightValue)
{
let leftTreadResultRegion = TreadResultRegion.companion.doInitMm(isAvailable: true, confidence: 100, value: safeLeftValue)
let middleTreadResultRegion = TreadResultRegion.companion.doInitMm(isAvailable: true, confidence: 100, value: safeMiddleValue)
let rightTreadResultRegion = TreadResultRegion.companion.doInitMm(isAvailable: true, confidence: 100, value: safeRightValue)
let leftTreadResultRegion = TreadResultRegion.companion.doInitMm(isAvailable: true, value: safeLeftValue)
let middleTreadResultRegion = TreadResultRegion.companion.doInitMm(isAvailable: true, value: safeMiddleValue)
let rightTreadResultRegion = TreadResultRegion.companion.doInitMm(isAvailable: true, value: safeRightValue)

let treadResultRegions = [leftTreadResultRegion, middleTreadResultRegion, rightTreadResultRegion]

Expand Down
Loading

0 comments on commit 54508d5

Please sign in to comment.