-
-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Converted About AudioKit info from alert to sheet view.
- Loading branch information
1 parent
23e2d1f
commit e474949
Showing
3 changed files
with
72 additions
and
4 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
Cookbook/CookbookCommon/Sources/CookbookCommon/About AudioKit/AboutAudioKitContentView.swift
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,33 @@ | ||
import SwiftUI | ||
|
||
struct AboutAudioKitContentView: View { | ||
private let maxWidth: CGFloat = 200 | ||
var stackSpacing: CGFloat | ||
|
||
var body: some View { | ||
audioKitArtwork | ||
audioKitText | ||
} | ||
|
||
private var audioKitArtwork: some View { | ||
return VStack(spacing: stackSpacing) { | ||
Image("audiokit-icon") | ||
.resizable() | ||
.aspectRatio(contentMode: .fit) | ||
.frame(maxWidth: maxWidth) | ||
Image("audiokit-logo") | ||
.resizable() | ||
.aspectRatio(contentMode: .fit) | ||
.frame(maxWidth: maxWidth) | ||
} | ||
} | ||
|
||
private var audioKitText: some View { | ||
Text("AudioKit is an audio synthesis, processing, and analysis platform for iOS, macOS, and tvOS.\n\nMost of the examples that were inside of AudioKit are now in this application.\n\nIn addition to the resources found here, there are various open-source example projects on GitHub and YouTube created by AudioKit contributors.") | ||
.padding() | ||
} | ||
} | ||
|
||
#Preview { | ||
AboutAudioKitContentView(stackSpacing: 25) | ||
} |
37 changes: 37 additions & 0 deletions
37
Cookbook/CookbookCommon/Sources/CookbookCommon/About AudioKit/AudioKitInfoView.swift
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,37 @@ | ||
import SwiftUI | ||
|
||
struct AudioKitInfoView: View { | ||
@Environment(\.dismiss) var dismiss | ||
@Environment(\.verticalSizeClass) var verticalSizeClass | ||
@Environment(\.dynamicTypeSize) var dynamicTypeSize | ||
let stackSpacing: CGFloat = 25 | ||
var body: some View { | ||
NavigationStack { | ||
ScrollView { | ||
if verticalSizeClass == .regular { | ||
VStack(spacing: stackSpacing) { | ||
AboutAudioKitContentView(stackSpacing: stackSpacing) | ||
} | ||
} else { | ||
HStack(spacing: stackSpacing) { AboutAudioKitContentView(stackSpacing: stackSpacing) | ||
} | ||
} | ||
} | ||
.toolbar { | ||
ToolbarItem(placement: .primaryAction) { | ||
Button { | ||
dismiss() | ||
} label: { | ||
Text("Done") | ||
.fontWeight(.semibold) | ||
} | ||
.accessibilityHint("Tap to close this screen.") | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
#Preview { | ||
AudioKitInfoView() | ||
} |
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