Skip to content

Commit

Permalink
#26 [Add] layout 메서드 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
soletree committed Apr 11, 2024
1 parent f5d085f commit ca17455
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Score/Score/Extension/View+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

import SwiftUI

//MARK: - View+Feature

extension View {
//MARK: - hideKeyBoard

Expand All @@ -20,3 +22,24 @@ extension View {
}
}

//MARK: - View+UI

extension View {
//MARK: - layout
@ViewBuilder
func layout() -> some View{
padding(.horizontal, 24)
}

//MARK: - layoutOfCalendarItem

@ViewBuilder
func layoutOfCalendarItem() -> some View {
// 양쪽에 padding이 들어가므로 2배를 곱해줍니다.
let paddingHorizontal: CGFloat = CGFloat(Constants.Layout.horizontal.rawValue * 2)
frame(
width: (UIScreen.main.bounds.width - paddingHorizontal) / 7,
height: (UIScreen.main.bounds.width - paddingHorizontal) / 7
)
}
}

0 comments on commit ca17455

Please sign in to comment.