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

fix: 기본 카메라로 명함 추가 불가 해결 (#509) #510

Merged
merged 8 commits into from
May 9, 2023
5 changes: 2 additions & 3 deletions IntentsExtension/IntentHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ extension IntentHandler {
guard let url = URL(string: "http://3.35.107.3:8080/api/v1/card") else { return }
var urlRequest = URLRequest(url: url)
urlRequest.httpMethod = "GET"
urlRequest.addValue("Bearer \(UserDefaults.appGroup.string(forKey: "accessToken") ?? "")", forHTTPHeaderField: "Authorization")
print("😀", UserDefaults.appGroup.string(forKey: "accessToken") ?? "")
urlRequest.addValue("Bearer \(UserDefaults.appGroup.string(forKey: "AccessToken") ?? "")", forHTTPHeaderField: "Authorization")

URLSession.shared.dataTask(with: urlRequest) { data, response, error in
guard let status = (response as? HTTPURLResponse)?.statusCode else { return }
Expand All @@ -108,7 +107,7 @@ extension IntentHandler {
} else {
if let result {
if result.status != 200 {
completion(.failure(WidgetError.networkFail(status: status,
completion(.failure(WidgetError.networkFail(status: result.status,
code: result.code ?? "none code",
message: result.message ?? "none message")))
} else {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "imgCardBg01.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "imgCardBg01@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "imgCardBg01@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "imgCardBg02.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "imgCardBg02@2x.png",
"scale" : "2x",
"idiom" : "universal"
"idiom" : "universal",
"scale" : "2x"
},
{
"scale" : "3x",
"filename" : "imgCardBg02@3x.png",
"idiom" : "universal",
"filename" : "imgCardBg02@3x.png"
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@
"images" : [
{
"filename" : "imgCardBg03.png",
"scale" : "1x",
"idiom" : "universal"
"idiom" : "universal",
"scale" : "1x"
},
{
"scale" : "2x",
"filename" : "imgCardBg03@2x.png",
"idiom" : "universal",
"filename" : "imgCardBg03@2x.png"
"scale" : "2x"
},
{
"scale" : "3x",
"filename" : "imgCardBg03@3x.png",
"idiom" : "universal",
"filename" : "imgCardBg03@3x.png"
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"images" : [
{
"filename" : "imgCardBg04.png",
"idiom" : "universal",
"scale" : "1x",
"filename" : "imgCardBg04.png"
"scale" : "1x"
},
{
"scale" : "2x",
"filename" : "imgCardBg04@2x.png",
"idiom" : "universal",
"filename" : "imgCardBg04@2x.png"
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "imgCardBg04@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "imgCardBg05@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"scale" : "3x",
"filename" : "imgCardBg05@3x.png",
"idiom" : "universal",
"filename" : "imgCardBg05@3x.png"
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
"scale" : "1x"
},
{
"filename" : "imgCardBg06@2x.png",
"idiom" : "universal",
"scale" : "2x",
"filename" : "imgCardBg06@2x.png"
"scale" : "2x"
},
{
"scale" : "3x",
"filename" : "imgCardBg06@3x.png",
"idiom" : "universal"
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"images" : [
{
"scale" : "1x",
"filename" : "imgCardBg07.png",
"idiom" : "universal",
"filename" : "imgCardBg07.png"
"scale" : "1x"
},
{
"filename" : "imgCardBg07@2x.png",
"scale" : "2x",
"idiom" : "universal"
"idiom" : "universal",
"scale" : "2x"
},
{
"scale" : "3x",
"filename" : "imgCardBg07@3x.png",
"idiom" : "universal",
"filename" : "imgCardBg07@3x.png"
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
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 @@ -98,7 +98,7 @@ class AddGroupBottomSheetViewController: CommonBottomSheetViewController, UIText
let safeAreaHeight = view.safeAreaLayoutGuide.layoutFrame.height
let bottomPadding = view.safeAreaInsets.bottom
bottomSheetViewTopConstraint?.constant = safeAreaHeight + bottomPadding
UIView.animate(withDuration: 0.5, delay: 0, options: .curveEaseOut, animations: {
UIView.animate(withDuration: 0.2, delay: 0, options: .curveEaseOut, animations: {
self.dimmedBackView.alpha = 0.0
self.view.layoutIfNeeded()
self.bottomSheetCoverView.isHidden = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class CommonBottomSheetViewController: UIViewController {

// bottomSheet가 view의 상단에서 떨어진 거리
private var bottomSheetViewTopConstraint: NSLayoutConstraint!
private var hideAnimationDuration: Float = 0.2

// 기존 화면을 흐려지게 만들기 위한 뷰
let dimmedBackView: UIView = {
Expand Down Expand Up @@ -176,12 +177,17 @@ class CommonBottomSheetViewController: UIViewController {
})
}

// 바텀 시트 사라지는 속도 조절
func setHideAnimationDuration(_ duration: Float) {
self.hideAnimationDuration = duration
}

// 바텀 시트 사라지는 애니메이션
func hideBottomSheetAndGoBack() {
let safeAreaHeight = view.safeAreaLayoutGuide.layoutFrame.height
let bottomPadding = view.safeAreaInsets.bottom
bottomSheetViewTopConstraint.constant = safeAreaHeight + bottomPadding
UIView.animate(withDuration: 0.5, delay: 0, options: .curveEaseOut, animations: {
UIView.animate(withDuration: TimeInterval(hideAnimationDuration), delay: 0, options: .curveEaseOut, animations: {
self.dimmedBackView.alpha = 0.0
self.view.layoutIfNeeded()
self.bottomSheetCoverView.isHidden = false
Expand All @@ -197,7 +203,7 @@ class CommonBottomSheetViewController: UIViewController {
let safeAreaHeight = view.safeAreaLayoutGuide.layoutFrame.height
let bottomPadding = view.safeAreaInsets.bottom
bottomSheetViewTopConstraint.constant = safeAreaHeight + bottomPadding
UIView.animate(withDuration: 0.2, delay: 0, options: .curveEaseOut, animations: {
UIView.animate(withDuration: TimeInterval(hideAnimationDuration), delay: 0, options: .curveEaseOut, animations: {
self.dimmedBackView.alpha = 0.0
self.view.layoutIfNeeded()
self.bottomSheetCoverView.isHidden = false
Expand All @@ -217,7 +223,7 @@ class CommonBottomSheetViewController: UIViewController {
let safeAreaHeight = view.safeAreaLayoutGuide.layoutFrame.height
let bottomPadding = view.safeAreaInsets.bottom
bottomSheetViewTopConstraint.constant = safeAreaHeight + bottomPadding
UIView.animate(withDuration: 0.2, delay: 0, options: .curveEaseOut, animations: {
UIView.animate(withDuration: TimeInterval(hideAnimationDuration), delay: 0, options: .curveEaseOut, animations: {
self.dimmedBackView.alpha = 0.0
self.view.layoutIfNeeded()
self.bottomSheetCoverView.isHidden = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import UIKit
class FirstCardAlertBottomSheetViewController: CommonBottomSheetViewController {

// MARK: - Properties

private var bottomSheetViewTopConstraint: NSLayoutConstraint?

private let cardImageView: UIImageView = {
let imageView = UIImageView()
Expand Down Expand Up @@ -71,6 +73,7 @@ class FirstCardAlertBottomSheetViewController: CommonBottomSheetViewController {
super.viewDidLoad()

setupUI()
setHideAnimationDuration(0.5)
}

// MARK: - Methods
Expand All @@ -94,8 +97,7 @@ class FirstCardAlertBottomSheetViewController: CommonBottomSheetViewController {
cardImageView.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
cardImageView.topAnchor.constraint(equalTo: titleLabel.bottomAnchor, constant: 16),
cardImageView.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 70),
cardImageView.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -70)
cardImageView.centerXAnchor.constraint(equalTo: self.view.centerXAnchor)
])

bgView.translatesAutoresizingMaskIntoConstraints = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class GroupNameEditBottomSheetViewController: CommonBottomSheetViewController, U
let safeAreaHeight = view.safeAreaLayoutGuide.layoutFrame.height
let bottomPadding = view.safeAreaInsets.bottom
bottomSheetViewTopConstraint?.constant = safeAreaHeight + bottomPadding
UIView.animate(withDuration: 0.5, delay: 0, options: .curveEaseOut, animations: {
UIView.animate(withDuration: 0.2, delay: 0, options: .curveEaseOut, animations: {
self.dimmedBackView.alpha = 0.0
self.view.layoutIfNeeded()
self.bottomSheetCoverView.isHidden = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ extension TabBarViewController {
}
}
private func cardAddInGroupWithAPI(cardUUID: String, completion: @escaping () -> Void) {
GroupAPI.shared.cardAddInGroup(cardRequest: CardAddInGroupRequest(cardGroupName: nil, cardUUID: cardUUID)) { response in
GroupAPI.shared.cardAddInGroup(cardRequest: CardAddInGroupRequest(cardGroupName: "미분류", cardUUID: cardUUID)) { response in
switch response {
case .success:
completion()
Expand Down