Address code review

- change varibale names with VC to ViewController
- add MIT License Header to new files
- add documentation about using a height constant
This commit is contained in:
Ashley Ng
2020-05-07 18:29:23 -05:00
parent e7f832b3a3
commit d2a34894a5
4 changed files with 72 additions and 39 deletions
@@ -74,29 +74,29 @@ final internal class LaunchViewController: UITableViewController {
let cell = cells[indexPath.row]
switch cell {
case "Basic Example":
let vc = BasicExampleViewController()
let detailVC = NavigationController(rootViewController: vc)
splitViewController?.showDetailViewController(detailVC, sender: self)
let viewController = BasicExampleViewController()
let detailViewController = NavigationController(rootViewController: viewController)
splitViewController?.showDetailViewController(detailViewController, sender: self)
case "Advanced Example":
let vc = AdvancedExampleViewController()
let detailVC = NavigationController(rootViewController: vc)
splitViewController?.showDetailViewController(detailVC, sender: self)
let viewController = AdvancedExampleViewController()
let detailViewController = NavigationController(rootViewController: viewController)
splitViewController?.showDetailViewController(detailViewController, sender: self)
case "Autocomplete Example":
let vc = AutocompleteExampleViewController()
let detailVC = NavigationController(rootViewController: vc)
splitViewController?.showDetailViewController(detailVC, sender: self)
let viewController = AutocompleteExampleViewController()
let detailViewController = NavigationController(rootViewController: viewController)
splitViewController?.showDetailViewController(detailViewController, sender: self)
case "Embedded Example":
let vc = MessageContainerController()
let detailVC = NavigationController(rootViewController: vc)
splitViewController?.showDetailViewController(detailVC, sender: self)
let viewController = MessageContainerController()
let detailViewController = NavigationController(rootViewController: viewController)
splitViewController?.showDetailViewController(detailViewController, sender: self)
case "Settings":
let vc = SettingsViewController()
let detailVC = NavigationController(rootViewController: vc)
splitViewController?.showDetailViewController(detailVC, sender: self)
let viewController = SettingsViewController()
let detailViewController = NavigationController(rootViewController: viewController)
splitViewController?.showDetailViewController(detailViewController, sender: self)
case "Subview Example":
let vc = MessageSubviewContainerViewController()
let detailVC = NavigationController(rootViewController: vc)
splitViewController?.showDetailViewController(detailVC, sender: self)
let viewController = MessageSubviewContainerViewController()
let detailViewController = NavigationController(rootViewController: viewController)
splitViewController?.showDetailViewController(detailViewController, sender: self)
case "Source Code":
guard let url = URL(string: "https://github.com/MessageKit/MessageKit") else { return }
openURL(url)
@@ -1,10 +1,26 @@
//
// MessageSubviewContainerViewController.swift
// ChatExample
//
// Created by Ng, Ashley on 3/10/20.
// Copyright © 2020 MessageKit. All rights reserved.
//
/*
MIT License
Copyright (c) 2017-2019 MessageKit
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
import Foundation
import UIKit
@@ -1,15 +1,31 @@
//
// MessageSubviewViewController.swift
// ChatExample
//
// Created by Ng, Ashley on 3/10/20.
// Copyright © 2020 MessageKit. All rights reserved.
//
/*
MIT License
Copyright (c) 2017-2019 MessageKit
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
import Foundation
import InputBarAccessoryView
class MessageSubviewViewController: BasicExampleViewController {
final class MessageSubviewViewController: BasicExampleViewController {
private var keyboardManager = KeyboardManager()
@@ -18,6 +34,7 @@ class MessageSubviewViewController: BasicExampleViewController {
override func viewDidLoad() {
super.viewDidLoad()
subviewInputBar.delegate = self
// Take into account the height of the bottom input bar
additionalBottomInset = 88
}