Skip to content

Commit

Permalink
Merge pull request #241 from yungu0010/feature/#240
Browse files Browse the repository at this point in the history
[Design] 로그인 Alert UI 구현
  • Loading branch information
yungu0010 authored Sep 6, 2022
2 parents bfa78c8 + d1036f3 commit 20fccc3
Show file tree
Hide file tree
Showing 20 changed files with 252 additions and 1 deletion.
24 changes: 24 additions & 0 deletions HealthFoodMe/HealthFoodMe.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
3B723CA32881AB8A00822B7C /* ReviewDetailVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B723CA22881AB8A00822B7C /* ReviewDetailVC.swift */; };
3B723CA52881B36F00822B7C /* ReviewDetail.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3B723CA42881B36F00822B7C /* ReviewDetail.storyboard */; };
3B7DC1A12888A4F9005B5536 /* ImageForSlide.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B7DC1A02888A4F9005B5536 /* ImageForSlide.swift */; };
3B83192428C65DEC007D8274 /* HelfmeLoginAlert.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3B83192328C65DEC007D8274 /* HelfmeLoginAlert.storyboard */; };
3B83192628C65E00007D8274 /* HelfmeLoginAlertVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B83192528C65E00007D8274 /* HelfmeLoginAlertVC.swift */; };
3B9332A22888643200543683 /* MyReviewEmptyViewCVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B9332A12888643200543683 /* MyReviewEmptyViewCVC.swift */; };
3B93ED4E2887C9CB00240434 /* HelfmeLoadingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B93ED4D2887C9CB00240434 /* HelfmeLoadingView.swift */; };
3B93ED522887CBC500240434 /* loading_iOS.json in Resources */ = {isa = PBXBuildFile; fileRef = 3B93ED512887CBC500240434 /* loading_iOS.json */; };
Expand Down Expand Up @@ -264,6 +266,8 @@
3B723CA22881AB8A00822B7C /* ReviewDetailVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReviewDetailVC.swift; sourceTree = "<group>"; };
3B723CA42881B36F00822B7C /* ReviewDetail.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = ReviewDetail.storyboard; sourceTree = "<group>"; };
3B7DC1A02888A4F9005B5536 /* ImageForSlide.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageForSlide.swift; sourceTree = "<group>"; };
3B83192328C65DEC007D8274 /* HelfmeLoginAlert.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = HelfmeLoginAlert.storyboard; sourceTree = "<group>"; };
3B83192528C65E00007D8274 /* HelfmeLoginAlertVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HelfmeLoginAlertVC.swift; sourceTree = "<group>"; };
3B9332A12888643200543683 /* MyReviewEmptyViewCVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyReviewEmptyViewCVC.swift; sourceTree = "<group>"; };
3B93ED4D2887C9CB00240434 /* HelfmeLoadingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HelfmeLoadingView.swift; sourceTree = "<group>"; };
3B93ED512887CBC500240434 /* loading_iOS.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = loading_iOS.json; sourceTree = "<group>"; };
Expand Down Expand Up @@ -570,6 +574,23 @@
path = VC;
sourceTree = "<group>";
};
3B83192128C65D6E007D8274 /* HelfmeLoginAlert */ = {
isa = PBXGroup;
children = (
3B83192228C65D79007D8274 /* VC */,
);
path = HelfmeLoginAlert;
sourceTree = "<group>";
};
3B83192228C65D79007D8274 /* VC */ = {
isa = PBXGroup;
children = (
3B83192328C65DEC007D8274 /* HelfmeLoginAlert.storyboard */,
3B83192528C65E00007D8274 /* HelfmeLoginAlertVC.swift */,
);
path = VC;
sourceTree = "<group>";
};
3B93ED4B2887C5D900240434 /* HelfmeLoading */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -1625,6 +1646,7 @@
EBF66A9F287227F500DE0ED1 /* Common */ = {
isa = PBXGroup;
children = (
3B83192128C65D6E007D8274 /* HelfmeLoginAlert */,
3B93ED4B2887C5D900240434 /* HelfmeLoading */,
A93252BE288086BA001EDF50 /* HelfmeAlerts */,
EB033E82287B5B6E00C48FB9 /* UI Components */,
Expand Down Expand Up @@ -2073,6 +2095,7 @@
3B089C4B287D877F00DA80B9 /* GodoB.otf in Resources */,
FD39FAD62880C63E00A01CDA /* Setting.storyboard in Resources */,
A938BB90287D222800B8DE07 /* MainDetail.storyboard in Resources */,
3B83192428C65DEC007D8274 /* HelfmeLoginAlert.storyboard in Resources */,
695758BD287DA4CD00E36789 /* ReviewWrite.storyboard in Resources */,
EBFAEB3F2885F379009C569C /* MyReview.storyboard in Resources */,
A93252E22880CBB9001EDF50 /* HelfmeAlert.storyboard in Resources */,
Expand Down Expand Up @@ -2228,6 +2251,7 @@
EBA8C1552882ABB4009DBA49 /* AuthService.swift in Sources */,
EBF66AF7287227F500DE0ED1 /* manageObserverAction.swift in Sources */,
3B93ED4E2887C9CB00240434 /* HelfmeLoadingView.swift in Sources */,
3B83192628C65E00007D8274 /* HelfmeLoginAlertVC.swift in Sources */,
FDCD5B452881ACC100EAEF51 /* LocationLiterals.swift in Sources */,
EBF66B05287227F500DE0ED1 /* GeneralResponse.swift in Sources */,
A93252CF2880913F001EDF50 /* HelfmeAlertVC.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
}

guard let windowScene = (scene as? UIWindowScene) else { return }
let rootViewController = ModuleFactory.resolve().makeSplashVC()
let rootViewController = ModuleFactory.resolve().makeHelfmeLoginAlertVC()
let navigation = UINavigationController(rootViewController: rootViewController)
let window = UIWindow(windowScene: windowScene)
window.rootViewController = navigation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ protocol ModuleFactoryProtocol {
func makeHamburgerBarNavigationController() -> HamburgerBarNavigationController
func makeSupplementMapVC(forSearchVC: Bool) -> SupplementMapVC
func makeMyReviewVC() -> MyReviewVC
func makeHelfmeLoginAlertVC() -> HelfmeLoginAlertVC

// MARK: - Detail
func makeMainDetailVC() -> MainDetailVC
Expand All @@ -39,6 +40,7 @@ protocol ModuleFactoryProtocol {

// MARK: - Spalsh
func makeSplashVC() -> SplashVC

// MARK: - Setting
func makeSettingVC() -> SettingVC
}
Expand Down Expand Up @@ -129,6 +131,11 @@ class ModuleFactory: ModuleFactoryProtocol {
return vc
}

func makeHelfmeLoginAlertVC() -> HelfmeLoginAlertVC {
let vc = HelfmeLoginAlertVC.controllerFromStoryboard(.helfmeLoginAlert)
return vc
}

// MARK: - Detail
func makeMainDetailVC() -> MainDetailVC {
let repository = DefaultMainDetailRepository()
Expand Down
3 changes: 3 additions & 0 deletions HealthFoodMe/HealthFoodMe/Global/Literals/ImageLiterals.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ struct ImageLiterals {
static let starIcon_50 = UIImage(named: "btn_star_03")
static let starIcon_75 = UIImage(named: "btn_star_04")
static let starIcon_filled = UIImage(named: "btn_star_05")
static let kakaoLoginBtn = UIImage(named: "btn_loginAlert_kakao")
static let appleLoginBtn = UIImage(named: "btn_loginAlert_apple")
static let alertDeleteBtn = UIImage(named: "btn_alertdelete")
}

struct MainDetail {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ enum Storyboards: String {
case reviewEmptyView = "ReviewEmptyView"
case supplementMap = "SupplementMap"
case myReview = "MyReview"

case helfmeLoginAlert = "HelfmeLoginAlert"
}

extension UIStoryboard {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ struct I18N {
static let networkError = "네트워크 상태를 확인해주세요"
static let copyComplete = "📑 주소가 복사되었습니다"
static let notOpenTravelSpot = "추후 오픈될 예정입니다"
static let alertLoginMessage =
"""
선택하신 기능은
간편 로그인 후 이용 가능합니다!
"""
}

struct Map {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "btn_alertdelete.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "btn_alertdelete@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "btn_alertdelete@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "btn_login_apple.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "btn_login_apple@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "btn_login_apple@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "btn_login_kakao.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "btn_login_kakao@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "btn_login_kakao@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
<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"/>
</dependencies>
<scenes>
<!--Helfme Login AlertVC-->
<scene sceneID="s0d-6b-0kx">
<objects>
<viewController storyboardIdentifier="HelfmeLoginAlertVC" useStoryboardIdentifierAsRestorationIdentifier="YES" id="Y6W-OH-hqX" customClass="HelfmeLoginAlertVC" customModule="HealthFoodMe" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="5EZ-qb-Rvc">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<viewLayoutGuide key="safeArea" id="vDu-zF-Fre"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Ief-a0-LHa" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="70" y="42"/>
</scene>
</scenes>
<resources>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
//
// HelfmeLoginAlertVC.swift
// HealthFoodMe
//
// Created by 강윤서 on 2022/09/06.
//

import UIKit

class HelfmeLoginAlertVC: UIViewController {

// MARK: - Properties

let width = UIScreen.main.bounds.width
let loginButtonWidth = UIScreen.main.bounds.width - 127
let deleteButtonWidth = UIScreen.main.bounds.width - 347

//MARK: - UI Components

private let loginAlertView: UIView = {
let view = UIView()
view.layer.cornerRadius = 15
view.backgroundColor = .helfmeWhite
return view
}()

private let alertMessage: UILabel = {
let lb = UILabel()
lb.text = I18N.Alert.alertLoginMessage
lb.font = .NotoMedium(size: 16)
lb.numberOfLines = 2
lb.textAlignment = .center
return lb
}()

private lazy var kakaoLoginButton: UIButton = {
let button = UIButton()
button.setBackgroundImage(ImageLiterals.Common.kakaoLoginBtn, for: .normal)
return button
}()

private lazy var appleLoginButton: UIButton = {
let button = UIButton()
button.setBackgroundImage(ImageLiterals.Common.appleLoginBtn, for: .normal)
return button
}()

private let alertDeleteBtn: UIButton = {
let button = UIButton()
button.setBackgroundImage(ImageLiterals.Common.alertDeleteBtn, for: .normal)
return button
}()

//MARK: - View Life Cycle

override func viewDidLoad() {
super.viewDidLoad()
setUI()
setLayout()
}

}

// MARK: - Extension

extension HelfmeLoginAlertVC {
private func setUI() {
view.backgroundColor = .black.withAlphaComponent(0.4)
}

private func setLayout() {
view.addSubviews(loginAlertView)
loginAlertView.addSubviews(alertMessage,
kakaoLoginButton,
appleLoginButton,
alertDeleteBtn)

loginAlertView.snp.makeConstraints {
let logoutWidth = width * (288/375)
$0.center.equalToSuperview()
$0.width.equalTo(logoutWidth)
$0.height.equalTo(logoutWidth * (219/288))
}

alertMessage.snp.makeConstraints {
$0.centerX.equalToSuperview()
$0.top.equalToSuperview().inset(32)
}

kakaoLoginButton.snp.makeConstraints {
$0.top.equalTo(alertMessage.snp.bottom).offset(24)
$0.leading.trailing.equalToSuperview().inset(20)
$0.height.equalTo(loginButtonWidth * 42/248)
}

appleLoginButton.snp.makeConstraints {
$0.bottom.equalToSuperview().inset(24)
$0.leading.trailing.equalToSuperview().inset(20)
$0.height.equalTo(loginButtonWidth * 42/248)
}

alertDeleteBtn.snp.makeConstraints {
$0.top.equalToSuperview().inset(8)
$0.trailing.equalToSuperview().inset(8)
$0.width.height.equalTo(28)
}
}
}

0 comments on commit 20fccc3

Please sign in to comment.