Skip to content

Commit

Permalink
disable multitasking on ipad (issue with storyboard) Because your app…
Browse files Browse the repository at this point in the history
… supports Multitasking on iPad, you need to include the LaunchScreen.storyboard launch storyboard file in your com.bsakhuja.Epicentral bundle
  • Loading branch information
bsakhuja committed Apr 7, 2024
1 parent 5e6c6f1 commit 3832d30
Show file tree
Hide file tree
Showing 11 changed files with 115 additions and 218 deletions.
20 changes: 14 additions & 6 deletions Epicentral.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
060F27462BC32EC000908E15 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 060F27452BC32EC000908E15 /* LaunchScreen.storyboard */; };
065FE1312B574D250014FD45 /* ApplicationInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 065FE1302B574D250014FD45 /* ApplicationInfo.swift */; };
068B01A32B0DB5A90012D86C /* FloatingButtonView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 068B01A22B0DB5A90012D86C /* FloatingButtonView.swift */; };
068B01A82B0DB8B20012D86C /* SettingsState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 068B01A72B0DB8B20012D86C /* SettingsState.swift */; };
Expand Down Expand Up @@ -58,6 +59,7 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
060F27452BC32EC000908E15 /* LaunchScreen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = "<group>"; };
065FE1302B574D250014FD45 /* ApplicationInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApplicationInfo.swift; sourceTree = "<group>"; };
068B01A22B0DB5A90012D86C /* FloatingButtonView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FloatingButtonView.swift; sourceTree = "<group>"; };
068B01A72B0DB8B20012D86C /* SettingsState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsState.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -155,6 +157,7 @@
06DA01622AFDBB0D0008FE49 /* SettingsView.swift */,
068B01A92B0DB9540012D86C /* EarthquakeListView.swift */,
068B01AB2B0DBAFB0012D86C /* EarthquakesMapView.swift */,
060F27452BC32EC000908E15 /* LaunchScreen.storyboard */,
);
path = Screens;
sourceTree = "<group>";
Expand Down Expand Up @@ -387,6 +390,7 @@
buildActionMask = 2147483647;
files = (
06EFE9E72AFABA0300351973 /* testresponse.json in Resources */,
060F27462BC32EC000908E15 /* LaunchScreen.storyboard in Resources */,
06EFE9BE2AFAB92000351973 /* Preview Assets.xcassets in Resources */,
06EFE9BB2AFAB92000351973 /* Assets.xcassets in Resources */,
);
Expand Down Expand Up @@ -622,7 +626,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 162;
CURRENT_PROJECT_VERSION = 265;
DEVELOPMENT_ASSET_PATHS = "\"Epicentral/Preview Content\"";
DEVELOPMENT_TEAM = DUCAN2M87U;
ENABLE_PREVIEWS = YES;
Expand All @@ -632,6 +636,8 @@
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.weather";
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen.storyboard;
INFOPLIST_KEY_UIRequiresFullScreen = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -656,7 +662,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 162;
CURRENT_PROJECT_VERSION = 265;
DEVELOPMENT_ASSET_PATHS = "\"Epicentral/Preview Content\"";
DEVELOPMENT_TEAM = DUCAN2M87U;
ENABLE_PREVIEWS = YES;
Expand All @@ -666,6 +672,8 @@
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.weather";
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen.storyboard;
INFOPLIST_KEY_UIRequiresFullScreen = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -689,7 +697,7 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 162;
CURRENT_PROJECT_VERSION = 265;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 17.2;
MARKETING_VERSION = 1.0;
Expand All @@ -708,7 +716,7 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 162;
CURRENT_PROJECT_VERSION = 265;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 17.2;
MARKETING_VERSION = 1.0;
Expand All @@ -726,7 +734,7 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 162;
CURRENT_PROJECT_VERSION = 265;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.bsakhuja.PlateUITests;
Expand All @@ -743,7 +751,7 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 162;
CURRENT_PROJECT_VERSION = 265;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.bsakhuja.PlateUITests;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,38 +82,6 @@
endingLineNumber = "42"
landmarkName = "init(from:)"
landmarkType = "7">
<Locations>
<Location
uuid = "7777B49F-DB21-426A-8044-9407F51AF399 - 9e3fcae5a5cbf218"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Plate.EarthquakeProperties.init(from: Swift.Decoder) throws -&gt; Plate.EarthquakeProperties"
moduleName = "Plate"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/briansakhuja/Documents/Xcode%20Projects/Plate/Plate/Models/EarthquakeProperties.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "38"
endingLineNumber = "38"
offsetFromSymbolStart = "784">
</Location>
<Location
uuid = "7777B49F-DB21-426A-8044-9407F51AF399 - 9e3fcae5a5cbf218"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Plate.EarthquakeProperties.init(from: Swift.Decoder) throws -&gt; Plate.EarthquakeProperties"
moduleName = "Plate"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/briansakhuja/Documents/Xcode%20Projects/Plate/Plate/Models/EarthquakeProperties.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "38"
endingLineNumber = "38"
offsetFromSymbolStart = "776">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
Expand Down Expand Up @@ -143,8 +111,7 @@
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "53"
endingLineNumber = "53"
offsetFromSymbolStart = "184">
endingLineNumber = "53">
</Location>
<Location
uuid = "3878AB28-4C7D-48C8-B15D-A4C5A3A6D47E - b2cb8727d3be637c"
Expand All @@ -158,8 +125,7 @@
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "53"
endingLineNumber = "53"
offsetFromSymbolStart = "128">
endingLineNumber = "53">
</Location>
<Location
uuid = "3878AB28-4C7D-48C8-B15D-A4C5A3A6D47E - b2cb8727d3be6e06"
Expand All @@ -173,8 +139,7 @@
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "79"
endingLineNumber = "79"
offsetFromSymbolStart = "160">
endingLineNumber = "79">
</Location>
</Locations>
</BreakpointContent>
Expand All @@ -193,38 +158,6 @@
endingLineNumber = "43"
landmarkName = "body"
landmarkType = "24">
<Locations>
<Location
uuid = "09A13F03-963D-4DD1-8CD4-B88A86B8F6C6 - 94d1804d2d24dea3"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "closure #4 () -&gt; () in closure #1 () -&gt; &lt;&lt;opaque return type of SwiftUI.View.navigationTitle(SwiftUI.LocalizedStringKey) -&gt; some&gt;&gt;.0 in Plate.ContentView.body.getter : some"
moduleName = "Plate"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/briansakhuja/Documents/Xcode%20Projects/Plate/Plate/ContentView.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "43"
endingLineNumber = "43"
offsetFromSymbolStart = "328">
</Location>
<Location
uuid = "09A13F03-963D-4DD1-8CD4-B88A86B8F6C6 - 26844d392075b9cf"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "closure #1 () -&gt; SwiftUI.TupleView&lt;(SwiftUI.DatePicker&lt;SwiftUI.Text&gt;, SwiftUI.DatePicker&lt;SwiftUI.Text&gt;, &lt;&lt;opaque return type of SwiftUI.View.navigationTitle(SwiftUI.LocalizedStringKey) -&gt; some&gt;&gt;.0)&gt; in Plate.ContentView.body.getter : some"
moduleName = "Plate"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/briansakhuja/Documents/Xcode%20Projects/Plate/Plate/ContentView.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "46"
endingLineNumber = "46"
offsetFromSymbolStart = "1760">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
Expand All @@ -241,38 +174,6 @@
endingLineNumber = "57"
landmarkName = "init(from:)"
landmarkType = "7">
<Locations>
<Location
uuid = "EC5FC333-230B-4EA7-8EEB-C8307656BA4A - 9e3fcae5a5cbef87"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Plate.EarthquakeProperties.init(from: Swift.Decoder) throws -&gt; Plate.EarthquakeProperties"
moduleName = "Plate"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/briansakhuja/Documents/Xcode%20Projects/Plate/Plate/Models/EarthquakeProperties.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "57"
endingLineNumber = "57"
offsetFromSymbolStart = "2812">
</Location>
<Location
uuid = "EC5FC333-230B-4EA7-8EEB-C8307656BA4A - 9e3fcae5a5cbef87"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Plate.EarthquakeProperties.init(from: Swift.Decoder) throws -&gt; Plate.EarthquakeProperties"
moduleName = "Plate"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/briansakhuja/Documents/Xcode%20Projects/Plate/Plate/Models/EarthquakeProperties.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "57"
endingLineNumber = "57"
offsetFromSymbolStart = "2972">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
Expand All @@ -289,38 +190,6 @@
endingLineNumber = "45"
landmarkName = "init(from:)"
landmarkType = "7">
<Locations>
<Location
uuid = "D382C507-B380-4D82-98C0-839474AC2770 - 9e3fcae5a5cbf133"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Plate.EarthquakeProperties.init(from: Swift.Decoder) throws -&gt; Plate.EarthquakeProperties"
moduleName = "Plate"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/briansakhuja/Documents/Xcode%20Projects/Plate/Plate/Models/EarthquakeProperties.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "45"
endingLineNumber = "45"
offsetFromSymbolStart = "1912">
</Location>
<Location
uuid = "D382C507-B380-4D82-98C0-839474AC2770 - 9e3fcae5a5cbf133"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Plate.EarthquakeProperties.init(from: Swift.Decoder) throws -&gt; Plate.EarthquakeProperties"
moduleName = "Plate"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/briansakhuja/Documents/Xcode%20Projects/Plate/Plate/Models/EarthquakeProperties.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "45"
endingLineNumber = "45"
offsetFromSymbolStart = "1024">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
Expand Down
12 changes: 1 addition & 11 deletions Epicentral/Info.plist
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UILaunchScreen</key>
<dict>
<key>UIColorName</key>
<string>LaunchScreenBackground</string>
<key>UIImageName</key>
<string>LaunchScreen</string>
<key>UIImageRespectsSafeAreaInsets</key>
<true/>
</dict>
</dict>
<dict/>
</plist>
4 changes: 4 additions & 0 deletions Epicentral/Models/EarthquakeProperties.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ struct EarthquakeProperties: Identifiable {
let title: String
let url: URL?

var didYouFeelItUrl: URL? {
url?.appendingPathComponent("/tellus")
}

var date: Date {
Date(timeIntervalSince1970: time / 1000)
}
Expand Down
2 changes: 1 addition & 1 deletion Epicentral/States/EarthquakesState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class EarthquakesState: ObservableObject {
.receive(on: RunLoop.main)
.sink(receiveCompletion: { data in

}, receiveValue: {[weak self] data in
}, receiveValue: { [weak self] data in
self?.earthquakes = data.earthquakes
self?.isLoading = false
}).store(in: &cancellables)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ struct EarthquakeRow: View {
.foregroundStyle(Color.gray)
Text(earthquake.properties.place ?? "Place")
.font(.subheadline)
.multilineTextAlignment(.trailing)

}
}
Expand Down
17 changes: 5 additions & 12 deletions Epicentral/Views/Components/EarthquakePreviewView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ struct EarthquakePreviewView: View {
var body: some View {
VStack {
HStack {
Text(earthquake.properties.title)
.font(.headline)
Button(earthquake.properties.title) {
isShowingDetails = true
}
.font(.headline)
.multilineTextAlignment(.leading)
Spacer()
}
HStack {
Expand All @@ -30,16 +33,6 @@ struct EarthquakePreviewView: View {
Spacer()
Text(earthquake.properties.date.formatted(.dateTime))
}
if let tsunami = earthquake.properties.tsunami {
HStack {
Text("Tsunami warning")
Spacer()
Text(tsunami ? "Yes" : "No")
}
}
Button("Details") {
isShowingDetails = true
}
}
.padding()
.sheet(isPresented: $isShowingDetails) {
Expand Down
Loading

0 comments on commit 3832d30

Please sign in to comment.