Skip to content

Commit

Permalink
Remove default value on initializers to remove carthage crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Enricoza committed Oct 12, 2022
1 parent a083857 commit eedfac6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tealium/core/pubsub/PubSub.swift
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,11 @@ public class TealiumReplayObservable<Element>: TealiumObservable<Element> {

public class TealiumReplaySubject<Element>: TealiumPublishSubject<Element> {

// Having a default value here would cause a crash on Carthage
public init(cacheSize: Int?) {
super.init(TealiumReplayObservable<Element>(cacheSize: cacheSize))
}

convenience public init() {
self.init(cacheSize: 1)
}
Expand Down Expand Up @@ -190,10 +192,14 @@ public class TealiumBufferedObservable<Element>: TealiumObservable<Element> {

public class TealiumBufferedSubject<Element>: TealiumPublishSubject<Element> {

@inline(never)
public init(bufferSize: Int? = 1) {
// Having a default value here would cause a crash on Carthage
public init(bufferSize: Int?) {
super.init(TealiumBufferedObservable<Element>(bufferSize: bufferSize))
}

convenience public init() {
self.init(bufferSize: 1)
}
}

private extension Optional where Wrapped == Int {
Expand Down

0 comments on commit eedfac6

Please sign in to comment.