Skip to content

Commit

Permalink
unify branches for visionOS support
Browse files Browse the repository at this point in the history
  • Loading branch information
dmrschmidt committed Oct 24, 2023
1 parent a398730 commit 4fa7361
Show file tree
Hide file tree
Showing 16 changed files with 338 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"idiom" : "vision",
"scale" : "2x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"info" : {
"author" : "xcode",
"version" : 1
},
"layers" : [
{
"filename" : "Front.solidimagestacklayer"
},
{
"filename" : "Middle.solidimagestacklayer"
},
{
"filename" : "Back.solidimagestacklayer"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"idiom" : "vision",
"scale" : "2x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"idiom" : "vision",
"scale" : "2x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
41 changes: 41 additions & 0 deletions Example/DSWaveformImageExample-VisionOS/ContentView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import SwiftUI
import DSWaveformImage
import DSWaveformImageViews

struct ContentView: View {
private static let colors = [UIColor.systemPink, UIColor.systemBlue, UIColor.systemGreen]
private static var randomColor: UIColor {
colors[Int.random(in: 0..<colors.count)]
}

@State private var audioURL: URL = Bundle.main.url(forResource: "example_sound", withExtension: "m4a")!

@State var configuration: Waveform.Configuration = Waveform.Configuration(
style: .gradient([.red, .green])
)

var body: some View {
VStack {
Text("SwiftUI example")
.font(.largeTitle.bold())

Button {
configuration = configuration.with(style: .striped(.init(color: Self.randomColor)))
} label: {
Label("switch color randomly", systemImage: "arrow.triangle.2.circlepath")
}
.font(.body.bold())
.padding()
.background(Color(UIColor.systemGray).opacity(0.6))
.cornerRadius(10)

WaveformView(audioURL: audioURL, configuration: configuration, renderer: CircularWaveformRenderer())
}
}
}

struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// DSWaveformImageExample_VisionOSApp.swift
// DSWaveformImageExample-VisionOS
//
// Created by Antonio Cabezuelo Vivo on 18/10/23.
//

import SwiftUI

@main
struct DSWaveformImageExample_VisionOSApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
15 changes: 15 additions & 0 deletions Example/DSWaveformImageExample-VisionOS/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?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>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationPreferredDefaultSceneSessionRole</key>
<string>UIWindowSceneSessionRoleApplication</string>
<key>UIApplicationSupportsMultipleScenes</key>
<true/>
<key>UISceneConfigurations</key>
<dict/>
</dict>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading

0 comments on commit 4fa7361

Please sign in to comment.