-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from iseebi/feature/about
About画面の追加
- Loading branch information
Showing
14 changed files
with
381 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// | ||
// AboutView.swift | ||
// Ukam | ||
// | ||
// Created by Nobuhiro Ito on 2024/08/10. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct AboutView: View { | ||
let versionString = { () -> String in | ||
let marketingVersion = (Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String) ?? "" | ||
let buildNumber = (Bundle.main.infoDictionary?["CFBundleVersion"] as? String) ?? "" | ||
return "\(marketingVersion) (\(buildNumber))" | ||
}() | ||
|
||
@State private var showingSheet = false | ||
|
||
var body: some View { | ||
VStack(spacing: LayoutConstants.padding * 2) { | ||
VStack(alignment: .center) { | ||
Image(.imageIcon) | ||
Text(R.string.localizable.app_name()).font(.title) | ||
Text(versionString).font(.subheadline) | ||
Text(R.string.localizable.about_view_copyright()) | ||
.font(.subheadline) | ||
} | ||
VStack(alignment: .trailing) { | ||
Button(R.string.localizable.about_view_acknowledgements()) { | ||
self.showingSheet.toggle() | ||
} | ||
.sheet(isPresented: $showingSheet) { | ||
AcknowledgementsView(dataSource: BundleAcknowledgementsDataSource()) | ||
} | ||
} | ||
.frame(maxWidth: .infinity, alignment: .trailing) | ||
} | ||
.frame(maxWidth: LayoutConstants.aboutViewWidth) | ||
.padding(LayoutConstants.padding * 2) | ||
} | ||
} | ||
|
||
#Preview { | ||
AboutView() | ||
} |
Oops, something went wrong.