Skip to content

Instantly share code, notes, and snippets.

@soniccat
soniccat / ControllerViewLifecycleOwner
Last active March 16, 2020 06:46
Conductor ControllerViewLifecycleOwner
// To use it add
// val viewLifecycleOwner: ControllerViewLifecycleOwner<BaseViewController>
// by lazy { ControllerViewLifecycleOwner(this) }
// in you BaseViewController
class ControllerViewLifecycleOwner<T>(lifecycleController: T) :
LifecycleOwner where T : LifecycleOwner, T : Controller {
private val controllerRef = WeakReference(lifecycleController)
private var lifecycleRegistry: LifecycleRegistry? = null
private set
@soniccat
soniccat / NSString+MCHTMLToPlainTextConversion.h
Created October 5, 2012 14:57 — forked from drewmccormack/NSString+MCHTMLToPlainTextConversion.h
Convert a NSString with HTML into a plain text string using NSXMLParser.
#import <Foundation/Foundation.h>
@interface NSString (MCHTMLToPlainTextConversion)
-(NSString *)stringByConvertingHTMLToPlainText;
@end