[App] Repositories in the Menu Bar view #4
@ -429,7 +429,7 @@
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
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;
|
||||
ENABLE_HARDENED_RUNTIME = YES;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
@ -461,7 +461,7 @@
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
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;
|
||||
ENABLE_HARDENED_RUNTIME = 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