Setup initial project
- Get started on initial UI and data flow for presenting a collection of dice.
|
@ -0,0 +1,597 @@
|
|||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 52;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
F397601823E742E000813BD8 /* PreviewData+AppStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = F397601723E742E000813BD8 /* PreviewData+AppStore.swift */; };
|
||||
F3CFFC6023E749A2001A2E19 /* DiceView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3CFFC5F23E749A2001A2E19 /* DiceView.swift */; };
|
||||
F3CFFC6223E74A37001A2E19 /* DiceGeneratorContainerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3CFFC6123E74A37001A2E19 /* DiceGeneratorContainerView.swift */; };
|
||||
F3CFFC6423E74D43001A2E19 /* DiceGeneratorView+ViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3CFFC6323E74D43001A2E19 /* DiceGeneratorView+ViewModel.swift */; };
|
||||
F3CFFC6823E77E02001A2E19 /* VerticalDiceRollView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3CFFC6723E77E02001A2E19 /* VerticalDiceRollView.swift */; };
|
||||
F3CFFC6A23E77E22001A2E19 /* HorizontalDiceRollView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3CFFC6923E77E22001A2E19 /* HorizontalDiceRollView.swift */; };
|
||||
F3CFFC6C23E85963001A2E19 /* PreviewData+DiceRolls.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3CFFC6B23E85963001A2E19 /* PreviewData+DiceRolls.swift */; };
|
||||
F3D4FD3923E5E688000CF606 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3D4FD3823E5E688000CF606 /* AppDelegate.swift */; };
|
||||
F3D4FD3B23E5E688000CF606 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3D4FD3A23E5E688000CF606 /* SceneDelegate.swift */; };
|
||||
F3D4FD3F23E5E68A000CF606 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F3D4FD3E23E5E68A000CF606 /* Assets.xcassets */; };
|
||||
F3D4FD4223E5E68A000CF606 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F3D4FD4123E5E68A000CF606 /* Preview Assets.xcassets */; };
|
||||
F3D4FD5423E5EF95000CF606 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F3D4FD5223E5EF95000CF606 /* LaunchScreen.storyboard */; };
|
||||
F3D4FD5623E5EFDE000CF606 /* CurrentApplication.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3D4FD5523E5EFDE000CF606 /* CurrentApplication.swift */; };
|
||||
F3D4FD5823E5F016000CF606 /* PreviewData.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3D4FD5723E5F016000CF606 /* PreviewData.swift */; };
|
||||
F3D4FD5C23E5F0E7000CF606 /* CypherPoetCoreDataKit in Frameworks */ = {isa = PBXBuildFile; productRef = F3D4FD5B23E5F0E7000CF606 /* CypherPoetCoreDataKit */; };
|
||||
F3D4FD5F23E5F0F6000CF606 /* CypherPoetSwiftUIKit in Frameworks */ = {isa = PBXBuildFile; productRef = F3D4FD5E23E5F0F6000CF606 /* CypherPoetSwiftUIKit */; };
|
||||
F3D4FD6123E5F120000CF606 /* CoreDataManager+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3D4FD6023E5F120000CF606 /* CoreDataManager+Utils.swift */; };
|
||||
F3D4FD6523E5F14D000CF606 /* Dicey.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = F3D4FD6323E5F14D000CF606 /* Dicey.xcdatamodeld */; };
|
||||
F3D4FD6E23E60076000CF606 /* DiceRoll+CoreDataClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3D4FD6C23E60076000CF606 /* DiceRoll+CoreDataClass.swift */; };
|
||||
F3D4FD6F23E60076000CF606 /* DiceRoll+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3D4FD6D23E60076000CF606 /* DiceRoll+CoreDataProperties.swift */; };
|
||||
F3D4FD7223E60115000CF606 /* Dice.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3D4FD7023E60115000CF606 /* Dice.swift */; };
|
||||
F3D4FD7523E60166000CF606 /* DiceRoll+Computeds.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3D4FD7423E60166000CF606 /* DiceRoll+Computeds.swift */; };
|
||||
F3D4FD7723E60359000CF606 /* Dice+Computeds.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3D4FD7623E60359000CF606 /* Dice+Computeds.swift */; };
|
||||
F3D4FD7E23E6FC25000CF606 /* DiceGeneratorState.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3D4FD7D23E6FC25000CF606 /* DiceGeneratorState.swift */; };
|
||||
F3D4FD8023E6FC51000CF606 /* AppState.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3D4FD7F23E6FC51000CF606 /* AppState.swift */; };
|
||||
F3D4FD8323E700EF000CF606 /* CypherPoetPropertyWrappers in Frameworks */ = {isa = PBXBuildFile; productRef = F3D4FD8223E700EF000CF606 /* CypherPoetPropertyWrappers */; };
|
||||
F3D4FD8623E70657000CF606 /* DiceGeneratorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3D4FD8523E70657000CF606 /* DiceGeneratorView.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
F397601723E742E000813BD8 /* PreviewData+AppStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "PreviewData+AppStore.swift"; sourceTree = "<group>"; };
|
||||
F3CFFC5F23E749A2001A2E19 /* DiceView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DiceView.swift; sourceTree = "<group>"; };
|
||||
F3CFFC6123E74A37001A2E19 /* DiceGeneratorContainerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DiceGeneratorContainerView.swift; sourceTree = "<group>"; };
|
||||
F3CFFC6323E74D43001A2E19 /* DiceGeneratorView+ViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "DiceGeneratorView+ViewModel.swift"; sourceTree = "<group>"; };
|
||||
F3CFFC6723E77E02001A2E19 /* VerticalDiceRollView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VerticalDiceRollView.swift; sourceTree = "<group>"; };
|
||||
F3CFFC6923E77E22001A2E19 /* HorizontalDiceRollView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HorizontalDiceRollView.swift; sourceTree = "<group>"; };
|
||||
F3CFFC6B23E85963001A2E19 /* PreviewData+DiceRolls.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "PreviewData+DiceRolls.swift"; sourceTree = "<group>"; };
|
||||
F3D4FD3523E5E688000CF606 /* Dicey.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Dicey.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
F3D4FD3823E5E688000CF606 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
F3D4FD3A23E5E688000CF606 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
|
||||
F3D4FD3E23E5E68A000CF606 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
F3D4FD4123E5E68A000CF606 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
|
||||
F3D4FD4623E5E68A000CF606 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
F3D4FD5323E5EF95000CF606 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Dicey/Base.lproj/LaunchScreen.storyboard; sourceTree = SOURCE_ROOT; };
|
||||
F3D4FD5523E5EFDE000CF606 /* CurrentApplication.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CurrentApplication.swift; sourceTree = "<group>"; };
|
||||
F3D4FD5723E5F016000CF606 /* PreviewData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PreviewData.swift; sourceTree = "<group>"; };
|
||||
F3D4FD6023E5F120000CF606 /* CoreDataManager+Utils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CoreDataManager+Utils.swift"; sourceTree = "<group>"; };
|
||||
F3D4FD6423E5F14D000CF606 /* Dicey.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Dicey.xcdatamodel; sourceTree = "<group>"; };
|
||||
F3D4FD6C23E60076000CF606 /* DiceRoll+CoreDataClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "DiceRoll+CoreDataClass.swift"; sourceTree = "<group>"; };
|
||||
F3D4FD6D23E60076000CF606 /* DiceRoll+CoreDataProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "DiceRoll+CoreDataProperties.swift"; sourceTree = "<group>"; };
|
||||
F3D4FD7023E60115000CF606 /* Dice.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Dice.swift; sourceTree = "<group>"; };
|
||||
F3D4FD7423E60166000CF606 /* DiceRoll+Computeds.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "DiceRoll+Computeds.swift"; sourceTree = "<group>"; };
|
||||
F3D4FD7623E60359000CF606 /* Dice+Computeds.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Dice+Computeds.swift"; sourceTree = "<group>"; };
|
||||
F3D4FD7D23E6FC25000CF606 /* DiceGeneratorState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DiceGeneratorState.swift; sourceTree = "<group>"; };
|
||||
F3D4FD7F23E6FC51000CF606 /* AppState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppState.swift; sourceTree = "<group>"; };
|
||||
F3D4FD8523E70657000CF606 /* DiceGeneratorView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DiceGeneratorView.swift; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
F3D4FD3223E5E688000CF606 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
F3D4FD5F23E5F0F6000CF606 /* CypherPoetSwiftUIKit in Frameworks */,
|
||||
F3D4FD8323E700EF000CF606 /* CypherPoetPropertyWrappers in Frameworks */,
|
||||
F3D4FD5C23E5F0E7000CF606 /* CypherPoetCoreDataKit in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
F397601423E73E6A00813BD8 /* Views */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F3CFFC5F23E749A2001A2E19 /* DiceView.swift */,
|
||||
F3CFFC6723E77E02001A2E19 /* VerticalDiceRollView.swift */,
|
||||
F3CFFC6923E77E22001A2E19 /* HorizontalDiceRollView.swift */,
|
||||
);
|
||||
path = Views;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F3D4FD2C23E5E688000CF606 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F3D4FD3723E5E688000CF606 /* Dicey */,
|
||||
F3D4FD3623E5E688000CF606 /* Products */,
|
||||
F3D4FD5D23E5F0F6000CF606 /* Frameworks */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F3D4FD3623E5E688000CF606 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F3D4FD3523E5E688000CF606 /* Dicey.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F3D4FD3723E5E688000CF606 /* Dicey */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F3D4FD4623E5E68A000CF606 /* Info.plist */,
|
||||
F3D4FD4E23E5EF54000CF606 /* App */,
|
||||
F3D4FD5123E5EF64000CF606 /* Data */,
|
||||
F3D4FD4023E5E68A000CF606 /* Preview Content */,
|
||||
F3D4FD5023E5EF5D000CF606 /* Resources */,
|
||||
F3D4FD4F23E5EF58000CF606 /* Reusables */,
|
||||
F3D4FD4C23E5EF46000CF606 /* Scenes */,
|
||||
);
|
||||
path = Dicey;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F3D4FD4023E5E68A000CF606 /* Preview Content */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F3D4FD4D23E5EF4F000CF606 /* PreviewData */,
|
||||
F3D4FD4123E5E68A000CF606 /* Preview Assets.xcassets */,
|
||||
);
|
||||
path = "Preview Content";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F3D4FD4C23E5EF46000CF606 /* Scenes */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F3D4FD8423E705FD000CF606 /* Dice Generator */,
|
||||
);
|
||||
path = Scenes;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F3D4FD4D23E5EF4F000CF606 /* PreviewData */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F3D4FD5723E5F016000CF606 /* PreviewData.swift */,
|
||||
F3CFFC6B23E85963001A2E19 /* PreviewData+DiceRolls.swift */,
|
||||
F397601723E742E000813BD8 /* PreviewData+AppStore.swift */,
|
||||
);
|
||||
path = PreviewData;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F3D4FD4E23E5EF54000CF606 /* App */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F3D4FD3823E5E688000CF606 /* AppDelegate.swift */,
|
||||
F3D4FD3A23E5E688000CF606 /* SceneDelegate.swift */,
|
||||
F3D4FD5223E5EF95000CF606 /* LaunchScreen.storyboard */,
|
||||
F3D4FD5523E5EFDE000CF606 /* CurrentApplication.swift */,
|
||||
);
|
||||
path = App;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F3D4FD4F23E5EF58000CF606 /* Reusables */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F397601423E73E6A00813BD8 /* Views */,
|
||||
);
|
||||
path = Reusables;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F3D4FD5023E5EF5D000CF606 /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F3D4FD3E23E5E68A000CF606 /* Assets.xcassets */,
|
||||
);
|
||||
path = Resources;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F3D4FD5123E5EF64000CF606 /* Data */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F3D4FD6023E5F120000CF606 /* CoreDataManager+Utils.swift */,
|
||||
F3D4FD6223E5F136000CF606 /* Models */,
|
||||
F3D4FD7C23E6FB4B000CF606 /* State */,
|
||||
);
|
||||
path = Data;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F3D4FD5D23E5F0F6000CF606 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F3D4FD6223E5F136000CF606 /* Models */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F3D4FD6723E5FB7A000CF606 /* DiceRoll */,
|
||||
F3D4FD6623E5FB77000CF606 /* Dice */,
|
||||
F3D4FD6323E5F14D000CF606 /* Dicey.xcdatamodeld */,
|
||||
);
|
||||
path = Models;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F3D4FD6623E5FB77000CF606 /* Dice */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F3D4FD7023E60115000CF606 /* Dice.swift */,
|
||||
F3D4FD7623E60359000CF606 /* Dice+Computeds.swift */,
|
||||
);
|
||||
path = Dice;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F3D4FD6723E5FB7A000CF606 /* DiceRoll */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F3D4FD6C23E60076000CF606 /* DiceRoll+CoreDataClass.swift */,
|
||||
F3D4FD6D23E60076000CF606 /* DiceRoll+CoreDataProperties.swift */,
|
||||
F3D4FD7423E60166000CF606 /* DiceRoll+Computeds.swift */,
|
||||
);
|
||||
path = DiceRoll;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F3D4FD7C23E6FB4B000CF606 /* State */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F3D4FD7D23E6FC25000CF606 /* DiceGeneratorState.swift */,
|
||||
F3D4FD7F23E6FC51000CF606 /* AppState.swift */,
|
||||
);
|
||||
path = State;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F3D4FD8423E705FD000CF606 /* Dice Generator */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F3D4FD8523E70657000CF606 /* DiceGeneratorView.swift */,
|
||||
F3CFFC6323E74D43001A2E19 /* DiceGeneratorView+ViewModel.swift */,
|
||||
F3CFFC6123E74A37001A2E19 /* DiceGeneratorContainerView.swift */,
|
||||
);
|
||||
path = "Dice Generator";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
F3D4FD3423E5E688000CF606 /* Dicey */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = F3D4FD4923E5E68A000CF606 /* Build configuration list for PBXNativeTarget "Dicey" */;
|
||||
buildPhases = (
|
||||
F3D4FD3123E5E688000CF606 /* Sources */,
|
||||
F3D4FD3223E5E688000CF606 /* Frameworks */,
|
||||
F3D4FD3323E5E688000CF606 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = Dicey;
|
||||
packageProductDependencies = (
|
||||
F3D4FD5B23E5F0E7000CF606 /* CypherPoetCoreDataKit */,
|
||||
F3D4FD5E23E5F0F6000CF606 /* CypherPoetSwiftUIKit */,
|
||||
F3D4FD8223E700EF000CF606 /* CypherPoetPropertyWrappers */,
|
||||
);
|
||||
productName = Dicey;
|
||||
productReference = F3D4FD3523E5E688000CF606 /* Dicey.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
F3D4FD2D23E5E688000CF606 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftUpdateCheck = 1130;
|
||||
LastUpgradeCheck = 1130;
|
||||
ORGANIZATIONNAME = CypherPoet;
|
||||
TargetAttributes = {
|
||||
F3D4FD3423E5E688000CF606 = {
|
||||
CreatedOnToolsVersion = 11.3.1;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = F3D4FD3023E5E688000CF606 /* Build configuration list for PBXProject "Dicey" */;
|
||||
compatibilityVersion = "Xcode 9.3";
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
mainGroup = F3D4FD2C23E5E688000CF606;
|
||||
packageReferences = (
|
||||
F3D4FD5923E5F051000CF606 /* XCRemoteSwiftPackageReference "CypherPoetSwiftUIKit" */,
|
||||
F3D4FD5A23E5F0E7000CF606 /* XCRemoteSwiftPackageReference "CypherPoetCoreDataKit" */,
|
||||
F3D4FD8123E700EF000CF606 /* XCRemoteSwiftPackageReference "CypherPoetPropertyWrappers" */,
|
||||
);
|
||||
productRefGroup = F3D4FD3623E5E688000CF606 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
F3D4FD3423E5E688000CF606 /* Dicey */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
F3D4FD3323E5E688000CF606 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
F3D4FD5423E5EF95000CF606 /* LaunchScreen.storyboard in Resources */,
|
||||
F3D4FD4223E5E68A000CF606 /* Preview Assets.xcassets in Resources */,
|
||||
F3D4FD3F23E5E68A000CF606 /* Assets.xcassets in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
F3D4FD3123E5E688000CF606 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
F3CFFC6223E74A37001A2E19 /* DiceGeneratorContainerView.swift in Sources */,
|
||||
F3D4FD6E23E60076000CF606 /* DiceRoll+CoreDataClass.swift in Sources */,
|
||||
F3D4FD5823E5F016000CF606 /* PreviewData.swift in Sources */,
|
||||
F3D4FD3923E5E688000CF606 /* AppDelegate.swift in Sources */,
|
||||
F3D4FD6523E5F14D000CF606 /* Dicey.xcdatamodeld in Sources */,
|
||||
F3CFFC6823E77E02001A2E19 /* VerticalDiceRollView.swift in Sources */,
|
||||
F3D4FD7523E60166000CF606 /* DiceRoll+Computeds.swift in Sources */,
|
||||
F3D4FD7E23E6FC25000CF606 /* DiceGeneratorState.swift in Sources */,
|
||||
F3D4FD3B23E5E688000CF606 /* SceneDelegate.swift in Sources */,
|
||||
F3D4FD7223E60115000CF606 /* Dice.swift in Sources */,
|
||||
F3D4FD7723E60359000CF606 /* Dice+Computeds.swift in Sources */,
|
||||
F3D4FD8623E70657000CF606 /* DiceGeneratorView.swift in Sources */,
|
||||
F3CFFC6023E749A2001A2E19 /* DiceView.swift in Sources */,
|
||||
F3D4FD8023E6FC51000CF606 /* AppState.swift in Sources */,
|
||||
F3CFFC6C23E85963001A2E19 /* PreviewData+DiceRolls.swift in Sources */,
|
||||
F3D4FD5623E5EFDE000CF606 /* CurrentApplication.swift in Sources */,
|
||||
F3D4FD6123E5F120000CF606 /* CoreDataManager+Utils.swift in Sources */,
|
||||
F397601823E742E000813BD8 /* PreviewData+AppStore.swift in Sources */,
|
||||
F3D4FD6F23E60076000CF606 /* DiceRoll+CoreDataProperties.swift in Sources */,
|
||||
F3CFFC6A23E77E22001A2E19 /* HorizontalDiceRollView.swift in Sources */,
|
||||
F3CFFC6423E74D43001A2E19 /* DiceGeneratorView+ViewModel.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
F3D4FD5223E5EF95000CF606 /* LaunchScreen.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
F3D4FD5323E5EF95000CF606 /* Base */,
|
||||
);
|
||||
name = LaunchScreen.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
F3D4FD4723E5E68A000CF606 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 13.2;
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
MTL_FAST_MATH = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
F3D4FD4823E5E68A000CF606 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 13.2;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
MTL_FAST_MATH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_COMPILATION_MODE = wholemodule;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
F3D4FD4A23E5E68A000CF606 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_ASSET_PATHS = "\"Dicey/Preview Content\"";
|
||||
DEVELOPMENT_TEAM = QRXXH2RKAG;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
INFOPLIST_FILE = Dicey/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = io.github.cypherpoet.Dicey;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
F3D4FD4B23E5E68A000CF606 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_ASSET_PATHS = "\"Dicey/Preview Content\"";
|
||||
DEVELOPMENT_TEAM = QRXXH2RKAG;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
INFOPLIST_FILE = Dicey/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = io.github.cypherpoet.Dicey;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
F3D4FD3023E5E688000CF606 /* Build configuration list for PBXProject "Dicey" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
F3D4FD4723E5E68A000CF606 /* Debug */,
|
||||
F3D4FD4823E5E68A000CF606 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
F3D4FD4923E5E68A000CF606 /* Build configuration list for PBXNativeTarget "Dicey" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
F3D4FD4A23E5E68A000CF606 /* Debug */,
|
||||
F3D4FD4B23E5E68A000CF606 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
|
||||
/* Begin XCRemoteSwiftPackageReference section */
|
||||
F3D4FD5923E5F051000CF606 /* XCRemoteSwiftPackageReference "CypherPoetSwiftUIKit" */ = {
|
||||
isa = XCRemoteSwiftPackageReference;
|
||||
repositoryURL = "https://github.com/CypherPoet/CypherPoetSwiftUIKit.git";
|
||||
requirement = {
|
||||
kind = upToNextMajorVersion;
|
||||
minimumVersion = 0.0.35;
|
||||
};
|
||||
};
|
||||
F3D4FD5A23E5F0E7000CF606 /* XCRemoteSwiftPackageReference "CypherPoetCoreDataKit" */ = {
|
||||
isa = XCRemoteSwiftPackageReference;
|
||||
repositoryURL = "https://github.com/CypherPoet/CypherPoetCoreDataKit.git";
|
||||
requirement = {
|
||||
kind = upToNextMajorVersion;
|
||||
minimumVersion = 0.0.8;
|
||||
};
|
||||
};
|
||||
F3D4FD8123E700EF000CF606 /* XCRemoteSwiftPackageReference "CypherPoetPropertyWrappers" */ = {
|
||||
isa = XCRemoteSwiftPackageReference;
|
||||
repositoryURL = "https://github.com/CypherPoet/CypherPoetPropertyWrappers.git";
|
||||
requirement = {
|
||||
kind = upToNextMajorVersion;
|
||||
minimumVersion = 0.0.1;
|
||||
};
|
||||
};
|
||||
/* End XCRemoteSwiftPackageReference section */
|
||||
|
||||
/* Begin XCSwiftPackageProductDependency section */
|
||||
F3D4FD5B23E5F0E7000CF606 /* CypherPoetCoreDataKit */ = {
|
||||
isa = XCSwiftPackageProductDependency;
|
||||
package = F3D4FD5A23E5F0E7000CF606 /* XCRemoteSwiftPackageReference "CypherPoetCoreDataKit" */;
|
||||
productName = CypherPoetCoreDataKit;
|
||||
};
|
||||
F3D4FD5E23E5F0F6000CF606 /* CypherPoetSwiftUIKit */ = {
|
||||
isa = XCSwiftPackageProductDependency;
|
||||
package = F3D4FD5923E5F051000CF606 /* XCRemoteSwiftPackageReference "CypherPoetSwiftUIKit" */;
|
||||
productName = CypherPoetSwiftUIKit;
|
||||
};
|
||||
F3D4FD8223E700EF000CF606 /* CypherPoetPropertyWrappers */ = {
|
||||
isa = XCSwiftPackageProductDependency;
|
||||
package = F3D4FD8123E700EF000CF606 /* XCRemoteSwiftPackageReference "CypherPoetPropertyWrappers" */;
|
||||
productName = CypherPoetPropertyWrappers;
|
||||
};
|
||||
/* End XCSwiftPackageProductDependency section */
|
||||
|
||||
/* Begin XCVersionGroup section */
|
||||
F3D4FD6323E5F14D000CF606 /* Dicey.xcdatamodeld */ = {
|
||||
isa = XCVersionGroup;
|
||||
children = (
|
||||
F3D4FD6423E5F14D000CF606 /* Dicey.xcdatamodel */,
|
||||
);
|
||||
currentVersion = F3D4FD6423E5F14D000CF606 /* Dicey.xcdatamodel */;
|
||||
path = Dicey.xcdatamodeld;
|
||||
sourceTree = "<group>";
|
||||
versionGroupType = wrapper.xcdatamodel;
|
||||
};
|
||||
/* End XCVersionGroup section */
|
||||
};
|
||||
rootObject = F3D4FD2D23E5E688000CF606 /* Project object */;
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:">
|
||||
</FileRef>
|
||||
</Workspace>
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
"object": {
|
||||
"pins": [
|
||||
{
|
||||
"package": "CypherPoetCoreDataKit",
|
||||
"repositoryURL": "https://github.com/CypherPoet/CypherPoetCoreDataKit.git",
|
||||
"state": {
|
||||
"branch": null,
|
||||
"revision": "4c02f3fa248d3b6c606a77f2f6c7c54eafb53bca",
|
||||
"version": "0.0.8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"package": "CypherPoetPropertyWrappers",
|
||||
"repositoryURL": "https://github.com/CypherPoet/CypherPoetPropertyWrappers.git",
|
||||
"state": {
|
||||
"branch": null,
|
||||
"revision": "9e1c62432f5a25a159e80dee28965e8cc20b7939",
|
||||
"version": "0.0.1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"package": "CypherPoetSwiftUIKit",
|
||||
"repositoryURL": "https://github.com/CypherPoet/CypherPoetSwiftUIKit.git",
|
||||
"state": {
|
||||
"branch": null,
|
||||
"revision": "dca4353f34bdf5a622fd5fc7c31dc72ad377194a",
|
||||
"version": "0.0.35"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"version": 1
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
//
|
||||
// AppDelegate.swift
|
||||
// Dicey
|
||||
//
|
||||
// Created by Brian Sipple on 2/1/20.
|
||||
// Copyright © 2020 CypherPoet. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
@UIApplicationMain
|
||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
|
||||
|
||||
|
||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
||||
// Override point for customization after application launch.
|
||||
CurrentApp.coreDataManager.setup()
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
// MARK: UISceneSession Lifecycle
|
||||
|
||||
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
|
||||
// Called when a new scene session is being created.
|
||||
// Use this method to select a configuration to create the new scene with.
|
||||
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
|
||||
}
|
||||
|
||||
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
|
||||
// Called when the user discards a scene session.
|
||||
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
|
||||
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
//
|
||||
// CurrentApplication.swift
|
||||
// Dicey
|
||||
//
|
||||
// Created by CypherPoet on 2/1/20.
|
||||
// ✌️
|
||||
//
|
||||
|
||||
|
||||
import Foundation
|
||||
import CypherPoetCoreDataKit_CoreDataManager
|
||||
|
||||
|
||||
struct CurrentApplication {
|
||||
var coreDataManager: CoreDataManager
|
||||
}
|
||||
|
||||
|
||||
var CurrentApp = CurrentApplication(
|
||||
coreDataManager: .shared
|
||||
)
|
|
@ -0,0 +1,81 @@
|
|||
//
|
||||
// SceneDelegate.swift
|
||||
// Dicey
|
||||
//
|
||||
// Created by Brian Sipple on 2/1/20.
|
||||
// Copyright © 2020 CypherPoet. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import SwiftUI
|
||||
|
||||
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
||||
|
||||
var window: UIWindow?
|
||||
|
||||
|
||||
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
|
||||
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
|
||||
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
|
||||
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
|
||||
|
||||
// Use a UIHostingController as window root view controller.
|
||||
if let windowScene = scene as? UIWindowScene {
|
||||
let window = UIWindow(windowScene: windowScene)
|
||||
|
||||
// Get the managed object context from the shared persistent container.
|
||||
let context = CurrentApp.coreDataManager.mainContext
|
||||
|
||||
#if targetEnvironment(simulator)
|
||||
PreviewData.setupSimulatorPreviewData(in: context)
|
||||
#endif
|
||||
|
||||
let store = AppStore(initialState: .init(), appReducer: appReducer)
|
||||
|
||||
// Create the SwiftUI view and set the context as the value for the managedObjectContext environment keyPath.
|
||||
// Add `@Environment(\.managedObjectContext)` in the views that will need the context.
|
||||
let entryView = DiceGeneratorContainerView()
|
||||
.environment(\.managedObjectContext, context)
|
||||
.environmentObject(store)
|
||||
|
||||
window.rootViewController = UIHostingController(rootView: entryView)
|
||||
|
||||
self.window = window
|
||||
window.makeKeyAndVisible()
|
||||
}
|
||||
}
|
||||
|
||||
func sceneDidDisconnect(_ scene: UIScene) {
|
||||
// Called as the scene is being released by the system.
|
||||
// This occurs shortly after the scene enters the background, or when its session is discarded.
|
||||
// Release any resources associated with this scene that can be re-created the next time the scene connects.
|
||||
// The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead).
|
||||
}
|
||||
|
||||
func sceneDidBecomeActive(_ scene: UIScene) {
|
||||
// Called when the scene has moved from an inactive state to an active state.
|
||||
// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
|
||||
}
|
||||
|
||||
func sceneWillResignActive(_ scene: UIScene) {
|
||||
// Called when the scene will move from an active state to an inactive state.
|
||||
// This may occur due to temporary interruptions (ex. an incoming phone call).
|
||||
}
|
||||
|
||||
func sceneWillEnterForeground(_ scene: UIScene) {
|
||||
// Called as the scene transitions from the background to the foreground.
|
||||
// Use this method to undo the changes made on entering the background.
|
||||
}
|
||||
|
||||
func sceneDidEnterBackground(_ scene: UIScene) {
|
||||
// Called as the scene transitions from the foreground to the background.
|
||||
// Use this method to save data, release shared resources, and store enough scene-specific state information
|
||||
// to restore the scene back to its current state.
|
||||
|
||||
// Save changes in the application's managed object context when the application transitions to the background.
|
||||
CurrentApp.coreDataManager.saveContexts()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="EHf-IW-A2E">
|
||||
<objects>
|
||||
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
|
||||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
|
||||
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="53" y="375"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
|
@ -0,0 +1,18 @@
|
|||
//
|
||||
// CoreDataManager+Utils.swift
|
||||
// Dicey
|
||||
//
|
||||
// Created by CypherPoet on 2/1/20.
|
||||
// ✌️
|
||||
//
|
||||
|
||||
|
||||
import Foundation
|
||||
import CypherPoetCoreDataKit_CoreDataManager
|
||||
|
||||
|
||||
extension CoreDataManager {
|
||||
static let shared = CoreDataManager(
|
||||
managedObjectModelName: "Dicey"
|
||||
)
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
//
|
||||
// Dice+Computeds.swift
|
||||
// Dicey
|
||||
//
|
||||
// Created by CypherPoet on 2/1/20.
|
||||
// ✌️
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
extension Dice {
|
||||
|
||||
var imageName: String {
|
||||
switch self {
|
||||
case .one:
|
||||
return "dice-1"
|
||||
case .two:
|
||||
return "dice-2"
|
||||
case .three:
|
||||
return "dice-3"
|
||||
case .four:
|
||||
return "dice-4"
|
||||
case .five:
|
||||
return "dice-5"
|
||||
case .six:
|
||||
return "dice-6"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
//
|
||||
// Dice+CoreDataClass.swift
|
||||
// Dicey
|
||||
//
|
||||
// Created by Brian Sipple on 2/1/20.
|
||||
// Copyright © 2020 CypherPoet. All rights reserved.
|
||||
//
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
enum Dice: Int16 {
|
||||
case one = 1
|
||||
case two
|
||||
case three
|
||||
case four
|
||||
case five
|
||||
case six
|
||||
}
|
||||
|
||||
extension Dice: CaseIterable {}
|
||||
|
||||
extension Dice: Identifiable {
|
||||
var id: Int16 { rawValue }
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
//
|
||||
// DiceRoll+Computeds.swift
|
||||
// Dicey
|
||||
//
|
||||
// Created by CypherPoet on 2/1/20.
|
||||
// ✌️
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
extension DiceRoll {
|
||||
|
||||
var diceArray: [Dice] {
|
||||
diceValues.compactMap(Dice.init(rawValue:))
|
||||
}
|
||||
|
||||
|
||||
var rollResult: Int {
|
||||
diceArray.reduce(0) { (accumulated, current) in
|
||||
accumulated + Int(current.rawValue)
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
//
|
||||
// DiceRoll+CoreDataClass.swift
|
||||
// Dicey
|
||||
//
|
||||
// Created by Brian Sipple on 2/1/20.
|
||||
// Copyright © 2020 CypherPoet. All rights reserved.
|
||||
//
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import CoreData
|
||||
|
||||
@objc(DiceRoll)
|
||||
public class DiceRoll: NSManagedObject {
|
||||
|
||||
}
|
||||
|
||||
|
||||
extension DiceRoll: Identifiable {}
|
|
@ -0,0 +1,22 @@
|
|||
//
|
||||
// DiceRoll+CoreDataProperties.swift
|
||||
// Dicey
|
||||
//
|
||||
// Created by Brian Sipple on 2/1/20.
|
||||
// Copyright © 2020 CypherPoet. All rights reserved.
|
||||
//
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import CoreData
|
||||
|
||||
|
||||
extension DiceRoll {
|
||||
|
||||
@nonobjc public class func fetchRequest() -> NSFetchRequest<DiceRoll> {
|
||||
return NSFetchRequest<DiceRoll>(entityName: "DiceRoll")
|
||||
}
|
||||
|
||||
@NSManaged public var createdAt: Date
|
||||
@NSManaged public var diceValues: [Int16]
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="15702" systemVersion="19C57" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
|
||||
<entity name="DiceRoll" representedClassName="DiceRoll" syncable="YES">
|
||||
<attribute name="createdAt" attributeType="Date" usesScalarValueType="NO"/>
|
||||
<attribute name="diceValues" attributeType="Transformable" valueTransformerName="NSSecureUnarchiveFromData" customClassName="[Int16]"/>
|
||||
</entity>
|
||||
<elements>
|
||||
<element name="DiceRoll" positionX="-63" positionY="-18" width="128" height="73"/>
|
||||
</elements>
|
||||
</model>
|
|
@ -0,0 +1,44 @@
|
|||
//
|
||||
// AppState.swift
|
||||
// Dicey
|
||||
//
|
||||
// Created by CypherPoet on 2/2/20.
|
||||
// ✌️
|
||||
//
|
||||
|
||||
|
||||
import Foundation
|
||||
import Combine
|
||||
import CypherPoetSwiftUIKit_DataFlowUtils
|
||||
|
||||
|
||||
|
||||
struct AppState {
|
||||
var diceGeneratorState = DiceGeneratorState()
|
||||
}
|
||||
|
||||
|
||||
|
||||
//enum AppSideEffect: SideEffect {
|
||||
//
|
||||
//}
|
||||
|
||||
|
||||
|
||||
enum AppAction {
|
||||
case diceGenerator(_ action: DiceGeneratorAction)
|
||||
}
|
||||
|
||||
|
||||
// MARK: - Reducer
|
||||
let appReducer: Reducer<AppState, AppAction> = Reducer(
|
||||
reduce: { appState, action in
|
||||
switch action {
|
||||
case .diceGenerator(let action):
|
||||
diceGeneratorReducer.reduce(&appState.diceGeneratorState, action)
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
typealias AppStore = Store<AppState, AppAction>
|
|
@ -0,0 +1,48 @@
|
|||
//
|
||||
// DiceGeneratorState.swift
|
||||
// Dicey
|
||||
//
|
||||
// Created by CypherPoet on 2/2/20.
|
||||
// ✌️
|
||||
//
|
||||
|
||||
|
||||
import Foundation
|
||||
import Combine
|
||||
import CypherPoetSwiftUIKit_DataFlowUtils
|
||||
import CypherPoetPropertyWrappers_UserDefault
|
||||
|
||||
|
||||
struct DiceGeneratorState {
|
||||
|
||||
@UserDefault("Dice Generator State :: roll size", defaultValue: 1)
|
||||
var rollSize: Int
|
||||
|
||||
|
||||
@UserDefault("Dice Generator State :: allows repeat results", defaultValue: true)
|
||||
var allowsRepeatResults: Bool
|
||||
}
|
||||
|
||||
|
||||
|
||||
//enum DiceGeneratorSideEffect: SideEffect {
|
||||
//
|
||||
//}
|
||||
|
||||
|
||||
|
||||
enum DiceGeneratorAction {
|
||||
case rollSizeSet(Int)
|
||||
}
|
||||
|
||||
|
||||
// MARK: - Reducer
|
||||
let diceGeneratorReducer: Reducer<DiceGeneratorState, DiceGeneratorAction> = Reducer(
|
||||
reduce: { state, action in
|
||||
switch action {
|
||||
case .rollSizeSet(let size):
|
||||
state.rollSize = size
|
||||
}
|
||||
}
|
||||
)
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UIApplicationSceneManifest</key>
|
||||
<dict>
|
||||
<key>UIApplicationSupportsMultipleScenes</key>
|
||||
<false/>
|
||||
<key>UISceneConfigurations</key>
|
||||
<dict>
|
||||
<key>UIWindowSceneSessionRoleApplication</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>UISceneConfigurationName</key>
|
||||
<string>Default Configuration</string>
|
||||
<key>UISceneDelegateClassName</key>
|
||||
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
//
|
||||
// PreviewData+AppStore.swift
|
||||
// Dicey
|
||||
//
|
||||
// Created by CypherPoet on 2/2/20.
|
||||
// ✌️
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
extension PreviewData {
|
||||
|
||||
enum AppStores {
|
||||
|
||||
static let `default`: AppStore = {
|
||||
AppStore(initialState: .init(), appReducer: appReducer)
|
||||
}()
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
//
|
||||
// PreviewData+Dice.swift
|
||||
// Dicey
|
||||
//
|
||||
// Created by CypherPoet on 2/3/20.
|
||||
// ✌️
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
extension PreviewData {
|
||||
|
||||
enum DiceRolls {
|
||||
|
||||
static let fourDice: DiceRoll = {
|
||||
let diceRoll = DiceRoll(context: CurrentApp.coreDataManager.mainContext)
|
||||
|
||||
diceRoll.diceValues = [1, 2, 3, 4]
|
||||
diceRoll.createdAt = Date()
|
||||
|
||||
return diceRoll
|
||||
}()
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
//
|
||||
// PreviewData.swift
|
||||
// Dicey
|
||||
//
|
||||
// Created by CypherPoet on 2/1/20.
|
||||
// ✌️
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import CoreData
|
||||
|
||||
|
||||
enum PreviewData {
|
||||
|
||||
static func setupSimulatorPreviewData(in context: NSManagedObjectContext) {
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,98 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "20x20",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "20x20",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "20x20",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "20x20",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "29x29",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "29x29",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "40x40",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "40x40",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "76x76",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "76x76",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "83.5x83.5",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ios-marketing",
|
||||
"size" : "1024x1024",
|
||||
"scale" : "1x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "dice-1.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "dice-1@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "dice-1@3x.png",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 21 KiB |
BIN
day-095/Dicey/Dicey/Resources/Assets.xcassets/dice-1.imageset/dice-1@2x.png
vendored
Normal file
After Width: | Height: | Size: 52 KiB |
BIN
day-095/Dicey/Dicey/Resources/Assets.xcassets/dice-1.imageset/dice-1@3x.png
vendored
Normal file
After Width: | Height: | Size: 85 KiB |
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "dice-2.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "dice-2@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "dice-2@3x.png",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 35 KiB |
BIN
day-095/Dicey/Dicey/Resources/Assets.xcassets/dice-2.imageset/dice-2@2x.png
vendored
Normal file
After Width: | Height: | Size: 92 KiB |
BIN
day-095/Dicey/Dicey/Resources/Assets.xcassets/dice-2.imageset/dice-2@3x.png
vendored
Normal file
After Width: | Height: | Size: 158 KiB |
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "dice-3.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "dice-3@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "dice-3@3x.png",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 29 KiB |
BIN
day-095/Dicey/Dicey/Resources/Assets.xcassets/dice-3.imageset/dice-3@2x.png
vendored
Normal file
After Width: | Height: | Size: 72 KiB |
BIN
day-095/Dicey/Dicey/Resources/Assets.xcassets/dice-3.imageset/dice-3@3x.png
vendored
Normal file
After Width: | Height: | Size: 124 KiB |
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "dice-4.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "dice-4@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "dice-4@3x.png",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 30 KiB |
BIN
day-095/Dicey/Dicey/Resources/Assets.xcassets/dice-4.imageset/dice-4@2x.png
vendored
Normal file
After Width: | Height: | Size: 72 KiB |
BIN
day-095/Dicey/Dicey/Resources/Assets.xcassets/dice-4.imageset/dice-4@3x.png
vendored
Normal file
After Width: | Height: | Size: 121 KiB |
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "dice-5.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "dice-5@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "dice-5@3x.png",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 32 KiB |
BIN
day-095/Dicey/Dicey/Resources/Assets.xcassets/dice-5.imageset/dice-5@2x.png
vendored
Normal file
After Width: | Height: | Size: 78 KiB |
BIN
day-095/Dicey/Dicey/Resources/Assets.xcassets/dice-5.imageset/dice-5@3x.png
vendored
Normal file
After Width: | Height: | Size: 136 KiB |
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "dice-6.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "dice-6@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "dice-6@3x.png",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 34 KiB |
BIN
day-095/Dicey/Dicey/Resources/Assets.xcassets/dice-6.imageset/dice-6@2x.png
vendored
Normal file
After Width: | Height: | Size: 84 KiB |
BIN
day-095/Dicey/Dicey/Resources/Assets.xcassets/dice-6.imageset/dice-6@3x.png
vendored
Normal file
After Width: | Height: | Size: 144 KiB |
|
@ -0,0 +1,60 @@
|
|||
//
|
||||
// DiceView.swift
|
||||
// Dicey
|
||||
//
|
||||
// Created by CypherPoet on 2/2/20.
|
||||
// ✌️
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
|
||||
struct DiceView {
|
||||
var dice: Dice
|
||||
|
||||
static let images: [Dice: Image] = [
|
||||
.one: Image(Dice.one.imageName),
|
||||
.two: Image(Dice.two.imageName),
|
||||
.three: Image(Dice.three.imageName),
|
||||
.four: Image(Dice.four.imageName),
|
||||
.five: Image(Dice.five.imageName),
|
||||
.six: Image(Dice.six.imageName),
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
// MARK: - View
|
||||
extension DiceView: View {
|
||||
|
||||
var body: some View {
|
||||
Self.images[dice]?
|
||||
.resizable()
|
||||
.scaledToFit()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// MARK: - Computeds
|
||||
extension DiceView {
|
||||
}
|
||||
|
||||
|
||||
// MARK: - View Variables
|
||||
extension DiceView {
|
||||
}
|
||||
|
||||
|
||||
// MARK: - Private Helpers
|
||||
private extension DiceView {
|
||||
}
|
||||
|
||||
|
||||
// MARK: - Preview
|
||||
struct DiceView_Previews: PreviewProvider {
|
||||
|
||||
static var previews: some View {
|
||||
VStack {
|
||||
DiceView(dice: Dice.allCases.randomElement()!)
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
//
|
||||
// HorizontalDiceRollView.swift
|
||||
// Dicey
|
||||
//
|
||||
// Created by CypherPoet on 2/2/20.
|
||||
// ✌️
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
|
||||
struct HorizontalDiceRollView {
|
||||
var diceCollection: [Dice] = []
|
||||
}
|
||||
|
||||
|
||||
// MARK: - View
|
||||
extension HorizontalDiceRollView: View {
|
||||
|
||||
var body: some View {
|
||||
Text("Horizontal Dice Roll View")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// MARK: - Computeds
|
||||
extension HorizontalDiceRollView {
|
||||
}
|
||||
|
||||
|
||||
// MARK: - View Variables
|
||||
extension HorizontalDiceRollView {
|
||||
}
|
||||
|
||||
|
||||
// MARK: - Private Helpers
|
||||
private extension HorizontalDiceRollView {
|
||||
}
|
||||
|
||||
|
||||
|
||||
// MARK: - Preview
|
||||
struct HorizontalDiceRollView_Previews: PreviewProvider {
|
||||
|
||||
static var previews: some View {
|
||||
HorizontalDiceRollView()
|
||||
}
|
||||
}
|
|
@ -0,0 +1,140 @@
|
|||
//
|
||||
// VerticalDiceRollView.swift
|
||||
// Dicey
|
||||
//
|
||||
// Created by CypherPoet on 2/2/20.
|
||||
// ✌️
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import CypherPoetSwiftUIKit_BindingUtils
|
||||
|
||||
|
||||
struct VerticalDiceRollView {
|
||||
var diceCollection: [Dice] = []
|
||||
}
|
||||
|
||||
|
||||
// MARK: - View
|
||||
extension VerticalDiceRollView: View {
|
||||
|
||||
var body: some View {
|
||||
GeometryReader { geometry in
|
||||
ZStack {
|
||||
ForEach(self.diceCollection.indexed(), id: \.element) { (index, dice) in
|
||||
DiceView(dice: dice)
|
||||
.frame(
|
||||
width: self.sideLength(forDiceIn: geometry),
|
||||
height: self.sideLength(forDiceIn: geometry)
|
||||
)
|
||||
.position(self.position(forDiceAt: index, in: geometry))
|
||||
}
|
||||
}
|
||||
.frame(
|
||||
width: self.frameHorizontalSpace(in: geometry),
|
||||
height: self.frameVerticalSpace(in: geometry)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// MARK: - Computeds
|
||||
extension VerticalDiceRollView {
|
||||
var rowSpacing: CGFloat { 12.0 }
|
||||
var columnSpacing: CGFloat { 16.0 }
|
||||
|
||||
var rowCount: Int { ((diceCollection.count - 1) / 2) + 1 }
|
||||
var columnCount: Int { diceCollection.count < 2 ? 1 : 2 }
|
||||
}
|
||||
|
||||
|
||||
// MARK: - View Variables
|
||||
extension VerticalDiceRollView {
|
||||
}
|
||||
|
||||
|
||||
// MARK: - Private Helpers
|
||||
private extension VerticalDiceRollView {
|
||||
|
||||
func columnNumber(forDiceAt index: Int) -> Int {
|
||||
index % columnCount
|
||||
}
|
||||
|
||||
func columnSpacingOffset(forDiceAt index: Int) -> CGFloat {
|
||||
columnSpacing * CGFloat(columnNumber(forDiceAt: index))
|
||||
}
|
||||
|
||||
|
||||
func rowNumber(forDiceAt index: Int) -> Int {
|
||||
index / columnCount
|
||||
}
|
||||
|
||||
func rowSpacingOffset(forDiceAt index: Int) -> CGFloat {
|
||||
rowSpacing * CGFloat(rowNumber(forDiceAt: index))
|
||||
}
|
||||
|
||||
|
||||
func frameHorizontalSpace(in geometry: GeometryProxy) -> CGFloat {
|
||||
sideLength(forDiceIn: geometry) * CGFloat(columnCount) + (columnSpacing * CGFloat(columnCount - 1))
|
||||
}
|
||||
|
||||
func frameVerticalSpace(in geometry: GeometryProxy) -> CGFloat {
|
||||
sideLength(forDiceIn: geometry) * CGFloat(rowCount) + (rowSpacing * CGFloat(rowCount - 1))
|
||||
}
|
||||
|
||||
|
||||
func sideLength(forDiceIn geometry: GeometryProxy) -> CGFloat {
|
||||
let availableVerticalSpace = geometry.size.height - (rowSpacing * CGFloat(rowCount - 1))
|
||||
let availableHorizontalSpace = geometry.size.width - (columnSpacing * CGFloat(columnCount - 1))
|
||||
|
||||
if columnCount >= rowCount {
|
||||
return availableHorizontalSpace / CGFloat(columnCount)
|
||||
} else {
|
||||
return availableVerticalSpace / CGFloat(rowCount)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func position(forDiceAt index: Int, in geometry: GeometryProxy) -> CGPoint {
|
||||
let sideLength = self.sideLength(forDiceIn: geometry)
|
||||
let columnNumber: CGFloat = CGFloat(self.columnNumber(forDiceAt: index))
|
||||
let rowNumber: CGFloat = CGFloat(self.rowNumber(forDiceAt: index))
|
||||
|
||||
let columnSpacingOffset = self.columnSpacingOffset(forDiceAt: index)
|
||||
let rowSpacingOffset = self.rowSpacingOffset(forDiceAt: index)
|
||||
|
||||
|
||||
let centerX = (columnNumber * sideLength) + columnSpacingOffset
|
||||
+ (sideLength / 2)
|
||||
|
||||
let centerY = (rowNumber * sideLength) + rowSpacingOffset
|
||||
+ (sideLength / 2)
|
||||
|
||||
|
||||
return CGPoint(x: centerX, y: centerY)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// MARK: - Preview
|
||||
struct VerticalDiceRollView_Previews: PreviewProvider {
|
||||
|
||||
static var previews: some View {
|
||||
VStack(alignment: .center) {
|
||||
VerticalDiceRollView(
|
||||
diceCollection: [.one, .two, .three, .four]
|
||||
// diceCollection: [.one, .two, .three, .four, .five, .six]
|
||||
// diceCollection: [.one, .two,]
|
||||
// diceCollection: [.one]
|
||||
// diceCollection: [.one, .two, .three]
|
||||
)
|
||||
|
||||
Spacer()
|
||||
|
||||
Text("Dice")
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
//
|
||||
// DiceGeneratorContainerView.swift
|
||||
// Dicey
|
||||
//
|
||||
// Created by CypherPoet on 2/2/20.
|
||||
// ✌️
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
|
||||
struct DiceGeneratorContainerView {
|
||||
@Environment(\.managedObjectContext) var managedObjectContext
|
||||
@EnvironmentObject private var store: AppStore
|
||||
|
||||
private var diceCount: Binding<Int> {
|
||||
store.binding(
|
||||
for: \.diceGeneratorState.rollSize,
|
||||
onChange: { .diceGenerator(.rollSizeSet($0)) }
|
||||
)
|
||||
}
|
||||
|
||||
@State private var isShowingRollHistory = false
|
||||
}
|
||||
|
||||
|
||||
// MARK: - View
|
||||
extension DiceGeneratorContainerView: View {
|
||||
|
||||
var body: some View {
|
||||
DiceGeneratorView(
|
||||
viewModel: .init(
|
||||
// diceGeneratorState: diceGeneratorState,
|
||||
diceCount: diceCount
|
||||
// diceRoll:
|
||||
),
|
||||
onDiceRolled: onDiceRolled(_:)
|
||||
)
|
||||
.sheet(isPresented: $isShowingRollHistory) {
|
||||
Text("Roll History")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// MARK: - Computeds
|
||||
extension DiceGeneratorContainerView {
|
||||
var diceGeneratorState: DiceGeneratorState { store.state.diceGeneratorState }
|
||||
}
|
||||
|
||||
|
||||
// MARK: - View Variables
|
||||
extension DiceGeneratorContainerView {
|
||||
}
|
||||
|
||||
|
||||
// MARK: - Private Helpers
|
||||
private extension DiceGeneratorContainerView {
|
||||
|
||||
func onDiceRolled(_ diceRoll: DiceRoll) {
|
||||
guard let context = diceRoll.managedObjectContext else { preconditionFailure() }
|
||||
|
||||
CurrentApp.coreDataManager.save(context)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// MARK: - Preview
|
||||
struct DiceGeneratorContainerView_Previews: PreviewProvider {
|
||||
|
||||
static var previews: some View {
|
||||
DiceGeneratorContainerView()
|
||||
.environment(\.managedObjectContext, CurrentApp.coreDataManager.mainContext)
|
||||
.environmentObject(PreviewData.AppStores.default)
|
||||
}
|
||||
}
|
|
@ -0,0 +1,106 @@
|
|||
//
|
||||
// DiceGeneratorView+ViewModel.swift
|
||||
// Dicey
|
||||
//
|
||||
// Created by CypherPoet on 2/2/20.
|
||||
// ✌️
|
||||
//
|
||||
|
||||
|
||||
import SwiftUI
|
||||
import Combine
|
||||
|
||||
|
||||
|
||||
extension DiceGeneratorView {
|
||||
final class ViewModel: ObservableObject {
|
||||
private var subscriptions = Set<AnyCancellable>()
|
||||
|
||||
// private let diceGeneratorState: DiceGeneratorState
|
||||
private var rollResults: [Dice] = []
|
||||
|
||||
@Binding var diceCount: Int
|
||||
// @Binding var diceRoll: DiceRoll
|
||||
|
||||
|
||||
// MARK: - Published Outputs
|
||||
@Published var diceCollection: [Dice] = []
|
||||
|
||||
|
||||
// MARK: - Init
|
||||
init(
|
||||
// diceGeneratorState: DiceGeneratorState,
|
||||
diceCount: Binding<Int>
|
||||
// diceRoll: Binding<DiceRoll>
|
||||
) {
|
||||
// self.diceGeneratorState = diceGeneratorState
|
||||
self._diceCount = diceCount
|
||||
// self._diceRoll = diceRoll
|
||||
|
||||
setupSubscribers()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// MARK: - Publishers
|
||||
extension DiceGeneratorView.ViewModel {
|
||||
|
||||
private var rollResultsPublisher: AnyPublisher<[Dice], Never> {
|
||||
CurrentValueSubject(rollResults)
|
||||
.eraseToAnyPublisher()
|
||||
}
|
||||
|
||||
|
||||
private var diceCollectionPublisher: Publishers.Share<AnyPublisher<[Dice], Never>> {
|
||||
// guard let managedObjectContext = diceRoll.managedObjectContext else {
|
||||
// preconditionFailure()
|
||||
// }
|
||||
|
||||
return Publishers.CombineLatest(
|
||||
CurrentValueSubject(diceCount),
|
||||
rollResultsPublisher
|
||||
)
|
||||
.print("diceCollectionPublisher")
|
||||
.map { (diceCount, results) in
|
||||
let rollResultsCount = results.count
|
||||
|
||||
return (0 ..< diceCount).map { index -> Dice in
|
||||
if index <= (rollResultsCount - 1) {
|
||||
// use result
|
||||
return results[index]
|
||||
} else {
|
||||
// make new "starting" dice
|
||||
return .one
|
||||
}
|
||||
}
|
||||
}
|
||||
.eraseToAnyPublisher()
|
||||
.share()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// MARK: - Computeds
|
||||
extension DiceGeneratorView.ViewModel {
|
||||
|
||||
}
|
||||
|
||||
|
||||
// MARK: - Public Methods
|
||||
extension DiceGeneratorView.ViewModel {
|
||||
}
|
||||
|
||||
|
||||
|
||||
// MARK: - Private Helpers
|
||||
private extension DiceGeneratorView.ViewModel {
|
||||
|
||||
func setupSubscribers() {
|
||||
diceCollectionPublisher
|
||||
.receive(on: DispatchQueue.main)
|
||||
.assign(to: \.diceCollection, on: self)
|
||||
.store(in: &subscriptions)
|
||||
}
|
||||
}
|
|
@ -0,0 +1,102 @@
|
|||
//
|
||||
// DiceGeneratorView.swift
|
||||
// Dicey
|
||||
//
|
||||
// Created by CypherPoet on 2/2/20.
|
||||
// ✌️
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
|
||||
struct DiceGeneratorView {
|
||||
@Environment(\.horizontalSizeClass) var horizontalSizeClass
|
||||
@Environment(\.verticalSizeClass) var verticalSizeClass
|
||||
|
||||
private let diceCountRange = 1...4
|
||||
|
||||
@ObservedObject var viewModel: ViewModel
|
||||
let onDiceRolled: ((DiceRoll) -> Void)?
|
||||
}
|
||||
|
||||
|
||||
|
||||
// MARK: - View
|
||||
extension DiceGeneratorView: View {
|
||||
|
||||
var body: some View {
|
||||
Group {
|
||||
if isShowingHorizontalDiceLayout {
|
||||
HorizontalDiceRollView(diceCollection: viewModel.diceCollection)
|
||||
// .offset(offsetFromShake)
|
||||
} else {
|
||||
VerticalDiceRollView(diceCollection: viewModel.diceCollection)
|
||||
// .offset(offsetFromShake)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// MARK: - Computeds
|
||||
extension DiceGeneratorView {
|
||||
var isShowingHorizontalDiceLayout: Bool {
|
||||
horizontalSizeClass == .regular && verticalSizeClass == .compact
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// MARK: - View Variables
|
||||
extension DiceGeneratorView {
|
||||
|
||||
private var roleButton: some View {
|
||||
Button(action: {
|
||||
// self.onDiceRolled?(viewModel.diceRollFromForm)
|
||||
}) {
|
||||
Text("Roll")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private var controlPanel: some View {
|
||||
Form {
|
||||
HStack {
|
||||
Text("Dice Count")
|
||||
|
||||
Spacer()
|
||||
|
||||
Text("\(viewModel.diceCount)")
|
||||
Stepper("Dice Count", value: viewModel.$diceCount, in: diceCountRange)
|
||||
.labelsHidden()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// MARK: - Private Helpers
|
||||
private extension DiceGeneratorView {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// MARK: - Preview
|
||||
struct DiceGeneratorView_Previews: PreviewProvider {
|
||||
|
||||
static var previews: some View {
|
||||
// let diceRoll = DiceRoll(context: CurrentApp.coreDataManager.mainContext)
|
||||
|
||||
return DiceGeneratorView(
|
||||
viewModel: .init(
|
||||
diceCount: .constant(2)
|
||||
// diceRoll: .constant(diceRoll)
|
||||
),
|
||||
onDiceRolled: { _ in }
|
||||
)
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 21 KiB |
After Width: | Height: | Size: 52 KiB |
After Width: | Height: | Size: 85 KiB |
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 92 KiB |
After Width: | Height: | Size: 158 KiB |
After Width: | Height: | Size: 29 KiB |
After Width: | Height: | Size: 72 KiB |
After Width: | Height: | Size: 124 KiB |
After Width: | Height: | Size: 30 KiB |
After Width: | Height: | Size: 72 KiB |
After Width: | Height: | Size: 121 KiB |
After Width: | Height: | Size: 32 KiB |
After Width: | Height: | Size: 78 KiB |
After Width: | Height: | Size: 136 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 84 KiB |
After Width: | Height: | Size: 144 KiB |