Skip to content

Instantly share code, notes, and snippets.

@EnesKaraosman
EnesKaraosman / MailView.swift
Created December 10, 2020 05:48
Mail composer in SwiftUI
// https://stackoverflow.com/questions/56784722/swiftui-send-email
public struct MailView: UIViewControllerRepresentable {
@Environment(\.presentationMode) var presentation
@Binding var result: Result<MFMailComposeResult, Error>?
public var configure: ((MFMailComposeViewController) -> Void)?
public class Coordinator: NSObject, MFMailComposeViewControllerDelegate {
@Binding var presentation: PresentationMode
@romainbriche
romainbriche / TBXML+NSDictionary.h
Created February 27, 2012 09:07
Parse XML to NSDictionary using TBXML
#import "TBXML.h"
@interface TBXML (TBXML_NSDictionary)
+ (NSDictionary*)dictionaryWithXMLNode:(TBXMLElement*)element;
+ (NSDictionary*)dictionaryWithXMLData:(NSData*)data;
@end