Skip to content

Commit

Permalink
Merge pull request #179 from mini-min/release/#167
Browse files Browse the repository at this point in the history
[FEAT] 애플 소셜 로그인 구현
  • Loading branch information
mini-min authored Dec 21, 2021
2 parents 2db475c + 6258243 commit fd34150
Show file tree
Hide file tree
Showing 27 changed files with 197 additions and 123 deletions.
4 changes: 4 additions & 0 deletions NADA-iOS-forRelease.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
3903CC1F2769F4F40094C458 /* EmptyCardCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = EmptyCardCell.xib; sourceTree = "<group>"; };
390515B72706CEBB00C5F7A5 /* Colors.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Colors.xcassets; sourceTree = "<group>"; };
3909242E26FA15E800236C51 /* UIView+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+Extension.swift"; sourceTree = "<group>"; };
3918F6652771682F00984648 /* NADA-iOS-forRelease.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "NADA-iOS-forRelease.entitlements"; sourceTree = "<group>"; };
3927A7D6275F2A9B008BCD2A /* UserDefaults.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserDefaults.swift; sourceTree = "<group>"; };
39288E11273F52B20072F403 /* CardListLookUpRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardListLookUpRequest.swift; sourceTree = "<group>"; };
392F7FB2274621F1008CDBF5 /* MoreListTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoreListTableViewCell.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -768,6 +769,7 @@
F8FC438426C01CDD0033E151 /* NADA-iOS-forRelease */ = {
isa = PBXGroup;
children = (
3918F6652771682F00984648 /* NADA-iOS-forRelease.entitlements */,
F8FC439326C01CDE0033E151 /* Info.plist */,
F8FC439926C01E2B0033E151 /* Resouces */,
F8FC439A26C01EA90033E151 /* Sources */,
Expand Down Expand Up @@ -1329,6 +1331,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = "NADA-iOS-forRelease/NADA-iOS-forRelease.entitlements";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = T3VFJ764ZC;
INFOPLIST_FILE = "NADA-iOS-forRelease/Info.plist";
Expand All @@ -1349,6 +1352,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = "NADA-iOS-forRelease/NADA-iOS-forRelease.entitlements";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = T3VFJ764ZC;
INFOPLIST_FILE = "NADA-iOS-forRelease/Info.plist";
Expand Down
10 changes: 10 additions & 0 deletions NADA-iOS-forRelease/NADA-iOS-forRelease.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.applesignin</key>
<array>
<string>Default</string>
</array>
</dict>
</plist>
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.
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,56 @@
{
"images" : [
{
"filename" : "AppleLogin.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "AppleLogin-1.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "AppleLogin@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "AppleLogin-1@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "AppleLogin@3x.png",
"idiom" : "universal",
"scale" : "3x"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "AppleLogin-1@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.
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.
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.
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/UserDefaults.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ extension Const {
static let darkModeState = "darkModeState"
static let accessToken = "accessToken"
static let refreshToken = "refreshToken"
static let userID = "userID"
}
}
62 changes: 5 additions & 57 deletions NADA-iOS-forRelease/Resouces/Storyboards/Login/Login.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<customFonts key="customFonts">
<array key="NotoSansCJKkr-Regular.otf">
<string>NotoSansCJKkr-Regular</string>
</array>
</customFonts>
<scenes>
<!--Login View Controller-->
<scene sceneID="s0d-6b-0kx">
Expand All @@ -27,51 +22,10 @@
</imageView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" spacing="14" translatesAutoresizingMaskIntoConstraints="NO" id="Bjc-le-F1v">
<rect key="frame" x="24" y="558" width="327" height="110"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="5pM-UL-MTg">
<rect key="frame" x="0.0" y="0.0" width="327" height="48"/>
<color key="backgroundColor" name="background"/>
<constraints>
<constraint firstAttribute="height" constant="48" id="3RT-Mz-xhr"/>
</constraints>
<fontDescription key="fontDescription" name="NotoSansCJKkr-Regular" family="Noto Sans CJK KR" pointSize="14"/>
<state key="normal" image="kakao_login_large_wide">
<color key="titleColor" name="primary"/>
</state>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="15"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="kakaoLoginButton:" destination="Y6W-OH-hqX" eventType="touchUpInside" id="w4Z-RF-HNP"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="CFr-2z-xuP">
<rect key="frame" x="0.0" y="62" width="327" height="48"/>
<color key="backgroundColor" name="background"/>
<fontDescription key="fontDescription" name="NotoSansCJKkr-Regular" family="Noto Sans CJK KR" pointSize="14"/>
<inset key="titleEdgeInsets" minX="0.0" minY="0.0" maxX="15" maxY="0.0"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="150" maxY="0.0"/>
<state key="normal" title="Apple로 로그인" image="icnApple">
<color key="titleColor" name="primary"/>
</state>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="15"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
<real key="value" value="1"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="borderColor">
<color key="value" name="primary"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="appleLoginButton:" destination="Y6W-OH-hqX" eventType="touchUpInside" id="iBn-nD-f6a"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" name="background"/>
<constraints>
<constraint firstAttribute="height" constant="110" id="zMJ-VE-Guw"/>
</constraints>
</stackView>
</subviews>
<viewLayoutGuide key="safeArea" id="vDu-zF-Fre"/>
Expand All @@ -87,8 +41,7 @@
</view>
<navigationItem key="navigationItem" id="FOs-Km-lor"/>
<connections>
<outlet property="appleLogin" destination="CFr-2z-xuP" id="VGd-Su-LvK"/>
<outlet property="kakaoLogin" destination="5pM-UL-MTg" id="z8o-2L-Hda"/>
<outlet property="loginProviderStackView" destination="Bjc-le-F1v" id="xpW-XR-iPZ"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Ief-a0-LHa" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
Expand All @@ -97,14 +50,9 @@
</scene>
</scenes>
<resources>
<image name="icnApple" width="20" height="20"/>
<image name="kakao_login_large_wide" width="600" height="90"/>
<image name="logoNadaTxt2" width="99" height="136"/>
<namedColor name="background">
<color red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="primary">
<color red="0.074509803921568626" green="0.078431372549019607" blue="0.086274509803921567" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
</resources>
</document>
12 changes: 6 additions & 6 deletions NADA-iOS-forRelease/Resouces/Storyboards/Main/Front.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="0Mt-Gu-dQt">
<rect key="frame" x="321" y="12" width="30" height="30"/>
<rect key="frame" x="327" y="16" width="24" height="24"/>
<constraints>
<constraint firstAttribute="width" secondItem="0Mt-Gu-dQt" secondAttribute="height" multiplier="1:1" id="EVQ-c4-h5G"/>
<constraint firstAttribute="width" constant="30" id="R1B-w4-ZOH"/>
<constraint firstAttribute="width" constant="24" id="R1B-w4-ZOH"/>
</constraints>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" image="iconList"/>
Expand All @@ -44,7 +44,7 @@
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="6su-gs-zmp">
<rect key="frame" x="281" y="12" width="30" height="30"/>
<rect key="frame" x="293" y="16" width="24" height="24"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" image="iconAdd"/>
<connections>
Expand All @@ -55,7 +55,7 @@
<color key="backgroundColor" name="background"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="0Mt-Gu-dQt" secondAttribute="trailing" constant="24" id="AGE-s5-ahl"/>
<constraint firstItem="0Mt-Gu-dQt" firstAttribute="top" secondItem="FvW-XO-xRq" secondAttribute="top" constant="12" id="CCu-gm-wvy"/>
<constraint firstItem="0Mt-Gu-dQt" firstAttribute="top" secondItem="FvW-XO-xRq" secondAttribute="top" constant="16" id="CCu-gm-wvy"/>
<constraint firstItem="6su-gs-zmp" firstAttribute="width" secondItem="0Mt-Gu-dQt" secondAttribute="width" id="V7m-aU-6bW"/>
<constraint firstItem="fmx-Ie-VCf" firstAttribute="top" secondItem="FvW-XO-xRq" secondAttribute="top" constant="18" id="Vwd-wJ-6A1"/>
<constraint firstItem="0Mt-Gu-dQt" firstAttribute="leading" secondItem="6su-gs-zmp" secondAttribute="trailing" constant="10" id="jC0-d9-1y9"/>
Expand Down Expand Up @@ -127,10 +127,10 @@
</scene>
</scenes>
<resources>
<image name="iconAdd" width="30" height="30"/>
<image name="iconAdd" width="24" height="24"/>
<image name="iconHome" width="30" height="30"/>
<image name="iconHomeSelected" width="30" height="35"/>
<image name="iconList" width="30" height="30"/>
<image name="iconList" width="24" height="24"/>
<namedColor name="background">
<color red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
Expand Down
26 changes: 25 additions & 1 deletion NADA-iOS-forRelease/Sources/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@

import UIKit
import KakaoSDKCommon
import AuthenticationServices

@main
class AppDelegate: UIResponder, UIApplicationDelegate {

var isLogin = false

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
Expand All @@ -20,6 +21,29 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
if UserDefaults.standard.string(forKey: Const.UserDefaults.accessToken) != nil {
isLogin = true
}

// let appleIDProvider = ASAuthorizationAppleIDProvider()
// appleIDProvider.getCredentialState(forUserID: Const.UserDefaults.userID) { (credentialState, error) in
// switch credentialState {
// case .authorized:
// print("해당 ID는 연동되어있습니다.")
// self.isLogin = true
// case .revoked:
// print("해당 ID는 연동되어있지않습니다.")
// self.isLogin = false
// case .notFound:
// print("해당 ID를 찾을 수 없습니다.")
// self.isLogin = false
// default:
// break
// }
// }

NotificationCenter.default.addObserver(forName: ASAuthorizationAppleIDProvider.credentialRevokedNotification, object: nil, queue: nil) { (Notification) in
print("Revoked Notification")
self.isLogin = false
}

return true
}

Expand Down
Loading

0 comments on commit fd34150

Please sign in to comment.