xtool.git
Publicgit clone https://git.maproj.org/xtool.gitxtool.git / Examples / ExampleSupport / Sources / ExampleDynamicLibrary / ExampleDynamicLibrary.swift
ExampleDynamicLibrary.swift9 lines · 360 BRaw
| 1 | import Foundation |
| 2 | |
| 3 | public func exampleDynamicLibraryFunction() -> String { |
| 4 | guard let bundled = #bundle.url(forResource: "response", withExtension: "txt") |
| 5 | else { fatalError("Missing bundled.txt resource") } |
| 6 | // swiftlint:disable:next force_try |
| 7 | let contents = try! String(contentsOf: bundled, encoding: .utf8) |
| 8 | return "Hello \(contents)" |
| 9 | } |