Skip to content

Commit

Permalink
added delivery pickup time
Browse files Browse the repository at this point in the history
  • Loading branch information
1Soyebo committed Feb 14, 2022
1 parent 18cb377 commit b036117
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
Binary file not shown.
22 changes: 11 additions & 11 deletions FactoryIrisii/Controllers/DeliveryDetailViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import UIKit

/// could have used a tableView, or even better SwiftUI.
/// first time using programmatic UI
/// should have used custom classes too
class DeliveryDetailViewController: UIViewController {

private let appDelegate = UIApplication.shared.delegate as! AppDelegate
Expand All @@ -27,13 +26,13 @@ class DeliveryDetailViewController: UIViewController {

lazy var fromTitleLabel: DeliveryDetailTitleLabel = {
let objectLabel = DeliveryDetailTitleLabel()
objectLabel.text = "From"
objectLabel.text = "From:"
return objectLabel
}()

lazy var toTitleLabel: DeliveryDetailTitleLabel = {
let objectLabel = DeliveryDetailTitleLabel()
objectLabel.text = "To"
objectLabel.text = "To:"
return objectLabel
}()

Expand Down Expand Up @@ -95,7 +94,6 @@ class DeliveryDetailViewController: UIViewController {

lazy var stackViewEmailLabel: HorizontalStackViewTwoLabels = {
let objectStackView = HorizontalStackViewTwoLabels()
objectStackView.distribution = .fillProportionally
objectStackView.addArrangedSubview(emailTitleLabel)
objectStackView.addArrangedSubview(lblEmail)
return objectStackView
Expand All @@ -110,19 +108,19 @@ class DeliveryDetailViewController: UIViewController {

lazy var nameTitleLabel: DeliveryDetailTitleLabel = {
let objectLabel = DeliveryDetailTitleLabel()
objectLabel.text = "Name"
objectLabel.text = "Name:"
return objectLabel
}()

lazy var emailTitleLabel: DeliveryDetailTitleLabel = {
let objectLabel = DeliveryDetailTitleLabel()
objectLabel.text = "Email"
objectLabel.text = "Email:"
return objectLabel
}()

lazy var phoneTitleLabel: DeliveryDetailTitleLabel = {
let objectLabel = DeliveryDetailTitleLabel()
objectLabel.text = "Phone Number"
objectLabel.text = "Phone Number:"
return objectLabel
}()

Expand Down Expand Up @@ -153,12 +151,14 @@ class DeliveryDetailViewController: UIViewController {

lazy var descriptionTitleLabel: SmallTitleDeliveryDetail = {
let objectLabel = SmallTitleDeliveryDetail()
objectLabel.text = "Description"
objectLabel.text = "Description | Pickup Time: \(singleDeliveryObject.getFromTime())"
return objectLabel
}()

lazy var lblDescription: DeliveryDetailTitleLabel = {
return DeliveryDetailTitleLabel()
let objectLabel = DeliveryDetailTitleLabel()
objectLabel.numberOfLines = 0
return objectLabel
}()

lazy var viewDeliveryFee: DeliveryDetailCardView = {
Expand Down Expand Up @@ -322,7 +322,7 @@ class DeliveryDetailViewController: UIViewController {
viewDescription.addSubview(lblDescription)
NSLayoutConstraint.activate([
lblDescription.leftAnchor.constraint(equalTo: viewDescription.leftAnchor, constant: 16),
lblDescription.rightAnchor.constraint(equalTo: viewDescription.rightAnchor, constant: 16),
lblDescription.trailingAnchor.constraint(equalTo: viewDescription.trailingAnchor, constant: -16),
lblDescription.topAnchor.constraint(equalTo: descriptionTitleLabel.bottomAnchor, constant: 8.5),
lblDescription.bottomAnchor.constraint(greaterThanOrEqualTo: viewDescription.bottomAnchor, constant: 8.5)

Expand Down Expand Up @@ -356,7 +356,7 @@ class DeliveryDetailViewController: UIViewController {
NSLayoutConstraint.activate([
btnAddFavourites.leftAnchor.constraint(equalTo: mainScrollView.contentLayoutGuide.leftAnchor, constant: 16),
btnAddFavourites.rightAnchor.constraint(equalTo: mainScrollView.contentLayoutGuide.rightAnchor, constant: 16),
btnAddFavourites.bottomAnchor.constraint(equalTo: mainScrollView.contentLayoutGuide.bottomAnchor, constant: 20),
btnAddFavourites.bottomAnchor.constraint(equalTo: mainScrollView.contentLayoutGuide.bottomAnchor, constant: -20),
btnAddFavourites.topAnchor.constraint(equalTo: viewDeliveryFee.bottomAnchor, constant: 16),
btnAddFavourites.centerXAnchor.constraint(equalTo: mainScrollView.centerXAnchor),
btnAddFavourites.heightAnchor.constraint(equalToConstant: 50)
Expand Down
2 changes: 1 addition & 1 deletion FactoryIrisii/Views/CustomView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class HorizontalStackViewTwoLabels: UIStackView {
super.init(frame : frame)
self.translatesAutoresizingMaskIntoConstraints = false
self.alignment = .fill
self.distribution = .fillEqually
self.distribution = .fillProportionally
self.spacing = 16
self.axis = .horizontal
}
Expand Down

0 comments on commit b036117

Please sign in to comment.