Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Created by https://www.toptal.com/developers/gitignore/api/swift
# Edit at https://www.toptal.com/developers/gitignore?templates=swift

### Swift ###
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## User settings
xcuserdata/

## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
*.xcscmblueprint
*.xccheckout

## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
build/
DerivedData/
*.moved-aside
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3

## Obj-C/Swift specific
*.hmap

## App packaging
*.ipa
*.dSYM.zip
*.dSYM

## Playgrounds
timeline.xctimeline
playground.xcworkspace

# Swift Package Manager
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
# Package.resolved
# *.xcodeproj
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
# hence it is not needed unless you have added a package configuration file to your project
# .swiftpm

.build/

# CocoaPods
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
# Pods/
# Add this line if you want to avoid checking in source code from the Xcode workspace
# *.xcworkspace
*.xcuserstate

# Carthage
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts

Carthage/Build/

# Accio dependency management
Dependencies/
.accio/

# fastlane
# It is recommended to not store the screenshots in the git repo.
# Instead, use fastlane to re-generate the screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots/**/*.png
fastlane/test_output

# Code Injection
# After new code Injection tools there's a generated folder /iOSInjectionProject
# https://github.com/johnno1962/injectionforxcode

iOSInjectionProject/

# End of https://www.toptal.com/developers/gitignore/api/swift
753 changes: 753 additions & 0 deletions CountApp_Elly/CountApp_Elly.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?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>SchemeUserState</key>
<dict>
<key>CountApp_Elly.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"images" : [
{
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "americano.jpeg",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "americano 1.jpeg",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "americano 2.jpeg",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "caramel_macchiato.jpeg",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "caramel_macchiato 1.jpeg",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "caramel_macchiato 2.jpeg",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "hazelnut_latte.jpeg",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "hazelnut_latte 1.jpeg",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "hazelnut_latte 2.jpeg",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "latte.jpeg",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "latte 1.jpeg",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "latte 2.jpeg",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "moca.jpeg",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "moca 1.jpeg",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "moca 2.jpeg",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions CountApp_Elly/CountApp_Elly/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
18 changes: 18 additions & 0 deletions CountApp_Elly/CountApp_Elly/CountApp_EllyApp.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// CountApp_EllyApp.swift
// CountApp_Elly
//
// Created by elly on 1/13/24.
//

import SwiftUI
import ComposableArchitecture

@main
struct CountApp_EllyApp: App {
var body: some Scene {
WindowGroup {
CounterAppView(store: Store(initialState: CounterAppStore.State(), reducer: { CounterAppStore() }))
}
}
}
36 changes: 36 additions & 0 deletions CountApp_Elly/CountApp_Elly/Domain/CoffeeMenu/CoffeeMenuView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//
// CoffeeMenuView.swift
// CountApp_Elly
//
// Created by elly on 1/13/24.
//

import SwiftUI
import ComposableArchitecture

struct CoffeeMenuView: View {
@ObservedObject var viewStore: ViewStore<CounterAppStore.State, CounterAppStore.Action>

var body: some View {
NavigationView {
VStack(alignment: .leading, spacing: 0) {
ForEach(viewStore.listOfMenu.indices, id: \.self) { index in
MenuItemView(viewStore: viewStore, index: index)
.frame(maxWidth: .infinity)
.onTapGesture {
viewStore.send(.menuTapped(index, 1))
}
.contextMenu {
CoffeeMenuContextView(viewStore: viewStore, index: index)
}
}
}
.navigationTitle(String(localized: "title_coffee_menu_counting"))
.navigationBarTitleDisplayMode(.inline)
}
}
}

//#Preview {
// CoffeeMenuView()
//}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
//
// CoffeeMenuContextView.swift
// CountApp_Elly
//
// Created by elly on 1/13/24.
//

import SwiftUI
import ComposableArchitecture

struct CoffeeMenuContextView: View {
@ObservedObject var viewStore: ViewStore<CounterAppStore.State, CounterAppStore.Action>
var index: Int

var body: some View {
Button {
viewStore.send(.removeMenuCounting(index))
} label: {
Text(String(localized: "text_reset"))
}

Button {
viewStore.send(.menuTapped(index, 1))
} label: {
Text("+1")
}

Button {
viewStore.send(.menuTapped(index, 5))
} label: {
Text("+5")
}

Button {
viewStore.send(.menuTapped(index, 10))
} label: {
Text("+10")
}
}
}
Loading