Skip to content

Commit

Permalink
Fixes issue with landscape rotation on larger screens
Browse files Browse the repository at this point in the history
  • Loading branch information
CoryFoy committed Jun 30, 2024
1 parent 2448e09 commit 5c43f3e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
12 changes: 6 additions & 6 deletions TAKTracker.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
CODE_SIGN_ENTITLEMENTS = TAKTracker/TAKTracker.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 70;
CURRENT_PROJECT_VERSION = 72;
DEVELOPMENT_ASSET_PATHS = "TAKTracker/Preview\\ Content";
DEVELOPMENT_TEAM = 5LZ5HR44P3;
ENABLE_PREVIEWS = YES;
Expand Down Expand Up @@ -934,7 +934,7 @@
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
CODE_SIGN_ENTITLEMENTS = TAKTracker/TAKTracker.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 70;
CURRENT_PROJECT_VERSION = 72;
DEVELOPMENT_ASSET_PATHS = "TAKTracker/Preview\\ Content";
DEVELOPMENT_TEAM = 5LZ5HR44P3;
ENABLE_PREVIEWS = YES;
Expand Down Expand Up @@ -972,7 +972,7 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 70;
CURRENT_PROJECT_VERSION = 72;
DEVELOPMENT_TEAM = 5LZ5HR44P3;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -994,7 +994,7 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 70;
CURRENT_PROJECT_VERSION = 72;
DEVELOPMENT_TEAM = 5LZ5HR44P3;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -1014,7 +1014,7 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 70;
CURRENT_PROJECT_VERSION = 72;
DEVELOPMENT_TEAM = 5LZ5HR44P3;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.1;
Expand All @@ -1032,7 +1032,7 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 70;
CURRENT_PROJECT_VERSION = 72;
DEVELOPMENT_TEAM = 5LZ5HR44P3;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.1;
Expand Down
9 changes: 9 additions & 0 deletions TAKTracker/Screens/MainScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,15 @@ struct DisplayUIState {

func headingValue(unit:DirectionUnit, heading: CLHeading?) -> String {
guard let locationHeading = heading else {
#if targetEnvironment(simulator)
if(unit == DirectionUnit.TN) {
return "24"
} else {
return "18"
}
#else
return "--"
#endif
}
if(unit == DirectionUnit.TN) {
return Converter.formatOrZero(item: locationHeading.trueHeading) + "°"
Expand Down Expand Up @@ -272,6 +280,7 @@ struct MainScreen: View {
}
}
}
.navigationViewStyle(.stack)
.fullScreenCover(item: $sheet, content: { Sheet(type: $0) })
.background(Color.baseMediumGray)
.ignoresSafeArea(edges: .bottom)
Expand Down
10 changes: 9 additions & 1 deletion TAKTracker/Utilities/Converter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,15 @@ class Converter {

static func convertToSpeedUnit(unit: SpeedUnit, location:CLLocation) -> String {
// CLLocation.speed is reported in meters per second from iOS
let metersPerSecond = location.speed as Double
var metersPerSecond = location.speed as Double
if(metersPerSecond < 0) {
#if targetEnvironment(simulator)
metersPerSecond = 3.1
#else
metersPerSecond = 0
#endif

}
let numFeetInOneMeter = 3.281
let numFeetInOneMile = 5280.0
switch(unit) {
Expand Down

0 comments on commit 5c43f3e

Please sign in to comment.