Skip to content

Commit a48dab5

Browse files
authored
Merge pull request #1 from ozzycodeyolo/develop
Develop
2 parents ec7e98c + 763b514 commit a48dab5

File tree

67 files changed

+2647
-476
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+2647
-476
lines changed

SpaceXUIKit.xcodeproj/project.pbxproj

Lines changed: 271 additions & 24 deletions
Large diffs are not rendered by default.

SpaceXUIKit/Animations/astronaut01.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

SpaceXUIKit/Animations/astronaut04.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

SpaceXUIKit/Animations/rocket02.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

SpaceXUIKit/Animations/rocket03.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"colors" : [
3+
{
4+
"color" : {
5+
"color-space" : "extended-gray",
6+
"components" : {
7+
"alpha" : "0.500",
8+
"white" : "0.000"
9+
}
10+
},
11+
"idiom" : "universal"
12+
},
13+
{
14+
"appearances" : [
15+
{
16+
"appearance" : "luminosity",
17+
"value" : "dark"
18+
}
19+
],
20+
"color" : {
21+
"color-space" : "extended-gray",
22+
"components" : {
23+
"alpha" : "0.300",
24+
"white" : "1.000"
25+
}
26+
},
27+
"idiom" : "universal"
28+
}
29+
],
30+
"info" : {
31+
"author" : "xcode",
32+
"version" : 1
33+
}
34+
}

SpaceXUIKit/Assets.xcassets/clever.imageset/Contents.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"images" : [
33
{
4+
"filename" : "52DE5881-1762-4E69-9041-1631794F3A55.jpeg",
45
"idiom" : "universal",
56
"scale" : "1x"
67
},
78
{
8-
"filename" : "52DE5881-1762-4E69-9041-1631794F3A55.jpeg",
99
"idiom" : "universal",
1010
"scale" : "2x"
1111
},
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "falconHeavy.png",
5+
"idiom" : "universal",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "universal",
10+
"scale" : "2x"
11+
},
12+
{
13+
"idiom" : "universal",
14+
"scale" : "3x"
15+
}
16+
],
17+
"info" : {
18+
"author" : "xcode",
19+
"version" : 1
20+
}
21+
}
59.9 KB
Loading
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
//
2+
// AlertVC.swift
3+
// SpaceXUIKit
4+
//
5+
// Created by Jan Kučera on 18.02.2022.
6+
//
7+
8+
import UIKit
9+
10+
final class AlertVC: UIViewController {
11+
12+
let conteinerView: UIView = {
13+
let conteiner: UIView = UIView()
14+
conteiner.translatesAutoresizingMaskIntoConstraints = false
15+
conteiner.backgroundColor = .systemBackground
16+
conteiner.layer.borderWidth = 2
17+
conteiner.layer.borderColor = UIColor.systemYellow.cgColor
18+
conteiner.layer.cornerRadius = 10
19+
return conteiner
20+
}()
21+
let titleLabel: SectionTitleLabel = SectionTitleLabel(titled: "Error", sized: 36)
22+
let descriptionLabel: UILabel = {
23+
let label: UILabel = UILabel()
24+
label.translatesAutoresizingMaskIntoConstraints = false
25+
label.numberOfLines = 3
26+
label.lineBreakMode = .byWordWrapping
27+
label.textAlignment = .center
28+
return label
29+
}()
30+
let confirmationButton: UIButton = {
31+
let button: UIButton = UIButton()
32+
button.translatesAutoresizingMaskIntoConstraints = false
33+
button.configuration = .filled()
34+
button.tintColor = .systemYellow
35+
button.addTarget(self, action: #selector(dismissVC), for: .touchUpInside)
36+
return button
37+
}()
38+
39+
override func viewDidLoad() {
40+
super.viewDidLoad()
41+
view.backgroundColor = UIColor(named: "alertColor")
42+
// Subviews
43+
conteinerView.addSubview(titleLabel)
44+
conteinerView.addSubview(descriptionLabel)
45+
conteinerView.addSubview(confirmationButton)
46+
view.addSubview(conteinerView)
47+
// UI Config
48+
NSLayoutConstraint.activate([
49+
// CONTAINER
50+
conteinerView.centerYAnchor.constraint(equalTo: view.centerYAnchor),
51+
conteinerView.centerXAnchor.constraint(equalTo: view.centerXAnchor),
52+
conteinerView.widthAnchor.constraint(equalToConstant: 280),
53+
conteinerView.heightAnchor.constraint(equalToConstant: 220),
54+
// TITLE
55+
titleLabel.topAnchor.constraint(equalTo: conteinerView.topAnchor, constant: ConstraintsHelper.padding),
56+
titleLabel.centerXAnchor.constraint(equalTo: conteinerView.centerXAnchor),
57+
// DESCRIPTION
58+
descriptionLabel.topAnchor.constraint(equalTo: titleLabel.bottomAnchor, constant: ConstraintsHelper.padding),
59+
descriptionLabel.leadingAnchor.constraint(equalTo: conteinerView.leadingAnchor, constant: ConstraintsHelper.padding),
60+
descriptionLabel.trailingAnchor.constraint(equalTo: conteinerView.trailingAnchor, constant: -ConstraintsHelper.padding),
61+
// BUTTON
62+
confirmationButton.leadingAnchor.constraint(equalTo: conteinerView.leadingAnchor, constant: ConstraintsHelper.padding),
63+
confirmationButton.trailingAnchor.constraint(equalTo: conteinerView.trailingAnchor, constant: -ConstraintsHelper.padding),
64+
confirmationButton.bottomAnchor.constraint(equalTo: conteinerView.bottomAnchor, constant: -ConstraintsHelper.padding),
65+
confirmationButton.heightAnchor.constraint(equalToConstant: 44),
66+
67+
])
68+
}
69+
70+
init(titleText: String, description: String, buttonConfirmationText: String) {
71+
super.init(nibName: nil, bundle: nil)
72+
titleLabel.text = titleText
73+
descriptionLabel.text = description
74+
confirmationButton.setTitle(buttonConfirmationText, for: .normal)
75+
}
76+
77+
required init?(coder: NSCoder) {
78+
fatalError("init(coder:) has not been implemented")
79+
}
80+
81+
}
82+
83+
extension AlertVC {
84+
85+
@objc
86+
func dismissVC() {
87+
self.dismiss(animated: true)
88+
}
89+
90+
}

0 commit comments

Comments
 (0)