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

[#19] HandySwitch 생성 #23

Merged
merged 32 commits into from
Nov 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
d245e36
[#19] Switch 코드 변경
LeeJoEun-01 Oct 9, 2024
ab4401c
Chip
jysuhr Jul 29, 2024
7eef050
[#8] chipViewController 생성
jysuhr Aug 1, 2024
42abcf5
[#8] ViewDidLoad 삭제
jysuhr Aug 12, 2024
c8ea0e1
[#8] SnapKit으로 정리, icon추가
jysuhr Aug 20, 2024
7b1b436
[#8] icon추가, 주석 정리
jysuhr Aug 20, 2024
7692c58
[#8] icon 색상 지정
jysuhr Sep 3, 2024
1dc9ff3
ChipViewController SnapKit 문법 수정
jysuhr Sep 7, 2024
5c05a43
[#8] rebase conflict 및 package 에러 해결
LeeJoEun-01 Oct 9, 2024
7cf0deb
[#18] HandyDivider 생성 (#22)
jysuhr Oct 9, 2024
44b5b19
[#6] HandyCheckBox 생성
hye0njuoo Jul 24, 2024
76d11c3
[#6] HandyCheckBox 테스트 추가
hye0njuoo Jul 26, 2024
0a00f67
[#6] checkBox ConfigurationButton으로 변경
hye0njuoo Jul 27, 2024
68e50f7
[#6] HandyRadioButton 추가
hye0njuoo Jul 27, 2024
8cb892a
[#6] HandyCheckBox 생성
hye0njuoo Jul 24, 2024
3119c08
[#6] testViewController 수정
hye0njuoo Jul 27, 2024
167a7ac
[#6] checkBox, radioButton tintColor 커스텀 추가
hye0njuoo Aug 7, 2024
f86e3be
[#6]NON_ISSUE conflict resolve
hye0njuoo Oct 9, 2024
cd77bb5
[#19] Switch 코드 변경
LeeJoEun-01 Oct 9, 2024
4a9621b
Merge remote-tracking branch 'origin/feature/#19' into feature/#19
LeeJoEun-01 Oct 22, 2024
1deadb4
[#19] 코드리뷰 반영
LeeJoEun-01 Oct 22, 2024
6f8b8cf
[#24] Snackbar Info 타입 제작
LeeJoEun-01 Oct 25, 2024
149ce32
[#24] Handy 기본 아이콘 24개 추가
LeeJoEun-01 Nov 1, 2024
efc482f
[#24] Snackbar Error 타입 제작
LeeJoEun-01 Nov 2, 2024
55a2b3b
[#24] Radius 단위 CGFloat로 변환
LeeJoEun-01 Nov 2, 2024
7e2d985
[#24] Error 타입 레이아웃 수정 및 버튼 액션 추가
LeeJoEun-01 Nov 2, 2024
cc31b77
[#24] Snackbar Swipe Gesture 추가
LeeJoEun-01 Nov 3, 2024
0c43108
[#24] 코드리뷰 반영
LeeJoEun-01 Nov 8, 2024
80cf82c
[#24] 코드리뷰 반영 2
LeeJoEun-01 Nov 8, 2024
6ef61a1
[#19] Switch 코드 변경
LeeJoEun-01 Oct 9, 2024
edb4481
[#19] 코드리뷰 반영
LeeJoEun-01 Oct 22, 2024
105c5f3
Merge remote-tracking branch 'origin/feature/#19' into feature/#19
LeeJoEun-01 Nov 9, 2024
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "icClose.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"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
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "icInfoCircle.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"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.
54 changes: 54 additions & 0 deletions Handy/Handy-Storybook/Atom/CheckBoxViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
//
// CheckBoxViewController.swift
// Handy-Storybook
//
// Created by 성현주 on 7/26/24.
//

import Handy

final class CheckBoxViewController: BaseViewController {

let checkBox: HandyCheckBox = {
let checkBox = HandyCheckBox()
checkBox.setTintColor = .red
return checkBox
}()

let textCheckBox: HandyCheckBox = {
let checkBox = HandyCheckBox()
checkBox.text = "HandyCheckBox"
return checkBox
}()

let disabledCheckBox: HandyCheckBox = {
let checkBox = HandyCheckBox()
checkBox.isDisabled = true
return checkBox
}()

override func viewDidLoad() {
super.viewDidLoad()
}

override func setViewHierarchies() {
[checkBox, textCheckBox, disabledCheckBox].forEach {
view.addSubview($0)
}
}

override func setViewLayouts() {
checkBox.snp.makeConstraints {
$0.center.equalToSuperview()
}
textCheckBox.snp.makeConstraints {
$0.top.equalTo(checkBox.snp.bottom).offset(16)
$0.centerX.equalToSuperview()
}
disabledCheckBox.snp.makeConstraints {
$0.top.equalTo(textCheckBox.snp.bottom).offset(16)
$0.centerX.equalToSuperview()
}
}
}

143 changes: 143 additions & 0 deletions Handy/Handy-Storybook/Atom/ChipViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
//
// ChipViewController.swift
// Handy-Storybook
//
// Created by 서준영 on 7/29/24.
//

import UIKit
import Handy
import SnapKit

class ChipViewController: BaseViewController {

//MARK: 프로퍼티 선언
let unTappedLargeChip: HandyChip = {
let chip = HandyChip()
chip.chipState = HandyChip.ChipState(type: .enabled)
chip.size = HandyChip.ChipSize(type: .large)
chip.isSelected = false
chip.text = "Label"
chip.leftIcon = UIImage(named: "icInfoCircle")
chip.rightIcon = UIImage(named: "icClose")
chip.addTarget(self, action: #selector(firstChip), for: .touchUpInside)
chip.translatesAutoresizingMaskIntoConstraints = false
return chip
}()

let unTappedSmallChip: HandyChip = {
let chip = HandyChip()
chip.chipState = HandyChip.ChipState(type: .enabled)
chip.size = HandyChip.ChipSize(type: .small)
chip.isSelected = false
chip.text = "Label"
chip.leftIcon = UIImage(named: "icInfoCircle")
chip.rightIcon = UIImage(named: "icClose")
chip.addTarget(self, action: #selector(secondChip), for: .touchUpInside)
chip.translatesAutoresizingMaskIntoConstraints = false
return chip
}()

let tappedLargeChip: HandyChip = {
let chip = HandyChip()
chip.chipState = HandyChip.ChipState(type: .enabled)
chip.size = HandyChip.ChipSize(type: .large)
chip.isSelected = true
chip.text = "Label"
chip.leftIcon = UIImage(named: "icInfoCircle")
chip.rightIcon = UIImage(named: "icClose")
chip.addTarget(self, action: #selector(thirdChip), for: .touchUpInside)
chip.translatesAutoresizingMaskIntoConstraints = false
return chip
}()

let tappedSmallChip: HandyChip = {
let chip = HandyChip()
chip.chipState = HandyChip.ChipState(type: .enabled)
chip.size = HandyChip.ChipSize(type: .small)
chip.isSelected = true
chip.text = "Label"
chip.leftIcon = UIImage(named: "icInfoCircle")
chip.rightIcon = UIImage(named: "icClose")
chip.addTarget(self, action: #selector(fourthChip), for: .touchUpInside)
chip.translatesAutoresizingMaskIntoConstraints = false
return chip
}()

let disabledLargeChip: HandyChip = {
let chip = HandyChip()
chip.chipState = HandyChip.ChipState(type: .disabled)
chip.size = HandyChip.ChipSize(type: .large)
chip.text = "Label"
chip.leftIcon = UIImage(named: "icInfoCircle")
chip.rightIcon = UIImage(named: "icClose")
chip.translatesAutoresizingMaskIntoConstraints = false
return chip
}()

let disabledSmallChip: HandyChip = {
let chip = HandyChip()
chip.chipState = HandyChip.ChipState(type: .disabled)
chip.size = HandyChip.ChipSize(type: .small)
chip.text = "Label"
chip.leftIcon = UIImage(named: "icInfoCircle")
chip.rightIcon = UIImage(named: "icClose")
chip.translatesAutoresizingMaskIntoConstraints = false
return chip
}()


//MARK: Chip 뷰에 추가
override func setViewHierarchies() {
view.addSubview(unTappedLargeChip)
view.addSubview(unTappedSmallChip)
view.addSubview(tappedLargeChip)
view.addSubview(tappedSmallChip)
view.addSubview(disabledLargeChip)
view.addSubview(disabledSmallChip)
}


//MARK: 레이아웃 배치
override func setViewLayouts() {
unTappedLargeChip.snp.makeConstraints {
$0.centerX.equalToSuperview()
$0.top.equalTo(view.safeAreaLayoutGuide.snp.top).offset(100)
}
unTappedSmallChip.snp.makeConstraints {
$0.centerX.equalToSuperview()
$0.top.equalTo(unTappedLargeChip.snp.bottom).offset(24)
}
tappedLargeChip.snp.makeConstraints {
$0.centerX.equalToSuperview()
$0.top.equalTo(unTappedSmallChip.snp.bottom).offset(51)
}
tappedSmallChip.snp.makeConstraints {
$0.centerX.equalToSuperview()
$0.top.equalTo(tappedLargeChip.snp.bottom).offset(24)
}
disabledLargeChip.snp.makeConstraints {
$0.centerX.equalToSuperview()
$0.top.equalTo(tappedSmallChip.snp.bottom).offset(51)
}
disabledSmallChip.snp.makeConstraints {
$0.centerX.equalToSuperview()
$0.top.equalTo(disabledLargeChip.snp.bottom).offset(24)
}
}


//MARK: Chip 작동 함수
@objc private func firstChip(_ sender: HandyChip) {
sender.isSelected.toggle()
}
@objc private func secondChip(_ sender: HandyChip) {
sender.isSelected.toggle()
}
@objc private func thirdChip(_ sender: HandyChip) {
sender.isSelected.toggle()
}
@objc private func fourthChip(_ sender: HandyChip) {
sender.isSelected.toggle()
}
}
74 changes: 74 additions & 0 deletions Handy/Handy-Storybook/Atom/DividerViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
//
// DividerViewController.swift
// Handy-Storybook
//
// Created by 서준영 on 9/15/24.
//

import Handy
import UIKit
import SnapKit

class DividerViewController: BaseViewController {

//MARK: - 프로퍼티 선언
let divider1: HandyDivider = {
let divider = HandyDivider()
divider.thickness = .thickness1
return divider
}()

let divider2: HandyDivider = {
let divider = HandyDivider()
divider.thickness = .thickness2
return divider
}()

let divider4: HandyDivider = {
let divider = HandyDivider()
divider.thickness = .thickness4
return divider
}()

let divider8: HandyDivider = {
let divider = HandyDivider()
divider.thickness = .thickness8
return divider
}()

//MARK: - 뷰에 추가
override func setViewHierarchies() {
self.view.backgroundColor = .black
self.view.addSubview(divider1)
self.view.addSubview(divider2)
self.view.addSubview(divider4)
self.view.addSubview(divider8)
}

//MARK: - 레이아웃 배치
override func setViewLayouts() {
divider1.snp.makeConstraints {
$0.width.equalTo(375)
$0.centerX.equalToSuperview()
$0.top.equalTo(self.view.snp.top).offset(300)
}

divider2.snp.makeConstraints {
$0.width.equalTo(375)
$0.centerX.equalToSuperview()
$0.top.equalTo(divider1.snp.bottom).offset(20)
}

divider4.snp.makeConstraints {
$0.width.equalTo(375)
$0.centerX.equalToSuperview()
$0.top.equalTo(divider2.snp.bottom).offset(20)
}

divider8.snp.makeConstraints {
$0.width.equalTo(375)
$0.centerX.equalToSuperview()
$0.top.equalTo(divider4.snp.bottom).offset(20)
}
}
}
59 changes: 59 additions & 0 deletions Handy/Handy-Storybook/Atom/HansySwitchViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
//
// HansySwitchViewController.swift
// Handy-Storybook
//
// Created by 이조은 on 9/18/24.
//

import Handy
import UIKit

final class HansySwitchViewController: BaseViewController {

private let switch1: HandySwitch = {
let uiSwitch = HandySwitch()
uiSwitch.size = .large
return uiSwitch
}()

private let switch2: HandySwitch = {
let uiSwitch = HandySwitch()
uiSwitch.size = .medium
uiSwitch.isOn = true
return uiSwitch
}()

private let switch3: HandySwitch = {
let uiSwitch = HandySwitch()
uiSwitch.size = .small
uiSwitch.isDisabled = true
return uiSwitch
}()

override func viewDidLoad() {
super.viewDidLoad()

self.view.backgroundColor = .white
}

override func setViewHierarchies() {
self.view.addSubview(switch1)
self.view.addSubview(switch2)
self.view.addSubview(switch3)
}

override func setViewLayouts() {
switch1.snp.makeConstraints {
$0.top.equalToSuperview().inset(100)
$0.leading.equalToSuperview().inset(20)
}
switch2.snp.makeConstraints {
$0.top.equalTo(switch1.snp.bottom).offset(36) // -4
$0.leading.equalToSuperview().inset(13) // -7
}
switch3.snp.makeConstraints {
$0.top.equalTo(switch2.snp.bottom).offset(28) // -12
$0.leading.equalToSuperview().inset(8) // -12
}
}
}
Loading