diff --git a/elpha-ios/AbstractStatusTableViewController.swift b/elpha-ios/AbstractStatusTableViewController.swift index 8ea8ef3..c547278 100644 --- a/elpha-ios/AbstractStatusTableViewController.swift +++ b/elpha-ios/AbstractStatusTableViewController.swift @@ -26,19 +26,19 @@ class AbstractStatusTableViewController: UITableViewController, StatusViewDelega } } + func storyboard() -> UIStoryboard { + return UIStoryboard(name: "Main", bundle: nil) + } + func accountTapped(account: AccountMO) { - let storyboard = UIStoryboard(name: "Main", bundle: nil) - - if let controller = storyboard.instantiateViewController(withIdentifier: "AccountTableViewController") as? AccountTableViewController { + if let controller = storyboard().instantiateViewController(withIdentifier: "AccountTableViewController") as? AccountTableViewController { controller.account = account self.navigationController?.pushViewController(controller, animated: true) } } func statusTapped(status: StatusMO) { - let storyboard = UIStoryboard(name: "Main", bundle: nil) - - if let controller = storyboard.instantiateViewController(withIdentifier: "StatusTableViewController") as? StatusTableViewController { + if let controller = storyboard().instantiateViewController(withIdentifier: "StatusTableViewController") as? StatusTableViewController { controller.status = status self.navigationController?.pushViewController(controller, animated: true) } @@ -49,13 +49,14 @@ class AbstractStatusTableViewController: UITableViewController, StatusViewDelega } func replyTapped(status: StatusMO) { - performSegue(withIdentifier: "ComposeSegue", sender: self) + if let controller = storyboard().instantiateViewController(withIdentifier: "ComposeViewController") as? ComposeViewController { + controller.replyToStatus = status + present(controller, animated: true) + } } func attachmentTapped(status: StatusMO, index: Int) { - let storyboard = UIStoryboard(name: "Main", bundle: nil) - - if let controller = storyboard.instantiateViewController(withIdentifier: "AttachmentPageViewController") as? AttachmentPageViewController { + if let controller = storyboard().instantiateViewController(withIdentifier: "AttachmentPageViewController") as? AttachmentPageViewController { controller.status = status controller.attachmentIndex = index diff --git a/elpha-ios/AttachmentManager.swift b/elpha-ios/AttachmentManager.swift index dd059b6..23f5514 100644 --- a/elpha-ios/AttachmentManager.swift +++ b/elpha-ios/AttachmentManager.swift @@ -40,6 +40,7 @@ class AttachmentManager: NSObject { case 1: let attachment = attachments.firstObject as! AttachmentMO let imageView = FLAnimatedImageView() + imageView.contentMode = UIImageView.ContentMode.scaleAspectFill let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(attachmentTapped)) tapGestureRecognizer.delegate = self diff --git a/elpha-ios/Base.lproj/Main.storyboard b/elpha-ios/Base.lproj/Main.storyboard index a681866..e7b311c 100644 --- a/elpha-ios/Base.lproj/Main.storyboard +++ b/elpha-ios/Base.lproj/Main.storyboard @@ -1062,78 +1062,56 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - + - + - - + + - + @@ -1149,7 +1127,7 @@ - + @@ -1159,47 +1137,38 @@ - + - + - - - - - - - - - - + - + - + - +