Skip to content

Commit f0f5f68

Browse files
authored
Patch 0.9.2
feat: - Added Cocoapods distribution docs: - Added library documentation - Added license details
1 parent eced4ce commit f0f5f68

File tree

3 files changed

+71
-0
lines changed

3 files changed

+71
-0
lines changed

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Mijick
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

MijickCameraView.podspec

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Pod::Spec.new do |s|
2+
s.name = 'MijickCameraView'
3+
s.summary = 'Camera made simple'
4+
s.description = <<-DESC
5+
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.
6+
DESC
7+
8+
s.version = '1.0.0'
9+
s.ios.deployment_target = '14.0'
10+
s.swift_version = '5.10'
11+
12+
s.source_files = 'Sources/**/*'
13+
s.frameworks = 'SwiftUI', 'Foundation', 'AVKit', 'AVFoundation', 'MijickTimer'
14+
15+
s.homepage = 'https://github.com/Mijick/CameraView.git'
16+
s.license = { :type => 'MIT', :file => 'LICENSE' }
17+
s.author = { 'Tomasz Kurylik' => '[email protected]' }
18+
s.source = { :git => 'https://github.com/Mijick/CameraView.git', :tag => s.version.to_s }
19+
end

Sources/Public/Config/Public+MCameraController.swift

+31
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,58 @@ import SwiftUI
1313

1414
// MARK: - Initial Camera Settings
1515
public extension MCameraController {
16+
/// Changes the initial setting of Camera Output Type
1617
func outputType(_ type: CameraOutputType) -> Self { setAndReturnSelf { $0.cameraManager.change(outputType: type) } }
18+
19+
/// Changes the initial setting of Camera Position
1720
func cameraPosition(_ position: CameraPosition) -> Self { setAndReturnSelf { $0.cameraManager.change(cameraPosition: position) } }
21+
22+
/// Changes the initial setting of Camera Flash Mode
1823
func flashMode(_ flashMode: CameraFlashMode) -> Self { setAndReturnSelf { $0.cameraManager.change(flashMode: flashMode) } }
24+
25+
/// Changes the initial setting of Camera Grid View Visibility
1926
func gridVisible(_ visible: Bool) -> Self { setAndReturnSelf { $0.cameraManager.change(isGridVisible: visible) } }
27+
28+
/// Changes the Focus Image that is displayed when the camera screen is tapped
2029
func focusImage(_ focusImage: UIImage) -> Self { setAndReturnSelf { $0.cameraManager.change(focusImage: focusImage) } }
30+
31+
/// Changes the color of Focus Image that is displayed when the camera screen is tapped
2132
func focusImageColor(_ color: UIColor) -> Self { setAndReturnSelf { $0.cameraManager.change(focusImageColor: color) } }
33+
34+
/// Changes the size of Focus Image that is displayed when the camera screen is tapped
2235
func focusImageSize(_ size: CGFloat) -> Self { setAndReturnSelf { $0.cameraManager.change(focusImageSize: size) } }
36+
37+
/// Locks the camera interface in portrait orientation (even if device screen rotation is enabled).
38+
/// For more information, see the project documentation (https://github.com/Mijick/CameraView)
2339
func lockOrientation(_ appDelegate: MApplicationDelegate.Type) -> Self { setAndReturnSelf { $0.config.appDelegate = appDelegate; $0.cameraManager.lockOrientation() } }
2440
}
2541

2642
// MARK: - Changing Default Views
2743
public extension MCameraController {
44+
/// Replaces the default Camera Screen with a new one of your choice (pass the initialiser as an argument of this method).
45+
/// For more information, see the project documentation (https://github.com/Mijick/CameraView)
2846
func cameraScreen(_ builder: @escaping CameraViewBuilder) -> Self { setAndReturnSelf { $0.config.cameraView = builder } }
47+
48+
/// Replaces the default Media Preview Screen with a new one of your choice (pass the initialiser as an argument of this method).
49+
/// For more information, see the project documentation (https://github.com/Mijick/CameraView)
2950
func mediaPreviewScreen(_ builder: PreviewViewBuilder?) -> Self { setAndReturnSelf { $0.config.mediaPreviewView = builder } }
51+
52+
/// Replaces the default Error Screen with a new one of your choice (pass the initialiser as an argument of this method).
53+
/// For more information, see the project documentation (https://github.com/Mijick/CameraView)
3054
func errorScreen(_ builder: @escaping ErrorViewBuilder) -> Self { setAndReturnSelf { $0.config.cameraErrorView = builder } }
3155
}
3256

3357
// MARK: - Actions
3458
public extension MCameraController {
59+
/// Sets the action to be triggered when the photo is taken. Passes the captured content as an argument
3560
func onImageCaptured(_ action: @escaping (Data) -> ()) -> Self { setAndReturnSelf { $0.config.onImageCaptured = action } }
61+
62+
/// Sets the action to be triggered when the video is taken. Passes the captured content as an argument
3663
func onVideoCaptured(_ action: @escaping (URL) -> ()) -> Self { setAndReturnSelf { $0.config.onVideoCaptured = action } }
64+
65+
/// Sets the action triggered when a photo or video is taken
3766
func afterMediaCaptured(_ action: @escaping () -> ()) -> Self { setAndReturnSelf { $0.config.afterMediaCaptured = action } }
67+
68+
/// Determines what happens when the Camera Controller should be closed
3869
func onCloseController(_ action: @escaping () -> ()) -> Self { setAndReturnSelf { $0.config.onCloseController = action } }
3970
}

0 commit comments

Comments
 (0)