Commit 70e2051a authored by domenicw's avatar domenicw
Browse files

Added Events View and Jobs View, as well as an Generic Info View (will be used for jobs and events)

parent 499c8063
...@@ -47,6 +47,12 @@ ...@@ -47,6 +47,12 @@
B07A8A0621523B96003CC2D8 /* InfoViewControllerDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B07A8A0521523B96003CC2D8 /* InfoViewControllerDelegate.swift */; }; B07A8A0621523B96003CC2D8 /* InfoViewControllerDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B07A8A0521523B96003CC2D8 /* InfoViewControllerDelegate.swift */; };
B07A8A0921524384003CC2D8 /* OnboardingNavigatorDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B07A8A0821524384003CC2D8 /* OnboardingNavigatorDelegate.swift */; }; B07A8A0921524384003CC2D8 /* OnboardingNavigatorDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B07A8A0821524384003CC2D8 /* OnboardingNavigatorDelegate.swift */; };
B07A8A0B21524474003CC2D8 /* LoginModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = B07A8A0A21524474003CC2D8 /* LoginModel.swift */; }; B07A8A0B21524474003CC2D8 /* LoginModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = B07A8A0A21524474003CC2D8 /* LoginModel.swift */; };
B0FE2EFC2154179600F3D073 /* JobsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0FE2EFB2154179600F3D073 /* JobsViewController.swift */; };
B0FE2EFF21541A2B00F3D073 /* EventsNavigator.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0FE2EFE21541A2B00F3D073 /* EventsNavigator.swift */; };
B0FE2F0221541A6300F3D073 /* EventsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0FE2F0121541A6300F3D073 /* EventsViewController.swift */; };
B0FE2F0621541C5C00F3D073 /* GenericInfoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0FE2F0521541C5C00F3D073 /* GenericInfoViewController.swift */; };
B0FE2F082154230500F3D073 /* GenericInfoViewControllerDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0FE2F072154230500F3D073 /* GenericInfoViewControllerDelegate.swift */; };
B0FE2F0A2154237C00F3D073 /* GenericInfoViewControllerModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0FE2F092154237C00F3D073 /* GenericInfoViewControllerModel.swift */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */ /* Begin PBXContainerItemProxy section */
...@@ -105,6 +111,12 @@ ...@@ -105,6 +111,12 @@
B07A8A0521523B96003CC2D8 /* InfoViewControllerDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InfoViewControllerDelegate.swift; sourceTree = "<group>"; }; B07A8A0521523B96003CC2D8 /* InfoViewControllerDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InfoViewControllerDelegate.swift; sourceTree = "<group>"; };
B07A8A0821524384003CC2D8 /* OnboardingNavigatorDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingNavigatorDelegate.swift; sourceTree = "<group>"; }; B07A8A0821524384003CC2D8 /* OnboardingNavigatorDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingNavigatorDelegate.swift; sourceTree = "<group>"; };
B07A8A0A21524474003CC2D8 /* LoginModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginModel.swift; sourceTree = "<group>"; }; B07A8A0A21524474003CC2D8 /* LoginModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginModel.swift; sourceTree = "<group>"; };
B0FE2EFB2154179600F3D073 /* JobsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JobsViewController.swift; sourceTree = "<group>"; };
B0FE2EFE21541A2B00F3D073 /* EventsNavigator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventsNavigator.swift; sourceTree = "<group>"; };
B0FE2F0121541A6300F3D073 /* EventsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventsViewController.swift; sourceTree = "<group>"; };
B0FE2F0521541C5C00F3D073 /* GenericInfoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GenericInfoViewController.swift; sourceTree = "<group>"; };
B0FE2F072154230500F3D073 /* GenericInfoViewControllerDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GenericInfoViewControllerDelegate.swift; sourceTree = "<group>"; };
B0FE2F092154237C00F3D073 /* GenericInfoViewControllerModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GenericInfoViewControllerModel.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
...@@ -222,6 +234,7 @@ ...@@ -222,6 +234,7 @@
B050E1952151AAB70090CB79 /* Settings */, B050E1952151AAB70090CB79 /* Settings */,
B050E16C215177E30090CB79 /* Amiv Applications */, B050E16C215177E30090CB79 /* Amiv Applications */,
B050E1692151776A0090CB79 /* Jobs */, B050E1692151776A0090CB79 /* Jobs */,
B0FE2EFD21541A1000F3D073 /* Events */,
B050E15A215171E40090CB79 /* Home */, B050E15A215171E40090CB79 /* Home */,
B050E14D21516AFE0090CB79 /* AppNavigator.swift */, B050E14D21516AFE0090CB79 /* AppNavigator.swift */,
); );
...@@ -239,6 +252,8 @@ ...@@ -239,6 +252,8 @@
B050E15221516C860090CB79 /* App */ = { B050E15221516C860090CB79 /* App */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
B0FE2F0321541C3700F3D073 /* Generic */,
B0FE2F0021541A5200F3D073 /* Events */,
B050E1832151A3600090CB79 /* Jobs */, B050E1832151A3600090CB79 /* Jobs */,
B050E1822151A3590090CB79 /* Settings */, B050E1822151A3590090CB79 /* Settings */,
B050E16F2151798B0090CB79 /* Amiv Application */, B050E16F2151798B0090CB79 /* Amiv Application */,
...@@ -380,6 +395,7 @@ ...@@ -380,6 +395,7 @@
B050E1832151A3600090CB79 /* Jobs */ = { B050E1832151A3600090CB79 /* Jobs */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
B0FE2EFB2154179600F3D073 /* JobsViewController.swift */,
); );
path = Jobs; path = Jobs;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -416,6 +432,40 @@ ...@@ -416,6 +432,40 @@
path = Info; path = Info;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
B0FE2EFD21541A1000F3D073 /* Events */ = {
isa = PBXGroup;
children = (
B0FE2EFE21541A2B00F3D073 /* EventsNavigator.swift */,
);
path = Events;
sourceTree = "<group>";
};
B0FE2F0021541A5200F3D073 /* Events */ = {
isa = PBXGroup;
children = (
B0FE2F0121541A6300F3D073 /* EventsViewController.swift */,
);
path = Events;
sourceTree = "<group>";
};
B0FE2F0321541C3700F3D073 /* Generic */ = {
isa = PBXGroup;
children = (
B0FE2F0421541C4000F3D073 /* Info */,
);
path = Generic;
sourceTree = "<group>";
};
B0FE2F0421541C4000F3D073 /* Info */ = {
isa = PBXGroup;
children = (
B0FE2F0521541C5C00F3D073 /* GenericInfoViewController.swift */,
B0FE2F072154230500F3D073 /* GenericInfoViewControllerDelegate.swift */,
B0FE2F092154237C00F3D073 /* GenericInfoViewControllerModel.swift */,
);
path = Info;
sourceTree = "<group>";
};
/* End PBXGroup section */ /* End PBXGroup section */
/* Begin PBXNativeTarget section */ /* Begin PBXNativeTarget section */
...@@ -524,6 +574,8 @@ ...@@ -524,6 +574,8 @@
B050E17521517E1B0090CB79 /* AmivApplicationViewControllerDelegate.swift in Sources */, B050E17521517E1B0090CB79 /* AmivApplicationViewControllerDelegate.swift in Sources */,
B050E120215169230090CB79 /* AppDelegate.swift in Sources */, B050E120215169230090CB79 /* AppDelegate.swift in Sources */,
B07A89FE2152316C003CC2D8 /* InfoViewController.swift in Sources */, B07A89FE2152316C003CC2D8 /* InfoViewController.swift in Sources */,
B0FE2EFF21541A2B00F3D073 /* EventsNavigator.swift in Sources */,
B0FE2F0221541A6300F3D073 /* EventsViewController.swift in Sources */,
B050E17D2151910F0090CB79 /* LoginViewController.swift in Sources */, B050E17D2151910F0090CB79 /* LoginViewController.swift in Sources */,
B050E171215179A30090CB79 /* AmivApplicationViewController.swift in Sources */, B050E171215179A30090CB79 /* AmivApplicationViewController.swift in Sources */,
B050E18A2151A4A80090CB79 /* SettingsAction.swift in Sources */, B050E18A2151A4A80090CB79 /* SettingsAction.swift in Sources */,
...@@ -538,8 +590,11 @@ ...@@ -538,8 +590,11 @@
B050E1972151AAC40090CB79 /* SettingsNavigator.swift in Sources */, B050E1972151AAC40090CB79 /* SettingsNavigator.swift in Sources */,
B050E1942151A9750090CB79 /* Bundle+Extension.swift in Sources */, B050E1942151A9750090CB79 /* Bundle+Extension.swift in Sources */,
B050E14E21516AFE0090CB79 /* AppNavigator.swift in Sources */, B050E14E21516AFE0090CB79 /* AppNavigator.swift in Sources */,
B0FE2F0A2154237C00F3D073 /* GenericInfoViewControllerModel.swift in Sources */,
B050E18121519B390090CB79 /* LoginViewControllerDelegate.swift in Sources */, B050E18121519B390090CB79 /* LoginViewControllerDelegate.swift in Sources */,
B050E18E2151A5660090CB79 /* SettingsCellType.swift in Sources */, B050E18E2151A5660090CB79 /* SettingsCellType.swift in Sources */,
B0FE2F0621541C5C00F3D073 /* GenericInfoViewController.swift in Sources */,
B0FE2F082154230500F3D073 /* GenericInfoViewControllerDelegate.swift in Sources */,
B050E1852151A3700090CB79 /* SettingsViewController.swift in Sources */, B050E1852151A3700090CB79 /* SettingsViewController.swift in Sources */,
B050E1902151A6000090CB79 /* SettingsModel.swift in Sources */, B050E1902151A6000090CB79 /* SettingsModel.swift in Sources */,
B050E15621516D4D0090CB79 /* HomeViewController.swift in Sources */, B050E15621516D4D0090CB79 /* HomeViewController.swift in Sources */,
...@@ -552,6 +607,7 @@ ...@@ -552,6 +607,7 @@
B050E15F2151735A0090CB79 /* UIColor+Extension.swift in Sources */, B050E15F2151735A0090CB79 /* UIColor+Extension.swift in Sources */,
B050E17F215195B50090CB79 /* UIFont+Extension.swift in Sources */, B050E17F215195B50090CB79 /* UIFont+Extension.swift in Sources */,
B07A8A022152384F003CC2D8 /* InfoItemModel.swift in Sources */, B07A8A022152384F003CC2D8 /* InfoItemModel.swift in Sources */,
B0FE2EFC2154179600F3D073 /* JobsViewController.swift in Sources */,
B050E17321517A050090CB79 /* AmivApplication.swift in Sources */, B050E17321517A050090CB79 /* AmivApplication.swift in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
......
...@@ -21,8 +21,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -21,8 +21,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
let window = UIWindow(frame: UIScreen.main.bounds) let window = UIWindow(frame: UIScreen.main.bounds)
self.window = window self.window = window
let rootNavigator = AmivRootNavigator(window: window) let generic = GenericInfoViewController(model: .createTestModel())
self.rootNavigator = rootNavigator window.rootViewController = generic
//let rootNavigator = AmivRootNavigator(window: window)
//self.rootNavigator = rootNavigator
self.window?.makeKeyAndVisible() self.window?.makeKeyAndVisible()
......
...@@ -25,6 +25,8 @@ public class AppNavigator: Navigator { ...@@ -25,6 +25,8 @@ public class AppNavigator: Navigator {
private enum Tab: Int { private enum Tab: Int {
case home case home
case events
case jobs
case apps case apps
case settings case settings
} }
...@@ -42,6 +44,8 @@ public class AppNavigator: Navigator { ...@@ -42,6 +44,8 @@ public class AppNavigator: Navigator {
private func createTabs() { private func createTabs() {
// Create all tabs // Create all tabs
self.createHomeTab() self.createHomeTab()
self.createEventsTab()
self.createJobsTab()
self.createAmivApplicationTab() self.createAmivApplicationTab()
self.createSettingsTab() self.createSettingsTab()
...@@ -56,6 +60,16 @@ public class AppNavigator: Navigator { ...@@ -56,6 +60,16 @@ public class AppNavigator: Navigator {
self.childNavigators.append(home) self.childNavigators.append(home)
} }
private func createEventsTab() {
let events = EventsNavigator()
self.childNavigators.append(events)
}
private func createJobsTab() {
let jobs = JobsNavigator()
self.childNavigators.append(jobs)
}
private func createAmivApplicationTab() { private func createAmivApplicationTab() {
let app = AmivApplicationsNavigator() let app = AmivApplicationsNavigator()
self.childNavigators.append(app) self.childNavigators.append(app)
......
//
// EventsNavigator.swift
// Amiv
//
// Created by Domenic Wüthrich on 20.09.18.
// Copyright © 2018 Amiv an der ETH. All rights reserved.
//
import Foundation
import UIKit
public class EventsNavigator: Navigator {
// MARK: - Variables
public var rootViewController: UIViewController {
return self.navigationController
}
private var navigationController: UINavigationController
// MARK: - Initializers
public init() {
let home = EventsViewController()
self.navigationController = UINavigationController(rootViewController: home)
}
}
...@@ -22,7 +22,8 @@ public class JobsNavigator: Navigator { ...@@ -22,7 +22,8 @@ public class JobsNavigator: Navigator {
// MARK: - Initializers // MARK: - Initializers
public init() { public init() {
self.navigationController = UINavigationController() let jobs = JobsViewController()
self.navigationController = UINavigationController(rootViewController: jobs)
} }
} }
//
// EventsViewController.swift
// Amiv
//
// Created by Domenic Wüthrich on 20.09.18.
// Copyright © 2018 Amiv an der ETH. All rights reserved.
//
import Foundation
import UIKit
public class EventsViewController: UITableViewController {
// MARK: - Variables
// MARK: - Initializers
public init() {
super.init(style: .plain)
self.title = "Events"
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
// MARK: - View Setup
public override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = .white
self.navigationController?.navigationBar.prefersLargeTitles = true
self.navigationItem.largeTitleDisplayMode = .automatic
}
// MARK: - View Interaction
}
// MARK: - Table View Data Source
extension EventsViewController {
public override func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
public override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 0
}
public override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
return UITableViewCell()
}
public override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
return ""
}
}
//
// GenericInfoViewController.swift
// Amiv
//
// Created by Domenic Wüthrich on 20.09.18.
// Copyright © 2018 Amiv an der ETH. All rights reserved.
//
import Foundation
import UIKit
public class GenericInfoViewController: UIViewController {
// MARK: - Variables
public var delegate: GenericInfoViewControllerDelegate?
// MARK: - View Variables
public private(set) var scrollView: UIScrollView!
public private(set) var imageView: UIImageView?
public private(set) var textView: UITextView!
public private(set) var button: UIButton?
// MARK: - Initializers
public init(model: GenericInfoViewControllerModel) {
super.init(nibName: nil, bundle: nil)
self.view.backgroundColor = .white
// View Creation
self.scrollView = self.createScrollView()
self.view.addSubview(self.scrollView)
if let image = model.image {
let view = self.createImageView(image)
self.imageView = view
self.scrollView.addSubview(view)
}
self.textView = self.createTextView(model.text)
self.scrollView.addSubview(self.textView)
if let title = model.titleButton {
let button = self.createButton(title)
self.button = button
self.scrollView.addSubview(button)
}
// View Constraints
self.applyScrollViewConstraints()
self.applyImageViewConstraints()
self.applyTextViewConstraints()
self.applyButtonConstraints()
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
// MARK: - View Creation
private func createScrollView() -> UIScrollView {
let view = UIScrollView()
view.backgroundColor = .white
view.translatesAutoresizingMaskIntoConstraints = false
return view
}
private func applyScrollViewConstraints() {
NSLayoutConstraint(item: self.scrollView, attribute: .top, relatedBy: .equal, toItem: self.view, attribute: .top, multiplier: 1, constant: 0).isActive = true
NSLayoutConstraint(item: self.scrollView, attribute: .leading, relatedBy: .equal, toItem: self.view, attribute: .leading, multiplier: 1, constant: 0).isActive = true
NSLayoutConstraint(item: self.scrollView, attribute: .trailing, relatedBy: .equal, toItem: self.view, attribute: .trailing, multiplier: 1, constant: 0).isActive = true
NSLayoutConstraint(item: self.scrollView, attribute: .bottom, relatedBy: .equal, toItem: self.view, attribute: .bottom, multiplier: 1, constant: 0).isActive = true
}
private func createImageView(_ image: UIImage?) -> UIImageView {
let view = UIImageView()
view.image = image
view.translatesAutoresizingMaskIntoConstraints = false
return view
}
private func applyImageViewConstraints() {
guard let imageView = self.imageView else {
return
}
NSLayoutConstraint(item: imageView, attribute: .top, relatedBy: .equal, toItem: self.scrollView, attribute: .topMargin, multiplier: 1, constant: 0).isActive = true
NSLayoutConstraint(item: imageView, attribute: .leading, relatedBy: .equal, toItem: self.view, attribute: .leadingMargin, multiplier: 1, constant: 0).isActive = true
NSLayoutConstraint(item: imageView, attribute: .trailing, relatedBy: .equal, toItem: self.view, attribute: .trailingMargin, multiplier: 1, constant: 0).isActive = true
NSLayoutConstraint(item: imageView, attribute: .height, relatedBy: .equal, toItem: imageView, attribute: .width, multiplier: 0.7, constant: 0).isActive = true
}
private func createTextView(_ text: String) -> UITextView {
let textView = UITextView()
textView.text = text
textView.isScrollEnabled = false
textView.font = UIFont.preferredFont(forTextStyle: .body)
textView.translatesAutoresizingMaskIntoConstraints = false
return textView
}
private func applyTextViewConstraints() {
if let imageView = self.imageView {
NSLayoutConstraint(item: self.textView, attribute: .top, relatedBy: .equal, toItem: imageView, attribute: .bottom, multiplier: 1, constant: 20).isActive = true
} else {
NSLayoutConstraint(item: self.textView, attribute: .top, relatedBy: .equal, toItem: self.scrollView, attribute: .topMargin, multiplier: 1, constant: 0).isActive = true
}
NSLayoutConstraint(item: self.textView, attribute: .leading, relatedBy: .equal, toItem: self.view, attribute: .leadingMargin, multiplier: 1, constant: 0).isActive = true
NSLayoutConstraint(item: self.textView, attribute: .trailing, relatedBy: .equal, toItem: self.view, attribute: .trailingMargin, multiplier: 1, constant: 0).isActive = true
if self.button == nil {
NSLayoutConstraint(item: self.textView, attribute: .bottom, relatedBy: .equal, toItem: self.scrollView, attribute: .bottom, multiplier: 1, constant: 0).isActive = true
}
}
private func createButton(_ title: String) -> UIButton {
let button = UIButton()
button.setTitle(title, for: .normal)
button.setTitleColor(.white, for: .normal)
button.setTitleColor(.lightGray, for: .highlighted)
button.backgroundColor = .amivRed
button.layer.cornerRadius = 12
button.addTarget(self, action: #selector(self.buttonTapped), for: .touchUpInside)
button.translatesAutoresizingMaskIntoConstraints = false
return button
}
private func applyButtonConstraints() {
guard let button = self.button else {
return
}
NSLayoutConstraint(item: button, attribute: .top, relatedBy: .equal, toItem: self.textView, attribute: .bottom, multiplier: 1, constant: 20).isActive = true
NSLayoutConstraint(item: button, attribute: .leading, relatedBy: .equal, toItem: self.view, attribute: .leadingMargin, multiplier: 1, constant: 10).isActive = true
NSLayoutConstraint(item: button, attribute: .trailing, relatedBy: .equal, toItem: self.view, attribute: .trailingMargin, multiplier: 1, constant: -10).isActive = true
NSLayoutConstraint(item: button, attribute: .bottom, relatedBy: .equal, toItem: self.scrollView, attribute: .bottom, multiplier: 1, constant: 0).isActive = true
NSLayoutConstraint(item: button, attribute: .height, relatedBy: .equal, toItem: nil, attribute: .notAnAttribute, multiplier: 1, constant: 50).isActive = true
}
// MARK: - View Setup
public override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.navigationItem.largeTitleDisplayMode = .never
}
// MARK: - View Interaction
@objc private func buttonTapped() {
debugPrint("button tapped")
self.delegate?.buttonTapped()
}
}
//
// GenericInfoViewControllerDelegate.swift
// Amiv
//
// Created by Domenic Wüthrich on 20.09.18.
// Copyright © 2018 Amiv an der ETH. All rights reserved.
//
import Foundation
import UIKit
public protocol GenericInfoViewControllerDelegate {
func buttonTapped()
}
//
// GenericInfoViewControllerModel.swift
// Amiv
//
// Created by Domenic Wüthrich on 20.09.18.
// Copyright © 2018 Amiv an der ETH. All rights reserved.
//
import Foundation
import UIKit
public struct GenericInfoViewControllerModel {
// MARK: - Variables
public let image: UIImage?
public let text: String
public let titleButton: String?
// MARK: - Initializers
public init(image: UIImage?, text: String, titleButton: String?) {
self.image = image
self.text = text
self.titleButton = titleButton
}
}
extension GenericInfoViewControllerModel {
public static func createTestModel() -> GenericInfoViewControllerModel {
let text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
return self.init(image: UIImage(named: "settings"), text: text, titleButton: "Ok, go!")
}
public static func createTestNoImageModel() -> GenericInfoViewControllerModel {
let text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
return self.init(image: nil, text: text, titleButton: "Ok, go!")
}
public static func createTestOnlyTextModel() -> GenericInfoViewControllerModel {
let text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
return self.init(image: nil, text: text, titleButton: nil)
}
}
...@@ -50,4 +50,20 @@ public class HomeViewController: UITableViewController { ...@@ -50,4 +50,20 @@ public class HomeViewController: UITableViewController {