diff --git a/MemorialHouse/MHApplication/MHApplication.xcodeproj/project.pbxproj b/MemorialHouse/MHApplication/MHApplication.xcodeproj/project.pbxproj index 76c69d77..82a5691e 100644 --- a/MemorialHouse/MHApplication/MHApplication.xcodeproj/project.pbxproj +++ b/MemorialHouse/MHApplication/MHApplication.xcodeproj/project.pbxproj @@ -47,7 +47,7 @@ /* End PBXFileReference section */ /* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */ - 0E5C14CC2CDFB75D005406B3 /* Exceptions for "MHApplication" folder in "MemorialHouse" target */ = { + A8C933432CDFBCCB007D932A /* Exceptions for "MHApplication" folder in "MemorialHouse" target */ = { isa = PBXFileSystemSynchronizedBuildFileExceptionSet; membershipExceptions = ( Resource/Info.plist, @@ -57,10 +57,10 @@ /* End PBXFileSystemSynchronizedBuildFileExceptionSet section */ /* Begin PBXFileSystemSynchronizedRootGroup section */ - 0E5C14C62CDFB75D005406B3 /* MHApplication */ = { + A8C9333B2CDFBCCA007D932A /* MHApplication */ = { isa = PBXFileSystemSynchronizedRootGroup; exceptions = ( - 0E5C14CC2CDFB75D005406B3 /* Exceptions for "MHApplication" folder in "MemorialHouse" target */, + A8C933432CDFBCCB007D932A /* Exceptions for "MHApplication" folder in "MemorialHouse" target */, ); path = MHApplication; sourceTree = ""; @@ -86,7 +86,7 @@ 0EE4A0772CD5DD1800F17FA5 = { isa = PBXGroup; children = ( - 0E5C14C62CDFB75D005406B3 /* MHApplication */, + A8C9333B2CDFBCCA007D932A /* MHApplication */, CE9AEB682CD7B3DA00F8471D /* Frameworks */, 0EE4A0812CD5DD1800F17FA5 /* Products */, ); @@ -130,7 +130,7 @@ dependencies = ( ); fileSystemSynchronizedGroups = ( - 0E5C14C62CDFB75D005406B3 /* MHApplication */, + A8C9333B2CDFBCCA007D932A /* MHApplication */, ); name = MemorialHouse; packageProductDependencies = ( diff --git a/MemorialHouse/MHCore/MHCore.xcodeproj/project.pbxproj b/MemorialHouse/MHCore/MHCore.xcodeproj/project.pbxproj index ded56890..0b313db7 100644 --- a/MemorialHouse/MHCore/MHCore.xcodeproj/project.pbxproj +++ b/MemorialHouse/MHCore/MHCore.xcodeproj/project.pbxproj @@ -16,7 +16,7 @@ /* End PBXFileReference section */ /* Begin PBXFileSystemSynchronizedRootGroup section */ - 0E5C14BB2CDFB75B005406B3 /* MHCore */ = { + A8C9332E2CDFBCBA007D932A /* MHCore */ = { isa = PBXFileSystemSynchronizedRootGroup; path = MHCore; sourceTree = ""; @@ -38,7 +38,7 @@ CE9AEBB12CD7B5EF00F8471D = { isa = PBXGroup; children = ( - 0E5C14BB2CDFB75B005406B3 /* MHCore */, + A8C9332E2CDFBCBA007D932A /* MHCore */, CE9AEBFF2CD7BA2B00F8471D /* Frameworks */, CE9AEBBC2CD7B5EF00F8471D /* Products */, ); @@ -88,7 +88,7 @@ dependencies = ( ); fileSystemSynchronizedGroups = ( - 0E5C14BB2CDFB75B005406B3 /* MHCore */, + A8C9332E2CDFBCBA007D932A /* MHCore */, ); name = MHCore; packageProductDependencies = ( diff --git a/MemorialHouse/MHData/MHData.xcodeproj/project.pbxproj b/MemorialHouse/MHData/MHData.xcodeproj/project.pbxproj index 0dbfee94..6b23eeb6 100644 --- a/MemorialHouse/MHData/MHData.xcodeproj/project.pbxproj +++ b/MemorialHouse/MHData/MHData.xcodeproj/project.pbxproj @@ -20,7 +20,7 @@ /* End PBXFileReference section */ /* Begin PBXFileSystemSynchronizedRootGroup section */ - 0E5C14CE2CDFB761005406B3 /* MHData */ = { + A8C9336C2CDFBCDB007D932A /* MHData */ = { isa = PBXFileSystemSynchronizedRootGroup; path = MHData; sourceTree = ""; @@ -44,7 +44,7 @@ CE9AEB6D2CD7B46700F8471D = { isa = PBXGroup; children = ( - 0E5C14CE2CDFB761005406B3 /* MHData */, + A8C9336C2CDFBCDB007D932A /* MHData */, CE9AEB842CD7B49C00F8471D /* Frameworks */, CE9AEB782CD7B46700F8471D /* Products */, ); @@ -96,7 +96,7 @@ dependencies = ( ); fileSystemSynchronizedGroups = ( - 0E5C14CE2CDFB761005406B3 /* MHData */, + A8C9336C2CDFBCDB007D932A /* MHData */, ); name = MHData; packageProductDependencies = ( diff --git a/MemorialHouse/MHDomain/MHDomain.xcodeproj/project.pbxproj b/MemorialHouse/MHDomain/MHDomain.xcodeproj/project.pbxproj index ed77d7a3..eec75035 100644 --- a/MemorialHouse/MHDomain/MHDomain.xcodeproj/project.pbxproj +++ b/MemorialHouse/MHDomain/MHDomain.xcodeproj/project.pbxproj @@ -18,7 +18,7 @@ /* End PBXFileReference section */ /* Begin PBXFileSystemSynchronizedRootGroup section */ - 0E5C14D12CDFB762005406B3 /* MHDomain */ = { + A8C9336F2CDFBCDD007D932A /* MHDomain */ = { isa = PBXFileSystemSynchronizedRootGroup; path = MHDomain; sourceTree = ""; @@ -41,7 +41,7 @@ CE9AEB442CD7B31300F8471D = { isa = PBXGroup; children = ( - 0E5C14D12CDFB762005406B3 /* MHDomain */, + A8C9336F2CDFBCDD007D932A /* MHDomain */, CE9AEBEB2CD7BA0C00F8471D /* Frameworks */, CE9AEB4F2CD7B31300F8471D /* Products */, ); @@ -92,7 +92,7 @@ dependencies = ( ); fileSystemSynchronizedGroups = ( - 0E5C14D12CDFB762005406B3 /* MHDomain */, + A8C9336F2CDFBCDD007D932A /* MHDomain */, ); name = MHDomain; packageProductDependencies = ( diff --git a/MemorialHouse/MHFoundation/MHFoundation.xcodeproj/project.pbxproj b/MemorialHouse/MHFoundation/MHFoundation.xcodeproj/project.pbxproj index 91ad81ef..82cc1bd9 100644 --- a/MemorialHouse/MHFoundation/MHFoundation.xcodeproj/project.pbxproj +++ b/MemorialHouse/MHFoundation/MHFoundation.xcodeproj/project.pbxproj @@ -11,7 +11,7 @@ /* End PBXFileReference section */ /* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */ - 0E5C14B92CDFB758005406B3 /* Exceptions for "MHFoundation" folder in "MHFoundation" target */ = { + A8C933492CDFBCD1007D932A /* Exceptions for "MHFoundation" folder in "MHFoundation" target */ = { isa = PBXFileSystemSynchronizedBuildFileExceptionSet; publicHeaders = ( MHFoundation.h, @@ -21,10 +21,10 @@ /* End PBXFileSystemSynchronizedBuildFileExceptionSet section */ /* Begin PBXFileSystemSynchronizedRootGroup section */ - 0E5C14B62CDFB758005406B3 /* MHFoundation */ = { + A8C933462CDFBCD1007D932A /* MHFoundation */ = { isa = PBXFileSystemSynchronizedRootGroup; exceptions = ( - 0E5C14B92CDFB758005406B3 /* Exceptions for "MHFoundation" folder in "MHFoundation" target */, + A8C933492CDFBCD1007D932A /* Exceptions for "MHFoundation" folder in "MHFoundation" target */, ); path = MHFoundation; sourceTree = ""; @@ -45,7 +45,7 @@ DB3CB96B2CD9B08A008186F4 = { isa = PBXGroup; children = ( - 0E5C14B62CDFB758005406B3 /* MHFoundation */, + A8C933462CDFBCD1007D932A /* MHFoundation */, DB3CB9762CD9B08A008186F4 /* Products */, ); sourceTree = ""; @@ -86,7 +86,7 @@ dependencies = ( ); fileSystemSynchronizedGroups = ( - 0E5C14B62CDFB758005406B3 /* MHFoundation */, + A8C933462CDFBCD1007D932A /* MHFoundation */, ); name = MHFoundation; packageProductDependencies = ( diff --git a/MemorialHouse/MHPresentation/MHPresentation.xcodeproj/project.pbxproj b/MemorialHouse/MHPresentation/MHPresentation.xcodeproj/project.pbxproj index a7ac3c1d..4453895b 100644 --- a/MemorialHouse/MHPresentation/MHPresentation.xcodeproj/project.pbxproj +++ b/MemorialHouse/MHPresentation/MHPresentation.xcodeproj/project.pbxproj @@ -20,7 +20,7 @@ /* End PBXFileReference section */ /* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */ - 0E5C14B22CDFB74F005406B3 /* Exceptions for "MHPresentation" folder in "MHPresentation" target */ = { + A8C933692CDFBCD4007D932A /* Exceptions for "MHPresentation" folder in "MHPresentation" target */ = { isa = PBXFileSystemSynchronizedBuildFileExceptionSet; membershipExceptions = ( Resource/Info.plist, @@ -30,7 +30,7 @@ /* End PBXFileSystemSynchronizedBuildFileExceptionSet section */ /* Begin PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet section */ - 0E5C14B32CDFB74F005406B3 /* Exceptions for "MHPresentation" folder in "Headers" phase from "MHPresentation" target */ = { + A8C9336A2CDFBCD4007D932A /* Exceptions for "MHPresentation" folder in "Headers" phase from "MHPresentation" target */ = { isa = PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet; attributesByRelativePath = { Resource/Colors.xcassets = (Public, ); @@ -43,11 +43,11 @@ /* End PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet section */ /* Begin PBXFileSystemSynchronizedRootGroup section */ - 0E5C14A42CDFB74F005406B3 /* MHPresentation */ = { + A8C9335B2CDFBCD4007D932A /* MHPresentation */ = { isa = PBXFileSystemSynchronizedRootGroup; exceptions = ( - 0E5C14B22CDFB74F005406B3 /* Exceptions for "MHPresentation" folder in "MHPresentation" target */, - 0E5C14B32CDFB74F005406B3 /* Exceptions for "MHPresentation" folder in "Headers" phase from "MHPresentation" target */, + A8C933692CDFBCD4007D932A /* Exceptions for "MHPresentation" folder in "MHPresentation" target */, + A8C9336A2CDFBCD4007D932A /* Exceptions for "MHPresentation" folder in "Headers" phase from "MHPresentation" target */, ); path = MHPresentation; sourceTree = ""; @@ -71,7 +71,7 @@ CE9AEB8F2CD7B4F200F8471D = { isa = PBXGroup; children = ( - 0E5C14A42CDFB74F005406B3 /* MHPresentation */, + A8C9335B2CDFBCD4007D932A /* MHPresentation */, CE9AEBA92CD7B51D00F8471D /* Frameworks */, CE9AEB9A2CD7B4F200F8471D /* Products */, ); @@ -113,7 +113,7 @@ buildConfigurationList = CE9AEB9F2CD7B4F200F8471D /* Build configuration list for PBXNativeTarget "MHPresentation" */; buildPhases = ( CE9AEB942CD7B4F200F8471D /* Headers */, - 0E7F28882CDA0846007D4F2B /* ShellScript */, + 0E7F28882CDA0846007D4F2B /* Run Script */, CE9AEB952CD7B4F200F8471D /* Sources */, CE9AEB962CD7B4F200F8471D /* Frameworks */, CE9AEB972CD7B4F200F8471D /* Resources */, @@ -123,7 +123,7 @@ dependencies = ( ); fileSystemSynchronizedGroups = ( - 0E5C14A42CDFB74F005406B3 /* MHPresentation */, + A8C9335B2CDFBCD4007D932A /* MHPresentation */, ); name = MHPresentation; packageProductDependencies = ( @@ -180,7 +180,7 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 0E7F28882CDA0846007D4F2B /* ShellScript */ = { + 0E7F28882CDA0846007D4F2B /* Run Script */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -189,6 +189,7 @@ ); inputPaths = ( ); + name = "Run Script"; outputFileListPaths = ( ); outputPaths = ( diff --git a/MemorialHouse/MHPresentation/MHPresentation/Resource/Colors.xcassets/CaptionPlaceHolderColor.colorset/Contents.json b/MemorialHouse/MHPresentation/MHPresentation/Resource/Colors.xcassets/CaptionPlaceHolderColor.colorset/Contents.json new file mode 100644 index 00000000..6396404c --- /dev/null +++ b/MemorialHouse/MHPresentation/MHPresentation/Resource/Colors.xcassets/CaptionPlaceHolderColor.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.529", + "green" : "0.529", + "red" : "0.529" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MemorialHouse/MHPresentation/MHPresentation/Resource/Colors.xcassets/DividedLineColor.colorset/Contents.json b/MemorialHouse/MHPresentation/MHPresentation/Resource/Colors.xcassets/DividedLineColor.colorset/Contents.json new file mode 100644 index 00000000..46f4c5f8 --- /dev/null +++ b/MemorialHouse/MHPresentation/MHPresentation/Resource/Colors.xcassets/DividedLineColor.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.169", + "green" : "0.169", + "red" : "0.169" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MemorialHouse/MHPresentation/MHPresentation/Resource/Images.xcassets/CropImage.imageset/Contents.json b/MemorialHouse/MHPresentation/MHPresentation/Resource/Images.xcassets/CropImage.imageset/Contents.json new file mode 100644 index 00000000..eb6ceb7d --- /dev/null +++ b/MemorialHouse/MHPresentation/MHPresentation/Resource/Images.xcassets/CropImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "Crop.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Crop@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Crop@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MemorialHouse/MHPresentation/MHPresentation/Resource/Images.xcassets/CropImage.imageset/Crop.png b/MemorialHouse/MHPresentation/MHPresentation/Resource/Images.xcassets/CropImage.imageset/Crop.png new file mode 100644 index 00000000..3e46362e Binary files /dev/null and b/MemorialHouse/MHPresentation/MHPresentation/Resource/Images.xcassets/CropImage.imageset/Crop.png differ diff --git a/MemorialHouse/MHPresentation/MHPresentation/Resource/Images.xcassets/CropImage.imageset/Crop@2x.png b/MemorialHouse/MHPresentation/MHPresentation/Resource/Images.xcassets/CropImage.imageset/Crop@2x.png new file mode 100644 index 00000000..b45adba1 Binary files /dev/null and b/MemorialHouse/MHPresentation/MHPresentation/Resource/Images.xcassets/CropImage.imageset/Crop@2x.png differ diff --git a/MemorialHouse/MHPresentation/MHPresentation/Resource/Images.xcassets/CropImage.imageset/Crop@3x.png b/MemorialHouse/MHPresentation/MHPresentation/Resource/Images.xcassets/CropImage.imageset/Crop@3x.png new file mode 100644 index 00000000..56fb7b85 Binary files /dev/null and b/MemorialHouse/MHPresentation/MHPresentation/Resource/Images.xcassets/CropImage.imageset/Crop@3x.png differ diff --git a/MemorialHouse/MHPresentation/MHPresentation/Resource/Images.xcassets/DrawImage.imageset/Contents.json b/MemorialHouse/MHPresentation/MHPresentation/Resource/Images.xcassets/DrawImage.imageset/Contents.json new file mode 100644 index 00000000..a993624f --- /dev/null +++ b/MemorialHouse/MHPresentation/MHPresentation/Resource/Images.xcassets/DrawImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "Draw.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Draw@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Draw@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MemorialHouse/MHPresentation/MHPresentation/Resource/Images.xcassets/DrawImage.imageset/Draw.png b/MemorialHouse/MHPresentation/MHPresentation/Resource/Images.xcassets/DrawImage.imageset/Draw.png new file mode 100644 index 00000000..42f146fa Binary files /dev/null and b/MemorialHouse/MHPresentation/MHPresentation/Resource/Images.xcassets/DrawImage.imageset/Draw.png differ diff --git a/MemorialHouse/MHPresentation/MHPresentation/Resource/Images.xcassets/DrawImage.imageset/Draw@2x.png b/MemorialHouse/MHPresentation/MHPresentation/Resource/Images.xcassets/DrawImage.imageset/Draw@2x.png new file mode 100644 index 00000000..dec2e51f Binary files /dev/null and b/MemorialHouse/MHPresentation/MHPresentation/Resource/Images.xcassets/DrawImage.imageset/Draw@2x.png differ diff --git a/MemorialHouse/MHPresentation/MHPresentation/Resource/Images.xcassets/DrawImage.imageset/Draw@3x.png b/MemorialHouse/MHPresentation/MHPresentation/Resource/Images.xcassets/DrawImage.imageset/Draw@3x.png new file mode 100644 index 00000000..65a74084 Binary files /dev/null and b/MemorialHouse/MHPresentation/MHPresentation/Resource/Images.xcassets/DrawImage.imageset/Draw@3x.png differ diff --git a/MemorialHouse/MHPresentation/MHPresentation/Resource/Images.xcassets/RotateImage.imageset/Contents.json b/MemorialHouse/MHPresentation/MHPresentation/Resource/Images.xcassets/RotateImage.imageset/Contents.json new file mode 100644 index 00000000..ef9b0793 --- /dev/null +++ b/MemorialHouse/MHPresentation/MHPresentation/Resource/Images.xcassets/RotateImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "Rotate.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Rotate@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Rotate@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MemorialHouse/MHPresentation/MHPresentation/Resource/Images.xcassets/RotateImage.imageset/Rotate.png b/MemorialHouse/MHPresentation/MHPresentation/Resource/Images.xcassets/RotateImage.imageset/Rotate.png new file mode 100644 index 00000000..d70c1766 Binary files /dev/null and b/MemorialHouse/MHPresentation/MHPresentation/Resource/Images.xcassets/RotateImage.imageset/Rotate.png differ diff --git a/MemorialHouse/MHPresentation/MHPresentation/Resource/Images.xcassets/RotateImage.imageset/Rotate@2x.png b/MemorialHouse/MHPresentation/MHPresentation/Resource/Images.xcassets/RotateImage.imageset/Rotate@2x.png new file mode 100644 index 00000000..1ecebea1 Binary files /dev/null and b/MemorialHouse/MHPresentation/MHPresentation/Resource/Images.xcassets/RotateImage.imageset/Rotate@2x.png differ diff --git a/MemorialHouse/MHPresentation/MHPresentation/Resource/Images.xcassets/RotateImage.imageset/Rotate@3x.png b/MemorialHouse/MHPresentation/MHPresentation/Resource/Images.xcassets/RotateImage.imageset/Rotate@3x.png new file mode 100644 index 00000000..a18272a4 Binary files /dev/null and b/MemorialHouse/MHPresentation/MHPresentation/Resource/Images.xcassets/RotateImage.imageset/Rotate@3x.png differ diff --git a/MemorialHouse/MHPresentation/MHPresentation/Source/EditPhoto/EditPhotoViewController.swift b/MemorialHouse/MHPresentation/MHPresentation/Source/EditPhoto/EditPhotoViewController.swift new file mode 100644 index 00000000..b8f50484 --- /dev/null +++ b/MemorialHouse/MHPresentation/MHPresentation/Source/EditPhoto/EditPhotoViewController.swift @@ -0,0 +1,177 @@ +import UIKit + +public final class EditPhotoViewController: UIViewController { + // MARK: - Properties + private let photoView = UIImageView() + private let clearView = UIView.dimmedView(opacity: 0) + private let dimmedView1 = UIView.dimmedView(opacity: 0.5) + private let dimmedView2 = UIView.dimmedView(opacity: 0.5) + private let dividedLine1 = UIView.dividedLine() + private let dividedLine2 = UIView.dividedLine() + private let captionTextField: UITextField = { + let textField = UITextField() + textField.attributedPlaceholder = NSAttributedString( + string: "캡션을 입력해주세요.", + attributes: [.foregroundColor: UIColor.captionPlaceHolder] + ) + textField.font = UIFont.ownglyphBerry(size: 17) + textField.textColor = .white + + return textField + }() + private let editButtonStackView: UIStackView = { + let stackView = UIStackView() + stackView.axis = .horizontal + stackView.spacing = 83 + stackView.alignment = .center + + return stackView + }() + private let cropButton: UIButton = { + var configuration = UIButton.Configuration.plain() + configuration.image = .crop + let button = UIButton() + button.configuration = configuration + + return button + }() + private let rotateButton: UIButton = { + var configuration = UIButton.Configuration.plain() + configuration.image = .rotate + let button = UIButton() + button.configuration = configuration + + return button + }() + private let drawButton: UIButton = { + var configuration = UIButton.Configuration.plain() + configuration.image = .draw + let button = UIButton() + button.configuration = configuration + + return button + }() + + // MARK: - View Did Load + public override func viewDidLoad() { + super.viewDidLoad() + + setup() + configureNavagationBar() + configureAddSubView() + configureConstraints() + configureButtonAction() + } + + // MARK: - Setup & Configure + private func setup() { + view.backgroundColor = .black + captionTextField.delegate = self + self.hideKeyboardWhenTappedView() + } + + private func configureNavagationBar() { + navigationItem.title = "사진 편집" + navigationController?.navigationBar.titleTextAttributes = [ + NSAttributedString.Key.font: UIFont.ownglyphBerry(size: 17), + NSAttributedString.Key.foregroundColor: UIColor.white] + let leftBarButton = UIBarButtonItem(title: "닫기") + leftBarButton.setTitleTextAttributes( + [NSAttributedString.Key.font: UIFont.ownglyphBerry(size: 17), + NSAttributedString.Key.foregroundColor: UIColor.white], + for: .normal + ) + navigationItem.leftBarButtonItem = leftBarButton + let rightBarButton = UIBarButtonItem(title: "완료") + rightBarButton.setTitleTextAttributes( + [NSAttributedString.Key.font: UIFont.ownglyphBerry(size: 17), + NSAttributedString.Key.foregroundColor: UIColor.white], + for: .normal + ) + navigationItem.rightBarButtonItem = rightBarButton + } + + private func configureAddSubView() { + [cropButton, + rotateButton, + drawButton].forEach { + editButtonStackView.addArrangedSubview($0) + } + + [dimmedView1, + clearView, + dimmedView2].forEach { + photoView.addSubview($0) + } + + [photoView, + dividedLine1, + captionTextField, + dividedLine2, + editButtonStackView].forEach { + view.addSubview($0) + } + } + + private func configureConstraints() { + editButtonStackView.setCenterX(view: view) + editButtonStackView.setBottom( + anchor: view.safeAreaLayoutGuide.bottomAnchor, + constant: 16 + ) + dividedLine1.setHorizontal(view: view) + dividedLine1.setBottom( + anchor: editButtonStackView.topAnchor, + constant: 11 + ) + captionTextField.setAnchor( + leading: view.leadingAnchor, constantLeading: 13, + bottom: dividedLine1.topAnchor, constantBottom: 11, + trailing: view.trailingAnchor + ) + dividedLine2.setHorizontal(view: view) + dividedLine2.setBottom( + anchor: captionTextField.topAnchor, + constant: 11 + ) + photoView.setAnchor( + top: view.safeAreaLayoutGuide.topAnchor, + leading: view.leadingAnchor, + bottom: dividedLine2.topAnchor, + trailing: view.trailingAnchor + ) + clearView.setAnchor(width: view.frame.width, height: view.frame.width * 0.75) + clearView.setCenter(view: photoView) + dimmedView1.setAnchor( + top: photoView.topAnchor, + leading: view.leadingAnchor, + bottom: clearView.topAnchor, + trailing: view.trailingAnchor + ) + dimmedView2.setAnchor( + top: clearView.bottomAnchor, + leading: view.leadingAnchor, + bottom: dividedLine2.topAnchor, + trailing: view.trailingAnchor + ) + } + + private func configureButtonAction() { + let cropButtonAction = UIAction { _ in + // TODO: - Crop Action + } + let rotateButtonAction = UIAction { _ in + // TODO: - Rotate Action + } + let drawButtonAction = UIAction { _ in + // TODO: - Draw Action + } + cropButton.addAction(cropButtonAction, for: .touchUpInside) + rotateButton.addAction(rotateButtonAction, for: .touchUpInside) + drawButton.addAction(drawButtonAction, for: .touchUpInside) + } +} + +extension EditPhotoViewController: UITextFieldDelegate { + // TODO: - TextField의 텍스트 처리 +} diff --git a/MemorialHouse/MHPresentation/MHPresentation/Source/Extensions/UIView+Anchor.swift b/MemorialHouse/MHPresentation/MHPresentation/Source/Extensions/UIView+Anchor.swift index 051b3906..2d88e837 100644 --- a/MemorialHouse/MHPresentation/MHPresentation/Source/Extensions/UIView+Anchor.swift +++ b/MemorialHouse/MHPresentation/MHPresentation/Source/Extensions/UIView+Anchor.swift @@ -59,7 +59,7 @@ extension UIView { self.trailingAnchor.constraint(equalTo: anchor, constant: -constant).isActive = true } - func setCenter(view: UIView, offset: CGPoint) { + func setCenter(view: UIView, offset: CGPoint = CGPoint(x: 0, y: 0)) { self.translatesAutoresizingMaskIntoConstraints = false self.centerXAnchor.constraint(equalTo: view.centerXAnchor, constant: offset.x).isActive = true self.centerYAnchor.constraint(equalTo: view.centerYAnchor, constant: offset.y).isActive = true diff --git a/MemorialHouse/MHPresentation/MHPresentation/Source/Extensions/UIView+CustomView.swift b/MemorialHouse/MHPresentation/MHPresentation/Source/Extensions/UIView+CustomView.swift new file mode 100644 index 00000000..2e028877 --- /dev/null +++ b/MemorialHouse/MHPresentation/MHPresentation/Source/Extensions/UIView+CustomView.swift @@ -0,0 +1,19 @@ +import UIKit + +extension UIView { + static func dividedLine() -> UIView { + let line = UIView() + line.backgroundColor = .dividedLine + line.setHeight(1) + + return line + } + + static func dimmedView(opacity: Float) -> UIView { + let dim = UIView() + dim.backgroundColor = .white + dim.layer.opacity = opacity + + return dim + } +} diff --git a/MemorialHouse/MHPresentation/MHPresentation/Source/Extensions/UIViewController+HideKeyboard.swift b/MemorialHouse/MHPresentation/MHPresentation/Source/Extensions/UIViewController+HideKeyboard.swift new file mode 100644 index 00000000..4a0253c1 --- /dev/null +++ b/MemorialHouse/MHPresentation/MHPresentation/Source/Extensions/UIViewController+HideKeyboard.swift @@ -0,0 +1,13 @@ +import UIKit + +extension UIViewController { + func hideKeyboardWhenTappedView() { + let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(viewTapped(_:))) + tapGestureRecognizer.cancelsTouchesInView = false + view.addGestureRecognizer(tapGestureRecognizer) + } + + @objc func viewTapped(_ sender: UITapGestureRecognizer) { + view.endEditing(true) + } +}