Skip to content

Commit

Permalink
[#73] viewcontroller embed extension 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Gyuni committed Sep 13, 2021
1 parent 375e4b0 commit c02f7b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions YDS-Storybook/Extension/UIViewController+Embed.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@
import UIKit

extension UIViewController {
func embed(_ viewController: UIViewController, at view: UIView) {
func embed(_ viewController: UIViewController) {
viewController.willMove(toParent: self)
viewController.view.frame = view.bounds
view.addSubview(viewController.view)
self.addChild(viewController)
viewController.didMove(toParent: self)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ class ColorsPageViewController: UIViewController {
}

private func setViewHierarchy() {
self.view.addSubview(tableViewArea)
embed(colorsListTableViewController, at: tableViewArea)
self.embed(colorsListTableViewController)
self.view.addSubview(colorsListTableViewController.view)
}

private func setAutolayout() {
tableViewArea.snp.makeConstraints {
colorsListTableViewController.view.snp.makeConstraints {
$0.top.leading.trailing.equalTo(view.safeAreaLayoutGuide)
$0.bottom.equalToSuperview()
}
Expand Down

0 comments on commit c02f7b2

Please sign in to comment.