Skip to content

Commit

Permalink
fixed issue with links and tags taking up way too much space in lands…
Browse files Browse the repository at this point in the history
…cape
  • Loading branch information
jiachenyee committed May 22, 2020
1 parent 29700ef commit c21c57b
Show file tree
Hide file tree
Showing 3 changed files with 255 additions and 236 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ extension ContentViewController: UICollectionViewDelegate, UICollectionViewDataS
if collectionView == labelsCollectionView {
let cell = collectionView.cellForItem(at: indexPath) as! CategoriesCollectionViewCell
filter = cell.titleLabel.text!
print(filter)

filterUpdated?()

navigationController?.popToRootViewController(animated: true)
Expand Down
13 changes: 13 additions & 0 deletions Announcer/Content VC/ContentViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ class ContentViewController: UIViewController {
@IBOutlet weak var linksCollectionView: UICollectionView!
@IBOutlet weak var labelsCollectionView: UICollectionView!

@IBOutlet weak var linksAndLabelStackView: UIStackView!

var post: Post!
var isPinned = false

Expand Down Expand Up @@ -216,6 +218,17 @@ class ContentViewController: UIViewController {

}

override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
super.viewWillTransition(to: size, with: coordinator)
if UIDevice.current.orientation.isLandscape {
print("Landscape")
linksAndLabelStackView.isHidden = true
} else {
print("Portrait")
linksAndLabelStackView.isHidden = false
}
}

@IBAction func sharePost(_ sender: Any) {

//Create Activity View Controller (Share screen)
Expand Down
Loading

0 comments on commit c21c57b

Please sign in to comment.