Skip to content

Commit 2451fea

Browse files
committed
delegate fix
1 parent 0f87b0c commit 2451fea

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Layout.swift

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ public enum LayoutError: Error {
1212
case fileNotFound(String)
1313
}
1414

15-
@objc public protocol LayoutDelegate {
16-
@objc optional func view(of type: String, for id: String) -> UIView?
17-
@objc optional func didCreate(_ view: UIView, for id: String)
18-
@objc optional func formatOptions(for constraint: String) -> NSLayoutConstraint.FormatOptions
15+
public protocol LayoutDelegate {
16+
func view(of type: String, for id: String) -> UIView?
17+
func didCreate(_ view: UIView, for id: String)
18+
func formatOptions(for constraint: String) -> NSLayoutConstraint.FormatOptions
1919
}
2020

2121
extension LayoutDelegate {
@@ -59,7 +59,7 @@ public class Layout {
5959
private func add(views: [String: MarkupElement], to root: UIView) {
6060
for (id, view) in views {
6161
guard let v = self.delegate?.view(of: view.type, for: id) ?? Layout.view(of: view.type) else { continue }
62-
self.delegate?.didCreate?(v, for: id)
62+
self.delegate?.didCreate(v, for: id)
6363
v.translatesAutoresizingMaskIntoConstraints = false
6464
v.tag = id.hash
6565
self.views[id] = v

0 commit comments

Comments
 (0)