-
Notifications
You must be signed in to change notification settings - Fork 20
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 #15 from enebin/release/0.3.0
release/0.3.0
- Loading branch information
Showing
47 changed files
with
2,152 additions
and
969 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
Demo/Aespa-iOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
Demo/Aespa-iOS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
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,8 @@ | ||
<?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>IDEDidComputeMac32BitWarning</key> | ||
<true/> | ||
</dict> | ||
</plist> |
101 changes: 101 additions & 0 deletions
101
Demo/Aespa-iOS.xcodeproj/xcshareddata/xcschemes/Aespa-iOS.xcscheme
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,101 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Scheme | ||
LastUpgradeVersion = "1430" | ||
version = "1.7"> | ||
<BuildAction | ||
parallelizeBuildables = "YES" | ||
buildImplicitDependencies = "YES"> | ||
<BuildActionEntries> | ||
<BuildActionEntry | ||
buildForTesting = "YES" | ||
buildForRunning = "YES" | ||
buildForProfiling = "YES" | ||
buildForArchiving = "YES" | ||
buildForAnalyzing = "YES"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "9CE5B7D72A306F350058334D" | ||
BuildableName = "Aespa-iOS.app" | ||
BlueprintName = "Aespa-iOS" | ||
ReferencedContainer = "container:Aespa-iOS.xcodeproj"> | ||
</BuildableReference> | ||
</BuildActionEntry> | ||
</BuildActionEntries> | ||
</BuildAction> | ||
<TestAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
shouldAutocreateTestPlan = "YES"> | ||
<Testables> | ||
<TestableReference | ||
skipped = "NO" | ||
parallelizable = "YES"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "9CE5B7E72A306F370058334D" | ||
BuildableName = "Aespa-iOSTests.xctest" | ||
BlueprintName = "Aespa-iOSTests" | ||
ReferencedContainer = "container:Aespa-iOS.xcodeproj"> | ||
</BuildableReference> | ||
</TestableReference> | ||
<TestableReference | ||
skipped = "NO" | ||
parallelizable = "YES"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "9CE5B7F12A306F370058334D" | ||
BuildableName = "Aespa-iOSUITests.xctest" | ||
BlueprintName = "Aespa-iOSUITests" | ||
ReferencedContainer = "container:Aespa-iOS.xcodeproj"> | ||
</BuildableReference> | ||
</TestableReference> | ||
</Testables> | ||
</TestAction> | ||
<LaunchAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
launchStyle = "0" | ||
useCustomWorkingDirectory = "NO" | ||
ignoresPersistentStateOnLaunch = "NO" | ||
debugDocumentVersioning = "YES" | ||
debugServiceExtension = "internal" | ||
allowLocationSimulation = "YES"> | ||
<BuildableProductRunnable | ||
runnableDebuggingMode = "0"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "9CE5B7D72A306F350058334D" | ||
BuildableName = "Aespa-iOS.app" | ||
BlueprintName = "Aespa-iOS" | ||
ReferencedContainer = "container:Aespa-iOS.xcodeproj"> | ||
</BuildableReference> | ||
</BuildableProductRunnable> | ||
</LaunchAction> | ||
<ProfileAction | ||
buildConfiguration = "Release" | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
savedToolIdentifier = "" | ||
useCustomWorkingDirectory = "NO" | ||
debugDocumentVersioning = "YES"> | ||
<BuildableProductRunnable | ||
runnableDebuggingMode = "0"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "9CE5B7D72A306F350058334D" | ||
BuildableName = "Aespa-iOS.app" | ||
BlueprintName = "Aespa-iOS" | ||
ReferencedContainer = "container:Aespa-iOS.xcodeproj"> | ||
</BuildableReference> | ||
</BuildableProductRunnable> | ||
</ProfileAction> | ||
<AnalyzeAction | ||
buildConfiguration = "Debug"> | ||
</AnalyzeAction> | ||
<ArchiveAction | ||
buildConfiguration = "Release" | ||
revealArchiveInOrganizer = "YES"> | ||
</ArchiveAction> | ||
</Scheme> |
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,5 @@ | ||
<?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/> | ||
</plist> |
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,17 @@ | ||
// | ||
// Aespa_iOSApp.swift | ||
// Aespa-iOS | ||
// | ||
// Created by 이영빈 on 2023/06/07. | ||
// | ||
|
||
import SwiftUI | ||
|
||
@main | ||
struct Aespa_iOSApp: App { | ||
var body: some Scene { | ||
WindowGroup { | ||
VideoContentView() | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Demo/Aespa-iOS/Assets.xcassets/AccentColor.colorset/Contents.json
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,11 @@ | ||
{ | ||
"colors" : [ | ||
{ | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
Demo/Aespa-iOS/Assets.xcassets/AppIcon.appiconset/Contents.json
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,13 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"platform" : "ios", | ||
"size" : "1024x1024" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
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,6 @@ | ||
{ | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
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,78 @@ | ||
// | ||
// GalleryView.swift | ||
// Aespa-iOS | ||
// | ||
// Created by 이영빈 on 2023/06/12. | ||
// | ||
|
||
import Aespa | ||
import SwiftUI | ||
|
||
struct GalleryView: View { | ||
@ObservedObject var viewModel: VideoContentViewModel | ||
|
||
@Binding private var mediaType: MediaType | ||
|
||
init( | ||
mediaType: Binding<MediaType>, | ||
contentViewModel viewModel: VideoContentViewModel | ||
) { | ||
self._mediaType = mediaType | ||
self.viewModel = viewModel | ||
} | ||
|
||
var body: some View { | ||
VStack(alignment: .center) { | ||
Picker("File", selection: $mediaType) { | ||
Text("Video").tag(MediaType.video) | ||
Text("Photo").tag(MediaType.photo) | ||
} | ||
.pickerStyle(.segmented) | ||
.frame(width: 200) | ||
.padding(.vertical) | ||
|
||
ScrollView { | ||
switch mediaType { | ||
case .photo: | ||
LazyVGrid( | ||
columns: [GridItem(.flexible()), GridItem(.flexible()), GridItem(.flexible())], | ||
spacing: 5 | ||
) { | ||
ForEach(viewModel.photoFiles) { file in | ||
let image = Image(uiImage: file.thumbnail ?? UIImage()) | ||
|
||
image | ||
.resizable() | ||
.scaledToFill() | ||
} | ||
} | ||
.onAppear { | ||
viewModel.fetchPhotoFiles() | ||
} | ||
case .video: | ||
LazyVGrid( | ||
columns: [GridItem(.flexible()), GridItem(.flexible()), GridItem(.flexible())], | ||
spacing: 5 | ||
) { | ||
ForEach(viewModel.videoFiles) { file in | ||
let image = Image(uiImage: file.thumbnail ?? UIImage()) | ||
|
||
image | ||
.resizable() | ||
.scaledToFill() | ||
} | ||
} | ||
.onAppear { | ||
viewModel.fetchVideoFiles() | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
struct GalleryView_Previews: PreviewProvider { | ||
static var previews: some View { | ||
GalleryView(mediaType: .constant(.video), contentViewModel: .init()) | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
Demo/Aespa-iOS/Preview Content/Preview Assets.xcassets/Contents.json
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,6 @@ | ||
{ | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
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,97 @@ | ||
// | ||
// SettingView.swift | ||
// Aespa-iOS | ||
// | ||
// Created by Young Bin on 2023/06/08. | ||
// | ||
|
||
import SwiftUI | ||
import AVFoundation | ||
|
||
struct SettingView: View { | ||
@ObservedObject var viewModel: VideoContentViewModel | ||
|
||
@State private var quality: AVCaptureSession.Preset | ||
@State private var focusMode: AVCaptureDevice.FocusMode | ||
|
||
@State private var isMuted: Bool | ||
|
||
@State private var flashMode: AVCaptureDevice.FlashMode | ||
|
||
init(contentViewModel viewModel: VideoContentViewModel) { | ||
self.viewModel = viewModel | ||
|
||
self.quality = viewModel.aespaSession.avCaptureSession.sessionPreset | ||
self.focusMode = viewModel.aespaSession.currentFocusMode ?? .continuousAutoFocus | ||
|
||
self.isMuted = viewModel.aespaSession.isMuted | ||
|
||
self.flashMode = viewModel.aespaSession.currentSetting.flashMode | ||
} | ||
|
||
var body: some View { | ||
List { | ||
Section(header: Text("Common")) { | ||
Picker("Quality", selection: $quality) { | ||
Text("Low").tag(AVCaptureSession.Preset.low) | ||
Text("Medium").tag(AVCaptureSession.Preset.medium) | ||
Text("High").tag(AVCaptureSession.Preset.high) | ||
} | ||
.modifier(TitledPicker(title: "Asset quality")) | ||
.onChange(of: quality) { newValue in | ||
viewModel.aespaSession.quality(to: newValue) | ||
} | ||
|
||
Picker("Focus", selection: $focusMode) { | ||
Text("Auto").tag(AVCaptureDevice.FocusMode.autoFocus) | ||
Text("Locked").tag(AVCaptureDevice.FocusMode.locked) | ||
Text("Continuous").tag(AVCaptureDevice.FocusMode.continuousAutoFocus) | ||
} | ||
.modifier(TitledPicker(title: "Focus mode")) | ||
.onChange(of: focusMode) { newValue in | ||
viewModel.aespaSession.focus(mode: newValue) | ||
} | ||
} | ||
|
||
Section(header: Text("Video")) { | ||
Picker("Mute", selection: $isMuted) { | ||
Text("Unmute").tag(false) | ||
Text("Mute").tag(true) | ||
} | ||
.modifier(TitledPicker(title: "Mute")) | ||
.onChange(of: isMuted) { newValue in | ||
_ = newValue ? | ||
viewModel.aespaSession.mute() : | ||
viewModel.aespaSession.unmute() | ||
} | ||
} | ||
|
||
Section(header: Text("Photo")) { | ||
Picker("Flash", selection: $flashMode) { | ||
Text("On").tag(AVCaptureDevice.FlashMode.on) | ||
Text("Off").tag(AVCaptureDevice.FlashMode.off) | ||
Text("Auto").tag(AVCaptureDevice.FlashMode.auto) | ||
} | ||
.modifier(TitledPicker(title: "Flash mode")) | ||
.onChange(of: flashMode) { newValue in | ||
viewModel.aespaSession.flashMode(to: newValue) | ||
} | ||
} | ||
} | ||
} | ||
|
||
struct TitledPicker: ViewModifier { | ||
let title: String | ||
func body(content: Content) -> some View { | ||
VStack(alignment: .leading) { | ||
Text(title) | ||
.foregroundColor(.gray) | ||
.font(.caption) | ||
|
||
content | ||
.pickerStyle(.segmented) | ||
.frame(height: 40) | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.