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
{ | |
"action": "1-questions-newest-tag-ios", | |
"data": "{"id":"57471635","body":"<div class=\"question-summary\" id=\"question-summary-57471635\">\r\n <div class=\"statscontainer\">\r\n <div class=\"stats\">\r\n <div class=\"vote\">\r\n <div class=\"votes\">\r\n <span class=\"vote-count-post \"><strong>0</strong></span>\r\n <div class=\"viewcount\">votes</div>\r\n </div>\r\n </div>\r\n <div class=\"status unanswered\">\r\n <strong>0</strong>answers\r\n </div>\r\n </div>\r\n <div class=\"views \" title=\"1 view\">\r\n 1 view\r\n</div>\r\n </div>\r\n <div class=\"summary\">\r\n <h3><a href=\"/questions/57471635/firebase-crashlytics-not-uploading-dysm-automatically\" class=\"question-hyperlink\">Firebase crashlytics not uploading dysm automatically</a></h3>\r\n <div class=\"excerpt\">\r\n I'm having problem when migrating to firebase crashlytics from fabric with the automatic upload of dysm. Ever since i migrated to firebase the automatic upload isn't working.\n\nI have already tried ...\r\n </div>\r\n <div class=\"t |
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 SwiftUI | |
protocol UIViewRepresentableHelper: UIViewRepresentable { | |
var configuration: (UIViewType) -> () { get set } | |
} | |
@available(iOS 13.0, *) | |
extension UIViewRepresentableHelper { | |
func makeUIView(context: UIViewRepresentableContext<Self>) -> UIViewType { | |
let uiView = UIViewType() |
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
// MARK: - Wrapper | |
@propertyWrapper | |
struct SomeKindOfBool: Decodable { | |
var wrappedValue: Bool | |
init(from decoder: Decoder) throws { | |
let container = try decoder.singleValueContainer() | |
if let stringifiedValue = try? container.decode(String.self) { | |
switch stringifiedValue.lowercased() { | |
case "false", "no", "0", "n", "f": wrappedValue = false |
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
struct <#NSViewForSwiftUI#>: NSViewRepresentable { | |
typealias TheNSView = <#The Original UIView Type#> /* e.g. NSProgressIndicator */ | |
var configuration = { (view: TheNSView) in } | |
func makeNSView(context: NSViewRepresentableContext<ProgressIndicator>) -> NSProgressIndicator { | |
TheNSView() | |
} | |
func updateNSView(_ nsView: NSProgressIndicator, context: NSViewRepresentableContext<ProgressIndicator>) { |
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
struct <#NSViewForSwiftUI#>: NSViewRepresentable { | |
typealias TheNSView = <#The Original UIView Type#> /* e.g. NSProgressIndicator */ | |
var configuration = { (view: TheNSView) in } | |
func makeNSView(context: NSViewRepresentableContext<ProgressIndicator>) -> NSProgressIndicator { | |
TheNSView() | |
} | |
func updateNSView(_ nsView: NSProgressIndicator, context: NSViewRepresentableContext<ProgressIndicator>) { |
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
public extension JSONDecoder.KeyDecodingStrategy { | |
/// Convert from "UpperCamelCaseKeys" to "lowerCamelCaseKeys" before attempting to match a key with the one specified by each type. | |
/// | |
/// The conversion to upper case uses `Locale.system`, also known as the ICU "root" locale. This means the result is consistent regardless of the current user's locale and language preferences. | |
/// | |
/// - Copyright: This function is based on this [source](https://gist.github.com/MojtabaHs/1f9a0f19bafaecd0c94f585648244303) | |
static var convertFromUpperCamelCase: Self { | |
.custom { keys in | |
/// - Precondition: `Keys` array must never be empty. | |
guard let key = keys.last else { fatalError("Keys should not be empty") } |
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
#if DEBUG | |
import SwiftUI | |
protocol UIViewControllerRepresentableHelper: UIViewControllerRepresentable { | |
var configuration: (UIViewControllerType) -> () { get set } | |
} | |
extension UIViewControllerRepresentableHelper { | |
func makeUIViewController(context: Context) -> UIViewControllerType { UIViewControllerType() } | |
func updateUIViewController(_ uiViewController: UIViewControllerType, context: Context) { configuration(uiViewController) } |
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
@propertyWrapper | |
struct Fallible<Value: Decodable>: Decodable { | |
var wrappedValue: [Value] = [] | |
private struct _None: Decodable {} | |
init(from decoder: Decoder) throws { | |
var container = try decoder.unkeyedContainer() | |
while !container.isAtEnd { | |
if let decoded = try? container.decode(Value.self) { |
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
@IBDesignable | |
class MaskableView: <#AnyUIViewSubclass#> { | |
var maskImageView = UIImageView() | |
@IBInspectable | |
var maskImage: UIImage? { | |
didSet { | |
maskImageView.image = maskImage | |
updateView() | |
} |
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
@propertyWrapper struct BundleFile<DataType> { | |
let name: String | |
let type: String | |
let fileManager: FileManager = .default | |
let bundle: Bundle = .main | |
let decoder: (Data) -> DataType | |
var wrappedValue: DataType { | |
guard let path = bundle.path(forResource: name, ofType: type) else { fatalError("Resource not found") } | |
guard let data = fileManager.contents(atPath: path) else { fatalError("File not loaded") } |
OlderNewer