Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrandonw committed Aug 22, 2024
1 parent 361345c commit dff88f5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
12 changes: 6 additions & 6 deletions Examples/CaseStudies/UIKit/AnimationsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ class AnimationsViewController: UIViewController, UIKitCaseStudy {
observe { [weak self] in
guard let self else { return }

var transform = CGAffineTransform(translationX: model.position.x, y: model.position.y)
if model.isScaled {
transform = transform.scaledBy(x: 2, y: 2)
}
circleView.transform = transform
circleView.backgroundColor = model.color
// var transform = CGAffineTransform(translationX: model.position.x, y: model.position.y)
// if model.isScaled {
// transform = transform.scaledBy(x: 2, y: 2)
// }
// circleView.transform = transform
// circleView.backgroundColor = model.color
}
}

Expand Down
7 changes: 5 additions & 2 deletions Sources/SwiftNavigation/Observe.swift
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,12 @@ private func onChange(
) -> Void
) {
withPerceptionTracking {
print("apply(.current)")
apply(.current)
} onChange: {
task(.current) {
onChange(apply) { transaction, operation in

var count = 0
for key in transaction.storage.keys {
guard let key = key.keyType as? any PerformKey.Type
else { continue }
Expand All @@ -147,8 +148,10 @@ private func onChange(
}
}
open(key)
count += 1
}

print("!!!!", count)
print("---------")

// var perform: @Sendable () -> Void = {
// task(transaction, operation)
Expand Down
1 change: 1 addition & 0 deletions Sources/UIKitNavigation/Bindings/UIControl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
unbind(keyPath)
let action = UIAction { [weak self] _ in
guard let self else { return }
print("UIAction")
binding.wrappedValue = self[keyPath: keyPath]
}
addAction(action, for: event)
Expand Down

0 comments on commit dff88f5

Please # to comment.