Skip to content

Commit 4fa7361

Browse files
committed
unify branches for visionOS support
1 parent a398730 commit 4fa7361

16 files changed

Lines changed: 338 additions & 7 deletions

File tree

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "vision",
5+
"scale" : "2x"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
}
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"author" : "xcode",
4+
"version" : 1
5+
}
6+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"info" : {
3+
"author" : "xcode",
4+
"version" : 1
5+
},
6+
"layers" : [
7+
{
8+
"filename" : "Front.solidimagestacklayer"
9+
},
10+
{
11+
"filename" : "Middle.solidimagestacklayer"
12+
},
13+
{
14+
"filename" : "Back.solidimagestacklayer"
15+
}
16+
]
17+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "vision",
5+
"scale" : "2x"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
}
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"author" : "xcode",
4+
"version" : 1
5+
}
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "vision",
5+
"scale" : "2x"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
}
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"author" : "xcode",
4+
"version" : 1
5+
}
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"version" : 1,
4+
"author" : "xcode"
5+
}
6+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import SwiftUI
2+
import DSWaveformImage
3+
import DSWaveformImageViews
4+
5+
struct ContentView: View {
6+
private static let colors = [UIColor.systemPink, UIColor.systemBlue, UIColor.systemGreen]
7+
private static var randomColor: UIColor {
8+
colors[Int.random(in: 0..<colors.count)]
9+
}
10+
11+
@State private var audioURL: URL = Bundle.main.url(forResource: "example_sound", withExtension: "m4a")!
12+
13+
@State var configuration: Waveform.Configuration = Waveform.Configuration(
14+
style: .gradient([.red, .green])
15+
)
16+
17+
var body: some View {
18+
VStack {
19+
Text("SwiftUI example")
20+
.font(.largeTitle.bold())
21+
22+
Button {
23+
configuration = configuration.with(style: .striped(.init(color: Self.randomColor)))
24+
} label: {
25+
Label("switch color randomly", systemImage: "arrow.triangle.2.circlepath")
26+
}
27+
.font(.body.bold())
28+
.padding()
29+
.background(Color(UIColor.systemGray).opacity(0.6))
30+
.cornerRadius(10)
31+
32+
WaveformView(audioURL: audioURL, configuration: configuration, renderer: CircularWaveformRenderer())
33+
}
34+
}
35+
}
36+
37+
struct ContentView_Previews: PreviewProvider {
38+
static var previews: some View {
39+
ContentView()
40+
}
41+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//
2+
// DSWaveformImageExample_VisionOSApp.swift
3+
// DSWaveformImageExample-VisionOS
4+
//
5+
// Created by Antonio Cabezuelo Vivo on 18/10/23.
6+
//
7+
8+
import SwiftUI
9+
10+
@main
11+
struct DSWaveformImageExample_VisionOSApp: App {
12+
var body: some Scene {
13+
WindowGroup {
14+
ContentView()
15+
}
16+
}
17+
}

0 commit comments

Comments
 (0)