Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
3AEC4CC428DA671500733231 /* EmptyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AEC4CC328DA671500733231 /* EmptyView.swift */; };
63FF52CB15549064843C73DF /* Pods_DeliveryApp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0448F42AD61170E17D9F1810 /* Pods_DeliveryApp.framework */; };
876C15CE28D918780016A88E /* LoadingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 876C15CD28D918780016A88E /* LoadingView.swift */; };
876C15D028D91B6E0016A88E /* ViewCodeProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 876C15CF28D91B6E0016A88E /* ViewCodeProtocol.swift */; };
Expand Down Expand Up @@ -50,6 +51,7 @@
/* Begin PBXFileReference section */
0448F42AD61170E17D9F1810 /* Pods_DeliveryApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_DeliveryApp.framework; sourceTree = BUILT_PRODUCTS_DIR; };
28732BDCBF9CB8F20D976BA6 /* Pods-DeliveryAppTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DeliveryAppTests.debug.xcconfig"; path = "Target Support Files/Pods-DeliveryAppTests/Pods-DeliveryAppTests.debug.xcconfig"; sourceTree = "<group>"; };
3AEC4CC328DA671500733231 /* EmptyView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EmptyView.swift; sourceTree = "<group>"; };
53D70E9C975A30B7F20A3F8D /* Pods_DeliveryAppTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_DeliveryAppTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
811AB034AC0ED48496D3A4D8 /* Pods-DeliveryAppTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DeliveryAppTests.release.xcconfig"; path = "Target Support Files/Pods-DeliveryAppTests/Pods-DeliveryAppTests.release.xcconfig"; sourceTree = "<group>"; };
876C15CD28D918780016A88E /* LoadingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadingView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -253,6 +255,7 @@
98F12963272F307100B88A87 /* Components */ = {
isa = PBXGroup;
children = (
3AEC4CC328DA671500733231 /* EmptyView.swift */,
98C4368027ADADC000D9048A /* SampleComponentView.swift */,
876C15CD28D918780016A88E /* LoadingView.swift */,
876C15CF28D91B6E0016A88E /* ViewCodeProtocol.swift */,
Expand Down Expand Up @@ -286,7 +289,6 @@
28732BDCBF9CB8F20D976BA6 /* Pods-DeliveryAppTests.debug.xcconfig */,
811AB034AC0ED48496D3A4D8 /* Pods-DeliveryAppTests.release.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
Expand Down Expand Up @@ -470,6 +472,7 @@
98AF573627ADB34C00339A66 /* DebugViewController.swift in Sources */,
98AF572327ADB16E00339A66 /* SceneDelegate.swift in Sources */,
876C15CE28D918780016A88E /* LoadingView.swift in Sources */,
3AEC4CC428DA671500733231 /* EmptyView.swift in Sources */,
98AF572427ADB16E00339A66 /* SampleComponentView.swift in Sources */,
98AF572527ADB16E00339A66 /* HomeViewController.swift in Sources */,
98AF572627ADB16E00339A66 /* HomeView.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
//
// EmptyView.swift
// DeliveryApp
//
// Created by Dio on 19/09/22.
//

import UIKit

final class EmptyView: UIView {

private lazy var labelTitle: UILabel = {
let label = UILabel()
label.text = "Endereço não encontrado"
label.font = UIFont.boldSystemFont(ofSize: 17)
label.translatesAutoresizingMaskIntoConstraints = false

return label
}()

private lazy var labelSubtitle: UILabel = {
let label = UILabel()
label.text = "Procure por ruas com números e bairro utilizando o campo de busca"
label.textColor = UIColor.gray
label.font = UIFont.systemFont(ofSize: 13)
label.textAlignment = .center
label.numberOfLines = 0
label.translatesAutoresizingMaskIntoConstraints = false

return label
}()

//MARK: - Initialization

override init(frame: CGRect) {
super.init(frame: frame)

setupViews()
}

@available(*, unavailable)
required init?(coder: NSCoder) { nil }

}

//MARK: - View code protocol

extension EmptyView: ViewCodeProtocol{

func configViews() {
translatesAutoresizingMaskIntoConstraints = false
}

func buildViews() {
addSubviews([labelTitle, labelSubtitle])
}

func setupConstraints() {
NSLayoutConstraint.activate([
labelTitle.bottomAnchor.constraint(equalTo: centerYAnchor, constant: -7.5),
labelTitle.centerXAnchor.constraint(equalTo: centerXAnchor),

labelSubtitle.topAnchor.constraint(equalTo: centerYAnchor, constant: 7.5),
labelSubtitle.centerXAnchor.constraint(equalTo: centerXAnchor),
labelSubtitle.leadingAnchor.constraint(equalTo: leadingAnchor, constant: 53),
labelSubtitle.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -54)
])
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,9 @@ extension ViewCodeProtocol where Self: UIView {
views.forEach(addSubview)
}
}

extension ViewCodeProtocol where Self: UIStackView {
func addArrangedSubviews(_ views: [UIView]) {
views.forEach(addArrangedSubview)
}
}