Skip to content

Commit d6ea5c2

Browse files
committed
Minor cleanup
1 parent 916cad0 commit d6ea5c2

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

Sources/UIKitBackend/BaseWidget.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// Untitled.swift
2+
// BaseWidget.swift
33
// swift-cross-ui
44
//
55
// Created by William Baker on 1/10/25.
@@ -45,7 +45,7 @@ public class BaseWidget: UIView {
4545
}
4646
}
4747

48-
init() {
48+
internal init() {
4949
super.init(frame: .zero)
5050

5151
self.clipsToBounds = true

Sources/UIKitBackend/UIKitBackend+Control.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ internal final class ButtonWidget: WrapperWidget<UIButton> {
2020
super.init(child: UIButton())
2121
child.addTarget(self, action: #selector(buttonTapped), for: .touchUpInside)
2222
}
23-
24-
@available(*, unavailable)
25-
required init?(coder: NSCoder) {
26-
return nil
27-
}
2823
}
2924

3025
internal final class TextFieldWidget: WrapperWidget<UITextField>, UITextFieldDelegate {

Sources/UIKitBackend/UIKitBackend+Window.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ internal final class RootViewController: UIViewController {
1818

1919
@available(*, unavailable)
2020
required init?(coder: NSCoder) {
21-
return nil
21+
fatalError("init(coder:) is not used for the root view controller")
2222
}
2323

2424
override func loadView() {
@@ -44,7 +44,6 @@ internal final class RootViewController: UIViewController {
4444
view.subviews.forEach { $0.removeFromSuperview() }
4545
view.addSubview(child)
4646

47-
child.translatesAutoresizingMaskIntoConstraints = false
4847
NSLayoutConstraint.activate([
4948
child.topAnchor.constraint(equalTo: view.topAnchor),
5049
child.bottomAnchor.constraint(equalTo: view.bottomAnchor),

0 commit comments

Comments
 (0)