-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to the Anyline Tire Tread SDK v9.0.0
Co-authored-by: Measure Team - Anyline <[email protected]>
- Loading branch information
1 parent
25b3416
commit 1b5cf65
Showing
11 changed files
with
158 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
104 changes: 104 additions & 0 deletions
104
Anyline Tire Demo/Presentation/Features/Settings/View/CustomTagSettingsView.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
// | ||
// LicenseSettingsView 2.swift | ||
// Anyline Tire Demo | ||
// | ||
// Created by Patrick Fekete on 15.11.24. | ||
// | ||
|
||
|
||
import UIKit | ||
|
||
class CustomTagSettingsView: UIView { | ||
|
||
// MARK: - UI properties | ||
private lazy var customTagLabel: ATDTextLabel = { | ||
let label = ATDTextLabel(text: "settings.label.custom_tag".localized()) | ||
return label | ||
}() | ||
|
||
lazy var customTagTextField: ATDTextField = { | ||
let textField = ATDTextField(backgroundColor: ColorStruct.snowWhite) | ||
textField.placeholder = "settings.label.custom_tag.placeholer".localized() | ||
textField.returnKeyType = .done | ||
return textField | ||
}() | ||
|
||
private lazy var licenseHStackView: UIStackView = { | ||
let stackView = UIStackView() | ||
stackView.axis = .horizontal | ||
stackView.alignment = .leading | ||
stackView.spacing = 20 | ||
return stackView | ||
}() | ||
|
||
private lazy var contentVStackView: UIStackView = { | ||
let stackView = UIStackView() | ||
stackView.axis = .vertical | ||
stackView.alignment = .leading | ||
stackView.distribution = .fillProportionally | ||
stackView.spacing = 10 | ||
return stackView | ||
}() | ||
|
||
// MARK: - Private Properties | ||
|
||
// MARK: - Public properties | ||
|
||
// MARK: - Init | ||
override init(frame: CGRect) { | ||
super.init(frame: frame) | ||
configureView() | ||
addSubviews() | ||
setupLayout() | ||
customTagTextField.delegate = self | ||
} | ||
|
||
required init?(coder: NSCoder) { | ||
super.init(coder: coder) | ||
} | ||
|
||
} | ||
|
||
// MARK: - Private functions | ||
private extension CustomTagSettingsView { | ||
|
||
// MARK: - Setup UI | ||
func configureView() { | ||
backgroundColor = ColorStruct.snowWhite | ||
customTagTextField.text = UserDefaultsManager.shared.customTag ?? "" | ||
} | ||
|
||
func addSubviews() { | ||
self.addSubview(contentVStackView) | ||
self.contentVStackView.addArrangedSubview(licenseHStackView) | ||
self.licenseHStackView.addArrangedSubview(customTagLabel) | ||
self.licenseHStackView.addArrangedSubview(customTagTextField) | ||
} | ||
|
||
func setupLayout() { | ||
|
||
contentVStackView.snp.makeConstraints { make in | ||
make.edges.equalToSuperview() | ||
} | ||
|
||
customTagLabel.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal) | ||
customTagLabel.snp.makeConstraints { make in | ||
make.centerY.equalTo(customTagTextField.snp.centerY) | ||
} | ||
|
||
customTagTextField.snp.makeConstraints { make in | ||
make.height.equalTo(40) | ||
make.width.lessThanOrEqualTo(280) | ||
} | ||
} | ||
} | ||
|
||
// MARK: - UITextFieldDelegate | ||
extension CustomTagSettingsView: UITextFieldDelegate { | ||
|
||
func textFieldShouldReturn(_ textField: UITextField) -> Bool { | ||
self.customTagTextField.resignFirstResponder() | ||
return true | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.