Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Edit UI #281

Merged
merged 4 commits into from
Jul 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="18122" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="19455" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="gPn-Q7-fFB">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="18093"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19454"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
Expand All @@ -18,10 +19,27 @@
<viewLayoutGuide key="safeArea" id="vDu-zF-Fre"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</view>
<navigationItem key="navigationItem" id="cqO-0K-iPG"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Ief-a0-LHa" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="139" y="53"/>
<point key="canvasLocation" x="1291" y="54"/>
</scene>
<!--On BoardNC-->
<scene sceneID="nZi-iz-9rB">
<objects>
<navigationController storyboardIdentifier="OnBoardNC" id="gPn-Q7-fFB" customClass="OnBoardNC" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" id="3EG-58-Byo">
<rect key="frame" x="0.0" y="44" width="414" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
<segue destination="Y6W-OH-hqX" kind="relationship" relationship="rootViewController" id="SZE-Wf-MJm"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Qxq-qz-pD7" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="264" y="54"/>
</scene>
</scenes>
<resources>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,29 @@
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
<segue destination="3Jv-cf-BbT" kind="relationship" relationship="rootViewController" id="8vP-9I-v44"/>
<segue destination="0CE-hc-miW" kind="relationship" relationship="rootViewController" id="bGf-f4-D7t"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="5Km-5k-d4p" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-1316" y="35"/>
</scene>
<!--On BoardVC-->
<scene sceneID="5Aj-53-PS5">
<objects>
<viewController storyboardIdentifier="OnBoardVC" id="0CE-hc-miW" customClass="OnBoardVC" customModule="ChaRo_iOS" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="RGG-oM-WZJ">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<viewLayoutGuide key="safeArea" id="Iw9-vZ-qRb"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</view>
<navigationItem key="navigationItem" id="uw3-g1-dpM"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="BO7-fT-6U8" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-384" y="-677"/>
</scene>
<!--LoginVC-->
<scene sceneID="v2F-md-1GI">
<objects>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="19529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="FSr-K2-YcY">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="19455" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="FSr-K2-YcY">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19519"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19454"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class HomeThemeCVC: UICollectionViewCell {


public func setThemeTitle(name: String) {
themeLabel.text = "#\(name)"
themeLabel.text = name
}

public func setData() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ class InputTextField: UITextField {
}
}

override func clearButtonRect(forBounds bounds: CGRect) -> CGRect {
let originalRect = super.clearButtonRect(forBounds: bounds)

return originalRect.offsetBy(dx: -6, dy: 0)
}

private func configureShowPasswordButton() {

let iconImageView = UIImageView()
Expand Down Expand Up @@ -103,7 +109,7 @@ class InputTextField: UITextField {

//ν…Œλ‘λ¦¬ 색상을 λ³€κ²½
public func setBlueBorderWithText() {
self.layer.borderColor = UIColor.mainBlue.cgColor
self.layer.borderColor = UIColor.neomorfismBlueLine.cgColor
}

public func setOrangeBorderWithText() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ class NextButton: UIButton {
fatalError("init(coder:) has not been implemented")
}

init(isSticky: Bool, isTheLast: Bool) {
init(isSticky: Bool, isTheLast: Bool, isTempPassword: Bool = false) {
super.init(frame: .zero)
self.isTheLast = isTheLast
configureUI(isSticky: isSticky)
configureUI(isSticky: isSticky, isTempPassword: isTempPassword)
self.addTarget(self, action: #selector(nextButtonClicked), for: .touchUpInside)
}

Expand All @@ -43,9 +43,9 @@ class NextButton: UIButton {

}

private func configureUI(isSticky: Bool) {
private func configureUI(isSticky: Bool, isTempPassword: Bool) {

self.setTitle("λ‹€μŒ", for: .normal)
self.setTitle(isTempPassword ? "μž„μ‹œ λΉ„λ°€λ²ˆν˜Έ 전솑" : "λ‹€μŒ", for: .normal)
self.setTitleColor(.white, for: .normal)
self.backgroundColor = .gray30

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,8 @@ class OnBoardVC: UIViewController {

@objc func dismissAction() {
let storyboard = UIStoryboard(name: "Login", bundle: nil)
let nextVC = storyboard.instantiateViewController(identifier: SNSLoginVC.identifier)
nextVC.modalPresentationStyle = .fullScreen
self.present(nextVC, animated: true, completion: nil)
//self.dismiss(animated: false)
let nextVC = storyboard.instantiateViewController(identifier: SNSLoginVC.className)
self.navigationController?.pushViewController(nextVC, animated: true)
}

private func setConstraints() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ final class FindPasswordVC: UIViewController {
let emailInputView = JoinInputView(title: "μž„μ‹œ λΉ„λ°€λ²ˆν˜Έ λ°œκΈ‰",
subTitle: "κ°€μž…ν•˜μ‹  이메일 μ£Όμ†Œλ‘œ μž„μ‹œ λΉ„λ°€λ²ˆν˜Έκ°€ λ°œκΈ‰λ©λ‹ˆλ‹€. 둜그인 ν›„ κΌ­ λΉ„λ°€λ²ˆν˜Έλ₯Ό λ³€κ²½ν•΄μ£Όμ„Έμš”.",
placeholder: "이메일 아이디λ₯Ό μž…λ ₯ν•΄μ£Όμ„Έμš”")
let nextButton = NextButton(isSticky: false, isTheLast: true)
let stickyNextButton = NextButton(isSticky: true, isTheLast: true)
let nextButton = NextButton(isSticky: false, isTheLast: true, isTempPassword: true)
let stickyNextButton = NextButton(isSticky: true, isTheLast: true, isTempPassword: true)
var stickyView: UIView?

var navigationView = UIView().then {
Expand Down
27 changes: 27 additions & 0 deletions ChaRo-iOS/ChaRo-iOS/Source/Views/VCs/SignScene/JoinVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class JoinVC: UIViewController {
super.viewDidLoad()
setupCollectionView()
configureUI()
configureNotificationCenter()
configureClosure()

showView(number: pageNumber)
Expand All @@ -69,6 +70,9 @@ class JoinVC: UIViewController {
configureNavigationController()
}

override func viewWillDisappear(_ animated: Bool) {
removeObservers()
}

//MARK: - configure ν•¨μˆ˜
private func configureNavigationController() {
Expand Down Expand Up @@ -137,6 +141,29 @@ class JoinVC: UIViewController {
}

//MARK: - Custom ν•¨μˆ˜
func configureNotificationCenter() {
NotificationCenter.default.addObserver(self, selector: #selector(textFieldMoveUp), name: UIResponder.keyboardWillShowNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(textFieldMoveDown), name: UIResponder.keyboardWillHideNotification, object: nil)
}

func removeObservers() {
NotificationCenter.default.removeObserver(self)
}

@objc func textFieldMoveUp(_ notification: NSNotification) {
if (!self.emailView.isHidden && !self.emailView.emailVerifyInputView.isHidden) || !self.profileView.isHidden {
if let keyboardSize = (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue {
UIView.animate(withDuration: 0.3, animations: {
self.view.transform = CGAffineTransform(translationX: 0, y: -keyboardSize.height)
})
}
}
}

@objc func textFieldMoveDown(_ notification: NSNotification) {
view.transform = .identity
}

private func showView(number: Int) {

if number == 0 {
Expand Down
19 changes: 11 additions & 8 deletions ChaRo-iOS/ChaRo-iOS/Source/Views/VCs/SignScene/LoginVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ class LoginVC: UIViewController {
@IBOutlet weak var backButton: UIButton!
@IBOutlet weak var findPasswordButton: UIButton!

@IBOutlet weak var idTextField: UITextField!
@IBOutlet weak var pwdTextField: UITextField!
@IBOutlet weak var idTextField: LoginTextField!
@IBOutlet weak var pwdTextField: LoginTextField!

@IBOutlet weak var imageView: UIImageView!

Expand Down Expand Up @@ -73,12 +73,11 @@ class LoginVC: UIViewController {
self.idTextField.leftViewMode = .always
self.pwdTextField.leftViewMode = .always

self.idTextField.rightViewMode = .always
self.pwdTextField.rightViewMode = .always
self.idTextField.clearButtonMode = .whileEditing
self.pwdTextField.clearButtonMode = .whileEditing

let idContainerView = UIView(frame: CGRect(x: 0, y: 0, width: 50, height: height))
let pwdContainerView = UIView(frame: CGRect(x: 0, y: 0, width: 50, height: height))
let rightpaddingView = UIView(frame: CGRect(x: 0, y: 0, width: 4, height: height))

let idImageView = UIImageView(frame: CGRect(x: 5, y: 4, width: 40, height: 40))
let pwdImageView = UIImageView(frame: CGRect(x: 5, y: 4, width: 40, height: 40))
Expand All @@ -91,9 +90,6 @@ class LoginVC: UIViewController {

idTextField.leftView = idContainerView
pwdTextField.leftView = pwdContainerView

// idTextField.rightView = rightpaddingView
// pwdTextField.rightView = rightpaddingView
}

func loginAction() {
Expand Down Expand Up @@ -199,3 +195,10 @@ extension LoginVC {
}
}
}

class LoginTextField: UITextField {
override func clearButtonRect(forBounds bounds: CGRect) -> CGRect {
let originalRect = super.clearButtonRect(forBounds: bounds)
return originalRect.offsetBy(dx: -10, dy: 0)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class SNSLoginVC: UIViewController {
$0.titleLabel?.font = UIFont.notoSansMediumFont(ofSize: 17)
$0.setImage(UIImage(named: "appleLogo"), for: .normal)
$0.imageEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 180)
$0.titleEdgeInsets = UIEdgeInsets(top: 0, left: -40, bottom: 0, right: 0)
$0.titleEdgeInsets = UIEdgeInsets(top: 0, left: -30, bottom: 0, right: 0)
$0.layer.cornerRadius = 10
$0.clipsToBounds = true
$0.addTarget(self, action: #selector(appleLogin), for: .touchUpInside)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class ThemePostVC: UIViewController {
override func viewDidLoad() {
setTableView()
setTitleLabelUI()
setHeaderBottomView()
filterViewCompletion()
filterViewLayout()
dismissDropDownWhenTappedAround()
Expand Down