Implemented the "samples(in: )" static function for the Repository+Samples extension in the app target.
This commit is contained in:
parent
0d43a148db
commit
cd9bd975b4
@ -429,7 +429,7 @@
|
|||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 1;
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
DEVELOPMENT_ASSET_PATHS = Piper/Resources/Catalogs/Previews.xcassets;
|
DEVELOPMENT_ASSET_PATHS = "Piper/Sources/Previews/Extensions/Repository+Samples.swift Piper/Resources/Catalogs/Previews.xcassets";
|
||||||
DEVELOPMENT_TEAM = 7FMNM89WKG;
|
DEVELOPMENT_TEAM = 7FMNM89WKG;
|
||||||
ENABLE_HARDENED_RUNTIME = YES;
|
ENABLE_HARDENED_RUNTIME = YES;
|
||||||
ENABLE_PREVIEWS = YES;
|
ENABLE_PREVIEWS = YES;
|
||||||
@ -461,7 +461,7 @@
|
|||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 1;
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
DEVELOPMENT_ASSET_PATHS = Piper/Resources/Catalogs/Previews.xcassets;
|
DEVELOPMENT_ASSET_PATHS = "Piper/Sources/Previews/Extensions/Repository+Samples.swift Piper/Resources/Catalogs/Previews.xcassets";
|
||||||
DEVELOPMENT_TEAM = 7FMNM89WKG;
|
DEVELOPMENT_TEAM = 7FMNM89WKG;
|
||||||
ENABLE_HARDENED_RUNTIME = YES;
|
ENABLE_HARDENED_RUNTIME = YES;
|
||||||
ENABLE_PREVIEWS = YES;
|
ENABLE_PREVIEWS = YES;
|
||||||
|
36
Piper/Sources/Previews/Extensions/Repository+Samples.swift
Normal file
36
Piper/Sources/Previews/Extensions/Repository+Samples.swift
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
//
|
||||||
|
// Repository+Samples.swift
|
||||||
|
// Piper
|
||||||
|
//
|
||||||
|
// Created by Javier Cicchelli on 06/10/2024.
|
||||||
|
// Copyright © 2024 Röck+Cöde. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
import SwiftData
|
||||||
|
|
||||||
|
extension Repository {
|
||||||
|
|
||||||
|
// MARK: Functions
|
||||||
|
|
||||||
|
@MainActor
|
||||||
|
static func samples(in container: ModelContainer) {
|
||||||
|
let context = container.mainContext
|
||||||
|
|
||||||
|
context.insert(Repository(
|
||||||
|
URL(filePath: "/full/path/to/repository/name-0.git"),
|
||||||
|
sortOrder: 0
|
||||||
|
))
|
||||||
|
|
||||||
|
context.insert(Repository(
|
||||||
|
URL(filePath: "/full/path/to/repository/name-1.git"),
|
||||||
|
sortOrder: 1
|
||||||
|
))
|
||||||
|
|
||||||
|
context.insert(Repository(
|
||||||
|
URL(filePath: "/full/path/to/repository/name-2.git"),
|
||||||
|
sortOrder: 2
|
||||||
|
))
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user