Modern Apps git

xtool.git

Public
git clone https://git.maproj.org/xtool.git
appstore-distribution ▾

xtool.git / Examples / ExampleSupport / Sources / ExampleDynamicLibrary / ExampleDynamicLibrary.swift

ExampleDynamicLibrary.swift9 lines · 360 BRaw
1import Foundation
2
3public 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}