diff --git a/Projects/DesignSystem/DesignKit/DesignKit/UITableViewCell/BaseTableViewCell.swift b/Projects/DesignSystem/DesignKit/DesignKit/UITableViewCell/BaseTableViewCell.swift index 0e8d6d5..e61ba3a 100644 --- a/Projects/DesignSystem/DesignKit/DesignKit/UITableViewCell/BaseTableViewCell.swift +++ b/Projects/DesignSystem/DesignKit/DesignKit/UITableViewCell/BaseTableViewCell.swift @@ -7,7 +7,7 @@ import UIKit -class BaseTableViewCell: UITableViewCell { +public class BaseTableViewCell: UITableViewCell { // MARK: - Init override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { @@ -24,7 +24,7 @@ class BaseTableViewCell: UITableViewCell { // MARK: - Func - override func prepareForReuse() { + public override func prepareForReuse() { super.prepareForReuse() reset() } diff --git a/Projects/DesignSystem/DesignKit/DesignKit/UITableViewCell/CodeTableViewCell.swift b/Projects/DesignSystem/DesignKit/DesignKit/UITableViewCell/CodeTableViewCell.swift index bcea71f..0f26e41 100644 --- a/Projects/DesignSystem/DesignKit/DesignKit/UITableViewCell/CodeTableViewCell.swift +++ b/Projects/DesignSystem/DesignKit/DesignKit/UITableViewCell/CodeTableViewCell.swift @@ -7,7 +7,10 @@ import UIKit -class CodeTableViewCell: BaseTableViewCell { +import SnapKit +import Extensions + +public final class CodeTableViewCell: BaseTableViewCell { // MARK: - UI private let codeLabel: UILabel = .init() @@ -20,14 +23,16 @@ class CodeTableViewCell: BaseTableViewCell { codeLabel.backgroundColor = .systemBackground codeLabel.text = Constants.CodeLabel.defaultText codeLabel.font = Constants.CodeLabel.font - codeLabel.layer.cornerRadius = Constants.CodeLabel.cornerRadius - codeLabel.clipsToBounds = true } override func setLayout() { super.setLayout() + contentView.addSubview(codeLabel) + codeLabel.snp.makeConstraints { make in + make.edges.equalToSuperview().inset(Constants.inset) + } } @@ -47,11 +52,11 @@ class CodeTableViewCell: BaseTableViewCell { private extension CodeTableViewCell { enum Constants { + static var inset: CGFloat { 10 } enum CodeLabel { - static var defaultText: String { "default" } + static var defaultText: String { "default Code" } static var font: UIFont { .systemFont(ofSize: 16) } - static var cornerRadius: CGFloat { 16 } } } diff --git a/Projects/DesignSystem/DesignKit/DesignKit/Views/BaseView.swift b/Projects/DesignSystem/DesignKit/DesignKit/Views/BaseView.swift index 2180f37..cf40124 100644 --- a/Projects/DesignSystem/DesignKit/DesignKit/Views/BaseView.swift +++ b/Projects/DesignSystem/DesignKit/DesignKit/Views/BaseView.swift @@ -7,7 +7,7 @@ import UIKit -class BaseView: UIView { +public class BaseView: UIView { // MARK: - Init override init(frame: CGRect) { diff --git a/Projects/DesignSystem/DesignKit/DesignKitDemoApp/AppDelegate.swift b/Projects/DesignSystem/DesignKit/DesignKitDemoApp/AppDelegate.swift index 74bf10d..6873a03 100644 --- a/Projects/DesignSystem/DesignKit/DesignKitDemoApp/AppDelegate.swift +++ b/Projects/DesignSystem/DesignKit/DesignKitDemoApp/AppDelegate.swift @@ -8,29 +8,4 @@ import UIKit @main -class AppDelegate: UIResponder, UIApplicationDelegate { - - - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - // Override point for customization after application launch. - return true - } - - // MARK: UISceneSession Lifecycle - - func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { - // Called when a new scene session is being created. - // Use this method to select a configuration to create the new scene with. - return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) - } - - func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { - // Called when the user discards a scene session. - // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. - // Use this method to release any resources that were specific to the discarded scenes, as they will not return. - } - - -} - +class AppDelegate: UIResponder, UIApplicationDelegate { } diff --git a/Projects/DesignSystem/DesignKit/DesignKitDemoApp/Info.plist b/Projects/DesignSystem/DesignKit/DesignKitDemoApp/Info.plist index dd3c9af..0eb786d 100644 --- a/Projects/DesignSystem/DesignKit/DesignKitDemoApp/Info.plist +++ b/Projects/DesignSystem/DesignKit/DesignKitDemoApp/Info.plist @@ -15,8 +15,6 @@ Default Configuration UISceneDelegateClassName $(PRODUCT_MODULE_NAME).SceneDelegate - UISceneStoryboardFile - Main diff --git a/Projects/DesignSystem/DesignKit/DesignKitDemoApp/SceneDelegate.swift b/Projects/DesignSystem/DesignKit/DesignKitDemoApp/SceneDelegate.swift index d76bc32..5a33715 100644 --- a/Projects/DesignSystem/DesignKit/DesignKitDemoApp/SceneDelegate.swift +++ b/Projects/DesignSystem/DesignKit/DesignKitDemoApp/SceneDelegate.swift @@ -18,7 +18,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { window = UIWindow(windowScene: windowScene) window?.backgroundColor = .systemBackground - window?.rootViewController = UIViewController() + window?.rootViewController = ViewController() window?.makeKeyAndVisible() } diff --git a/Projects/DesignSystem/DesignKit/DesignKitDemoApp/ViewController.swift b/Projects/DesignSystem/DesignKit/DesignKitDemoApp/ViewController.swift index a948ec2..3f2afcb 100644 --- a/Projects/DesignSystem/DesignKit/DesignKitDemoApp/ViewController.swift +++ b/Projects/DesignSystem/DesignKit/DesignKitDemoApp/ViewController.swift @@ -7,13 +7,44 @@ import UIKit +import SnapKit + +import DesignKit +import Extensions + final class ViewController: UIViewController { + + private let tableView = UITableView() + override func viewDidLoad() { super.viewDidLoad() + view.addSubview(tableView) + + tableView.register(CodeTableViewCell.self) + tableView.dataSource = self + + tableView.snp.makeConstraints { make in + make.edges.equalToSuperview() + } + } } +extension ViewController: UITableViewDataSource { + + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + 1 + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = tableView.dequeue(CodeTableViewCell.self, for: indexPath) + return cell + } + + +} + diff --git a/iOS UIKit.xcworkspace/xcuserdata/junbok.xcuserdatad/UserInterfaceState.xcuserstate b/iOS UIKit.xcworkspace/xcuserdata/junbok.xcuserdatad/UserInterfaceState.xcuserstate index fbc0dc9..feeeacd 100644 Binary files a/iOS UIKit.xcworkspace/xcuserdata/junbok.xcuserdatad/UserInterfaceState.xcuserstate and b/iOS UIKit.xcworkspace/xcuserdata/junbok.xcuserdatad/UserInterfaceState.xcuserstate differ