1659034800
SwiftyCam is a a simple, Snapchat-style iOS Camera framework for easy photo and video capture. SwiftyCam allows users to capture both photos and videos from the same session with very little configuration.
Configuring a Camera View Controller in AVFoundation can be tedious and time consuming. SwiftyCam is a drop in View Controller which gives complete control of the AVSession.
SwiftyCam | |
---|---|
:sunglasses: | Snapchat-style media capture |
:+1: | Support iOS8+ |
:camera: | Image capture |
:movie_camera: | Video capture |
:chart_with_upwards_trend: | Manual image quality settings |
:tada: | Front and rear camera support |
:flashlight: | Front and rear flash |
:sunny: | Retina flash support |
:mag_right: | Supports manual zoom |
:lock: | Supports manual focus |
:last_quarter_moon_with_face: | Low light setting |
:speaker: | Background audio support |
SwiftyCam is available under the BSD license. See the LICENSE file for more info.
SwiftyCam is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "SwiftyCam"
Add this to Cartfile
github "Awalz/SwiftyCam" ~> 2.2.1
$ carthage update SwiftyCam
Simply copy the contents of the Source folder into your project.
Using SwiftyCam is very simple.
As of iOS 10, Apple requires the additon of the NSCameraUsageDescription
and NSMicrophoneUsageDescription
strings to the info.plist of your application. Example:
<key>NSCameraUsageDescription</key>
<string>To Take Photos and Video</string>
<key>NSMicrophoneUsageDescription</key>
<string>To Record Audio With Video</string>
If you install SwiftyCam from Cocoapods, be sure to import the module into your View Controller:
import SwiftyCam
SwiftyCam is a drop-in convenience framework. To create a Camera instance, create a new UIViewController subclass. Replace the UIViewController subclass declaration with SwiftyCamViewController
:
class MyCameraViewController : SwiftyCamViewController
That is all that is required to setup the AVSession for photo and video capture. SwiftyCam will prompt the user for permission to use the camera/microphone, and configure both the device inputs and outputs.
SwiftyCam comes with a very convenient method of capturing media. SwiftyCamButton captures photos with a UITapGestureRecognizer
and captures video with a UILongPressGestureRecognizer
To use a SwiftyCamButton, simply create one and assign the delegate to your SwiftyCamViewController:
let captureButton = SwiftyCamButton(frame: buttonFrame)
captureButton.delegate = self
Capturing media with SwiftyCam is very simple. To capture a photo, simply call the takePhoto
function:
takePhoto()
Capturing Video is just as easy. To begin recording video, call the startVideoRecording
function:
startVideoRecording()
To end the capture of a video, call the stopVideoRecording
function:
stopVideoRecording()
In order to acquire the photos and videos taken by either the SwiftyCamButton or manually, you must implement the SwiftyCamViewControllerDelegate
and set the cameraDelegate
to your view controller instance:
class MyCameraViewController : SwiftyCamViewController, SwiftyCamViewControllerDelegate {
override func viewDidLoad() {
super.viewDidLoad()
cameraDelegate = self
}
...
}
func swiftyCam(_ swiftyCam: SwiftyCamViewController, didTake photo: UIImage) {
// Called when takePhoto() is called or if a SwiftyCamButton initiates a tap gesture
// Returns a UIImage captured from the current session
}
func swiftyCam(_ swiftyCam: SwiftyCamViewController, didBeginRecordingVideo camera: SwiftyCamViewController.CameraSelection) {
// Called when startVideoRecording() is called
// Called if a SwiftyCamButton begins a long press gesture
}
func swiftyCam(_ swiftyCam: SwiftyCamViewController, didFinishRecordingVideo camera: SwiftyCamViewController.CameraSelection) {
// Called when stopVideoRecording() is called
// Called if a SwiftyCamButton ends a long press gesture
}
func swiftyCam(_ swiftyCam: SwiftyCamViewController, didFinishProcessVideoAt url: URL) {
// Called when stopVideoRecording() is called and the video is finished processing
// Returns a URL in the temporary directory where video is stored
}
func swiftyCam(_ swiftyCam: SwiftyCamViewController, didFocusAtPoint point: CGPoint) {
// Called when a user initiates a tap gesture on the preview layer
// Will only be called if tapToFocus = true
// Returns a CGPoint of the tap location on the preview layer
}
func swiftyCam(_ swiftyCam: SwiftyCamViewController, didChangeZoomLevel zoom: CGFloat) {
// Called when a user initiates a pinch gesture on the preview layer
// Will only be called if pinchToZoomn = true
// Returns a CGFloat of the current zoom level
}
func swiftyCam(_ swiftyCam: SwiftyCamViewController, didSwitchCameras camera: SwiftyCamViewController.CameraSelection) {
// Called when user switches between cameras
// Returns current camera selection
}
The flash(torch) can be enabled by changing the flashEnabled
property:
flashEnabled = true
Flash is now supported for front and rear facing cameras.
For photos, the camera will flash much like the stock iOS camera. For video, the torch(flash) will enable for the duration of the video capture.
For models that support Retina Flash, the front camera will use the default flash for image capture. If Retina Flash is not supported, a faux Retina Flash is used similar to Snapchat.
For front facing videos, a white, 85% opaque view will be placed over the video feed for the duration of the video capture.
By default, SwiftyCam will launch to the rear facing camera. This can be changed by changing the defaultCamera
property in viewDidLoad
:
override func viewDidLoad() {
super.viewDidLoad()
defaultCamera = .front
...
}
SwiftyCam supports capture from both the front and back cameras. To switch cameras, call the function:
switchCamera()
Tap-to-focus, pinch-to-zoom and camera flash are not supported when the front facing camera is selected. Switching video while video is being recorded is not currently supported
SwiftyCam also enables switching between cameras with a double tap gesture. To disable this feature, use the doubleTapCameraSwitch
property:
doubleTapCameraSwitch = false
SwiftyCam has several options for configurating the functionality of the capture:
Video quality can be set by the videoQuality property of SwiftyCamViewController. The choices available correspond to the matching AVCaptureSessionPreset:
VideoQuality | AVCaptureSessionPreset |
---|---|
.high | AVCapturePresetHigh |
.medium | AVCapturePresetMedium |
.low | AVCapturePresetLow |
.resolution352x288 | AVCaptureSessionPreset352x288 |
.resolution640x480 | AVCaptureSessionPreset640x480 |
.resolution1280x720 | AVCaptureSessionPreset1280x720 |
.resolution1920x1080 | AVCaptureSessionPreset1920x1080 |
.resolution3840x2160 | AVCaptureSessionPreset3840x2160 |
.iframe960x540 | AVCaptureSessionPresetiFrame960x540 |
.iframe1280x720 | AVCaptureSessionPresetiFrame1280x720 |
The default value is .high. For use with the front-facing camera, .high will always be used.
If using a SwiftyCamButton, you can set a maximum video duration for the length of video. The video recording will me automatically stopped once the time limit has been reached and the delegate method SwiftyCamDidFinishRecordingVideo
will be called. To set this value, simply change the maximumVideoDuration
value:
maximumVideoDuration = 10.0
A value of 0.0 will allow for unlimited video recording via the SwiftyCamButton. The default value is 0.0.
SwiftyCam supports digital zoom of the camera session via pinch and pan gestures. The gestures work similar to the default iOS app and will zoom to the maximum supported zoom level. Camera zoom is only supported on the rear facing camera. AVFoundation does not currently support front facing camera zoom. To disable this feature, change the pinchToZoom
property:
pinchToZoom = false
By default, pinchToZoom
is enabled.
SwiftyCam also supports the ability to zoom the rear facing camera with vertical pan gestures. To disable this feature, change the swipeToZoom
property:
swipeToZoom = false
By default, swipeToZoom
is enabled. The default gestures zoom in the capture session with a downward swipe, and zoom out with an upward swipe. This can be reversed by changing the swipeToZoomInverted
property:
swipeToZoomInverted = true
You can also restrict the amount that the rear facing camera can zoom. To do this, use the maxZoomScale
property:
maxZoomScale = 2.0
By default, maxZoomScale
is set to infinite. The actual maximum zoom level is determined by the device's videoMaxZoomFactor.
SwiftyCam, by default, support tap to focus on the video preview. SwiftyCam will set the focus and exposure levels of the session to the tapped point. While tap to set exposure is supported on both cameras, tap to focus is only supported on rear facing cameras. Autofocus and autoexposure will be resumed once SwiftyCam detects significant movement from the tapped point. To disable this feature, change the tapToFocus
property:
tapToFocus = false
By default, tapToFocus
is enabled. If you wish to show a on screen animation when a tap to focus is initiated, you can use the SwiftyCamDidFocusAtPoint(focusPoint:)
to get the coordinates of tap and provide your own tap animation
By default, SwiftyCam will set the photo orientation to be portrait. If you wish to preserve the orientation of the capture photos to allow support for landscape images, use the shouldUseDeviceOrientation
property:
shouldUseDeviceOrientation = true
SwiftyCam has the ability to allow background audio to continue playing within the session, and to be captured by the video recording. By default, this is enabled. If you wish to disable this feature, change the allowBackgroundAudio
property:
allowBackgroundAudio = false
For supported models (iPhone 5 and 5C), AVCaptureDevice supports a low light boost when it is detected that the capture session is in a low light area. By default, this is set to true. It can be modified with the lowLightBoost
variable:
lowLightBoost = false
When a user firsts launch SwiftyCamViewController, they will be prompted for permission for access to the cameras and microphones. By default, if a user declines access to the hardware, SwiftyCam will provide a prompt to the App privacy settings inside the iOS settings application.
Other properties:
isCameraFlashOn
- BooleanisVideoRecording
- BooleanisSessionRunning
- BooleancurrentCamera
- CameraSelectionAuthor: Awalz
Source Code: https://github.com/Awalz/SwiftyCam
License: BSD-2-Clause license
1616839708
Are you looking for the best swift iOS App Development Company in USA & India? We at AppClues Infotech is one of the leading Swift iOS App development company that help to build Innovative, Secure & high-performance mobile app with modern features & technology.
For more info:
Website: https://www.appcluesinfotech.com/
Email: info@appcluesinfotech.com
Call: +1-978-309-9910
#swift ios app development company in usa & india #swift ios app development company in usa #hire swift ios app developers in usa #top swift ios app development company #best swift ios app development company in usa #app development company in usa & india
1659034800
SwiftyCam is a a simple, Snapchat-style iOS Camera framework for easy photo and video capture. SwiftyCam allows users to capture both photos and videos from the same session with very little configuration.
Configuring a Camera View Controller in AVFoundation can be tedious and time consuming. SwiftyCam is a drop in View Controller which gives complete control of the AVSession.
SwiftyCam | |
---|---|
:sunglasses: | Snapchat-style media capture |
:+1: | Support iOS8+ |
:camera: | Image capture |
:movie_camera: | Video capture |
:chart_with_upwards_trend: | Manual image quality settings |
:tada: | Front and rear camera support |
:flashlight: | Front and rear flash |
:sunny: | Retina flash support |
:mag_right: | Supports manual zoom |
:lock: | Supports manual focus |
:last_quarter_moon_with_face: | Low light setting |
:speaker: | Background audio support |
SwiftyCam is available under the BSD license. See the LICENSE file for more info.
SwiftyCam is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "SwiftyCam"
Add this to Cartfile
github "Awalz/SwiftyCam" ~> 2.2.1
$ carthage update SwiftyCam
Simply copy the contents of the Source folder into your project.
Using SwiftyCam is very simple.
As of iOS 10, Apple requires the additon of the NSCameraUsageDescription
and NSMicrophoneUsageDescription
strings to the info.plist of your application. Example:
<key>NSCameraUsageDescription</key>
<string>To Take Photos and Video</string>
<key>NSMicrophoneUsageDescription</key>
<string>To Record Audio With Video</string>
If you install SwiftyCam from Cocoapods, be sure to import the module into your View Controller:
import SwiftyCam
SwiftyCam is a drop-in convenience framework. To create a Camera instance, create a new UIViewController subclass. Replace the UIViewController subclass declaration with SwiftyCamViewController
:
class MyCameraViewController : SwiftyCamViewController
That is all that is required to setup the AVSession for photo and video capture. SwiftyCam will prompt the user for permission to use the camera/microphone, and configure both the device inputs and outputs.
SwiftyCam comes with a very convenient method of capturing media. SwiftyCamButton captures photos with a UITapGestureRecognizer
and captures video with a UILongPressGestureRecognizer
To use a SwiftyCamButton, simply create one and assign the delegate to your SwiftyCamViewController:
let captureButton = SwiftyCamButton(frame: buttonFrame)
captureButton.delegate = self
Capturing media with SwiftyCam is very simple. To capture a photo, simply call the takePhoto
function:
takePhoto()
Capturing Video is just as easy. To begin recording video, call the startVideoRecording
function:
startVideoRecording()
To end the capture of a video, call the stopVideoRecording
function:
stopVideoRecording()
In order to acquire the photos and videos taken by either the SwiftyCamButton or manually, you must implement the SwiftyCamViewControllerDelegate
and set the cameraDelegate
to your view controller instance:
class MyCameraViewController : SwiftyCamViewController, SwiftyCamViewControllerDelegate {
override func viewDidLoad() {
super.viewDidLoad()
cameraDelegate = self
}
...
}
func swiftyCam(_ swiftyCam: SwiftyCamViewController, didTake photo: UIImage) {
// Called when takePhoto() is called or if a SwiftyCamButton initiates a tap gesture
// Returns a UIImage captured from the current session
}
func swiftyCam(_ swiftyCam: SwiftyCamViewController, didBeginRecordingVideo camera: SwiftyCamViewController.CameraSelection) {
// Called when startVideoRecording() is called
// Called if a SwiftyCamButton begins a long press gesture
}
func swiftyCam(_ swiftyCam: SwiftyCamViewController, didFinishRecordingVideo camera: SwiftyCamViewController.CameraSelection) {
// Called when stopVideoRecording() is called
// Called if a SwiftyCamButton ends a long press gesture
}
func swiftyCam(_ swiftyCam: SwiftyCamViewController, didFinishProcessVideoAt url: URL) {
// Called when stopVideoRecording() is called and the video is finished processing
// Returns a URL in the temporary directory where video is stored
}
func swiftyCam(_ swiftyCam: SwiftyCamViewController, didFocusAtPoint point: CGPoint) {
// Called when a user initiates a tap gesture on the preview layer
// Will only be called if tapToFocus = true
// Returns a CGPoint of the tap location on the preview layer
}
func swiftyCam(_ swiftyCam: SwiftyCamViewController, didChangeZoomLevel zoom: CGFloat) {
// Called when a user initiates a pinch gesture on the preview layer
// Will only be called if pinchToZoomn = true
// Returns a CGFloat of the current zoom level
}
func swiftyCam(_ swiftyCam: SwiftyCamViewController, didSwitchCameras camera: SwiftyCamViewController.CameraSelection) {
// Called when user switches between cameras
// Returns current camera selection
}
The flash(torch) can be enabled by changing the flashEnabled
property:
flashEnabled = true
Flash is now supported for front and rear facing cameras.
For photos, the camera will flash much like the stock iOS camera. For video, the torch(flash) will enable for the duration of the video capture.
For models that support Retina Flash, the front camera will use the default flash for image capture. If Retina Flash is not supported, a faux Retina Flash is used similar to Snapchat.
For front facing videos, a white, 85% opaque view will be placed over the video feed for the duration of the video capture.
By default, SwiftyCam will launch to the rear facing camera. This can be changed by changing the defaultCamera
property in viewDidLoad
:
override func viewDidLoad() {
super.viewDidLoad()
defaultCamera = .front
...
}
SwiftyCam supports capture from both the front and back cameras. To switch cameras, call the function:
switchCamera()
Tap-to-focus, pinch-to-zoom and camera flash are not supported when the front facing camera is selected. Switching video while video is being recorded is not currently supported
SwiftyCam also enables switching between cameras with a double tap gesture. To disable this feature, use the doubleTapCameraSwitch
property:
doubleTapCameraSwitch = false
SwiftyCam has several options for configurating the functionality of the capture:
Video quality can be set by the videoQuality property of SwiftyCamViewController. The choices available correspond to the matching AVCaptureSessionPreset:
VideoQuality | AVCaptureSessionPreset |
---|---|
.high | AVCapturePresetHigh |
.medium | AVCapturePresetMedium |
.low | AVCapturePresetLow |
.resolution352x288 | AVCaptureSessionPreset352x288 |
.resolution640x480 | AVCaptureSessionPreset640x480 |
.resolution1280x720 | AVCaptureSessionPreset1280x720 |
.resolution1920x1080 | AVCaptureSessionPreset1920x1080 |
.resolution3840x2160 | AVCaptureSessionPreset3840x2160 |
.iframe960x540 | AVCaptureSessionPresetiFrame960x540 |
.iframe1280x720 | AVCaptureSessionPresetiFrame1280x720 |
The default value is .high. For use with the front-facing camera, .high will always be used.
If using a SwiftyCamButton, you can set a maximum video duration for the length of video. The video recording will me automatically stopped once the time limit has been reached and the delegate method SwiftyCamDidFinishRecordingVideo
will be called. To set this value, simply change the maximumVideoDuration
value:
maximumVideoDuration = 10.0
A value of 0.0 will allow for unlimited video recording via the SwiftyCamButton. The default value is 0.0.
SwiftyCam supports digital zoom of the camera session via pinch and pan gestures. The gestures work similar to the default iOS app and will zoom to the maximum supported zoom level. Camera zoom is only supported on the rear facing camera. AVFoundation does not currently support front facing camera zoom. To disable this feature, change the pinchToZoom
property:
pinchToZoom = false
By default, pinchToZoom
is enabled.
SwiftyCam also supports the ability to zoom the rear facing camera with vertical pan gestures. To disable this feature, change the swipeToZoom
property:
swipeToZoom = false
By default, swipeToZoom
is enabled. The default gestures zoom in the capture session with a downward swipe, and zoom out with an upward swipe. This can be reversed by changing the swipeToZoomInverted
property:
swipeToZoomInverted = true
You can also restrict the amount that the rear facing camera can zoom. To do this, use the maxZoomScale
property:
maxZoomScale = 2.0
By default, maxZoomScale
is set to infinite. The actual maximum zoom level is determined by the device's videoMaxZoomFactor.
SwiftyCam, by default, support tap to focus on the video preview. SwiftyCam will set the focus and exposure levels of the session to the tapped point. While tap to set exposure is supported on both cameras, tap to focus is only supported on rear facing cameras. Autofocus and autoexposure will be resumed once SwiftyCam detects significant movement from the tapped point. To disable this feature, change the tapToFocus
property:
tapToFocus = false
By default, tapToFocus
is enabled. If you wish to show a on screen animation when a tap to focus is initiated, you can use the SwiftyCamDidFocusAtPoint(focusPoint:)
to get the coordinates of tap and provide your own tap animation
By default, SwiftyCam will set the photo orientation to be portrait. If you wish to preserve the orientation of the capture photos to allow support for landscape images, use the shouldUseDeviceOrientation
property:
shouldUseDeviceOrientation = true
SwiftyCam has the ability to allow background audio to continue playing within the session, and to be captured by the video recording. By default, this is enabled. If you wish to disable this feature, change the allowBackgroundAudio
property:
allowBackgroundAudio = false
For supported models (iPhone 5 and 5C), AVCaptureDevice supports a low light boost when it is detected that the capture session is in a low light area. By default, this is set to true. It can be modified with the lowLightBoost
variable:
lowLightBoost = false
When a user firsts launch SwiftyCamViewController, they will be prompted for permission for access to the cameras and microphones. By default, if a user declines access to the hardware, SwiftyCam will provide a prompt to the App privacy settings inside the iOS settings application.
Other properties:
isCameraFlashOn
- BooleanisVideoRecording
- BooleanisSessionRunning
- BooleancurrentCamera
- CameraSelectionAuthor: Awalz
Source Code: https://github.com/Awalz/SwiftyCam
License: BSD-2-Clause license
1606455026
Are you looking for a Top Swift iOS App Development Company in USA? AppClues Infotech is a top Swift iOS App Development Company in USA that offers cutting-edge services to businesses for their custom requirements. Hire Dedicated Swift iOS Mobile Apps Developer & Programmers from AppClues Infotech at an affordable cost.
For more info:
Website: https://www.appcluesinfotech.com/
Email: info@appcluesinfotech.com
Call: +1-978-309-9910
#top swift app development company usa #best swift app development company #swift app development #swift ios app development #swift app development company #best swift ios app development company in usa
1612441441
Are you looking to hire the best swift iOS developers for your iPhone or iPad App project? AppClues Infotech is a top-rated iOS app development company in the USA. Hire our dedicated swift iOS app developers to build feature-rich and robust iOS app.
For more info:
Website: https://www.appcluesinfotech.com/
Email: info@appcluesinfotech.com
Call: +1-978-309-9910
#top swift app development company usa #best swift app development company #swift app development #swift ios app development #swift app development company #hire expert swift ios app developers in usa
1653939840
Note: Xcode's limited Markdown support means this file is best viewed on GitHub. Not seeing this as a formatted file in Xcode? Check out the Build section of the project wiki on GitHub for troubleshooting tips.
Open Food Facts is a food products database made by everyone, for everyone.
You can help translate Open Food Facts and the app at (no technical knowledge required, takes a minute to signup): translate.openfoodfacts.org
Open Food Facts on iPhone and iPad has 0,5M users and 1M products. Each contribution you make will have a large impact on food transparency worldwide. Finding the right issue or feature will help you have even more more impact. Feel free to ask for feedback on the #android channel before you start work, and to document what you intend to code.
Here are issues and feature requests you can work on:
The easiest way to setup the dependencies of the project and generate the Xcode project is to run sh scripts/setup.sh
from the top of the repository.
If you prefer to not use the sh scripts/setup.sh
script and install the dependencies yourself, follow the instructions below.
We use Carthage for dependency management.
Run carthage bootstrap --platform iOS --cache-builds
before opening the project in Xcode.
You can install Carthage with Homebrew:
brew install carthage
To generate the Xcode project run sh scripts/create-project.sh
. In order to generate the Xcode project we use XcodeGen.
New to Carthage? Others have found the following resources helpful:
Currently there are two lanes, one for running the tests (fastlane test
) and one for uploading a new beta to TestFlight (fastlane beta
).
You can install Fastlane with Homebrew:
brew cask install fastlane
fastlane snapshot
Roadmap on automatic screenshot generation:
fastlane frameit
to the Fastlane file, so that we can get versions wrapped in physical devicesWe have a script that runs when building the app, it executes SwiftLint to enforce a style and conventions to the code.
You can install SwiftLint with Homebrew:
brew install swiftlint
OpenFoodFacts has a Slack team where we chat, discuss and support each other, join the #iOS and #iOS-alerts channels. Click here to join.
Download Details:
Author: openfoodfacts
Source Code: https://github.com/openfoodfacts/openfoodfacts-ios
License: Apache-2.0 license