This file contains hidden or 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 | |
import UIKit | |
public final class HostingView: UIView { | |
public init(@ViewBuilder content: () -> some View) { | |
super.init(frame: .zero) | |
let contentView = UIHostingConfiguration(content: content) | |
.margins(.all, 0) | |
.makeContentView() |
This file contains hidden or 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
// | |
// ViewController.swift | |
// UIMenu-Demo | |
// | |
// Created by Seb Vidal on 28/05/2024. | |
// | |
import UIKit | |
class ViewController: UIViewController { |
This file contains hidden or 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
// | |
// CodableInheritanceExample.swift | |
// | |
// Created by 홍경표 on 2021/05/28. | |
// | |
class BaseResponse: Codable { | |
var retCode: Int = 0 | |
private enum CodingKeys: String, CodingKey { |
This file contains hidden or 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 SwiftUI | |
import UIKit | |
struct DocumentPicker: UIViewControllerRepresentable { | |
@Binding var filePath: URL? | |
func makeCoordinator() -> DocumentPicker.Coordinator { | |
return DocumentPicker.Coordinator(parent1: self) |
This file contains hidden or 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 | |
public class CodableStorage { | |
fileprivate init() { } | |
enum Directory { | |
case documents | |
case caches | |
case shared // Use for sharing files between containers. Eg, with an app extension. |
This file contains hidden or 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 enum ColorSupport { | |
public static var label: UIColor { | |
if #available(iOS 13, *) { | |
return .label | |
} | |
return UIColor(red: 0.0, green: 0.0, blue: 0.0, alpha: 1.0) | |
} |