Skip to content
This repository was archived by the owner on Oct 12, 2025. It is now read-only.

Commit 6e039d3

Browse files
authored
Recovered iPad Support (#379)
1 parent 6373937 commit 6e039d3

6 files changed

Lines changed: 19 additions & 12 deletions

File tree

HackIllinois.xcodeproj/project.pbxproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,7 +1181,7 @@
11811181
PRODUCT_BUNDLE_IDENTIFIER = org.hackillinois.ios;
11821182
PRODUCT_NAME = "$(TARGET_NAME)";
11831183
SWIFT_VERSION = 5.0;
1184-
TARGETED_DEVICE_FAMILY = 1;
1184+
TARGETED_DEVICE_FAMILY = "1,2";
11851185
};
11861186
name = Debug;
11871187
};
@@ -1203,7 +1203,7 @@
12031203
PRODUCT_BUNDLE_IDENTIFIER = org.hackillinois.ios;
12041204
PRODUCT_NAME = "$(TARGET_NAME)";
12051205
SWIFT_VERSION = 5.0;
1206-
TARGETED_DEVICE_FAMILY = 1;
1206+
TARGETED_DEVICE_FAMILY = "1,2";
12071207
};
12081208
name = Release;
12091209
};
@@ -1239,7 +1239,7 @@
12391239
SUPPORTS_MACCATALYST = NO;
12401240
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
12411241
SWIFT_VERSION = 5.0;
1242-
TARGETED_DEVICE_FAMILY = 1;
1242+
TARGETED_DEVICE_FAMILY = "1,2";
12431243
VERSIONING_SYSTEM = "apple-generic";
12441244
VERSION_INFO_PREFIX = "";
12451245
};
@@ -1275,7 +1275,7 @@
12751275
SKIP_INSTALL = YES;
12761276
SUPPORTS_MACCATALYST = NO;
12771277
SWIFT_VERSION = 5.0;
1278-
TARGETED_DEVICE_FAMILY = 1;
1278+
TARGETED_DEVICE_FAMILY = "1,2";
12791279
VERSIONING_SYSTEM = "apple-generic";
12801280
VERSION_INFO_PREFIX = "";
12811281
};
@@ -1302,7 +1302,7 @@
13021302
PRODUCT_BUNDLE_IDENTIFIER = org.hackillinois.ios.Stickers;
13031303
PRODUCT_NAME = "$(TARGET_NAME)";
13041304
SKIP_INSTALL = YES;
1305-
TARGETED_DEVICE_FAMILY = 1;
1305+
TARGETED_DEVICE_FAMILY = "1,2";
13061306
};
13071307
name = Debug;
13081308
};
@@ -1326,7 +1326,7 @@
13261326
PRODUCT_BUNDLE_IDENTIFIER = org.hackillinois.ios.Stickers;
13271327
PRODUCT_NAME = "$(TARGET_NAME)";
13281328
SKIP_INSTALL = YES;
1329-
TARGETED_DEVICE_FAMILY = 1;
1329+
TARGETED_DEVICE_FAMILY = "1,2";
13301330
};
13311331
name = Release;
13321332
};

HackIllinois/UI/HIErrorView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import Foundation
1414
import UIKit
1515

1616
protocol HIErrorViewDelegate: class {
17-
func didSelectErrorLogout()
17+
func didSelectErrorLogout(_ sender: UIButton)
1818
}
1919
class HIErrorView: HIView {
2020
enum ErrorType {
@@ -84,6 +84,6 @@ class HIErrorView: HIView {
8484
// MARK: - Actions
8585
extension HIErrorView {
8686
@objc func didSelectLogoutButton(_ sender: UIButton) {
87-
delegate?.didSelectErrorLogout()
87+
delegate?.didSelectErrorLogout(sender)
8888
}
8989
}

HackIllinois/ViewControllers/HICodePopupViewController.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ extension HICodePopupViewController: UIGestureRecognizerDelegate {
246246

247247
// MARK: - HIErrorViewDelegate
248248
extension HICodePopupViewController: HIErrorViewDelegate {
249-
func didSelectErrorLogout() {
249+
func didSelectErrorLogout(_ sender: UIButton) {
250250
let alert = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet)
251251
alert.addAction(
252252
UIAlertAction(title: "Log Out", style: .destructive) { _ in
@@ -257,6 +257,7 @@ extension HICodePopupViewController: HIErrorViewDelegate {
257257
alert.addAction(
258258
UIAlertAction(title: "Cancel", style: .cancel, handler: nil)
259259
)
260+
alert.popoverPresentationController?.sourceView = sender
260261
present(alert, animated: true, completion: nil)
261262
}
262263
}

HackIllinois/ViewControllers/HIGroupViewController.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ extension HIGroupViewController: HIGroupPopupViewDelegate {
351351

352352
// MARK: - HIErrorViewDelegate
353353
extension HIGroupViewController: HIErrorViewDelegate {
354-
func didSelectErrorLogout() {
354+
func didSelectErrorLogout(_ sender: UIButton) {
355355
let alert = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet)
356356
alert.addAction(
357357
UIAlertAction(title: "Log Out", style: .destructive) { _ in
@@ -362,6 +362,7 @@ extension HIGroupViewController: HIErrorViewDelegate {
362362
alert.addAction(
363363
UIAlertAction(title: "Cancel", style: .cancel, handler: nil)
364364
)
365+
alert.popoverPresentationController?.sourceView = sender
365366
present(alert, animated: true, completion: nil)
366367
}
367368
}

HackIllinois/ViewControllers/HIHomeViewController.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,11 @@ extension HIHomeViewController {
122122
view.addSubview(countdownViewController.view)
123123
countdownViewController.view.topAnchor.constraint(equalTo: countdownTitleLabel.bottomAnchor, constant: 10).isActive = true
124124
countdownViewController.view.constrain(to: view.safeAreaLayoutGuide, trailingInset: -10, leadingInset: 10)
125-
countdownViewController.view.constrain(height: 200)
125+
if UIDevice.current.userInterfaceIdiom == .pad {
126+
countdownViewController.view.constrain(height: 0.34 * UIScreen.main.bounds.height)
127+
} else {
128+
countdownViewController.view.constrain(height: 200)
129+
}
126130
countdownViewController.didMove(toParent: self)
127131

128132
let items = dataStore.map { $0 }

HackIllinois/ViewControllers/HIProfileViewController.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ extension HIProfileViewController {
370370

371371
// MARK: - HIErrorViewDelegate
372372
extension HIProfileViewController: HIErrorViewDelegate {
373-
func didSelectErrorLogout() {
373+
func didSelectErrorLogout(_ sender: UIButton) {
374374
let alert = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet)
375375
alert.addAction(
376376
UIAlertAction(title: "Log Out", style: .destructive) { _ in
@@ -381,6 +381,7 @@ extension HIProfileViewController: HIErrorViewDelegate {
381381
alert.addAction(
382382
UIAlertAction(title: "Cancel", style: .cancel, handler: nil)
383383
)
384+
alert.popoverPresentationController?.sourceView = sender
384385
present(alert, animated: true, completion: nil)
385386
}
386387
}

0 commit comments

Comments
 (0)