16 lines
566 B
Swift
16 lines
566 B
Swift
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
import Foundation
|
|
|
|
/// Load the editable lesson from the same source shipped in the example tree.
|
|
final class DevelopmentStarterSource {
|
|
static func planet(withExtension ext: String) -> String? {
|
|
for bundle in [Bundle.main, Bundle(for: DevelopmentStarterSource.self)] {
|
|
if let file = bundle.url(forResource: "planet", withExtension: ext),
|
|
let source = try? String(contentsOf: file, encoding: .utf8) {
|
|
return source
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
}
|