WWDC22 SALE: Save 50% on all my Swift books and bundles! >>

Disabling recursion trigger logging

Forums > iOS

Does anyone know what this message means:

[UICollectionViewRecursion] cv == 0x7fe385815e00 Disabling recursion trigger logging

1      

Can you post your ViewController code?

1      

I am also facing this issue. while I tried to add UIMenu in my UI. Here is the code:

    let action = UIAction(title: "Majha"){ action in
        print("trial")
    }

    let menu = UIMenu(
        image: nil,
        identifier: UIMenu.Identifier("First"),
        options: .displayInline,
        children: [action]
    )

    let trial = UIBarButtonItem(title: "BarButton", image: nil, primaryAction: nil, menu: menu)

    self.navigationItem.leftBarButtonItem = trial

1      

I've spend some time answering this on Stackoverflow directly, you can go check my answer: https://stackoverflow.com/questions/69397650/swiftui-disabling-recursion-trigger-logging-when-use-menu/70102618#70102618

Someone there shared a tweet from the developer that seems involved: https://twitter.com/caughtinflux/status/1439276097464528896?s=21

So it's definately not your fault, for disabling this message for convenience you can check my solution.

As @Minho shared it's seems to be a simple debug / diagnostic left by a dev.

Fortunately for us they used Os.Log which we should all use, correctly like it is done here.

Using the console we can identify the subsystem and category of the messages

console.app logs of related error

We can then tell Os.Log to ignore the related subsystem and Category With subsystem: com.apple.UIKit and category: UICollectionViewRecursion

This give us the following commands, the first for system (device), the second for the booted simulator.

// Disable forgotten 'UICollectionViewRecursion' debug messages, see.
// https://stackoverflow.com/questions/69397650/swiftui-disabling-recursion-trigger-logging-when-use-menu
// https://twitter.com/caughtinflux/status/1439276097464528896?s=21
sudo log config --mode "level:off" --subsystem com.apple.UIKit --category UICollectionViewRecursion
xcrun simctl spawn booted log config --mode "level:off" --subsystem com.apple.UIKit --category UICollectionViewRecursion

Hope this helps and again please use Os.Log in your projects.

1      

Hacking with Swift is sponsored by RevenueCat

SPONSORED In-app subscriptions are a pain. The code can be hard to write, hard to test, and full of edge cases. RevenueCat makes it straightforward and reliable so you can get back to building your app.

Explore the docs

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.