feat: add about view

This commit is contained in:
dscyrescotti
2024-07-17 21:44:06 +07:00
parent 167fa6baf6
commit 2e2cc24e38
5 changed files with 74 additions and 2 deletions

View File

@@ -34,6 +34,8 @@
EC2106AD2C10C2A700FBE27C /* AnyStroke.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC2106AC2C10C2A700FBE27C /* AnyStroke.swift */; };
EC2117632C47FA30005B32A1 /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC2117622C47FA30005B32A1 /* SettingsView.swift */; };
EC2117662C4802C0005B32A1 /* AppWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC2117652C4802C0005B32A1 /* AppWindow.swift */; };
EC2117692C480D4D005B32A1 /* AboutView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC2117682C480D4D005B32A1 /* AboutView.swift */; };
EC21176B2C480EE6005B32A1 /* Bundle++.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC21176A2C480EE6005B32A1 /* Bundle++.swift */; };
EC2BEBF42C0F5FF7005DB0AF /* RTree.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC2BEBF32C0F5FF7005DB0AF /* RTree.swift */; };
EC2BEBF62C0F600D005DB0AF /* Box.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC2BEBF52C0F600D005DB0AF /* Box.swift */; };
EC2BEBF82C0F601A005DB0AF /* Node.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC2BEBF72C0F601A005DB0AF /* Node.swift */; };
@@ -173,6 +175,8 @@
EC2106AC2C10C2A700FBE27C /* AnyStroke.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnyStroke.swift; sourceTree = "<group>"; };
EC2117622C47FA30005B32A1 /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = "<group>"; };
EC2117652C4802C0005B32A1 /* AppWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppWindow.swift; sourceTree = "<group>"; };
EC2117682C480D4D005B32A1 /* AboutView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AboutView.swift; sourceTree = "<group>"; };
EC21176A2C480EE6005B32A1 /* Bundle++.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Bundle++.swift"; sourceTree = "<group>"; };
EC2BEBF32C0F5FF7005DB0AF /* RTree.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RTree.swift; sourceTree = "<group>"; };
EC2BEBF52C0F600D005DB0AF /* Box.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Box.swift; sourceTree = "<group>"; };
EC2BEBF72C0F601A005DB0AF /* Node.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Node.swift; sourceTree = "<group>"; };
@@ -446,6 +450,7 @@
EC2117602C47FA14005B32A1 /* Settings */ = {
isa = PBXGroup;
children = (
EC2117672C480D45005B32A1 /* About */,
EC2117612C47FA29005B32A1 /* Settings */,
);
path = Settings;
@@ -467,6 +472,14 @@
path = AppWindow;
sourceTree = "<group>";
};
EC2117672C480D45005B32A1 /* About */ = {
isa = PBXGroup;
children = (
EC2117682C480D4D005B32A1 /* AboutView.swift */,
);
path = About;
sourceTree = "<group>";
};
EC2BEBF22C0F5FE1005DB0AF /* RTree */ = {
isa = PBXGroup;
children = (
@@ -1010,6 +1023,7 @@
ECF7B2CC2C39169C004D2C57 /* simd_float4x4++.swift */,
ECF7B2CD2C39169C004D2C57 /* Image++.swift */,
ECF7B2CE2C39169C004D2C57 /* View++.swift */,
EC21176A2C480EE6005B32A1 /* Bundle++.swift */,
);
path = Extensions;
sourceTree = "<group>";
@@ -1182,6 +1196,7 @@
EC2BEBF62C0F600D005DB0AF /* Box.swift in Sources */,
ECA738832BE5FEFE00A4542E /* RenderPass.swift in Sources */,
ECEC01A82BEE11BA006DA24C /* QuadShape.swift in Sources */,
EC2117692C480D4D005B32A1 /* AboutView.swift in Sources */,
ECF7B2DC2C39169C004D2C57 /* MTLTexture++.swift in Sources */,
ECA738862BE5FF2500A4542E /* Canvas.swift in Sources */,
ECF7B2DE2C39169C004D2C57 /* NSManagedObjectContext++.swift in Sources */,
@@ -1245,6 +1260,7 @@
EC5050072BF65CED00B4D86E /* PenDropDelegate.swift in Sources */,
ECF7B2E42C39174D004D2C57 /* Platform.swift in Sources */,
ECA738C12BE60E5300A4542E /* PenStyle.swift in Sources */,
EC21176B2C480EE6005B32A1 /* Bundle++.swift in Sources */,
EC2002D72C4160EF002EBD5F /* EditCommands.swift in Sources */,
ECF7B2DF2C39169C004D2C57 /* simd_float4x4++.swift in Sources */,
ECF7B2D02C39169C004D2C57 /* Array++.swift in Sources */,

View File

@@ -2,6 +2,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>NSHumanReadableCopyright</key>
<string>Copyright © 2024 Memola. All rights reserved.</string>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>

View File

@@ -0,0 +1,29 @@
//
// AboutView.swift
// Memola
//
// Created by Dscyre Scotti on 7/17/24.
//
import SwiftUI
struct AboutView: View {
var body: some View {
List {
Section {
HStack {
Text("App Version")
Spacer()
Text("v\(Bundle.main.appVersion) (\(Bundle.main.appBuild))")
}
}
Section("Copyright") {
Text(Bundle.main.copyright)
.font(.callout)
}
}
.listStyle(.insetGrouped)
.navigationTitle("About")
.navigationBarTitleDisplayMode(.inline)
}
}

View File

@@ -10,10 +10,19 @@ import SwiftUI
struct SettingsView: View {
var body: some View {
NavigationStack {
Text("Settings View")
.navigationTitle("Settings")
List {
NavigationLink {
AboutView()
} label: {
Label("About", systemImage: "info.circle.fill")
.foregroundStyle(.primary)
}
}
.navigationTitle("Settings")
.navigationBarTitleDisplayMode(.large)
}
.focusedSceneValue(\.activeSceneKey, .settings)
.interactiveDismissDisabled()
}
}

View File

@@ -0,0 +1,16 @@
//
// Bundle++.swift
// Memola
//
// Created by Dscyre Scotti on 7/17/24.
//
import Foundation
extension Bundle {
var appBuild: String { getInfo("CFBundleVersion") }
var appVersion: String { getInfo("CFBundleShortVersionString") }
var copyright: String { getInfo("NSHumanReadableCopyright") }
fileprivate func getInfo(_ key: String) -> String { infoDictionary?[key] as! String }
}