diff --git a/NADA-iOS-forRelease.xcodeproj/project.pbxproj b/NADA-iOS-forRelease.xcodeproj/project.pbxproj index bb1941f1..99ef1b24 100644 --- a/NADA-iOS-forRelease.xcodeproj/project.pbxproj +++ b/NADA-iOS-forRelease.xcodeproj/project.pbxproj @@ -82,6 +82,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 */; }; @@ -196,6 +200,10 @@ F84BAFAC26FDB543004CA335 /* FrontCardCreationCollectionViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = FrontCardCreationCollectionViewCell.xib; sourceTree = ""; }; F84BAFAF26FDB552004CA335 /* BackCardCreationCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BackCardCreationCollectionViewCell.swift; sourceTree = ""; }; F84BAFB026FDB552004CA335 /* BackCardCreationCollectionViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = BackCardCreationCollectionViewCell.xib; sourceTree = ""; }; + F8518052275D040C006BD5ED /* OnboardingCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingCollectionViewCell.swift; sourceTree = ""; }; + F8518053275D040C006BD5ED /* OnboardingCollectionViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = OnboardingCollectionViewCell.xib; sourceTree = ""; }; + F8518057275D042B006BD5ED /* Onboarding.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Onboarding.storyboard; sourceTree = ""; }; + F851805A275D047C006BD5ED /* OnboardingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingViewController.swift; sourceTree = ""; }; F85711A4274A6B2200F59F0B /* CardCreationPreviewViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardCreationPreviewViewController.swift; sourceTree = ""; }; F85711A6274A6B3400F59F0B /* CardCreationPreview.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = CardCreationPreview.storyboard; sourceTree = ""; }; F858079C2700354E00872484 /* BackgroundCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BackgroundCollectionViewCell.swift; sourceTree = ""; }; @@ -374,6 +382,22 @@ path = Group; sourceTree = ""; }; + 395FE2E127619B0800A9815E /* Login */ = { + isa = PBXGroup; + children = ( + 3979709726FA0BF0003FB4F5 /* Login.storyboard */, + ); + path = Login; + sourceTree = ""; + }; + 395FE2E227619B0F00A9815E /* TabBar */ = { + isa = PBXGroup; + children = ( + 39D88B632745FDD400A72164 /* TabBar.storyboard */, + ); + path = TabBar; + sourceTree = ""; + }; 3979709426FA0BD8003FB4F5 /* Login */ = { isa = PBXGroup; children = ( @@ -532,6 +556,31 @@ path = CardCreation; sourceTree = ""; }; + F8518051275D039D006BD5ED /* Onboarding */ = { + isa = PBXGroup; + children = ( + F8518052275D040C006BD5ED /* OnboardingCollectionViewCell.swift */, + F8518053275D040C006BD5ED /* OnboardingCollectionViewCell.xib */, + ); + path = Onboarding; + sourceTree = ""; + }; + F8518056275D041F006BD5ED /* Onboarding */ = { + isa = PBXGroup; + children = ( + F8518057275D042B006BD5ED /* Onboarding.storyboard */, + ); + path = Onboarding; + sourceTree = ""; + }; + F8518059275D0468006BD5ED /* Onboarding */ = { + isa = PBXGroup; + children = ( + F851805A275D047C006BD5ED /* OnboardingViewController.swift */, + ); + path = Onboarding; + sourceTree = ""; + }; F857FC8A26C03A5C00A48D01 /* Assets */ = { isa = PBXGroup; children = ( @@ -690,6 +739,7 @@ F8FC439B26C01EC30033E151 /* Cells */ = { isa = PBXGroup; children = ( + F8518051275D039D006BD5ED /* Onboarding */, 3936993F274A565E00684420 /* GroupEdit */, 77607ED7274A689300204CD2 /* GroupCell */, 392F7FB1274621CF008CDBF5 /* MoreList */, @@ -739,6 +789,7 @@ F8FC43A026C01F040033E151 /* ViewControllers */ = { isa = PBXGroup; children = ( + F8518059275D0468006BD5ED /* Onboarding */, 393E3343275F69DB00965BBF /* Splash */, 3936993C274A53D300684420 /* GroupEdit */, 39D88B692746009B00A72164 /* BottomSheet */, @@ -766,8 +817,9 @@ isa = PBXGroup; children = ( 393E3348275F6A5D00965BBF /* Splash */, - 393E3347275F6A5100965BBF /* TabBar */, - 393E3346275F6A1100965BBF /* Login */, + 395FE2E227619B0F00A9815E /* TabBar */, + 395FE2E127619B0800A9815E /* Login */, + F8518056275D041F006BD5ED /* Onboarding */, 394F314D27081B4100C83291 /* Main */, 3958F23A270FFBC800B100B2 /* Group */, 39D88B602745FBA100A72164 /* More */, @@ -865,6 +917,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 */, @@ -888,6 +941,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 */, @@ -989,6 +1043,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 */, @@ -1029,6 +1084,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 */, diff --git a/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/buttonStartImg.imageset/Contents.json b/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/buttonStartImg.imageset/Contents.json new file mode 100644 index 00000000..47aa9cfa --- /dev/null +++ b/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/buttonStartImg.imageset/Contents.json @@ -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" + } +} \ No newline at end of file diff --git a/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/buttonStartImg.imageset/buttonStartImg.png b/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/buttonStartImg.imageset/buttonStartImg.png new file mode 100644 index 00000000..92e4f583 Binary files /dev/null and b/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/buttonStartImg.imageset/buttonStartImg.png differ diff --git a/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/buttonStartImg.imageset/buttonStartImg@2x.png b/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/buttonStartImg.imageset/buttonStartImg@2x.png new file mode 100644 index 00000000..a3d810e2 Binary files /dev/null and b/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/buttonStartImg.imageset/buttonStartImg@2x.png differ diff --git a/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/buttonStartImg.imageset/buttonStartImg@3x.png b/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/buttonStartImg.imageset/buttonStartImg@3x.png new file mode 100644 index 00000000..c143fba0 Binary files /dev/null and b/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/buttonStartImg.imageset/buttonStartImg@3x.png differ diff --git a/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding01.imageset/Contents.json b/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding01.imageset/Contents.json new file mode 100644 index 00000000..407ea520 --- /dev/null +++ b/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding01.imageset/Contents.json @@ -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" + } +} \ No newline at end of file diff --git a/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding01.imageset/onboarding01.png b/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding01.imageset/onboarding01.png new file mode 100644 index 00000000..9add7916 Binary files /dev/null and b/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding01.imageset/onboarding01.png differ diff --git a/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding01.imageset/onboarding01@2x.png b/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding01.imageset/onboarding01@2x.png new file mode 100644 index 00000000..98a94dfa Binary files /dev/null and b/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding01.imageset/onboarding01@2x.png differ diff --git a/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding01.imageset/onboarding01@3x.png b/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding01.imageset/onboarding01@3x.png new file mode 100644 index 00000000..ecc08874 Binary files /dev/null and b/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding01.imageset/onboarding01@3x.png differ diff --git a/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding02.imageset/Contents.json b/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding02.imageset/Contents.json new file mode 100644 index 00000000..c7a1cc2c --- /dev/null +++ b/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding02.imageset/Contents.json @@ -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" + } +} \ No newline at end of file diff --git a/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding02.imageset/onboarding02.png b/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding02.imageset/onboarding02.png new file mode 100644 index 00000000..c3f8c9d6 Binary files /dev/null and b/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding02.imageset/onboarding02.png differ diff --git a/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding02.imageset/onboarding02@2x.png b/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding02.imageset/onboarding02@2x.png new file mode 100644 index 00000000..815d7b61 Binary files /dev/null and b/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding02.imageset/onboarding02@2x.png differ diff --git a/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding02.imageset/onboarding02@3x.png b/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding02.imageset/onboarding02@3x.png new file mode 100644 index 00000000..4f285350 Binary files /dev/null and b/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding02.imageset/onboarding02@3x.png differ diff --git a/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding03.imageset/Contents.json b/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding03.imageset/Contents.json new file mode 100644 index 00000000..5d8a7f48 --- /dev/null +++ b/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding03.imageset/Contents.json @@ -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" + } +} \ No newline at end of file diff --git a/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding03.imageset/onboarding03.png b/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding03.imageset/onboarding03.png new file mode 100644 index 00000000..dcca195b Binary files /dev/null and b/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding03.imageset/onboarding03.png differ diff --git a/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding03.imageset/onboarding03@2x.png b/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding03.imageset/onboarding03@2x.png new file mode 100644 index 00000000..8631ab4d Binary files /dev/null and b/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding03.imageset/onboarding03@2x.png differ diff --git a/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding03.imageset/onboarding03@3x.png b/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding03.imageset/onboarding03@3x.png new file mode 100644 index 00000000..49a539fd Binary files /dev/null and b/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding03.imageset/onboarding03@3x.png differ diff --git a/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding04.imageset/Contents.json b/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding04.imageset/Contents.json new file mode 100644 index 00000000..b1cd728d --- /dev/null +++ b/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding04.imageset/Contents.json @@ -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" + } +} \ No newline at end of file diff --git a/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding04.imageset/onboarding04.png b/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding04.imageset/onboarding04.png new file mode 100644 index 00000000..a467e59c Binary files /dev/null and b/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding04.imageset/onboarding04.png differ diff --git a/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding04.imageset/onboarding04@2x.png b/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding04.imageset/onboarding04@2x.png new file mode 100644 index 00000000..11d4754c Binary files /dev/null and b/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding04.imageset/onboarding04@2x.png differ diff --git a/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding04.imageset/onboarding04@3x.png b/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding04.imageset/onboarding04@3x.png new file mode 100644 index 00000000..21b95657 Binary files /dev/null and b/NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/onboarding04.imageset/onboarding04@3x.png differ diff --git a/NADA-iOS-forRelease/Resouces/Constants/Storyboard.swift b/NADA-iOS-forRelease/Resouces/Constants/Storyboard.swift index 0c5069f9..3c0c2fdb 100644 --- a/NADA-iOS-forRelease/Resouces/Constants/Storyboard.swift +++ b/NADA-iOS-forRelease/Resouces/Constants/Storyboard.swift @@ -22,6 +22,7 @@ extension Const { static let cardCreationPreview = "CardCreationPreview" static let more = "More" static let splash = "Splash" + static let onboarding = "Onboarding" } } diff --git a/NADA-iOS-forRelease/Resouces/Constants/ViewController.swift b/NADA-iOS-forRelease/Resouces/Constants/ViewController.swift index d05ca2b6..cd43ce08 100644 --- a/NADA-iOS-forRelease/Resouces/Constants/ViewController.swift +++ b/NADA-iOS-forRelease/Resouces/Constants/ViewController.swift @@ -27,6 +27,7 @@ extension Const { static let selectGroupBottomSheetViewController = "SelectGroupBottomSheetViewController" static let moreViewController = "MoreViewController" static let splashViewController = "SplashViewController" + static let onboardingViewController = "OnboardingViewController" } } } diff --git a/NADA-iOS-forRelease/Resouces/Constants/Xib.swift b/NADA-iOS-forRelease/Resouces/Constants/Xib.swift index ca6ace1a..9e7c8522 100644 --- a/NADA-iOS-forRelease/Resouces/Constants/Xib.swift +++ b/NADA-iOS-forRelease/Resouces/Constants/Xib.swift @@ -21,5 +21,6 @@ extension Const { static let groupEditTableViewCell = "GroupEditTableViewCell" static let moreListTableViewCell = "MoreListTableViewCell" static let cardView = "CardView" + static let onboardingCollectionViewCell = "OnboardingCollectionViewCell" } } diff --git a/NADA-iOS-forRelease/Resouces/Storyboards/Onboarding/Onboarding.storyboard b/NADA-iOS-forRelease/Resouces/Storyboards/Onboarding/Onboarding.storyboard new file mode 100644 index 00000000..d7b76b96 --- /dev/null +++ b/NADA-iOS-forRelease/Resouces/Storyboards/Onboarding/Onboarding.storyboard @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/NADA-iOS-forRelease/Sources/Cells/CreationCard/BackCardCreationCollectionViewCell.swift b/NADA-iOS-forRelease/Sources/Cells/CreationCard/BackCardCreationCollectionViewCell.swift index f9fb3b2f..24ee4910 100644 --- a/NADA-iOS-forRelease/Sources/Cells/CreationCard/BackCardCreationCollectionViewCell.swift +++ b/NADA-iOS-forRelease/Sources/Cells/CreationCard/BackCardCreationCollectionViewCell.swift @@ -12,9 +12,12 @@ class BackCardCreationCollectionViewCell: UICollectionViewCell { // MARK: - Properties static let identifier = "BackCardCreationCollectionViewCell" + private let flavorList = ["민초", "반민초", "소주", "맥주", "부먹", "찍먹", "양념", "후라이드"] + private let maxLength: Int = 20 private var textFieldList = [UITextField]() private var requiredCollectionViewList = [UICollectionView]() + public weak var backCardCreationDelegate: BackCardCreationDelegate? // MARK: - @IBOutlet Properties @@ -42,6 +45,7 @@ class BackCardCreationCollectionViewCell: UICollectionViewCell { setUI() registerCell() textFieldDelegate() + setNotification() } } @@ -109,33 +113,76 @@ extension BackCardCreationCollectionViewCell { private func textFieldDelegate() { _ = textFieldList.map { $0.delegate = self } } + private func setNotification() { + NotificationCenter.default.addObserver(self, selector: #selector(textFieldDidChange(_:)), name: UITextField.textDidChangeNotification, object: nil) + } + private func checkBackCardStatus() { + backCardCreationDelegate?.backCardCreation(withRequired: [ + "isMincho": isMinchoCollectionView.indexPathsForSelectedItems == [[0, 0]] ? true: false, + "isSoju": isSojuCollectionView.indexPathsForSelectedItems == [[0, 0]] ? true: false, + "isBoomuk": isBoomukCollectionView.indexPathsForSelectedItems == [[0, 0]] ? true: false, + "isSauced": isSaucedCollectionView.indexPathsForSelectedItems == [[0, 0]] ? true: false + ], withOptional: [ + "firstTMI": firstTMITextField.text ?? "", + "secondTMI": secondTMITextField.text ?? "", + "thirdTMI": thirdTMITextField.text ?? "" + ]) + } static func nib() -> UINib { return UINib(nibName: Const.Xib.backCardCreationCollectionViewCell, bundle: Bundle(for: BackCardCreationCollectionViewCell.self)) } + + // MARK: - @objc Methods + + @objc + private func textFieldDidChange(_ notification: NSNotification) { + if let textField = notification.object as? UITextField { + switch textField { + case firstTMITextField: + if let text = firstTMITextField.text { + if text.count > maxLength { + let maxIndex = text.index(text.startIndex, offsetBy: maxLength) + let newString = String(text[text.startIndex.. maxLength { + let maxIndex = text.index(text.startIndex, offsetBy: maxLength) + let newString = String(text[text.startIndex.. maxLength { + let maxIndex = text.index(text.startIndex, offsetBy: maxLength) + let newString = String(text[text.startIndex.. Bool { diff --git a/NADA-iOS-forRelease/Sources/Cells/CreationCard/FrontCardCreationCollectionViewCell.swift b/NADA-iOS-forRelease/Sources/Cells/CreationCard/FrontCardCreationCollectionViewCell.swift index 40f007a1..772bb5c0 100644 --- a/NADA-iOS-forRelease/Sources/Cells/CreationCard/FrontCardCreationCollectionViewCell.swift +++ b/NADA-iOS-forRelease/Sources/Cells/CreationCard/FrontCardCreationCollectionViewCell.swift @@ -20,6 +20,7 @@ class FrontCardCreationCollectionViewCell: UICollectionViewCell { private var optionalTextFieldList = [UITextField]() private var cardBackgroundImage: UIImage? private var defaultImageIndex: Int? + private let maxLength: Int = 15 public var presentingBirthBottomVCClosure: (() -> Void)? public var presentingMBTIBottomVCClosure: (() -> Void)? @@ -160,6 +161,7 @@ extension FrontCardCreationCollectionViewCell { NotificationCenter.default.addObserver(self, selector: #selector(setBirthTextField(notification:)), name: .frontCardBirth, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(setMBTITextField(notification:)), name: .frontCardMBTI, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(setCardBackgroundImage(notifiation:)), name: .sendNewImage, object: nil) + NotificationCenter.default.addObserver(self, selector: #selector(textFieldDidChange(_:)), name: UITextField.textDidChangeNotification, object: nil) } /// front card 가 편집되었는지. 필수 항목이 다 입력되었는지 체크. @@ -171,20 +173,20 @@ extension FrontCardCreationCollectionViewCell { mbtiTextField.hasText && defaultImageIndex != nil { frontCardCreationDelegate?.frontCardCreation(requiredInfo: true) - frontCardCreationDelegate?.frontCardCreation(withRequired: [ - "defaultImageIndex": String(defaultImageIndex ?? -1), - "title": cardTitleTextField.text ?? "", - "name": userNameTextField.text ?? "", - "birthDate": birthTextField.text ?? "", - "mbti": mbtiTextField.text ?? "" - ], withOptional: [ - "instagram": instagramIDTextField.text ?? "", - "linkURL": linkURLTextField.text ?? "", - "description": descriptionTextField.text ?? "" - ]) } else { frontCardCreationDelegate?.frontCardCreation(requiredInfo: false) } + frontCardCreationDelegate?.frontCardCreation(withRequired: [ + "defaultImageIndex": String(defaultImageIndex ?? -1), + "title": cardTitleTextField.text ?? "", + "name": userNameTextField.text ?? "", + "birthDate": birthTextField.text ?? "", + "mbti": mbtiTextField.text ?? "" + ], withOptional: [ + "instagram": instagramIDTextField.text ?? "", + "linkURL": linkURLTextField.text ?? "", + "description": descriptionTextField.text ?? "" + ]) } static func nib() -> UINib { return UINib(nibName: Const.Xib.frontCardCreationCollectionViewCell, bundle: Bundle(for: FrontCardCreationCollectionViewCell.self)) @@ -209,13 +211,44 @@ extension FrontCardCreationCollectionViewCell { cardBackgroundImage = notifiation.object as? UIImage backgroundSettingCollectionView.reloadData() } + @objc + private func textFieldDidChange(_ notification: Notification) { + if let textField = notification.object as? UITextField { + switch textField { + case cardTitleTextField: + if let text = cardTitleTextField.text { + if text.count > maxLength { + let maxIndex = text.index(text.startIndex, offsetBy: maxLength) + let newString = String(text[text.startIndex.. maxLength { + let maxIndex = text.index(text.startIndex, offsetBy: maxLength) + let newString = String(text[text.startIndex.. maxLength { + let maxIndex = text.index(text.startIndex, offsetBy: maxLength) + let newString = String(text[text.startIndex.. Void)? + + // 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?() + } +} + +// 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 + } +} diff --git a/NADA-iOS-forRelease/Sources/Cells/Onboarding/OnboardingCollectionViewCell.xib b/NADA-iOS-forRelease/Sources/Cells/Onboarding/OnboardingCollectionViewCell.xib new file mode 100644 index 00000000..fae7bb5c --- /dev/null +++ b/NADA-iOS-forRelease/Sources/Cells/Onboarding/OnboardingCollectionViewCell.xib @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/NADA-iOS-forRelease/Sources/NetworkService/User/UserAPI.swift b/NADA-iOS-forRelease/Sources/NetworkService/User/UserAPI.swift index ae23edda..54a78d40 100644 --- a/NADA-iOS-forRelease/Sources/NetworkService/User/UserAPI.swift +++ b/NADA-iOS-forRelease/Sources/NetworkService/User/UserAPI.swift @@ -79,6 +79,22 @@ public class UserAPI { } } + func userSocialSignUp(request: User, completion: @escaping (NetworkResult) -> Void) { + userProvider.request(.userSignUp(request: request)) { (result) in + switch result { + case .success(let response): + let statusCode = response.statusCode + let data = response.data + + let networkResult = self.judgeUserTokenFetchStatus(by: statusCode, data) + completion(networkResult) + + case .failure(let err): + print(err) + } + } + } + private func judgeUserIDFetchStatus(by statusCode: Int, _ data: Data) -> NetworkResult { let decoder = JSONDecoder() diff --git a/NADA-iOS-forRelease/Sources/NetworkService/User/UserSevice.swift b/NADA-iOS-forRelease/Sources/NetworkService/User/UserSevice.swift index b60f6c80..95311475 100644 --- a/NADA-iOS-forRelease/Sources/NetworkService/User/UserSevice.swift +++ b/NADA-iOS-forRelease/Sources/NetworkService/User/UserSevice.swift @@ -13,6 +13,7 @@ enum UserSevice { case userTokenFetch(userID: String) case userSignUp(request: User) case userDelete(userID: String) + case userSocialSignUp(request: User) } extension UserSevice: TargetType { @@ -30,6 +31,8 @@ extension UserSevice: TargetType { return "/register" case .userDelete(let userID): return "/\(userID)" + case .userSocialSignUp: + return "auth/login" } } @@ -37,7 +40,7 @@ extension UserSevice: TargetType { switch self { case .userIDFetch, .userTokenFetch: return .get - case .userSignUp: + case .userSignUp, .userSocialSignUp: return .post case .userDelete: return .delete @@ -54,6 +57,8 @@ extension UserSevice: TargetType { return .requestPlain case .userSignUp(let request): return .requestJSONEncodable(request) + case .userSocialSignUp(let request): + return .requestJSONEncodable(request) } } @@ -61,7 +66,7 @@ extension UserSevice: TargetType { switch self { case .userIDFetch, .userTokenFetch, .userDelete: return .none - case .userSignUp: + case .userSignUp, .userSocialSignUp: return ["Content-Type": "application/json"] } } diff --git a/NADA-iOS-forRelease/Sources/SceneDelegate.swift b/NADA-iOS-forRelease/Sources/SceneDelegate.swift index 939b5c6b..8c12e176 100644 --- a/NADA-iOS-forRelease/Sources/SceneDelegate.swift +++ b/NADA-iOS-forRelease/Sources/SceneDelegate.swift @@ -22,8 +22,8 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { window = UIWindow(frame: windowScene.coordinateSpace.bounds) window?.windowScene = windowScene - window?.rootViewController = UIStoryboard(name: Const.Storyboard.Name.tabBar, bundle: nil).instantiateViewController(withIdentifier: Const.ViewController.Identifier.tabBarViewController) - // window?.rootViewController = UIStoryboard(name: Const.Storyboard.Name.login, bundle: nil).instantiateViewController(withIdentifier: Const.ViewController.Identifier.loginViewController) + // window?.rootViewController = UIStoryboard(name: Const.Storyboard.Name.tabBar, bundle: nil).instantiateViewController(withIdentifier: Const.ViewController.Identifier.tabBarViewController) + window?.rootViewController = UIStoryboard(name: Const.Storyboard.Name.login, bundle: nil).instantiateViewController(withIdentifier: Const.ViewController.Identifier.loginViewController) window?.makeKeyAndVisible() IQKeyboardManager.shared.enable = true diff --git a/NADA-iOS-forRelease/Sources/ViewControllers/BottomSheet/SelectBirthBottomViewController.swift b/NADA-iOS-forRelease/Sources/ViewControllers/BottomSheet/SelectBirthBottomViewController.swift index 2de5e31f..53ad1867 100644 --- a/NADA-iOS-forRelease/Sources/ViewControllers/BottomSheet/SelectBirthBottomViewController.swift +++ b/NADA-iOS-forRelease/Sources/ViewControllers/BottomSheet/SelectBirthBottomViewController.swift @@ -51,7 +51,7 @@ extension SelectBirthBottomSheetViewController { view.addSubview(birthPicker) view.addSubview(doneButton) - selectedBirth = yearList[0] + "/" + monthList[0] + "/" + dayList[0] + selectedBirth = yearList[0] + "." + monthList[0] + "." + dayList[0] birthPicker.delegate = self birthPicker.dataSource = self @@ -145,7 +145,7 @@ extension SelectBirthBottomSheetViewController: UIPickerViewDelegate, UIPickerVi year = year.isEmpty ? yearList[0] : year month = month.isEmpty ? monthList[0] : month day = day.isEmpty ? dayList[0] : day - selectedBirth = year + "/" + month + "/" + day + selectedBirth = year + "." + month + "." + day } func pickerView(_ pickerView: UIPickerView, rowHeightForComponent component: Int) -> CGFloat { diff --git a/NADA-iOS-forRelease/Sources/ViewControllers/Login/LoginViewController.swift b/NADA-iOS-forRelease/Sources/ViewControllers/Login/LoginViewController.swift index e2f8bae2..0ddcd09d 100644 --- a/NADA-iOS-forRelease/Sources/ViewControllers/Login/LoginViewController.swift +++ b/NADA-iOS-forRelease/Sources/ViewControllers/Login/LoginViewController.swift @@ -19,7 +19,6 @@ class LoginViewController: UIViewController { // FIXME: - 서버 연결 테스트, 추후 위치 수정 필요 // getUserIDFetchWithAPI(userID: "nada") // getUserTokenFetchWithAPI(userID: "nada") - // postUserSignUpWithAPI(request: User(userID: "nada3")) } override func viewWillAppear(_ animated: Bool) { @@ -31,15 +30,12 @@ class LoginViewController: UIViewController { // MARK: - IBAction Properties // 카카오톡으로 로그인 버튼 클릭 시 @IBAction func kakaoLoginButton(_ sender: Any) { - // 유효한 토큰 검사 - if AuthApi.hasToken() { + if AuthApi.hasToken() { // 유효한 토큰 존재 UserApi.shared.accessTokenInfo { (_, error) in if let error = error { if let sdkError = error as? SdkError, sdkError.isInvalidTokenError() == true { // 로그인 필요 self.signUp() - } else { - // 기타 에러 } } else { // 토큰 유효성 체크 성공(필요 시 토큰 갱신됨) @@ -73,44 +69,39 @@ extension LoginViewController { // 카카오톡 설치 여부 확인 if UserApi.isKakaoTalkLoginAvailable() { // 카카오톡 로그인. api 호출 결과를 클로저로 전달. - UserApi.shared.loginWithKakaoTalk {(oauthToken, error) in - if let error = error { // 예외 처리 (로그인 취소 등) - print(error) - } else { // 로그인 성공했을 때 - print("loginWithKakaoTalk() success.") - self.getUserInfo() - _ = oauthToken - // 어세스토큰 - let accessToken = oauthToken?.accessToken - self.goToMain() - } - } + login() } else { + print("카카오톡 미설치") // 만약, 카카오톡이 깔려있지 않을 경우에는 웹 브라우저로 카카오 로그인함. - UserApi.shared.loginWithKakaoTalk {(oauthToken, error) in - if let error = error { // 예외 처리 (로그인 취소 등) - print(error) - } else { // 로그인 성공했을 때 - print("loginWithKakaoTalk() success.") - self.getUserInfo() - _ = oauthToken - // 어세스토큰 - let accessToken = oauthToken?.accessToken - self.goToMain() + + } + } + + func login() { + UserApi.shared.loginWithKakaoTalk {(oauthToken, error) in + if let error = error { + print(error) + } else { + print("loginWithKakaoTalk() success.") + if let kakaoData = oauthToken { + } } } + } // 사용자 정보를 성공적으로 가져왔을 때, 화면전환하는 함수 - private func getUserInfo() { + func getUserInfo() { // 사용자 정보 가져오기 UserApi.shared.me() {(user, error) in if let error = error { print(error) } else { print("me() success.") + self.goToMain() let email = user?.kakaoAccount?.email // 이메일 정보 + } } } @@ -139,7 +130,7 @@ extension LoginViewController { } } } - + func getUserTokenFetchWithAPI(userID: String) { UserAPI.shared.userTokenFetch(userID: userID) { response in switch response { @@ -158,7 +149,7 @@ extension LoginViewController { } func postUserSignUpWithAPI(request: User) { - UserAPI.shared.userSignUp(request: request) { response in + UserAPI.shared.userSocialSignUp(request: request) { response in switch response { case .success: print("postUserSignUpWithAPI - success") @@ -173,4 +164,5 @@ extension LoginViewController { } } } + } diff --git a/NADA-iOS-forRelease/Sources/ViewControllers/More/MoreViewController.swift b/NADA-iOS-forRelease/Sources/ViewControllers/More/MoreViewController.swift index 3e8777b5..6f8bcdb7 100644 --- a/NADA-iOS-forRelease/Sources/ViewControllers/More/MoreViewController.swift +++ b/NADA-iOS-forRelease/Sources/ViewControllers/More/MoreViewController.swift @@ -101,7 +101,7 @@ extension MoreViewController: UITableViewDelegate { case 2: print("회원탈퇴!") // TODO: - 회원탈퇴 서버 전, alert 창이나 별도의 알림 필요, 수정 요함 - // deleteUserWithAPI(userID: "nada3") + deleteUserWithAPI(userID: "2alswo7@naver.com") default: print("default!") } } @@ -146,7 +146,6 @@ extension MoreViewController: UITableViewDataSource { // MARK: - Network extension MoreViewController { - // FIXME: - 계정 탈퇴 네트워크 함수 추후 위치 수정 func deleteUserWithAPI(userID: String) { UserAPI.shared.userDelete(userID: userID) { response in switch response { diff --git a/NADA-iOS-forRelease/Sources/ViewControllers/Onboarding/OnboardingViewController.swift b/NADA-iOS-forRelease/Sources/ViewControllers/Onboarding/OnboardingViewController.swift new file mode 100644 index 00000000..a7359af0 --- /dev/null +++ b/NADA-iOS-forRelease/Sources/ViewControllers/Onboarding/OnboardingViewController.swift @@ -0,0 +1,126 @@ +// +// OnboardingViewController.swift +// NADA-iOS-forRelease +// +// Created by kimhyungyu on 2021/12/05. +// + +import UIKit + +class OnboardingViewController: UIViewController { + + // MARK: - Properties + + private var currentIndex: CGFloat = 0 + private let onboardingList = ["onboarding01", "onboarding02", "onboarding03", "onboarding04"] + private enum Size { + static let cellWidth: CGFloat = 327 + static let cellHeigth: CGFloat = 327 + static let cellTopInset: CGFloat = 198 + static let cellBottomInset: CGFloat = 208 + static let cellLineSpacing: CGFloat = 85 + static let topSafeArea: CGFloat = 44 + } + + // MARK: - @IBOutlet Properties + + @IBOutlet weak var onboardingCollectionView: UICollectionView! + + // MARK: - View Life Cycle + + override func viewDidLoad() { + super.viewDidLoad() + + setUI() + collectionViewDelegate() + } +} + +// MARK: - Extensions + +extension OnboardingViewController { + private func setUI() { + let collectionViewLayout = onboardingCollectionView.collectionViewLayout as? UICollectionViewFlowLayout + collectionViewLayout?.estimatedItemSize = .zero + collectionViewLayout?.scrollDirection = .vertical + onboardingCollectionView.showsVerticalScrollIndicator = false + } + private func collectionViewDelegate() { + onboardingCollectionView.delegate = self + onboardingCollectionView.dataSource = self + + onboardingCollectionView.register(OnboardingCollectionViewCell.nib(), forCellWithReuseIdentifier: Const.Xib.onboardingCollectionViewCell) + } +} + +// MARK: - UICollectionViewDelegate + +extension OnboardingViewController: UICollectionViewDelegate { + func scrollViewWillEndDragging(_ scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer) { + var offset = targetContentOffset.pointee + let index = round(offset.y / Size.cellHeigth) + + if index > currentIndex { + currentIndex += 1 + } else if index < currentIndex { + if currentIndex != 0 { + currentIndex -= 1 + } + } + + if currentIndex == 0 { + offset = CGPoint(x: CGFloat.zero, y: -Size.topSafeArea) + } else { + offset = CGPoint(x: CGFloat.zero, y: currentIndex * (Size.cellHeigth + Size.cellLineSpacing) - Size.topSafeArea) + } + + targetContentOffset.pointee = offset + } +} + +// MARK: - UICollectionViewDataSource + +extension OnboardingViewController: UICollectionViewDataSource { + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + return onboardingList.count + } + + func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: Const.Xib.onboardingCollectionViewCell, for: indexPath) as? OnboardingCollectionViewCell else { return UICollectionViewCell() } + let isLast = indexPath.item == 3 ? true : false + cell.initCell(image: onboardingList[indexPath.item], isLast: isLast) + + if isLast { + cell.presentToLoginViewController = { + guard let nextVC = UIStoryboard(name: Const.Storyboard.Name.login, bundle: nil).instantiateViewController(withIdentifier: Const.ViewController.Identifier.loginViewController) as? LoginViewController else { return } + nextVC.modalTransitionStyle = .crossDissolve + nextVC.modalPresentationStyle = .fullScreen + + self.present(nextVC, animated: true, completion: nil) + } + } + + return cell + } +} + +// MARK: - UICollectionViewDelegateFlowLayout + +extension OnboardingViewController: UICollectionViewDelegateFlowLayout { + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat { + return Size.cellLineSpacing + } + + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat { + return 0 + } + + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets { + return UIEdgeInsets(top: Size.cellTopInset, left: 0, bottom: Size.cellBottomInset, right: 0) + } + + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { + return CGSize(width: Size.cellWidth, height: Size.cellHeigth) + } + +}