Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
HanGyeongjun committed Mar 14, 2023
2 parents 766a7ad + 2ecd61f commit 2434f6e
Show file tree
Hide file tree
Showing 55 changed files with 239 additions and 206 deletions.
8 changes: 4 additions & 4 deletions HappyAnding/HappyAnding.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1191,7 +1191,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.happyanding.HappyAnding;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = ShortcutsZipProfile_Dev_20230301;
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = ShortcutsZipProfile_Dev_20230308;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
Expand Down Expand Up @@ -1234,7 +1234,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.happyanding.HappyAnding;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = ShortcutsZipProfile_Dev_20230301;
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = ShortcutsZipProfile_Dev_20230308;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
Expand Down Expand Up @@ -1343,7 +1343,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.happyanding.HappyAnding.ShareExtension;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = ShortcutsZipShareExtProfile_Dev_20230301;
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = ShortcutsZipShareExtProfile_Dev_20230308;
SKIP_INSTALL = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
Expand Down Expand Up @@ -1375,7 +1375,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.happyanding.HappyAnding.ShareExtension;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = ShortcutsZipShareExtProfile_Dev_20230301;
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = ShortcutsZipShareExtProfile_Dev_20230308;
SKIP_INSTALL = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
Expand Down
18 changes: 9 additions & 9 deletions HappyAnding/HappyAnding/Extensions/UIFont+Extension.swift
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import SwiftUI

extension UIFont {
static var LargeTitle = UIFont.systemFont(ofSize: 26, weight: .heavy)
static var Title1 = UIFont.systemFont(ofSize: 22, weight: .bold)
static var Title2 = UIFont.systemFont(ofSize: 20, weight: .bold)
static var Headline = UIFont.systemFont(ofSize: 17, weight: .bold)
static var Body1 = UIFont.systemFont(ofSize: 17, weight: .regular)
static var Body2 = UIFont.systemFont(ofSize: 15, weight: .regular)
static var Subtitle = UIFont.systemFont(ofSize: 15, weight: .heavy)
static var Footnote = UIFont.systemFont(ofSize: 13, weight: .regular)
static var Sb = UIFont.systemFont(ofSize: 15, weight: .semibold)
static var shortcutsZipLargeTitle = UIFont.systemFont(ofSize: 26, weight: .heavy)
static var shortcutsZipTitle1 = UIFont.systemFont(ofSize: 22, weight: .bold)
static var shortcutsZipTitle2 = UIFont.systemFont(ofSize: 20, weight: .bold)
static var shortcutsZipHeadline = UIFont.systemFont(ofSize: 17, weight: .bold)
static var shortcutsZipBody1 = UIFont.systemFont(ofSize: 17, weight: .regular)
static var shortcutsZipBody2 = UIFont.systemFont(ofSize: 15, weight: .regular)
static var shortcutsZipSubtitle = UIFont.systemFont(ofSize: 15, weight: .heavy)
static var shortcutsZipFootnote = UIFont.systemFont(ofSize: 13, weight: .regular)
static var shortcutsZipSb = UIFont.systemFont(ofSize: 15, weight: .semibold)

static var mediumIcon = UIFont.systemFont(ofSize: 20, weight: .medium)
static var smallIcon = UIFont.systemFont(ofSize: 15, weight: .regular)
Expand Down
23 changes: 23 additions & 0 deletions HappyAnding/HappyAnding/Extensions/View/View+Navigation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,34 @@ extension View {
}
}

@ViewBuilder
func navigationLinkRouter<T: Hashable>(data: T, isPresented: Binding<Bool>) -> some View {
if #available(iOS 16.1, *) {
NavigationLink(value: data) {
self
}
} else {
NavigationLink(destination: getDestination(data: data, isPresented: isPresented)) {
self
}
}
}


/**
Naivagion View의 Destination 확인을 위해 필요한 View Builder입니다.
새로운 뷰가 추가되면, Stack에서 사용하는 데이터 타입과 목적지를 넣어주세요
*/
@ViewBuilder
func getDestination<T: Hashable>(data: T, isPresented: Binding<Bool>) -> some View {
switch data {
case is WriteCurationInfoType:
WriteCurationInfoView(data: data as! WriteCurationInfoType, isWriting: isPresented)
default:
EmptyView()
}
}

@ViewBuilder
func getDestination<T: Hashable>(data: T) -> some View {
switch data {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct NavigationBarColorModifier<Background>: ViewModifier where Background: Vi
appearance.configureWithOpaqueBackground()
appearance.backgroundColor = UIColor.clear
appearance.shadowColor = .clear
appearance.largeTitleTextAttributes = [.font : UIFont.LargeTitle, .foregroundColor: UIColor(.gray5)]
appearance.largeTitleTextAttributes = [.font : UIFont.shortcutsZipLargeTitle, .foregroundColor: UIColor(.gray5)]
//back button color 지정
let backItemAppearance = UIBarButtonItemAppearance()
backItemAppearance.normal.titleTextAttributes = [
Expand All @@ -51,7 +51,7 @@ struct NavigationBarColorModifier<Background>: ViewModifier where Background: Vi
scrollAppearance.configureWithDefaultBackground()
scrollAppearance.backgroundColor = UIColor(Color.shortcutsZipWhite)
scrollAppearance.shadowColor = .clear
scrollAppearance.largeTitleTextAttributes = [.font : UIFont.LargeTitle, .foregroundColor: UIColor(.gray5)]
scrollAppearance.largeTitleTextAttributes = [.font : UIFont.shortcutsZipLargeTitle, .foregroundColor: UIColor(.gray5)]
scrollAppearance.backButtonAppearance = backItemAppearance
scrollAppearance.setBackIndicatorImage(image, transitionMaskImage: image)

Expand Down
36 changes: 18 additions & 18 deletions HappyAnding/HappyAnding/Extensions/View/View+UIFont.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,32 @@ import SwiftUI

*/
extension View {
func LargeTitle() -> some View {
ModifiedContent(content: self, modifier: FontWithLineHeight(font: .LargeTitle, lineHeight: 38))
func shortcutsZipLargeTitle() -> some View {
ModifiedContent(content: self, modifier: FontWithLineHeight(font: .shortcutsZipLargeTitle, lineHeight: 38))
}
func Title1() -> some View {
ModifiedContent(content: self, modifier: FontWithLineHeight(font: .Title1, lineHeight: 32))
func shortcutsZipTitle1() -> some View {
ModifiedContent(content: self, modifier: FontWithLineHeight(font: .shortcutsZipTitle1, lineHeight: 32))
}
func Title2() -> some View {
ModifiedContent(content: self, modifier: FontWithLineHeight(font: .Title2, lineHeight: 28))
func shortcutsZipTitle2() -> some View {
ModifiedContent(content: self, modifier: FontWithLineHeight(font: .shortcutsZipTitle2, lineHeight: 28))
}
func Headline() -> some View {
ModifiedContent(content: self, modifier: FontWithLineHeight(font: .Headline, lineHeight: 22))
func shortcutsZipHeadline() -> some View {
ModifiedContent(content: self, modifier: FontWithLineHeight(font: .shortcutsZipHeadline, lineHeight: 22))
}
func Body1() -> some View {
ModifiedContent(content: self, modifier: FontWithLineHeight(font: .Body1, lineHeight: 22))
func shortcutsZipBody1() -> some View {
ModifiedContent(content: self, modifier: FontWithLineHeight(font: .shortcutsZipBody1, lineHeight: 22))
}
func Body2() -> some View {
ModifiedContent(content: self, modifier: FontWithLineHeight(font: .Body2, lineHeight: 20))
func shortcutsZipBody2() -> some View {
ModifiedContent(content: self, modifier: FontWithLineHeight(font: .shortcutsZipBody2, lineHeight: 20))
}
func Subtitle() -> some View {
ModifiedContent(content: self, modifier: FontWithLineHeight(font: .Subtitle, lineHeight: 20))
func shortcutsZipSubtitle() -> some View {
ModifiedContent(content: self, modifier: FontWithLineHeight(font: .shortcutsZipSubtitle, lineHeight: 20))
}
func Footnote() -> some View {
ModifiedContent(content: self, modifier: FontWithLineHeight(font: .Footnote, lineHeight: 18))
func shortcutsZipFootnote() -> some View {
ModifiedContent(content: self, modifier: FontWithLineHeight(font: .shortcutsZipFootnote, lineHeight: 18))
}
func Sb() -> some View {
ModifiedContent(content: self, modifier: FontWithLineHeight(font: .Sb, lineHeight: 20))
func shortcutsZipSb() -> some View {
ModifiedContent(content: self, modifier: FontWithLineHeight(font: .shortcutsZipSb, lineHeight: 20))
}

func mediumIcon() -> some View {
Expand Down
9 changes: 9 additions & 0 deletions HappyAnding/HappyAnding/Model/NavigationStackModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ struct NavigationListCategoryShortcutType: Identifiable, Hashable {
var navigationParentView: NavigationParentView
}

struct WriteCurationInfoType: Identifiable, Hashable {

var id = UUID().uuidString

var curation: Curation
var deletedShortcutCells: [ShortcutCellModel]
var isEdit: Bool
}

enum NavigationSearch: Hashable, Equatable {
case first
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ struct AdminCurationCell: View {
HStack(alignment: .bottom) {
VStack(alignment: .leading, spacing: 4) {
Text(adminCuration.title)
.Title1()
.shortcutsZipTitle1()
.foregroundColor(.textCuration)
.lineLimit(1)
Text(adminCuration.subtitle.replacingOccurrences(of: "\\n", with: "\n"))
.Body2()
.shortcutsZipBody2()
.foregroundColor(.textCuration)
.lineLimit(2)
.multilineTextAlignment(.leading)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ struct AnnouncementCell: View {

VStack(alignment: .leading, spacing: 4) {
Text(tagName)
.Footnote()
.shortcutsZipFootnote()
.fontWeight(.bold)
.foregroundColor(Color.tagText)
.frame(height: 20)
Expand All @@ -40,7 +40,7 @@ struct AnnouncementCell: View {
.strokeBorder(Color.shortcutsZipPrimary, lineWidth: 1))
)
Text(discription)
.Body2()
.shortcutsZipBody2()
.fontWeight(.semibold)
.foregroundColor(.gray5)
.lineLimit(1)
Expand All @@ -52,7 +52,7 @@ struct AnnouncementCell: View {
isAnnouncementShow = false
} label: {
Image(systemName: "xmark")
.Body1()
.shortcutsZipBody1()
.foregroundColor(.gray4)
.frame(width: 24, height: 24)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ struct CustomTextEditor: UIViewRepresentable {
func makeUIView(context: UIViewRepresentableContext<CustomTextEditor>) -> UITextView {
let textView = UITextView(frame: .zero)
textView.delegate = context.coordinator
textView.font = .Body2
textView.font = .shortcutsZipBody2
textView.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
textView.backgroundColor = UIColor(.shortcutsZipBackground)
return textView
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct GradeAlertView: View {
.disabled(true)

Text(isTextShowing ? TextLiteral.gradeAlertMessage : TextLiteral.gradeAlertMessageBlank)
.Title1()
.shortcutsZipTitle1()
.foregroundColor(.gray5)
.padding(.bottom, 60)
.disabled(isTextShowing)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct ListShortcutView: View {
if let shortcuts = data.shortcuts {
if shortcuts.count == 0 {
Text("아직 \(data.sectionType.rawValue)가 없어요")
.Body2()
.shortcutsZipBody2()
.foregroundColor(Color.gray4)
.frame(maxWidth: .infinity, maxHeight: .infinity)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct MoreCaptionTextView: View {

var body: some View {
Text(text)
.Footnote()
.shortcutsZipFootnote()
.foregroundColor(Color.gray4)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct MyShortcutCardView: View {
.foregroundColor(Color.textIcon)
.frame(width: 30.0, height: 30.0)
Text(myShortcutName)
.Subtitle()
.shortcutsZipSubtitle()
.multilineTextAlignment(.leading)
.foregroundColor(Color.textIcon)
.lineLimit(3)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ struct NicknameTextField: View {

if nicknameFocus == .focusError {
Text(nicknameError.message)
.Footnote()
.shortcutsZipFootnote()
.foregroundColor(.shortcutsZipError)
} else {
Text(TextLiteral.nicknameTextFieldSpace)
.Footnote()
.shortcutsZipFootnote()
.foregroundColor(.gray3)
}
}
Expand Down Expand Up @@ -117,7 +117,7 @@ struct NicknameTextField: View {
.textInputAutocapitalization(.never)
.focused($isFocused)
.frame(height: 52)
.Body2()
.shortcutsZipBody2()
.foregroundColor(.gray5)
.padding(.horizontal, 16)
.onAppear { UIApplication.shared.hideKeyboard() }
Expand Down Expand Up @@ -151,7 +151,7 @@ struct NicknameTextField: View {
.frame(width: 80, height: 52)

Text(TextLiteral.nicknameTextFieldDuplicateCheck)
.Body1()
.shortcutsZipBody1()
.foregroundColor(nicknameState != .none || nickname.isEmpty || initName == nickname ? .textButtonDisable : .textIcon)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct ShortcutCardCell: View {
Text(categoryShortcutName)
.multilineTextAlignment(.leading)
.lineLimit(2)
.Headline()
.shortcutsZipHeadline()
.foregroundColor(Color.textIcon)
Spacer()
}
Expand Down
6 changes: 3 additions & 3 deletions HappyAnding/HappyAnding/Views/Components/ShortcutCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,16 @@ struct ShortcutCell: View {
VStack(alignment: .leading, spacing: 0) {
if rankNumber != -1 {
Text("\(rankNumber)")
.Subtitle()
.shortcutsZipSubtitle()
.foregroundColor(.gray4)
.padding(0)
}
Text(shortcutCell.title)
.Headline()
.shortcutsZipHeadline()
.foregroundColor(.gray5)
.lineLimit(1)
Text(shortcutCell.subtitle.lineBreaking)
.Footnote()
.shortcutsZipFootnote()
.foregroundColor(.gray3)
.multilineTextAlignment(.leading)
.lineLimit(2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct SubtitleTextView: View {

var body: some View {
Text(text)
.Title2()
.shortcutsZipTitle2()
.foregroundColor(Color.gray5)
.frame(maxWidth: .infinity, alignment: .leading)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct UserCurationCell: View {
Image(systemName: "plus")
.smallIcon()
Text("\(shortcutsZipViewModel.userCurations[index].shortcuts.count-4)")
.Footnote()
.shortcutsZipFootnote()
}
.foregroundColor(.gray5)
}
Expand All @@ -60,11 +60,11 @@ struct UserCurationCell: View {
//MARK: - curation title, subtitle

Text(shortcutsZipViewModel.userCurations[index].title)
.Headline()
.shortcutsZipHeadline()
.foregroundColor(Color.gray5)
.frame(maxWidth: .infinity, alignment: .leading)
Text(shortcutsZipViewModel.userCurations[index].subtitle.lineBreaking)
.Body2()
.shortcutsZipBody2()
.multilineTextAlignment(.leading)
.lineLimit(lineLimit)
.foregroundColor(Color.gray5)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ struct UserCurationListView: View {
Image(systemName: "plus")
.mediumIcon()
Text(TextLiteral.userCurationListViewAdd)
.Headline()
.shortcutsZipHeadline()
}
.foregroundColor(.gray4)
.frame(maxWidth: .infinity)
Expand Down Expand Up @@ -71,13 +71,18 @@ struct UserCurationListView: View {
.fullScreenCover(isPresented: $isWriting) {
NavigationRouter(content: writeCurationView,
path: $writeCurationNavigation.navigationPath)
.environmentObject(writeCurationNavigation)
}
}

@ViewBuilder
private func writeCurationView() -> some View {
WriteCurationSetView(isWriting: $isWriting, isEdit: false)
.environmentObject(writeCurationNavigation)
WriteCurationSetView(isWriting: $isWriting
, isEdit: false
)
.navigationDestination(for: WriteCurationInfoType.self) { data in
WriteCurationInfoView(data: data, isWriting: $isWriting)
}
}
}

Loading

0 comments on commit 2434f6e

Please sign in to comment.