Skip to content

Commit

Permalink
Patch 0.9.2
Browse files Browse the repository at this point in the history
feat:
- Added Cocoapods distribution

docs:
- Added library documentation
- Added license details
  • Loading branch information
FulcrumOne authored May 1, 2024
1 parent eced4ce commit f0f5f68
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 0 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Mijick

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
19 changes: 19 additions & 0 deletions MijickCameraView.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Pod::Spec.new do |s|
s.name = 'MijickCameraView'
s.summary = 'Camera made simple'
s.description = <<-DESC
CameraView is a free and open-source library dedicated for SwiftUI that allows you to create fully customisable camera view in no time. Keep your code clean.
DESC

s.version = '1.0.0'
s.ios.deployment_target = '14.0'
s.swift_version = '5.10'

s.source_files = 'Sources/**/*'
s.frameworks = 'SwiftUI', 'Foundation', 'AVKit', 'AVFoundation', 'MijickTimer'

s.homepage = 'https://github.com/Mijick/CameraView.git'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'Tomasz Kurylik' => '[email protected]' }
s.source = { :git => 'https://github.com/Mijick/CameraView.git', :tag => s.version.to_s }
end
31 changes: 31 additions & 0 deletions Sources/Public/Config/Public+MCameraController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,58 @@ import SwiftUI

// MARK: - Initial Camera Settings
public extension MCameraController {
/// Changes the initial setting of Camera Output Type
func outputType(_ type: CameraOutputType) -> Self { setAndReturnSelf { $0.cameraManager.change(outputType: type) } }

/// Changes the initial setting of Camera Position
func cameraPosition(_ position: CameraPosition) -> Self { setAndReturnSelf { $0.cameraManager.change(cameraPosition: position) } }

/// Changes the initial setting of Camera Flash Mode
func flashMode(_ flashMode: CameraFlashMode) -> Self { setAndReturnSelf { $0.cameraManager.change(flashMode: flashMode) } }

/// Changes the initial setting of Camera Grid View Visibility
func gridVisible(_ visible: Bool) -> Self { setAndReturnSelf { $0.cameraManager.change(isGridVisible: visible) } }

/// Changes the Focus Image that is displayed when the camera screen is tapped
func focusImage(_ focusImage: UIImage) -> Self { setAndReturnSelf { $0.cameraManager.change(focusImage: focusImage) } }

/// Changes the color of Focus Image that is displayed when the camera screen is tapped
func focusImageColor(_ color: UIColor) -> Self { setAndReturnSelf { $0.cameraManager.change(focusImageColor: color) } }

/// Changes the size of Focus Image that is displayed when the camera screen is tapped
func focusImageSize(_ size: CGFloat) -> Self { setAndReturnSelf { $0.cameraManager.change(focusImageSize: size) } }

/// Locks the camera interface in portrait orientation (even if device screen rotation is enabled).
/// For more information, see the project documentation (https://github.com/Mijick/CameraView)
func lockOrientation(_ appDelegate: MApplicationDelegate.Type) -> Self { setAndReturnSelf { $0.config.appDelegate = appDelegate; $0.cameraManager.lockOrientation() } }
}

// MARK: - Changing Default Views
public extension MCameraController {
/// Replaces the default Camera Screen with a new one of your choice (pass the initialiser as an argument of this method).
/// For more information, see the project documentation (https://github.com/Mijick/CameraView)
func cameraScreen(_ builder: @escaping CameraViewBuilder) -> Self { setAndReturnSelf { $0.config.cameraView = builder } }

/// Replaces the default Media Preview Screen with a new one of your choice (pass the initialiser as an argument of this method).
/// For more information, see the project documentation (https://github.com/Mijick/CameraView)
func mediaPreviewScreen(_ builder: PreviewViewBuilder?) -> Self { setAndReturnSelf { $0.config.mediaPreviewView = builder } }

/// Replaces the default Error Screen with a new one of your choice (pass the initialiser as an argument of this method).
/// For more information, see the project documentation (https://github.com/Mijick/CameraView)
func errorScreen(_ builder: @escaping ErrorViewBuilder) -> Self { setAndReturnSelf { $0.config.cameraErrorView = builder } }
}

// MARK: - Actions
public extension MCameraController {
/// Sets the action to be triggered when the photo is taken. Passes the captured content as an argument
func onImageCaptured(_ action: @escaping (Data) -> ()) -> Self { setAndReturnSelf { $0.config.onImageCaptured = action } }

/// Sets the action to be triggered when the video is taken. Passes the captured content as an argument
func onVideoCaptured(_ action: @escaping (URL) -> ()) -> Self { setAndReturnSelf { $0.config.onVideoCaptured = action } }

/// Sets the action triggered when a photo or video is taken
func afterMediaCaptured(_ action: @escaping () -> ()) -> Self { setAndReturnSelf { $0.config.afterMediaCaptured = action } }

/// Determines what happens when the Camera Controller should be closed
func onCloseController(_ action: @escaping () -> ()) -> Self { setAndReturnSelf { $0.config.onCloseController = action } }
}

0 comments on commit f0f5f68

Please sign in to comment.