This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"808": { | |
"vod": [ | |
"Documentary", | |
"Music" | |
], | |
"iva": [ | |
"Documentary", | |
"Musical" | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Since AsyncLocalStorage API is not exposed to native code, we have to grab the data ourselves. | |
// If you have been able to get Cocoapods use_frameworks! to work, you can `import React` | |
// Else make sure to include the following in your brindging header: | |
// #import <React/RCTAsyncLocalStorage.h> | |
import Foundation | |
class CacheManager { | |
let storageLocation = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first!.appendingPathComponent("RCTAsyncLocalStorage_V1") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension UITextView { | |
func load(HTMLString: String) { | |
guard let htmlData = HTMLString.data(using: .utf8) else { return } | |
let options: [String: Any] = [ | |
NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType, | |
NSCharacterEncodingDocumentAttribute: String.Encoding.utf8.rawValue | |
] | |
let strNative = try! NSMutableAttributedString(data: htmlData, options: options, documentAttributes: nil) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import WebKit | |
// See https://developer.apple.com/library/content/documentation/Swift/Conceptual/BuildingCocoaApps/AdoptingCocoaDesignPatterns.html for more details. | |
private var observerContext = 0 | |
class StackableWebView: WKWebView { | |
// Keep track of height which will change when the view is loaded. | |
var webViewHeight: CGFloat = 0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
public extension UIView { | |
public class func instantiateFromNib<T: UIView>(viewType: T.Type) -> T { | |
return Bundle.main.loadNibNamed(String(describing: viewType), owner: nil, options: nil)!.first as! T | |
} | |
public class func instantiateFromNib() -> Self { | |
return instantiateFromNib(viewType: self) | |
} |