Skip to content

Commit

Permalink
item info vc suoerclass
Browse files Browse the repository at this point in the history
  • Loading branch information
grenos committed Apr 4, 2020
1 parent f8ea07b commit c2b2f06
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 0 deletions.
4 changes: 4 additions & 0 deletions GHFollowers.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

/* Begin PBXBuildFile section */
7D7C665224388F0900733687 /* GFItemInfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D7C665124388F0900733687 /* GFItemInfoView.swift */; };
7D7C6654243897F300733687 /* GFItemInfoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D7C6653243897F300733687 /* GFItemInfoVC.swift */; };
7D98BB282428FE73006C53E9 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D98BB272428FE73006C53E9 /* AppDelegate.swift */; };
7D98BB2A2428FE73006C53E9 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D98BB292428FE73006C53E9 /* SceneDelegate.swift */; };
7D98BB312428FE75006C53E9 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7D98BB302428FE75006C53E9 /* Assets.xcassets */; };
Expand Down Expand Up @@ -38,6 +39,7 @@

/* Begin PBXFileReference section */
7D7C665124388F0900733687 /* GFItemInfoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GFItemInfoView.swift; sourceTree = "<group>"; };
7D7C6653243897F300733687 /* GFItemInfoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GFItemInfoVC.swift; sourceTree = "<group>"; };
7D98BB242428FE73006C53E9 /* GHFollowers.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GHFollowers.app; sourceTree = BUILT_PRODUCTS_DIR; };
7D98BB272428FE73006C53E9 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
7D98BB292428FE73006C53E9 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -238,6 +240,7 @@
children = (
7D98BB49242A55ED006C53E9 /* GFAlertVC.swift */,
7DA45F842433FAF800AB426F /* GFUserInfoheaderVC.swift */,
7D7C6653243897F300733687 /* GFItemInfoVC.swift */,
);
path = ViewControllers;
sourceTree = "<group>";
Expand Down Expand Up @@ -330,6 +333,7 @@
7DA45F812433DE1300AB426F /* GFTitleLabel-Secondary.swift in Sources */,
7D98BB44242A29B4006C53E9 /* FollowerListVC.swift in Sources */,
7DA45F6C242BAEEC00AB426F /* ErrorMessage.swift in Sources */,
7D7C6654243897F300733687 /* GFItemInfoVC.swift in Sources */,
7DA45F73242E332000AB426F /* UIHelper.swift in Sources */,
7DA45F69242B831900AB426F /* NetworkManager.swift in Sources */,
7D98BB282428FE73006C53E9 /* AppDelegate.swift in Sources */,
Expand Down
Binary file not shown.
63 changes: 63 additions & 0 deletions GHFollowers/Components/ViewControllers/GFItemInfoVC.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
//
// GFItemInfoVC.swift
// GHFollowers
//
// Created by Vasileios Gkreen on 04/04/2020.
// Copyright © 2020 Vasileios Gkreen. All rights reserved.
//

import UIKit

class GFItemInfoVC: UIViewController {

let stackView = UIStackView()
let itemInfoView1 = GFItemInfoView()
let itemInfoView2 = GFItemInfoView()
let actionButton = GFButton()

override func viewDidLoad() {
super.viewDidLoad()
configureBackgroundView()
layoutUI()
configureStackView()
}


private func configureBackgroundView() {
view.layer.cornerRadius = 18
view.backgroundColor = .secondarySystemBackground
}


private func configureStackView() {
stackView.axis = .horizontal
stackView.distribution = .equalSpacing

stackView.addArrangedSubview(itemInfoView1)
stackView.addArrangedSubview(itemInfoView2)
}


private func layoutUI() {
view.addSubview(stackView)
view.addSubview(actionButton)

stackView.translatesAutoresizingMaskIntoConstraints = false
let padding: CGFloat = 20

NSLayoutConstraint.activate([
stackView.topAnchor.constraint(equalTo: view.topAnchor, constant: padding),
stackView.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: padding),
stackView.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -padding),
stackView.heightAnchor.constraint(equalToConstant: 50),

actionButton.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: -padding),
actionButton.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: padding),
actionButton.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -padding),
actionButton.heightAnchor.constraint(equalToConstant: 44)
])
}


}

0 comments on commit c2b2f06

Please sign in to comment.