Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…ease into feature/TeamNADA#528
  • Loading branch information
hyun99999 committed May 17, 2023
2 parents bb0b8de + 49b9ab0 commit 1f8854e
Show file tree
Hide file tree
Showing 51 changed files with 304 additions and 158 deletions.
34 changes: 0 additions & 34 deletions IntentsExtension/IntentHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ import Intents

class IntentHandler: INExtension {

// MARK: - Properties

var cardItems: [Card]?

override func handler(for intent: INIntent) -> Any {
// This is the default implementation. If you want different objects to handle different intents,
// you can override this and return the handler you want for that particular intent.
Expand Down Expand Up @@ -44,36 +40,6 @@ extension IntentHandler: MyCardIntentHandling {
}
}
}

// 위젯 추가할때 호출. 기본값 설정.
func defaultMyCard(for intent: MyCardIntent) -> MyCard? {
var myCard: MyCard?

let group = DispatchGroup()

DispatchQueue.global().async(group: group) { [weak self] in
group.enter()

self?.cardListFetchWithAPI { [weak self] result in
switch result {
case .success(let result):
if let result {
self?.cardItems = result.data
myCard = MyCard(identifier: self?.cardItems?[0].cardUUID ?? "", display: self?.cardItems?[0].cardName ?? "")
myCard?.userName = self?.cardItems?[0].userName
myCard?.cardImage = self?.cardItems?[0].cardImage
}
case .failure(let err):
print(err)
}
group.leave()
}
}

_ = group.wait(timeout: .now() + 60)

return myCard
}
}

// MARK: - Newtwork
Expand Down
26 changes: 18 additions & 8 deletions NADA-iOS-forRelease.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@
F8F00C3B29DD483000A15377 /* UpdateUserInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8F00C3A29DD483000A15377 /* UpdateUserInfo.swift */; };
F8F00C3E29DD489200A15377 /* UpdateAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8F00C3D29DD489200A15377 /* UpdateAPI.swift */; };
F8F00C4129DD48A000A15377 /* UpdateService.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8F00C4029DD48A000A15377 /* UpdateService.swift */; };
F8F0ACB22A0BB909001B8266 /* GenericResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8C83FBC272F9F430009DF0D /* GenericResponse.swift */; };
F8F0ACB32A0BB916001B8266 /* UserDefaults+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F82AF6A129FBBEE50051545B /* UserDefaults+Extension.swift */; };
F8F5D0AA270800FD00D99D2E /* Xib.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8F5D0A9270800FD00D99D2E /* Xib.swift */; };
F8FC438626C01CDD0033E151 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8FC438526C01CDD0033E151 /* AppDelegate.swift */; };
F8FC438826C01CDD0033E151 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8FC438726C01CDD0033E151 /* SceneDelegate.swift */; };
Expand Down Expand Up @@ -489,6 +491,7 @@
F8F00C3A29DD483000A15377 /* UpdateUserInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UpdateUserInfo.swift; sourceTree = "<group>"; };
F8F00C3D29DD489200A15377 /* UpdateAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UpdateAPI.swift; sourceTree = "<group>"; };
F8F00C4029DD48A000A15377 /* UpdateService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UpdateService.swift; sourceTree = "<group>"; };
F8F0ACB42A0CAC7C001B8266 /* WidgetsExtension.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = WidgetsExtension.entitlements; sourceTree = "<group>"; };
F8F5D0A9270800FD00D99D2E /* Xib.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Xib.swift; sourceTree = "<group>"; };
F8FC438226C01CDD0033E151 /* NADA-iOS-forRelease.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "NADA-iOS-forRelease.app"; sourceTree = BUILT_PRODUCTS_DIR; };
F8FC438526C01CDD0033E151 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1014,6 +1017,7 @@
F838B663298E5C5300D84340 /* Widgets */ = {
isa = PBXGroup;
children = (
F8F0ACB42A0CAC7C001B8266 /* WidgetsExtension.entitlements */,
F87D2220298EA5E5001A882B /* Resource */,
F87D2249298ECBEA001A882B /* WidgetsBundle */,
);
Expand Down Expand Up @@ -1777,8 +1781,10 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F8F0ACB22A0BB909001B8266 /* GenericResponse.swift in Sources */,
F8BCDD24298FFA940044D0B4 /* OpenAppLockScreenWidget.swift in Sources */,
F8BCDD27298FFB280044D0B4 /* Color+Extension.swift in Sources */,
F8F0ACB32A0BB916001B8266 /* UserDefaults+Extension.swift in Sources */,
F838B66E298E5C5400D84340 /* Widgets.intentdefinition in Sources */,
F838B667298E5C5300D84340 /* WidgetsLiveActivity.swift in Sources */,
F8BCDD25298FFAF90044D0B4 /* WidgetsBundle.swift in Sources */,
Expand Down Expand Up @@ -1997,6 +2003,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CODE_SIGN_ENTITLEMENTS = Widgets/WidgetsExtension.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
Expand All @@ -2007,7 +2014,7 @@
INFOPLIST_FILE = Widgets/Resource/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = Widgets;
INFOPLIST_KEY_NSHumanReadableCopyright = "";
IPHONEOS_DEPLOYMENT_TARGET = 16.2;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -2031,6 +2038,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CODE_SIGN_ENTITLEMENTS = Widgets/WidgetsExtension.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
Expand All @@ -2041,7 +2049,7 @@
INFOPLIST_FILE = Widgets/Resource/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = Widgets;
INFOPLIST_KEY_NSHumanReadableCopyright = "";
IPHONEOS_DEPLOYMENT_TARGET = 16.2;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -2073,7 +2081,7 @@
INFOPLIST_FILE = IntentsExtensionUI/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = IntentsExtensionUI;
INFOPLIST_KEY_NSHumanReadableCopyright = "";
IPHONEOS_DEPLOYMENT_TARGET = 16.2;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -2105,7 +2113,7 @@
INFOPLIST_FILE = IntentsExtensionUI/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = IntentsExtensionUI;
INFOPLIST_KEY_NSHumanReadableCopyright = "";
IPHONEOS_DEPLOYMENT_TARGET = 16.2;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -2138,7 +2146,7 @@
INFOPLIST_FILE = IntentsExtension/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = IntentsExtension;
INFOPLIST_KEY_NSHumanReadableCopyright = "";
IPHONEOS_DEPLOYMENT_TARGET = 16.2;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -2171,7 +2179,7 @@
INFOPLIST_FILE = IntentsExtension/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = IntentsExtension;
INFOPLIST_KEY_NSHumanReadableCopyright = "";
IPHONEOS_DEPLOYMENT_TARGET = 16.2;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -2318,10 +2326,11 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = T3VFJ764ZC;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = T3VFJ764ZC;
INFOPLIST_FILE = "NADA-iOS-forRelease/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -2347,10 +2356,11 @@
CODE_SIGN_IDENTITY = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = T3VFJ764ZC;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = T3VFJ764ZC;
INFOPLIST_FILE = "NADA-iOS-forRelease/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down
4 changes: 0 additions & 4 deletions NADA-iOS-forRelease/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@
</dict>
<key>NSCameraUsageDescription</key>
<string>QR코드를 인식하여 명함을 추가하기 위해 카메라 권한 허용이 필요해요.</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>"사용자의 위치를 받아오려고 합니다."</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>"사용자의 위치를 받아오려고 합니다."</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>명함을 이미지로 저장하기 위해 갤러리 권한 허용이 필요해요.</string>
<key>NSPhotoLibraryUsageDescription</key>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"images" : [
{
"filename" : "iconShare.png",
"idiom" : "universal",
"scale" : "1x"
"scale" : "1x",
"filename" : "iconShare.png"
},
{
"filename" : "iconShare@2x.png",
"scale" : "2x",
"idiom" : "universal",
"scale" : "2x"
"filename" : "iconShare@2x.png"
},
{
"filename" : "iconShare@3x.png",
"idiom" : "universal",
"scale" : "3x"
"scale" : "3x",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
"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.
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.
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/Notification.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ extension Notification.Name {
static let scrollToFirstIndex = Notification.Name("scrollToFirstIndex")
static let presentMail = Notification.Name("presentMail")
static let presentDynamicLink = Notification.Name("presentDynamicLink")
static let backToHome = Notification.Name("backToHome")
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
import Foundation

struct CardAddInGroupRequest: Codable {
var cardGroupName: String?
var cardGroupName: String
var cardUUID: String
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,22 @@ import Lottie

// MARK: - HarmonyResponse
struct HarmonyResponse: Codable {
let harmony: Int
let mbtiGrade: Double
let constellationGrade: Double
let totalGrade: Double

enum CodingKeys: String, CodingKey {
case harmony
case mbtiGrade
case constellationGrade
case totalGrade
}
}

struct HarmonyData {
let lottie: Int
let score: Double
let mbtiGrade: Double
let constellationGrade: Double
let totalGrade: Double
let color: UIColor
let description: String
let cardtype: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,11 @@ public class GroupAPI {

switch statusCode {
case 200:
return .success(decodedData.data ?? "None-Data")
if decodedData.status == 400 {
return .requestErr(decodedData.message ?? "error message")
} else {
return .success(decodedData.data ?? "None-Data")
}
case 400..<500:
return .requestErr(decodedData.message ?? "error message")
case 500:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class UtilAPI {
let statusCode = response.statusCode
let data = response.data

let networkResult = self.judgeStatus(by: statusCode, data: data, type: Double.self)
let networkResult = self.judgeStatus(by: statusCode, data: data, type: HarmonyResponse.self)
completion(networkResult)

case .failure(let err):
Expand Down
30 changes: 16 additions & 14 deletions NADA-iOS-forRelease/Sources/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -101,21 +101,23 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
}
} else if url.absoluteString.starts(with: myCardURL) {
// 내 명함 위젯.
guard let queryItems = urlComponents.queryItems,
let cardUUID = queryItems.filter({ $0.name == "cardUUID" }).first?.value else { return }

let nextVC = CardShareBottomSheetViewController()
.setTitle("명함공유")
.setHeight(606.0)

cardDetailFetchWithAPI(cardUUID: cardUUID) { cardDataModel in
nextVC.isActivate = false
nextVC.modalPresentationStyle = .overFullScreen
nextVC.cardDataModel = cardDataModel
if UserDefaults.appGroup.string(forKey: Const.UserDefaultsKey.accessToken) != nil {
guard let queryItems = urlComponents.queryItems,
let cardUUID = queryItems.filter({ $0.name == "cardUUID" }).first?.value else { return }

DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.5) {
let topVC = UIApplication.mostTopViewController()
topVC?.present(nextVC, animated: true)
let nextVC = CardShareBottomSheetViewController()
.setTitle("명함공유")
.setHeight(606.0)

cardDetailFetchWithAPI(cardUUID: cardUUID) { cardDataModel in
nextVC.isActivate = false
nextVC.modalPresentationStyle = .overFullScreen
nextVC.cardDataModel = cardDataModel

DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.5) {
let topVC = UIApplication.mostTopViewController()
topVC?.present(nextVC, animated: true)
}
}
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ final class AroundMeViewController: UIViewController {
bindViewModels()
}

override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
NotificationCenter.default.post(name: .backToHome, object: nil, userInfo: nil)
}
}

extension AroundMeViewController {
Expand Down Expand Up @@ -115,17 +119,7 @@ extension AroundMeViewController {
private func setLocationManager() {
locationManager.delegate = self
locationManager.desiredAccuracy = kCLLocationAccuracyBest
locationManager.requestWhenInUseAuthorization()

DispatchQueue.global().async {
if CLLocationManager.locationServicesEnabled() {
print("location on")
self.locationManager.startUpdatingLocation()
print(self.locationManager.location?.coordinate)
} else {
print("location off")
}
}
locationManager.requestLocation()
}

private func setDelegate() {
Expand Down Expand Up @@ -239,6 +233,8 @@ extension AroundMeViewController {
print(cards)
if cards.isEmpty {
self.aroundMeCollectionView.isHidden = true
} else {
self.aroundMeCollectionView.isHidden = false
}
self.aroundMeCollectionView.reloadData()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ class ReceiveCardBottomSheetViewController: CommonBottomSheetViewController {
bindActions()
}

override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
NotificationCenter.default.post(name: .backToHome, object: nil, userInfo: nil)
}
}

extension ReceiveCardBottomSheetViewController {
Expand Down
Loading

0 comments on commit 1f8854e

Please sign in to comment.