You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LifetimeTracker version 1.3.2 with a DEBUG configuration (I've also tried without this)
pod 'LifetimeTracker', :configurations => ['Debug']
Issue
I'm trying to conform a class to LifetimeTrackable so I've followed the steps in the README.md for Objective-C integration.
I get the above error when I try to use LifetimeConfiguration:
No visible @interface for 'LifetimeConfiguration' declares the
selector 'initWithMaxCount:groupName:'
In my file, I have imported the class as @import LifetimeTrackable.
I also tried importing as #import <LifetimeTracker/LifetimeTracker-Swift.h>. When I look at this file I see this generated interface for LifetimeConfiguration
/// Holds the properties which are needed to configure a <code>LifetimeTrackable</code>SWIFT_CLASS("_TtC15LifetimeTracker21LifetimeConfiguration")
@interface LifetimeConfiguration : NSObject
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
@end
hmm weird, the code works fine in our objc example, can you try adding @objc attribution to the initializer in your local pod checkout and see if it helps, I didn't expect this to be needed but maybe ?
@krzysztofzablocki Apologies for the delay! I was able to reproduce this more reliably now that I understand it better. Adding the @objc does indeed fix the issue though.
The ExampleObjc project works fine because the pod itself is on Swift 3 as shown here.
If you run the migrator so that it converts LifetimeTracker to Swift 4 which will require no syntax change then you'll see the following deprecation warning:
This matches what is happening in my project since I have a mixed Obj-C/Swift 4 codebase which requires the explicit @objc annotations. I didn't run the migrator on the Pod when I installed it but it was automatically set to Swift 4.
I can make a PR to annotate all the public methods with @objc or should it be done on a per need basis?
Setup
pod 'LifetimeTracker', :configurations => ['Debug']
Issue
I'm trying to conform a class to
LifetimeTrackable
so I've followed the steps in the README.md for Objective-C integration.I get the above error when I try to use
LifetimeConfiguration
:In my file, I have imported the class as
@import LifetimeTrackable
.I also tried importing as
#import <LifetimeTracker/LifetimeTracker-Swift.h>
. When I look at this file I see this generated interface forLifetimeConfiguration
Full generated interface file here
Has this been seen before? I took a look at the example and I was unable to reproduce the issue.
The text was updated successfully, but these errors were encountered: