In one of our frameworks we're using the SwiftObserver pod. Our framework is used in several other frameworks of our app.
After raising the development target to iOS 13.0 I'd like to mark all usage of the SwiftObserver methods as deprecated to gradually change our codebase to use Combine's observers.
I was thinking of forking SwiftObserver or linking a local copy of the pod from now on. However parts of the app that still use SwiftObserver should be able to continue updating it using pod update as long as not all code has been changed to use Combine.
Is there a simpler way, maybe in the podfile, or with some sort of overwrite, to mark the usage of that pod deprecated without breaking any of its funktionality?
Please let me know if you have further questions or if there are any code samples I can provide.
An alternative to using swiftlint proposed by @SoumyaMahunt, could be to setup your own private repo.
Here's how you might be able to achieve what you want:
s.deprecated = truesource 'https://github.com/CocoaPods/Specs.git', this is important to force CocoaPods to resolve against your private repo before searching in the global default repo.Pros
Cons
https://guides.cocoapods.org/making/private-cocoapods.html
https://guides.cocoapods.org/syntax/podspec.html#deprecated
If you are using swiftlint, you can add custom rule to produce warning with a message indicating deprecation. You can also adjust severity of these warning to cause compilation error as well.
For producing warning with SwiftObserver pod create the following custom rule in swift lint config file (.swiftlint.yml):
custom_rules:
pod_deprecation:
name: "Deprecated POD use"
regex: "(SwiftObserver)"
match_kinds:
- identifier
message: "Use of deprecated pods"
This rule will cause warning with the message provided in the message parameter for all the files that import SwiftObserver:

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With