Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Commit

Permalink
Merge branch 'release/3.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Tulleb committed Oct 13, 2019
2 parents a2b94fb + a90bdeb commit 6606a3b
Show file tree
Hide file tree
Showing 18 changed files with 524 additions and 643 deletions.
12 changes: 6 additions & 6 deletions ALCameraViewController.podspec
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Pod::Spec.new do |spec|
spec.name = "ALCameraViewController"
spec.version = "3.0.3"
spec.name = "ALCameraViewController-Tulleb"
spec.version = "3.1"
spec.summary = "A camera view controller with custom image picker and image cropping."
spec.source = { :git => "https://github.com/AlexLittlejohn/ALCameraViewController.git", :tag => spec.version.to_s }
spec.source = { :git => "https://github.com/Tulleb/ALCameraViewController.git", :tag => spec.version.to_s }
spec.requires_arc = true
spec.platform = :ios, "8.0"
spec.license = "MIT"
spec.source_files = "ALCameraViewController/**/*.{swift}"
spec.resources = ["ALCameraViewController/ViewController/ConfirmViewController.xib", "ALCameraViewController/CameraViewAssets.xcassets", "ALCameraViewController/CameraView.strings"]
spec.homepage = "https://github.com/AlexLittlejohn/ALCameraViewController"
spec.author = { "Alex Littlejohn" => "alexlittlejohn@me.com" }
spec.pod_target_xcconfig = { 'SWIFT_VERSION' => '4.0' }
spec.homepage = "https://github.com/Tulleb/ALCameraViewController"
spec.author = { "Alex Littlejohn" => "alexlittlejohn@me.com", "Guillaume Bellut" => "guillaume@bellut.com" }
spec.pod_target_xcconfig = { 'SWIFT_VERSION' => '5.0' }
end
27 changes: 15 additions & 12 deletions ALCameraViewController.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
/* Begin PBXBuildFile section */
1F3C56291F701CA7009667E9 /* CroppingParameters.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AC96FA11F5B5166003E53F4 /* CroppingParameters.swift */; };
7AC96FA21F5B5166003E53F4 /* CroppingParameters.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AC96FA11F5B5166003E53F4 /* CroppingParameters.swift */; };
7AD3B52D23521955002BAD73 /* CropOverlay.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AD3B52C23521955002BAD73 /* CropOverlay.swift */; };
7C6AF41F1FB340CA006CB4ED /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7C6AF41E1FB340CA006CB4ED /* LaunchScreen.xib */; };
C40665441C73A47C00EB9751 /* SingleImageSaver.swift in Sources */ = {isa = PBXBuildFile; fileRef = C40665431C73A47C00EB9751 /* SingleImageSaver.swift */; };
C40665461C73A94100EB9751 /* CameraGlobals.swift in Sources */ = {isa = PBXBuildFile; fileRef = C40665451C73A94100EB9751 /* CameraGlobals.swift */; };
Expand All @@ -32,7 +33,6 @@
C482A00F1CAEB18D00541D08 /* ImageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAB50BEE1B413E8C009905B9 /* ImageCell.swift */; };
C482A0101CAEB18D00541D08 /* PermissionsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA5FA3421B3AFA2B00497C62 /* PermissionsView.swift */; };
C482A0111CAEB18D00541D08 /* CameraView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAF058671B3175C5008E5592 /* CameraView.swift */; };
C482A0121CAEB18D00541D08 /* CropOverlay.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA787F1B1B4326F100B6B86E /* CropOverlay.swift */; };
C482A0141CAEB1B100541D08 /* CameraView.strings in Resources */ = {isa = PBXBuildFile; fileRef = FA8231371B3BF8F700A837BE /* CameraView.strings */; };
C482A0151CAEB1B100541D08 /* CameraViewAssets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FA5FA3441B3AFEB300497C62 /* CameraViewAssets.xcassets */; };
C484580B1D0AA44400ECDB15 /* UIViewExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBFE097C1CAF1D1A00A8C637 /* UIViewExtensions.swift */; };
Expand All @@ -45,7 +45,6 @@
FA5FA3431B3AFA2B00497C62 /* PermissionsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA5FA3421B3AFA2B00497C62 /* PermissionsView.swift */; };
FA5FA3451B3AFEB300497C62 /* CameraViewAssets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FA5FA3441B3AFEB300497C62 /* CameraViewAssets.xcassets */; };
FA778A411B8319D8005807E7 /* image.jpg in Resources */ = {isa = PBXBuildFile; fileRef = FA778A401B8319D8005807E7 /* image.jpg */; };
FA787F1C1B4326F100B6B86E /* CropOverlay.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA787F1B1B4326F100B6B86E /* CropOverlay.swift */; };
FA7E6B9B1B429012000E1B14 /* ConfirmViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA7E6B9A1B429012000E1B14 /* ConfirmViewController.swift */; };
FA8231381B3BF8F700A837BE /* CameraView.strings in Resources */ = {isa = PBXBuildFile; fileRef = FA8231371B3BF8F700A837BE /* CameraView.strings */; };
FA82313A1B3C296C00A837BE /* Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA8231391B3C296C00A837BE /* Utilities.swift */; };
Expand All @@ -62,6 +61,7 @@

/* Begin PBXFileReference section */
7AC96FA11F5B5166003E53F4 /* CroppingParameters.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CroppingParameters.swift; sourceTree = "<group>"; };
7AD3B52C23521955002BAD73 /* CropOverlay.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CropOverlay.swift; sourceTree = "<group>"; };
7C6AF41E1FB340CA006CB4ED /* LaunchScreen.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = LaunchScreen.xib; sourceTree = "<group>"; };
C40665431C73A47C00EB9751 /* SingleImageSaver.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SingleImageSaver.swift; sourceTree = "<group>"; };
C40665451C73A94100EB9751 /* CameraGlobals.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CameraGlobals.swift; sourceTree = "<group>"; };
Expand All @@ -79,7 +79,6 @@
FA5FA3421B3AFA2B00497C62 /* PermissionsView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PermissionsView.swift; sourceTree = "<group>"; };
FA5FA3441B3AFEB300497C62 /* CameraViewAssets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = CameraViewAssets.xcassets; sourceTree = "<group>"; };
FA778A401B8319D8005807E7 /* image.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = image.jpg; sourceTree = "<group>"; };
FA787F1B1B4326F100B6B86E /* CropOverlay.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CropOverlay.swift; sourceTree = "<group>"; };
FA7E6B9A1B429012000E1B14 /* ConfirmViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConfirmViewController.swift; sourceTree = "<group>"; };
FA8231371B3BF8F700A837BE /* CameraView.strings */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; path = CameraView.strings; sourceTree = "<group>"; };
FA8231391B3C296C00A837BE /* Utilities.swift */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.swift; path = Utilities.swift; sourceTree = "<group>"; tabWidth = 4; };
Expand Down Expand Up @@ -141,7 +140,7 @@
FAB50BEE1B413E8C009905B9 /* ImageCell.swift */,
FA5FA3421B3AFA2B00497C62 /* PermissionsView.swift */,
FAF058671B3175C5008E5592 /* CameraView.swift */,
FA787F1B1B4326F100B6B86E /* CropOverlay.swift */,
7AD3B52C23521955002BAD73 /* CropOverlay.swift */,
);
path = Views;
sourceTree = "<group>";
Expand Down Expand Up @@ -283,8 +282,8 @@
};
FAF0583E1B31618D008E5592 = {
CreatedOnToolsVersion = 6.3.2;
DevelopmentTeam = 2466624KEK;
LastSwiftMigration = 0900;
DevelopmentTeam = 9E43V6CC9L;
LastSwiftMigration = 1110;
ProvisioningStyle = Automatic;
};
};
Expand All @@ -294,6 +293,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand Down Expand Up @@ -358,7 +358,6 @@
C482A00F1CAEB18D00541D08 /* ImageCell.swift in Sources */,
C482A0101CAEB18D00541D08 /* PermissionsView.swift in Sources */,
C482A0111CAEB18D00541D08 /* CameraView.swift in Sources */,
C482A0121CAEB18D00541D08 /* CropOverlay.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -381,12 +380,12 @@
EBFE097D1CAF1D1A00A8C637 /* UIViewExtensions.swift in Sources */,
C40665481C73B72D00EB9751 /* SingleImageFetcher.swift in Sources */,
FAF058471B31618D008E5592 /* ViewController.swift in Sources */,
7AD3B52D23521955002BAD73 /* CropOverlay.swift in Sources */,
FAF058681B3175C5008E5592 /* CameraView.swift in Sources */,
C4D9BA471CA73163004F70F7 /* UIButtonExtensions.swift in Sources */,
C40665461C73A94100EB9751 /* CameraGlobals.swift in Sources */,
FAF058451B31618D008E5592 /* AppDelegate.swift in Sources */,
C40665441C73A47C00EB9751 /* SingleImageSaver.swift in Sources */,
FA787F1C1B4326F100B6B86E /* CropOverlay.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -408,6 +407,7 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 3.1;
PRODUCT_BUNDLE_IDENTIFIER = com.zero.CameraViewController;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand All @@ -432,6 +432,7 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 3.1;
PRODUCT_BUNDLE_IDENTIFIER = com.zero.CameraViewController;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -548,14 +549,15 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEVELOPMENT_TEAM = 2466624KEK;
DEVELOPMENT_TEAM = 9E43V6CC9L;
INFOPLIST_FILE = "Example/Supporting Files/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 3.1;
PRODUCT_BUNDLE_IDENTIFIER = com.alx.zero.CameraViewController;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -564,14 +566,15 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEVELOPMENT_TEAM = 2466624KEK;
DEVELOPMENT_TEAM = 9E43V6CC9L;
INFOPLIST_FILE = "Example/Supporting Files/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 3.1;
PRODUCT_BUNDLE_IDENTIFIER = com.alx.zero.CameraViewController;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand Down
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>
2 changes: 1 addition & 1 deletion ALCameraViewController/Utilities/Utilities.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ internal func errorWithKey(_ key: String, domain: String) -> NSError {
return error
}

internal func normalizedRect(_ rect: CGRect, orientation: UIImageOrientation) -> CGRect {
internal func normalizedRect(_ rect: CGRect, orientation: UIImage.Orientation) -> CGRect {
let normalizedX = rect.origin.x
let normalizedY = rect.origin.y

Expand Down
2 changes: 1 addition & 1 deletion ALCameraViewController/Utilities/VolumeControl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class VolumeControl {
init(view: UIView, onVolumeChange: VolumeChangeAction?) {
self.onVolumeChange = onVolumeChange
view.addSubview(volumeView)
view.sendSubview(toBack: volumeView)
view.sendSubviewToBack(volumeView)

try? AVAudioSession.sharedInstance().setActive(true)
NotificationCenter.default.addObserver(self, selector: #selector(volumeChanged), name: NSNotification.Name(rawValue: changeKey), object: nil)
Expand Down
34 changes: 6 additions & 28 deletions ALCameraViewController/ViewController/CameraViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ open class CameraViewController: UIViewController {

var animationDuration: TimeInterval = 0.5
var animationSpring: CGFloat = 0.5
var rotateAnimation: UIViewAnimationOptions = .curveLinear
var rotateAnimation: UIView.AnimationOptions = .curveLinear

var cameraButtonEdgeConstraint: NSLayoutConstraint?
var cameraButtonGravityConstraint: NSLayoutConstraint?
Expand All @@ -78,23 +78,12 @@ open class CameraViewController: UIViewController {

var flashButtonEdgeConstraint: NSLayoutConstraint?
var flashButtonGravityConstraint: NSLayoutConstraint?

var cameraOverlayEdgeOneConstraint: NSLayoutConstraint?
var cameraOverlayEdgeTwoConstraint: NSLayoutConstraint?
var cameraOverlayWidthConstraint: NSLayoutConstraint?
var cameraOverlayCenterConstraint: NSLayoutConstraint?


let cameraView : CameraView = {
let cameraView = CameraView()
cameraView.translatesAutoresizingMaskIntoConstraints = false
return cameraView
}()

let cameraOverlay : CropOverlay = {
let cameraOverlay = CropOverlay()
cameraOverlay.translatesAutoresizingMaskIntoConstraints = false
return cameraOverlay
}()

let cameraButton : UIButton = {
let button = UIButton(frame: CGRect(x: 0, y: 0, width: 64, height: 64))
Expand Down Expand Up @@ -170,8 +159,6 @@ open class CameraViewController: UIViewController {
self.allowVolumeButtonCapture = allowVolumeButtonCapture
super.init(nibName: nil, bundle: nil)
onCompletion = completion
cameraOverlay.isHidden = !croppingParameters.isEnabled
cameraOverlay.isUserInteractionEnabled = false
libraryButton.isEnabled = allowsLibraryAccess
libraryButton.isHidden = !allowsLibraryAccess
swapButton.isEnabled = allowsSwapCameraOrientation
Expand Down Expand Up @@ -199,7 +186,6 @@ open class CameraViewController: UIViewController {
super.loadView()
view.backgroundColor = UIColor.black
[cameraView,
cameraOverlay,
cameraButton,
closeButton,
flashButton,
Expand Down Expand Up @@ -247,14 +233,7 @@ open class CameraViewController: UIViewController {

configFlashEdgeButtonConstraint(statusBarOrientation)
configFlashGravityButtonConstraint(statusBarOrientation)

let padding : CGFloat = portrait ? 16.0 : -16.0
removeCameraOverlayEdgesConstraints()
configCameraOverlayEdgeOneContraint(portrait, padding: padding)
configCameraOverlayEdgeTwoConstraint(portrait, padding: padding)
configCameraOverlayWidthConstraint(portrait)
configCameraOverlayCenterConstraint(portrait)


rotate(actualInterfaceOrientation: statusBarOrientation)

super.updateViewConstraints()
Expand All @@ -273,7 +252,6 @@ open class CameraViewController: UIViewController {
super.viewDidLoad()
setupActions()
checkPermissions()
cameraView.configureFocus()
cameraView.configureZoom()
}

Expand Down Expand Up @@ -349,7 +327,7 @@ open class CameraViewController: UIViewController {
NotificationCenter.default.addObserver(
self,
selector: #selector(rotateCameraView),
name: NSNotification.Name.UIDeviceOrientationDidChange,
name: UIDevice.orientationDidChangeNotification,
object: nil)
}

Expand Down Expand Up @@ -631,12 +609,12 @@ open class CameraViewController: UIViewController {

private func showSpinner() -> UIActivityIndicatorView {
let spinner = UIActivityIndicatorView()
spinner.activityIndicatorViewStyle = .white
spinner.style = .white
spinner.center = view.center
spinner.startAnimating()

view.addSubview(spinner)
view.bringSubview(toFront: spinner)
view.bringSubviewToFront(spinner)

return spinner
}
Expand Down
Loading

0 comments on commit 6606a3b

Please sign in to comment.