Skip to content

Feature/production safety#62

Open
NullIsOne wants to merge 3 commits into
KaneCheshire:mainfrom
NullIsOne:feature/production-safety
Open

Feature/production safety#62
NullIsOne wants to merge 3 commits into
KaneCheshire:mainfrom
NullIsOne:feature/production-safety

Conversation

@NullIsOne

Copy link
Copy Markdown

What changed?

  • Replaced type of size CGSize -> CGFloat, because it is circle.
  • Disabled swizzle completelly if it is disabled.
  • Added logs (temporary)

Linked issues

#54

Motivation

Inspired by todos.

Notes

First of all struct Swizzled was in wrong scope. It tried to swizzle any time when UIWindow.layer was touched.
Also I've added unswizzle as mirrored operation triggered only correct Swizzled.once == true to completely disable it. It's important in production.

Logs are temporary.

@NullIsOne
NullIsOne force-pushed the feature/production-safety branch from c841460 to 63d20d1 Compare September 5, 2024 08:39
hekuli added a commit to hekulis-org/ShowTime that referenced this pull request Apr 11, 2026
  1. Default state is now .never -- zero swizzling occurs until explicitly enabled
  2. Zero performance impact when disabled -- swizzle only activates on didSet of enabled, and fully unswizzles when disabled. Removed the UIWindow.layer override that ran on every layout
   cycle (the root cause of 24% CPU from upstream issue KaneCheshire#54)
  3. _UIReparentingView warning fixed -- replaced TouchView: UIView (added via addSubview) with TouchIndicatorLayer: CAShapeLayer (added via addSublayer). Layers don't participate in
  UIView hierarchy, so no SwiftUI hosting conflict
  4. Upstream PR KaneCheshire#62 changes incorporated -- CGSize -> CGFloat for size, default .never, swizzle/unswizzle support. Improved on PR KaneCheshire#62's approach by using didSet instead of the layer
  override
  5. Swift 6 strict concurrency -- removed swiftLanguageModes: [.v5], added @mainactor isolation on touch handling methods, nonisolated(unsafe) on static stored properties, Sendable enums
  6. Dead code removed -- all commented-out text/label code, shouldShowMultipleTapCount, shouldShowForce, UIColor.auto sentinel, Animation.custom, iOS 9 availability checks,
  UITouch.normalizedForce
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant