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
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import UIKit

class BaseTableViewCell: UITableViewCell {
public class BaseTableViewCell: UITableViewCell {

// MARK: - Init
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
Expand All @@ -24,7 +24,7 @@ class BaseTableViewCell: UITableViewCell {

// MARK: - Func

override func prepareForReuse() {
public override func prepareForReuse() {
super.prepareForReuse()
reset()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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)
}
}


Expand All @@ -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 }
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import UIKit

class BaseView: UIView {
public class BaseView: UIView {

// MARK: - Init
override init(frame: CGRect) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<UISceneSession>) {
// 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 { }
2 changes: 0 additions & 2 deletions Projects/DesignSystem/DesignKit/DesignKitDemoApp/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
<key>UISceneStoryboardFile</key>
<string>Main</string>
</dict>
</array>
</dict>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
window = UIWindow(windowScene: windowScene)

window?.backgroundColor = .systemBackground
window?.rootViewController = UIViewController()
window?.rootViewController = ViewController()
window?.makeKeyAndVisible()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}


}

Binary file not shown.