Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

만국박람회[Step3]Toy,Kiseok #302

Open
wants to merge 9 commits into
base: ic_10_kiseok
Choose a base branch
from
11 changes: 9 additions & 2 deletions Expo1900/Expo1900/Controller/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,15 @@ import UIKit

@main
class AppDelegate: UIResponder, UIApplicationDelegate {


var shouldSupportAllOrientaion = false

func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
if shouldSupportAllOrientaion {
return [.all]
} else {
return [.portrait]
}
}

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
Expand Down
2 changes: 2 additions & 0 deletions Expo1900/Expo1900/Controller/ExpoItemListViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ final class ExpoItemListViewController: UIViewController {
@IBOutlet private weak var tableView: UITableView!
private var exhibitionItems: [ExhibitionItem] = []
private var exhibitionItemsData = DataDecoder<[ExhibitionItem]>()
private let appDelegate = UIApplication.shared.delegate as! AppDelegate

override func viewDidLoad() {
super.viewDidLoad()
Expand All @@ -23,6 +24,7 @@ final class ExpoItemListViewController: UIViewController {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)

appDelegate.shouldSupportAllOrientaion = true
navigationController?.isNavigationBarHidden = false
}

Expand Down
2 changes: 2 additions & 0 deletions Expo1900/Expo1900/Controller/HomeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ final class HomeViewController: UIViewController {
@IBOutlet private weak var leftFlagImageView: UIImageView!
@IBOutlet private weak var rightFlagImageView: UIImageView!
private var expoInformationData = DataDecoder<ExpoInformation>()
private let appDelegate = UIApplication.shared.delegate as! AppDelegate

override func viewDidLoad() {
super.viewDidLoad()
Expand All @@ -27,6 +28,7 @@ final class HomeViewController: UIViewController {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)

appDelegate.shouldSupportAllOrientaion = false
navigationController?.isNavigationBarHidden = true
}

Expand Down
Loading