-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7b84518
commit 0345d0d
Showing
8 changed files
with
298 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// | ||
// HandyListViewController.swift | ||
// Handy-Storybook | ||
// | ||
// Created by 이조은 on 11/18/24. | ||
// | ||
|
||
import Handy | ||
|
||
final class HandyListViewController: BaseViewController { | ||
|
||
private var list: HandyList = HandyList() | ||
|
||
private var listItem1: HandyListItem = { | ||
let listItem = HandyListItem() | ||
listItem.title = "마이페이지" | ||
listItem.leadingIcon = .icUserLine | ||
listItem.trailingIcon = .icArrowsChevronRightLine | ||
return listItem | ||
}() | ||
|
||
private var listItem2: HandyListItem = { | ||
let listItem = HandyListItem() | ||
listItem.title = "비밀번호 변경" | ||
listItem.trailingIcon = .icArrowsChevronRightLine | ||
return listItem | ||
}() | ||
|
||
private var listItem3: HandyListItem = { | ||
let listItem = HandyListItem() | ||
listItem.title = "이용약관" | ||
return listItem | ||
}() | ||
|
||
|
||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
} | ||
|
||
override func setViewHierarchies() { | ||
list.addArrangedSubview(listItem1) | ||
|
||
self.view.addSubview(list) | ||
|
||
} | ||
|
||
override func setViewLayouts() { | ||
list.snp.makeConstraints { | ||
$0.top.equalToSuperview().inset(100) | ||
$0.leading.trailing.equalToSuperview() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// | ||
// HandyList.swift | ||
// Handy | ||
// | ||
// Created by 이조은 on 11/18/24. | ||
// | ||
|
||
import UIKit | ||
|
||
final public class HandyList: UIView { | ||
|
||
/** | ||
HandyList 요소들을 담는 StackView | ||
*/ | ||
|
||
private let stackView: UIStackView = { | ||
let stackView = UIStackView() | ||
stackView.axis = .vertical | ||
stackView.distribution = .fill | ||
stackView.spacing = 0 | ||
return stackView | ||
}() | ||
|
||
public init() { | ||
super.init(frame: .zero) | ||
|
||
setupView() | ||
} | ||
|
||
required init?(coder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
private func setupView() { | ||
setViewHierarchy() | ||
setAutolayout() | ||
} | ||
|
||
private func setViewHierarchy() { | ||
self.addSubview(stackView) | ||
} | ||
|
||
private func setAutolayout() { | ||
stackView.snp.makeConstraints { | ||
$0.edges.equalToSuperview() | ||
} | ||
} | ||
|
||
public func addArrangedSubview(_ views: UIView...) { | ||
for view in views { | ||
self.stackView.addArrangedSubview(view) | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.