Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions src/Projects/BKDesign/PreviewApp/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?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>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>

<!-- 🖼 LaunchScreen -->
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>

<!-- 📱 iPhone만 지원 -->
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
</array>

<!-- 🎬 SceneDelegate 연결 -->
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneClassName</key>
<string>UIWindowScene</string>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>BKDesignPreviewApp.SceneDelegate</string>
</dict>
</array>
</dict>
</dict>

<!-- 👟 인터페이스 방향 -->
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>

<!-- 🔠 폰트 등록 -->
<key>UIAppFonts</key>
<array>
<string>Pretendard-Regular.otf</string>
<string>Pretendard-Medium.otf</string>
<string>Pretendard-SemiBold.otf</string>
<string>Pretendard-Bold.otf</string>
</array>
</dict>
</plist>
30 changes: 30 additions & 0 deletions src/Projects/BKDesign/PreviewApp/Resources/LaunchScreen.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17150" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17122"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="s0d-6b-0kx">
<objects>
<viewController id="Y6W-OH-hqX" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="5EZ-qb-Rvc">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<viewLayoutGuide key="safeArea" id="vDu-zF-Fre"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Ief-a0-LHa" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
<resources>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
23 changes: 23 additions & 0 deletions src/Projects/BKDesign/PreviewApp/Sources/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright © 2025 Booket. All rights reserved

import UIKit
Comment on lines +1 to +3
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PreviewApp은 머지하기 전에 지우실거죠 ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

엇 아뇨! 디자인시스템 테스트하는 용도로 남겨두려고 했습니다. 원래 모듈화했을 때, 각 모듈에 테스트앱 달아서 화면 테스트 빨리 해볼 수 있는 것도 장점이어서 이를 활용하면 좋을 것 같아요.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확인했습니다 ~


@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
return true
}

// MARK: UISceneSession Lifecycle

func application(
_ application: UIApplication,
configurationForConnecting connectingSceneSession: UISceneSession,
options: UIScene.ConnectionOptions
) -> UISceneConfiguration {
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}
}
24 changes: 24 additions & 0 deletions src/Projects/BKDesign/PreviewApp/Sources/SceneDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Copyright © 2025 Booket. All rights reserved

import BKDesign
import UIKit

class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?

func scene(
_ scene: UIScene,
willConnectTo session: UISceneSession,
options connectionOptions: UIScene.ConnectionOptions
) {
guard let windowScene = scene as? UIWindowScene else { return }

let window = UIWindow(windowScene: windowScene)
let viewController = BKButtonTestViewController()
// let viewController = BKButtonGroupDemoViewController()
window.rootViewController = UINavigationController(rootViewController: viewController)
window.makeKeyAndVisible()

self.window = window
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
// Copyright © 2025 Booket. All rights reserved

import BKDesign
import SnapKit
import UIKit

public final class BKButtonGroupDemoViewController: UIViewController {

private let scrollView = UIScrollView()
private let containerView = UIStackView()

public override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .white
setupScrollView()
setupDemoGroups()
}

private func setupScrollView() {
view.addSubview(scrollView)
scrollView.snp.makeConstraints { $0.edges.equalToSuperview() }

scrollView.addSubview(containerView)
containerView.axis = .vertical
containerView.spacing = 16
containerView.alignment = .fill
containerView.distribution = .fill
containerView.snp.makeConstraints {
$0.edges.equalToSuperview().inset(20)
$0.width.equalToSuperview().inset(20)
}
}

private func setupDemoGroups() {
addSection(title: "Custom 구성 (직접 만든 그룹)")
containerView.addArrangedSubview(BKButtonGroup(
buttons: [
makeButton(title: "[Custom] S", size: .small),
makeButton(title: "[Custom] M", size: .medium),
makeButton(title: "[Custom] L", size: .large)
],
layout: .horizontal
))

addDivider()

addSection(title: "TwoButtonGroup")
containerView.addArrangedSubview(BKButtonGroup.twoButtonGroup(
leftTitle: "취소", rightTitle: "확인",
leftAction: { print("취소 tapped") },
rightAction: { print("확인 tapped") }
))

addDivider()

addSection(title: "ThreeButtonGroup")
containerView.addArrangedSubview(BKButtonGroup.threeButtonGroup(
leftTitle: "이전", centerTitle: "중간", rightTitle: "다음",
leftAction: { print("이전 tapped") },
centerAction: { print("중간 tapped") },
rightAction: { print("다음 tapped") }
))

addDivider()

addSection(title: "SingleFullButton")
containerView.addArrangedSubview(BKButtonGroup.singleFullButton(
title: "계속하기",
action: { print("계속하기 tapped") }
))

addDivider()

addSection(title: "VerticalGroup (Rounded 버튼)")
containerView.addArrangedSubview(BKButtonGroup.verticalButtonGroup(buttons: [
makeButton(title: "둥글1", size: .rounded),
makeButton(title: "둥글2", size: .rounded)
]))
}

private func makeButton(title: String, size: BKButtonSize) -> BKButton {
let button = BKButton.primary(title: title, size: size)
button.addAction(UIAction { _ in
print("Tapped: \(title)")
}, for: .touchUpInside)
return button
}

private func addSection(title: String) {
let label = UILabel()
label.text = title
label.font = UIFont.systemFont(ofSize: 14, weight: .bold)
label.textColor = .darkGray
containerView.addArrangedSubview(label)
}

private func addDivider() {
let divider = UIView()
divider.backgroundColor = UIColor.lightGray.withAlphaComponent(0.4)
divider.snp.makeConstraints { make in
make.height.equalTo(1)
}
containerView.addArrangedSubview(divider)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
// Copyright © 2025 Booket. All rights reserved

import BKDesign
import SnapKit
import UIKit

public final class BKButtonTestViewController: UIViewController {

// MARK: - UI Components
private let scrollView = UIScrollView()
private let containerView = UIStackView()

// MARK: - Lifecycle

public override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .white
setupScrollView()
// setupIndependentButtons()
setupStackView()
}

public override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
setupAllTestButtons()
}

// MARK: - Setup Scroll & Stack

private func setupScrollView() {
view.addSubview(scrollView)
scrollView.snp.makeConstraints { $0.edges.equalToSuperview() }

scrollView.addSubview(containerView)
containerView.snp.makeConstraints {
$0.edges.equalToSuperview().inset(20)
$0.width.equalToSuperview().inset(20)
}
}

private func setupStackView() {
containerView.axis = .vertical
containerView.spacing = 16
containerView.alignment = .fill
containerView.distribution = .equalSpacing
}

// MARK: - Setup Buttons by Size

private func setupAllTestButtons() {
setupButtons(for: .large)
setupButtons(for: .medium)
setupButtons(for: .small)
setupButtons(for: .rounded)
}

private func setupButtons(for size: BKButtonSize) {
addButton("Primary", style: .primary, size: size)
addButton("Secondary", style: .secondary, size: size)
addButton("Tertiary", style: .tertiary, size: size)

addIconButton("Apple 로그인", style: .primary, size: size, left: .appleLogo)
addIconButton("카카오 로그인", style: .primary, size: size, right: .kakaoLogo)
addIconButton("양쪽 아이콘", style: .primary, size: size, left: .appleLogo, right: .kakaoLogo)
}

// MARK: - Button Builders

private func addButton(_ title: String, style: BKButtonStyle, size: BKButtonSize) {
let button = BKButton(style: style, size: size)
button.title = "[\(size.label)] \(title)"
containerView.addArrangedSubview(button)
}

private func addIconButton(
_ title: String,
style: BKButtonStyle,
size: BKButtonSize,
left: BKIcon? = nil,
right: BKIcon? = nil
) {
let button = BKButton(style: style, size: size)
button.title = "[\(size.label)] \(title)"
button.leftIcon = left?.image
button.rightIcon = right?.image
containerView.addArrangedSubview(button)
}

private func setupIndependentButtons() {
let sampleView = UIView()
scrollView.addSubview(sampleView)
sampleView.snp.makeConstraints {
$0.top.equalTo(containerView.snp.bottom).offset(40)
$0.centerX.equalToSuperview()
$0.bottom.lessThanOrEqualToSuperview()
}

let buttons: [BKButton] = [
.primary(title: "[Free] Apple 로그인", size: .large),
.secondary(title: "[Free] Secondary", size: .large),
.tertiary(title: "[Free] Tertiary", size: .large),
.primary(title: "[Free] Apple 로그인", size: .medium),
.secondary(title: "[Free] Secondary", size: .small),
.tertiary(title: "[Free] Tertiary", size: .rounded)
]

buttons[0].leftIcon = BKIcon.appleLogo.image
buttons[2].rightIcon = BKIcon.kakaoLogo.image

var last: UIView?
for button in buttons {
sampleView.addSubview(button)
button.snp.makeConstraints {
$0.centerX.equalToSuperview()
$0.top.equalTo(last?.snp.bottom ?? sampleView.snp.top).offset(16)
}
last = button
}
}

}


public extension BKButtonSize {
var label: String {
switch self {
case .large: return "Large"
case .medium: return "Medium"
case .small: return "Small"
case .rounded: return "Rounded"
}
}
}
Comment thread
doyeonk429 marked this conversation as resolved.
Loading