remov stateIDs

This commit is contained in:
John Estropia
2019-10-12 07:20:09 +09:00
parent 81dfb8e3e5
commit 5af0d17de4
31 changed files with 456 additions and 291 deletions

View File

@@ -288,6 +288,7 @@
TargetAttributes = {
B54AAD481AF4D26E00848AE0 = {
CreatedOnToolsVersion = 6.3;
DevelopmentTeam = 2JT32EJ5BH;
LastSwiftMigration = 0900;
};
};
@@ -493,6 +494,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = 2JT32EJ5BH;
INFOPLIST_FILE = CoreStoreDemo/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.johnestropia.corestore.demo;
@@ -505,6 +507,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = 2JT32EJ5BH;
INFOPLIST_FILE = CoreStoreDemo/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.johnestropia.corestore.demo;

View File

@@ -13,7 +13,7 @@ import CoreStore
import SwiftUI
#endif
import Compression
final class SwiftUIContainerViewController: UIViewController {
override func viewDidLoad() {

View File

@@ -60,25 +60,48 @@ struct SwiftUIView: View {
}
}
}
.navigationBarTitle(Text("SwiftUI"))
.navigationBarTitle(Text("SwiftUI (\(palettes.numberOfItems) objects)"))
.navigationBarItems(
leading: EditButton(),
trailing: Button(
action: {
trailing: HStack {
Button(
action: {
self.dataStack.perform(
asynchronous: { transaction in
self.dataStack.perform(
asynchronous: { transaction in
let palette = transaction.create(Into<Palette>())
palette.setInitialValues(in: transaction)
},
completion: { _ in }
)
},
label: {
Image(systemName: "plus")
}
)
for palette in try transaction.fetchAll(From<Palette>()) {
palette.hue .= Palette.randomHue()
palette.colorName .= nil
}
},
completion: { _ in }
)
},
label: {
Image(systemName: "goforward")
}
)
.frame(width: 30)
Button(
action: {
self.dataStack.perform(
asynchronous: { transaction in
let palette = transaction.create(Into<Palette>())
palette.setInitialValues(in: transaction)
},
completion: { _ in }
)
},
label: {
Image(systemName: "plus")
}
)
.frame(width: 30)
}
)
.alert(
isPresented: $needsShowAlert,