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

[FEAT] #111 - [FEAT] 온보딩 레이아웃 및 화면전환 구현 #115

Merged
merged 4 commits into from
Dec 7, 2021
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
40 changes: 40 additions & 0 deletions NADA-iOS-forRelease.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@
F84BAFAE26FDB543004CA335 /* FrontCardCreationCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F84BAFAC26FDB543004CA335 /* FrontCardCreationCollectionViewCell.xib */; };
F84BAFB126FDB552004CA335 /* BackCardCreationCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F84BAFAF26FDB552004CA335 /* BackCardCreationCollectionViewCell.swift */; };
F84BAFB226FDB552004CA335 /* BackCardCreationCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F84BAFB026FDB552004CA335 /* BackCardCreationCollectionViewCell.xib */; };
F8518054275D040C006BD5ED /* OnboardingCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8518052275D040C006BD5ED /* OnboardingCollectionViewCell.swift */; };
F8518055275D040C006BD5ED /* OnboardingCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F8518053275D040C006BD5ED /* OnboardingCollectionViewCell.xib */; };
F8518058275D042B006BD5ED /* Onboarding.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F8518057275D042B006BD5ED /* Onboarding.storyboard */; };
F851805B275D047C006BD5ED /* OnboardingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F851805A275D047C006BD5ED /* OnboardingViewController.swift */; };
F85711A5274A6B2200F59F0B /* CardCreationPreviewViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F85711A4274A6B2200F59F0B /* CardCreationPreviewViewController.swift */; };
F85711A7274A6B3400F59F0B /* CardCreationPreview.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F85711A6274A6B3400F59F0B /* CardCreationPreview.storyboard */; };
F858079E2700354E00872484 /* BackgroundCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F858079C2700354E00872484 /* BackgroundCollectionViewCell.swift */; };
Expand Down Expand Up @@ -192,6 +196,10 @@
F84BAFAC26FDB543004CA335 /* FrontCardCreationCollectionViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = FrontCardCreationCollectionViewCell.xib; sourceTree = "<group>"; };
F84BAFAF26FDB552004CA335 /* BackCardCreationCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BackCardCreationCollectionViewCell.swift; sourceTree = "<group>"; };
F84BAFB026FDB552004CA335 /* BackCardCreationCollectionViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = BackCardCreationCollectionViewCell.xib; sourceTree = "<group>"; };
F8518052275D040C006BD5ED /* OnboardingCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingCollectionViewCell.swift; sourceTree = "<group>"; };
F8518053275D040C006BD5ED /* OnboardingCollectionViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = OnboardingCollectionViewCell.xib; sourceTree = "<group>"; };
F8518057275D042B006BD5ED /* Onboarding.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Onboarding.storyboard; sourceTree = "<group>"; };
F851805A275D047C006BD5ED /* OnboardingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingViewController.swift; sourceTree = "<group>"; };
F85711A4274A6B2200F59F0B /* CardCreationPreviewViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardCreationPreviewViewController.swift; sourceTree = "<group>"; };
F85711A6274A6B3400F59F0B /* CardCreationPreview.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = CardCreationPreview.storyboard; sourceTree = "<group>"; };
F858079C2700354E00872484 /* BackgroundCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BackgroundCollectionViewCell.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -495,6 +503,31 @@
path = CardCreation;
sourceTree = "<group>";
};
F8518051275D039D006BD5ED /* Onboarding */ = {
isa = PBXGroup;
children = (
F8518052275D040C006BD5ED /* OnboardingCollectionViewCell.swift */,
F8518053275D040C006BD5ED /* OnboardingCollectionViewCell.xib */,
);
path = Onboarding;
sourceTree = "<group>";
};
F8518056275D041F006BD5ED /* Onboarding */ = {
isa = PBXGroup;
children = (
F8518057275D042B006BD5ED /* Onboarding.storyboard */,
);
path = Onboarding;
sourceTree = "<group>";
};
F8518059275D0468006BD5ED /* Onboarding */ = {
isa = PBXGroup;
children = (
F851805A275D047C006BD5ED /* OnboardingViewController.swift */,
);
path = Onboarding;
sourceTree = "<group>";
};
F857FC8A26C03A5C00A48D01 /* Assets */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -653,6 +686,7 @@
F8FC439B26C01EC30033E151 /* Cells */ = {
isa = PBXGroup;
children = (
F8518051275D039D006BD5ED /* Onboarding */,
3936993F274A565E00684420 /* GroupEdit */,
77607ED7274A689300204CD2 /* GroupCell */,
392F7FB1274621CF008CDBF5 /* MoreList */,
Expand Down Expand Up @@ -702,6 +736,7 @@
F8FC43A026C01F040033E151 /* ViewControllers */ = {
isa = PBXGroup;
children = (
F8518059275D0468006BD5ED /* Onboarding */,
3936993C274A53D300684420 /* GroupEdit */,
39D88B692746009B00A72164 /* BottomSheet */,
39D88B682745FE6C00A72164 /* TabBar */,
Expand All @@ -727,6 +762,7 @@
F8FC43A226C01F2B0033E151 /* Storyboards */ = {
isa = PBXGroup;
children = (
F8518056275D041F006BD5ED /* Onboarding */,
394F314D27081B4100C83291 /* Main */,
3958F23A270FFBC800B100B2 /* Group */,
39D88B602745FBA100A72164 /* More */,
Expand Down Expand Up @@ -827,6 +863,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F8518058275D042B006BD5ED /* Onboarding.storyboard in Resources */,
F8FC43BF26C025180033E151 /* .swiftlint.yml in Resources */,
F85711A7274A6B3400F59F0B /* CardCreationPreview.storyboard in Resources */,
77607EDB274A68BE00204CD2 /* GroupCollectionViewCell.xib in Resources */,
Expand All @@ -849,6 +886,7 @@
39523E5C2701A48900536900 /* CardListTableViewCell.xib in Resources */,
F8FC439226C01CDE0033E151 /* LaunchScreen.storyboard in Resources */,
F8FC438F26C01CDE0033E151 /* Assets.xcassets in Resources */,
F8518055275D040C006BD5ED /* OnboardingCollectionViewCell.xib in Resources */,
39F5A3D1271461EA00191F94 /* BackCardCell.xib in Resources */,
39369939274A4FCB00684420 /* Spoqa Han Sans Neo Regular.otf in Resources */,
39369938274A4FCB00684420 /* Spoqa Han Sans Neo Bold.otf in Resources */,
Expand Down Expand Up @@ -950,6 +988,7 @@
F8C310C0273A7360008EC5BA /* FrontCardCreationDelegate.swift in Sources */,
F8C83FBF272FA0670009DF0D /* UserSevice.swift in Sources */,
39F5A3D0271461EA00191F94 /* BackCardCell.swift in Sources */,
F851805B275D047C006BD5ED /* OnboardingViewController.swift in Sources */,
39C1E88F270EC762006D2089 /* UIColor+Extension.swift in Sources */,
F8C83FC9272FA3190009DF0D /* GroupAPI.swift in Sources */,
F8FC43B826C0227D0033E151 /* Const.swift in Sources */,
Expand Down Expand Up @@ -990,6 +1029,7 @@
3936993E274A53E000684420 /* GroupEditViewController.swift in Sources */,
F8C83FAE272F99940009DF0D /* MoyaLoggerPlugin.swift in Sources */,
F84BAFAD26FDB543004CA335 /* FrontCardCreationCollectionViewCell.swift in Sources */,
F8518054275D040C006BD5ED /* OnboardingCollectionViewCell.swift in Sources */,
77703157275005AA002CBD19 /* CardResultBottomSheetViewController.swift in Sources */,
39D13565273FDB9C00B1A148 /* User.swift in Sources */,
F822E7A92709CEB60020452C /* Notification.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "buttonStartImg.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "buttonStartImg@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "buttonStartImg@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
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" : [
{
"scale" : "1x",
"idiom" : "universal",
"filename" : "onboarding01.png"
},
{
"idiom" : "universal",
"filename" : "onboarding01@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "onboarding01@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
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" : [
{
"idiom" : "universal",
"filename" : "onboarding02.png",
"scale" : "1x"
},
{
"filename" : "onboarding02@2x.png",
"scale" : "2x",
"idiom" : "universal"
},
{
"idiom" : "universal",
"scale" : "3x",
"filename" : "onboarding02@3x.png"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
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" : "onboarding03.png",
"scale" : "1x",
"idiom" : "universal"
},
{
"idiom" : "universal",
"filename" : "onboarding03@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "onboarding03@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
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" : "onboarding04.png",
"scale" : "1x",
"idiom" : "universal"
},
{
"filename" : "onboarding04@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "onboarding04@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
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.
1 change: 1 addition & 0 deletions NADA-iOS-forRelease/Resouces/Constants/Storyboard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ extension Const {
static let tabBar = "TabBar"
static let cardCreationPreview = "CardCreationPreview"
static let more = "More"
static let onboarding = "Onboarding"
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ extension Const {
static let cardResultBottomSheetViewController = "CardResultBottomSheetViewController"
static let selectGroupBottomSheetViewController = "SelectGroupBottomSheetViewController"
static let moreViewController = "MoreViewController"
static let onboardingViewController = "OnboardingViewController"
}
}
}
1 change: 1 addition & 0 deletions NADA-iOS-forRelease/Resouces/Constants/Xib.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ extension Const {
static let groupEditTableViewCell = "GroupEditTableViewCell"
static let moreListTableViewCell = "MoreListTableViewCell"
static let cardView = "CardView"
static let onboardingCollectionViewCell = "OnboardingCollectionViewCell"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<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="collection view cell content view" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Onboarding View Controller-->
<scene sceneID="s0d-6b-0kx">
<objects>
<viewController storyboardIdentifier="OnboardingViewController" id="Y6W-OH-hqX" customClass="OnboardingViewController" customModule="NADA_iOS_forRelease" 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"/>
<subviews>
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="KQU-Sa-nlF">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<collectionViewFlowLayout key="collectionViewLayout" automaticEstimatedItemSize="YES" minimumLineSpacing="10" minimumInteritemSpacing="10" id="JMA-de-8hr">
<size key="itemSize" width="128" height="128"/>
<size key="headerReferenceSize" width="0.0" height="0.0"/>
<size key="footerReferenceSize" width="0.0" height="0.0"/>
<inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
</collectionViewFlowLayout>
<cells>
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="e4W-8i-s98">
<rect key="frame" x="0.0" y="0.0" width="128" height="128"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<collectionViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" id="NP5-bc-Icz">
<rect key="frame" x="0.0" y="0.0" width="128" height="128"/>
<autoresizingMask key="autoresizingMask"/>
</collectionViewCellContentView>
</collectionViewCell>
</cells>
</collectionView>
</subviews>
<viewLayoutGuide key="safeArea" id="vDu-zF-Fre"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="vDu-zF-Fre" firstAttribute="trailing" secondItem="KQU-Sa-nlF" secondAttribute="trailing" id="Kca-cl-bJT"/>
<constraint firstItem="KQU-Sa-nlF" firstAttribute="top" secondItem="5EZ-qb-Rvc" secondAttribute="top" id="Rnl-RF-juO"/>
<constraint firstAttribute="bottom" secondItem="KQU-Sa-nlF" secondAttribute="bottom" id="U5G-AQ-qQW"/>
<constraint firstItem="KQU-Sa-nlF" firstAttribute="leading" secondItem="vDu-zF-Fre" secondAttribute="leading" id="lig-BQ-Gl3"/>
</constraints>
</view>
<connections>
<outlet property="onboardingCollectionView" destination="KQU-Sa-nlF" id="92L-qk-Trf"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Ief-a0-LHa" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1" y="53"/>
</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,61 @@
//
// OnboardingCollectionViewCell.swift
// NADA-iOS-forRelease
//
// Created by kimhyungyu on 2021/12/05.
//

import UIKit

class OnboardingCollectionViewCell: UICollectionViewCell {

// MARK: - Properties

var presentToLoginViewController: (() -> Void)?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

우와 (() -> Void)? 이건 무슨 타입인가요?!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

클로저입니다! () -> () 이렇게로도 표현이 가능하지만 style share 코드 컨밴션을 따라서 위와 같이 표기했어요!!

야야 최이준 이거 세미나에 나왔다 야야 ㅋ ㅋ ㅋㅋㅋ ㅋ

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

스크린샷 2021-12-07 오후 9 31 58


// MARK: - @IBOutlet Properties

@IBOutlet weak var imageView: UIImageView!
@IBOutlet weak var startButton: UIButton!

// MARK: - View Life Cycle

override func awakeFromNib() {
super.awakeFromNib()

setUI()
}

static func nib() -> UINib {
return UINib(nibName: Const.Xib.onboardingCollectionViewCell, bundle: nil)
}

// MARK: - @IBAction Properties

@IBAction func touchStartButton(_ sender: Any) {
presentToLoginViewController?()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

그러게요 요런 모양 처음 만나는 친구네요???

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

셀안의 버튼을 누르면 뷰컨트롤러에서 화면전환하는 목적으로 구성했는데요! 셀에다가 클로저 옵셔널 변수를 만들고 셀을 뷰컨트롤러에서 만들어줄 때 delegate 에서 셀의 클로저 옵셔널 변수에 화면전환 코드를 넣는 로직입니당!

}
}

// MARK: - Methods

extension OnboardingCollectionViewCell {
private func setUI() {
layer.masksToBounds = false
layer.shadowColor = UIColor.black.cgColor
layer.shadowOpacity = 0.1
layer.shadowOffset = CGSize(width: 0, height: 0)
layer.shadowRadius = 10

contentView.layer.cornerRadius = 20
contentView.layer.masksToBounds = false

imageView.contentMode = .scaleAspectFill
}
func initCell(image: String, isLast: Bool) {
if let image = UIImage(named: image) {
imageView.image = image
}
startButton.isHidden = !isLast
}
}
Loading