Let a value invalidate x-seconds after it has been set. Usable if information has not to be hold on all the time (like a timeout message or something) class Melt<Element> { var value: Element? { didSet { self.timer?.invalidate() self.timer = Timer.scheduledTimer( timeInterval: self.lifetime, target: self, selector: