Remove test code
This commit is contained in:
parent
519446c5a8
commit
4614b25f33
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="21754" systemVersion="22D49" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
|
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="22221.1" systemVersion="22G74" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
|
||||||
<entity name="Draft" representedClassName="ComposeUI.Draft" syncable="YES">
|
<entity name="Draft" representedClassName="ComposeUI.Draft" syncable="YES">
|
||||||
<attribute name="accountID" attributeType="String"/>
|
<attribute name="accountID" attributeType="String"/>
|
||||||
<attribute name="contentWarning" attributeType="String" defaultValueString=""/>
|
<attribute name="contentWarning" attributeType="String" defaultValueString=""/>
|
||||||
|
@ -38,7 +38,4 @@
|
||||||
<attribute name="text" attributeType="String" defaultValueString=""/>
|
<attribute name="text" attributeType="String" defaultValueString=""/>
|
||||||
<relationship name="poll" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="Poll" inverseName="options" inverseEntity="Poll"/>
|
<relationship name="poll" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="Poll" inverseName="options" inverseEntity="Poll"/>
|
||||||
</entity>
|
</entity>
|
||||||
<entity name="TestEntity" representedClassName="TestEntity" syncable="YES" codeGenerationType="class">
|
|
||||||
<attribute name="id" optional="YES" attributeType="UUID" usesScalarValueType="NO"/>
|
|
||||||
</entity>
|
|
||||||
</model>
|
</model>
|
|
@ -1,36 +0,0 @@
|
||||||
//
|
|
||||||
// File.swift
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Created by Shadowfacts on 4/22/23.
|
|
||||||
//
|
|
||||||
|
|
||||||
import SwiftUI
|
|
||||||
|
|
||||||
struct TestView: View {
|
|
||||||
@State var manager = DraftsPersistentContainer()
|
|
||||||
|
|
||||||
var body: some View {
|
|
||||||
VStack {
|
|
||||||
Button("Add") {
|
|
||||||
let entity = TestEntity(context: manager.viewContext)
|
|
||||||
entity.id = UUID()
|
|
||||||
try! manager.viewContext.save()
|
|
||||||
}
|
|
||||||
InnerView()
|
|
||||||
.environment(\.managedObjectContext, manager.viewContext)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
struct InnerView: View {
|
|
||||||
@FetchRequest(sortDescriptors: []) var results: FetchedResults<TestEntity>
|
|
||||||
|
|
||||||
var body: some View {
|
|
||||||
List {
|
|
||||||
ForEach(results) { result in
|
|
||||||
Text(result.id?.uuidString ?? "<nil>")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue