Skip to content
This repository was archived by the owner on Jul 1, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
3b1484a
Update camera viewcontroller to use CoreMotion
Aug 24, 2017
30cd840
Remove debugging log
Aug 24, 2017
7b41751
Use xib to load UI
Aug 25, 2017
f532d41
Added crop UI
Aug 28, 2017
f775e76
Update build settings for framework target
Aug 28, 2017
8d83e46
Make few public headers
Aug 28, 2017
b7e907d
Added project settings
Aug 28, 2017
8a8e63c
Removed useless files
Aug 28, 2017
f13949b
update project settings
Aug 28, 2017
2c9d1e0
updated icons
Aug 29, 2017
cab887f
update UI part 2
Aug 29, 2017
9cba4df
update UI for cropping
Aug 29, 2017
ccafae2
Autolayout for different devices
Aug 30, 2017
34d469e
layout update for universal app
Aug 31, 2017
1c499bd
fix image loading crash
Sep 1, 2017
6a997dc
FIX - Add Chinese translation.
vinxentzhang Sep 7, 2017
082b200
Localization - Add the missing translation.
vinxentzhang Sep 8, 2017
5c1c4c4
Fix positioning of activity view
Sep 8, 2017
b905c73
Added more selection modes during cropping
Oct 5, 2017
0ca3e0c
give a bit top margin for cropping view
Oct 5, 2017
e139771
Update localization
Oct 17, 2017
8822fa2
Added filter screen
Oct 28, 2017
1d065a6
Merge pull request #1 from Skrapit/filter
Narek1994 Oct 28, 2017
e7e0bba
Revert "Added filter screen"
Narek1994 Oct 28, 2017
ef6d1eb
Merge pull request #2 from Skrapit/revert-1-filter
Narek1994 Oct 28, 2017
c000965
1 fix a bug that filter doesn't work after selecting different filters
Oct 29, 2017
532a1a6
fix issue with error when building framework
Oct 29, 2017
808ead0
merged
Oct 29, 2017
d4d6b93
merged
Oct 29, 2017
5820b47
Return filtered image
Oct 29, 2017
7ba6131
Update design to use SafeArea for iOS 11
Nov 2, 2017
a10d692
Added analytics
Nov 2, 2017
5d7879e
Update camera UX
Nov 21, 2017
234a670
Update camera icons
Nov 21, 2017
0ea2252
last second UI update, just waiting for library UI :)
Nov 21, 2017
a140c7b
Fix a resource loading crash
Nov 21, 2017
6a6d677
Keep image after confirming
Nov 21, 2017
fc87692
Use clear color for imageview in confirm page
Nov 21, 2017
66af852
removed crashlytics
Dec 14, 2017
2bdb566
Fix library UI issue
Dec 22, 2017
b0f4474
added localization
Jan 22, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update camera UX
  • Loading branch information
Wallace Wu committed Nov 21, 2017
commit 5d7879eaf36f8eee46df95c49348adf27f0bbc70
4 changes: 4 additions & 0 deletions ALCameraViewController.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
E36A37BB1FABB5C100485FD4 /* Crashlytics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E36A37B81FABB5C000485FD4 /* Crashlytics.framework */; };
E36A37BC1FABB5C100485FD4 /* Fabric.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E36A37B91FABB5C100485FD4 /* Fabric.framework */; };
E36A37BD1FABB5C100485FD4 /* Fabric.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E36A37B91FABB5C100485FD4 /* Fabric.framework */; };
E36A37BF1FABBB7E00485FD4 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E36A37BE1FABBB7E00485FD4 /* LaunchScreen.storyboard */; };
EBFE097D1CAF1D1A00A8C637 /* UIViewExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBFE097C1CAF1D1A00A8C637 /* UIViewExtensions.swift */; };
FA52EE0B1B44129B00E16B6F /* ViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = FA52EE0A1B44129B00E16B6F /* ViewController.xib */; };
FA5FA3431B3AFA2B00497C62 /* PermissionsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA5FA3421B3AFA2B00497C62 /* PermissionsView.swift */; };
Expand Down Expand Up @@ -122,6 +123,7 @@
E3669CCD1F96859A00CCDD01 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/ConfirmViewController.strings"; sourceTree = "<group>"; };
E36A37B81FABB5C000485FD4 /* Crashlytics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Crashlytics.framework; sourceTree = "<group>"; };
E36A37B91FABB5C100485FD4 /* Fabric.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Fabric.framework; sourceTree = "<group>"; };
E36A37BE1FABBB7E00485FD4 /* LaunchScreen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = "<group>"; };
EBFE097C1CAF1D1A00A8C637 /* UIViewExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIViewExtensions.swift; sourceTree = "<group>"; };
FA52EE0A1B44129B00E16B6F /* ViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ViewController.xib; sourceTree = "<group>"; };
FA5FA3421B3AFA2B00497C62 /* PermissionsView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PermissionsView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -266,6 +268,7 @@
FAF058421B31618D008E5592 /* Supporting Files */ = {
isa = PBXGroup;
children = (
E36A37BE1FABBB7E00485FD4 /* LaunchScreen.storyboard */,
FAF0584B1B31618D008E5592 /* Images.xcassets */,
FAF058431B31618D008E5592 /* Info.plist */,
);
Expand Down Expand Up @@ -406,6 +409,7 @@
FA778A411B8319D8005807E7 /* image.jpg in Resources */,
BF5861F31F613FB800B406F6 /* CropViewController.xib in Resources */,
B2357AB11FA50D51003F9ACF /* FilterViewController.xib in Resources */,
E36A37BF1FABBB7E00485FD4 /* LaunchScreen.storyboard in Resources */,
BF5861F81F61404C00B406F6 /* ConfirmViewController.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"images" : [
{
"idiom" : "universal",
"filename" : "anchorButton.pdf"
"filename" : "anchorbutton.pdf"
}
],
"info" : {
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"images" : [
{
"idiom" : "universal",
"filename" : "bwFilterHighlight.pdf"
"filename" : "filter_bw_highlight.pdf"
}
],
"info" : {
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"images" : [
{
"idiom" : "universal",
"filename" : "bwFilterNormal.pdf"
"filename" : "filter_bw.pdf"
}
],
"info" : {
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"images" : [
{
"idiom" : "universal",
"filename" : "colorFilterHighlight.pdf"
"filename" : "filter_color_highlight.pdf"
}
],
"info" : {
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"images" : [
{
"idiom" : "universal",
"filename" : "colorFilterNormal.pdf"
"filename" : "filter_color.pdf"
}
],
"info" : {
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"images" : [
{
"idiom" : "universal",
"filename" : "crop_a4_paper_normal.pdf"
"filename" : "crop_a4.pdf"
}
],
"info" : {
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"images" : [
{
"idiom" : "universal",
"filename" : "crop_detect_border_normal.pdf"
"filename" : "crop_border.pdf"
}
],
"info" : {
Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"images" : [
{
"idiom" : "universal",
"filename" : "crop_full_image_normal.pdf"
"filename" : "crop_full.pdf"
}
],
"info" : {
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"images" : [
{
"idiom" : "universal",
"filename" : "crop_no_statusbar_normal.pdf"
"filename" : "crop_screenshot.pdf"
}
],
"info" : {
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"images" : [
{
"idiom" : "universal",
"filename" : "crop_square_normal.pdf"
"filename" : "crop_square.pdf"
}
],
"info" : {
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"images" : [
{
"idiom" : "universal",
"filename" : "exposureFilterHighlight.pdf"
"filename" : "filter_exposure_hightlight.pdf"
}
],
"info" : {
Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"images" : [
{
"idiom" : "universal",
"filename" : "exposureFilterNormal.pdf"
"filename" : "filter_exposure.pdf"
}
],
"info" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"images" : [
{
"idiom" : "universal",
"filename" : "grayFilterHighlight.pdf"
"filename" : "filter_gray_highlight.pdf"
}
],
"info" : {
Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"images" : [
{
"idiom" : "universal",
"filename" : "grayFilterNormal.pdf"
"filename" : "filter_gray.pdf"
}
],
"info" : {
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"images" : [
{
"idiom" : "universal",
"filename" : "originalFilterNormal.pdf"
"filename" : "nav_back.pdf"
}
],
"info" : {
Expand Down
Binary file not shown.

This file was deleted.

Binary file not shown.
Binary file not shown.
43 changes: 43 additions & 0 deletions ALCameraViewController/Utilities/UIButtonExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,46 @@ extension UIButton {
}
}

extension UIBarButtonItem {

private struct AssociatedKeys {
static var ActionKey = "ActionKey"
}

private class ActionWrapper {
let action: ButtonAction
init(action: @escaping ButtonAction) {
self.action = action
}
}

var itemAction: ButtonAction? {
set(newValue) {
target = nil
action = nil
var wrapper: ActionWrapper? = nil
if let newValue = newValue {
wrapper = ActionWrapper(action: newValue)
target = self
action = #selector(performAction)
}

objc_setAssociatedObject(self, &AssociatedKeys.ActionKey, wrapper, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
}
get {
guard let wrapper = objc_getAssociatedObject(self, &AssociatedKeys.ActionKey) as? ActionWrapper else {
return nil
}

return wrapper.action
}
}

func performAction() {
guard let action = itemAction else {
return
}

action()
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="ipad9_7" orientation="portrait">
<device id="ipad12_9" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13527"/>
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand All @@ -24,14 +23,18 @@
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB">
<rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
<rect key="frame" x="0.0" y="0.0" width="1024" height="1366"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="qpY-V8-aOM" customClass="CameraView" customModule="ALCameraViewController" customModuleProvider="target">
<rect key="frame" x="0.0" y="20" width="1024" height="1346"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="GeG-7E-YhE" userLabel="TopBar">
<rect key="frame" x="0.0" y="0.0" width="768" height="44"/>
<rect key="frame" x="0.0" y="20" width="1024" height="44"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="T05-DW-nx9">
<rect key="frame" x="716" y="0.0" width="44" height="44"/>
<rect key="frame" x="972" y="0.0" width="44" height="44"/>
<constraints>
<constraint firstAttribute="width" constant="44" id="9kD-ej-J3I"/>
<constraint firstAttribute="height" constant="44" id="FUu-CZ-h2j"/>
Expand All @@ -47,7 +50,7 @@
<state key="normal" image="swapButton"/>
</button>
</subviews>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="calibratedRGB"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="T05-DW-nx9" secondAttribute="bottom" id="1m5-Fn-HaE"/>
<constraint firstAttribute="trailing" secondItem="T05-DW-nx9" secondAttribute="trailing" constant="8" id="70I-pN-QZM"/>
Expand All @@ -58,18 +61,11 @@
<constraint firstItem="qIC-aq-pXR" firstAttribute="leading" secondItem="GeG-7E-YhE" secondAttribute="leading" constant="8" id="X49-oh-2UR"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="qpY-V8-aOM" customClass="CameraView" customModule="ALCameraViewController" customModuleProvider="target">
<rect key="frame" x="0.0" y="-233.99999999999997" width="768" height="1023.5"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="width" secondItem="qpY-V8-aOM" secondAttribute="height" multiplier="3:4" id="tKI-DK-48f"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="SYY-32-acK" userLabel="Bottom">
<rect key="frame" x="0.0" y="901" width="768" height="123"/>
<rect key="frame" x="0.0" y="1243" width="1024" height="123"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="31q-oP-VTF">
<rect key="frame" x="352.5" y="30" width="64" height="64"/>
<rect key="frame" x="480.5" y="29.5" width="64" height="64"/>
<constraints>
<constraint firstAttribute="height" constant="64" id="Lsl-BL-is6"/>
<constraint firstAttribute="width" constant="64" id="kEL-vh-npa"/>
Expand All @@ -78,23 +74,23 @@
<state key="highlighted" image="cameraButtonHighlighted"/>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ERQ-At-bZe">
<rect key="frame" x="711" y="45" width="33" height="33"/>
<rect key="frame" x="967" y="45.5" width="33" height="33"/>
<constraints>
<constraint firstAttribute="height" constant="33" id="YXI-KU-dBr"/>
<constraint firstAttribute="width" constant="33" id="amV-zt-4xc"/>
</constraints>
<state key="normal" image="libraryButton"/>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="0T3-fj-1PF">
<rect key="frame" x="24" y="45" width="33" height="33"/>
<rect key="frame" x="24" y="45.5" width="33" height="33"/>
<constraints>
<constraint firstAttribute="height" constant="33" id="cOb-Ik-kqN"/>
<constraint firstAttribute="width" constant="33" id="wP6-4A-ccb"/>
</constraints>
<state key="normal" image="closeButton"/>
</button>
</subviews>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="calibratedRGB"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="0T3-fj-1PF" firstAttribute="centerY" secondItem="SYY-32-acK" secondAttribute="centerY" id="0cD-AJ-jbT"/>
<constraint firstAttribute="trailing" secondItem="ERQ-At-bZe" secondAttribute="trailing" constant="24" id="5mk-CL-OZF"/>
Expand All @@ -108,19 +104,16 @@
</subviews>
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="GeG-7E-YhE" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="7oe-7W-1fo"/>
<constraint firstItem="0O4-X5-Pk0" firstAttribute="bottom" secondItem="SYY-32-acK" secondAttribute="bottom" id="D8B-M3-Gu8"/>
<constraint firstItem="qpY-V8-aOM" firstAttribute="top" relation="lessThanOrEqual" secondItem="GeG-7E-YhE" secondAttribute="bottom" id="G3f-oY-Jwd"/>
<constraint firstItem="GeG-7E-YhE" firstAttribute="top" secondItem="0O4-X5-Pk0" secondAttribute="top" id="7oe-7W-1fo"/>
<constraint firstItem="qpY-V8-aOM" firstAttribute="top" secondItem="0O4-X5-Pk0" secondAttribute="top" id="G3f-oY-Jwd"/>
<constraint firstItem="SYY-32-acK" firstAttribute="leading" secondItem="0O4-X5-Pk0" secondAttribute="leading" id="Oh7-Wz-jxt"/>
<constraint firstItem="0O4-X5-Pk0" firstAttribute="bottom" secondItem="qpY-V8-aOM" secondAttribute="bottom" id="PK5-8Q-RCe"/>
<constraint firstItem="0O4-X5-Pk0" firstAttribute="trailing" secondItem="SYY-32-acK" secondAttribute="trailing" id="Q0T-Ji-Qbz"/>
<constraint firstItem="0O4-X5-Pk0" firstAttribute="trailing" secondItem="qpY-V8-aOM" secondAttribute="trailing" id="Rvo-jw-fVq"/>
<constraint firstItem="0O4-X5-Pk0" firstAttribute="trailing" secondItem="GeG-7E-YhE" secondAttribute="trailing" id="Zcs-Ab-QzI"/>
<constraint firstItem="GeG-7E-YhE" firstAttribute="leading" secondItem="0O4-X5-Pk0" secondAttribute="leading" id="cJf-HG-RlX"/>
<constraint firstItem="GeG-7E-YhE" firstAttribute="leading" secondItem="0O4-X5-Pk0" secondAttribute="leading" id="e9d-Sb-qpt"/>
<constraint firstItem="SYY-32-acK" firstAttribute="top" relation="lessThanOrEqual" secondItem="qpY-V8-aOM" secondAttribute="bottom" priority="750" id="k9X-U9-XJr"/>
<constraint firstItem="SYY-32-acK" firstAttribute="bottom" secondItem="0O4-X5-Pk0" secondAttribute="bottom" id="k9X-U9-XJr"/>
<constraint firstItem="qpY-V8-aOM" firstAttribute="leading" secondItem="0O4-X5-Pk0" secondAttribute="leading" id="tgg-Zd-Ran"/>
<constraint firstItem="0O4-X5-Pk0" firstAttribute="trailing" secondItem="GeG-7E-YhE" secondAttribute="trailing" id="uy9-jd-9Aw"/>
<constraint firstItem="0O4-X5-Pk0" firstAttribute="bottom" secondItem="qpY-V8-aOM" secondAttribute="bottom" priority="751" constant="234.33333333333326" id="wZs-v8-8OP"/>
</constraints>
<nil key="simulatedStatusBarMetrics"/>
<viewLayoutGuide key="safeArea" id="0O4-X5-Pk0"/>
Expand Down
Loading