-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update OC Compatiblity #2416
Update OC Compatiblity #2416
Conversation
var animation: LottieAnimation? { | ||
LottieAnimation.named(name, bundle: bundle, subdirectory: subdirectory) | ||
} | ||
private(set) lazy var animation = LottieAnimation.named(name, bundle: bundle, subdirectory: subdirectory) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead, what if we just make this:
private(set) lazy var animation = LottieAnimation.named(name, bundle: bundle, subdirectory: subdirectory) | |
var animation: LottieAnimation |
and update the existing init
to just:
public init(
name: String,
subdirectory: String? = nil,
bundle: Bundle = Bundle.main)
{
animation = LottieAnimation.named(name, bundle: bundle, subdirectory: subdirectory)
super.init()
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem
Looks like the build is failing -- also make sure to run |
@@ -46,6 +47,12 @@ public final class CompatibleAnimation: NSObject { | |||
private let bundle: Bundle | |||
} | |||
|
|||
extension LottieAnimation { | |||
public func ocCompatible() -> CompatibleAnimation { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necessary? I'd prefer to keep the change focused on the new init
Still seeing build failures |
Since the build is failing I'm going to go ahead and close this PR for now. If you'd like, feel free to re-open the PR after fixing the build errors! |
No description provided.