Skip to content

Runtime-based setup for tracking autolayout feedback loops

License

Notifications You must be signed in to change notification settings

rsrbk/LayoutLoopHunter

Repository files navigation

LayoutLoopHunter

CI Status Version License Platform

img

The library helps to catch the OOMs caused by Autolayout Feedback Loop by replicating the behavior of UIViewLayoutFeedbackLoopDebuggingThreshold in the live code.

This is the final result of the runtime tutorial on AppCoda.

Installation

LayoutLoopHunter is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'LayoutLoopHunter'

and run pod install in your terminal.

Alternatively, you can manually add the files from the LayoutLoopHunter directory to your project.

Usage

Please use the setUp method to set up tracking for your UIView:

static func setUp(for view: UIView, threshold: Int = 100, onLoop: @escaping () -> ())

The callback will be called when the layoutSubviews() method is called a certain amount of times in a single run loop.

Example

LayoutLoopHunter.setUp(for: view) {
    print("Hello, world")
}

Author

Ruslan Serebriakov

Twitter: @rsrbk123

Check out my other libraries

SmileToUnlock - this library uses ARKit Face Tracking in order to catch a user's smile..
SRCountdownTimer - a simple circle countdown with a configurable timer.
SRAttractionsMap - the map with attractions on which you can click and see the full description.

License

MIT License

Copyright (c) 2019 Ruslan Serebriakov [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Runtime-based setup for tracking autolayout feedback loops

Resources

License

Stars

Watchers

Forks

Packages

No packages published