Skip to content

Commit ed56d03

Browse files
Initial implementation
1 parent bd5594e commit ed56d03

File tree

11 files changed

+273
-34
lines changed

11 files changed

+273
-34
lines changed

.gitignore

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Xcode
2+
#
3+
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
4+
5+
## Build generated
6+
build/
7+
DerivedData
8+
9+
## Various settings
10+
*.pbxuser
11+
!default.pbxuser
12+
*.mode1v3
13+
!default.mode1v3
14+
*.mode2v3
15+
!default.mode2v3
16+
*.perspectivev3
17+
!default.perspectivev3
18+
xcuserdata
19+
20+
## Other
21+
*.xccheckout
22+
*.moved-aside
23+
*.xcuserstate
24+
*.xcscmblueprint
25+
26+
## Obj-C/Swift specific
27+
*.hmap
28+
*.ipa
29+
30+
# Swift Package Manager
31+
#
32+
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
33+
# Packages/
34+
.build/
35+
36+
# CocoaPods
37+
#
38+
# We recommend against adding the Pods directory to your .gitignore. However
39+
# you should judge for yourself, the pros and cons are mentioned at:
40+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
41+
#
42+
# Pods/
43+
44+
# Carthage
45+
#
46+
# Add this line if you want to avoid checking in source code from Carthage dependencies.
47+
Carthage/Checkouts
48+
49+
Carthage/Build
50+
51+
# fastlane
52+
#
53+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
54+
# screenshots whenever they are needed.
55+
# For more information about the recommended setup visit:
56+
# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md
57+
58+
fastlane/report.xml
59+
fastlane/screenshots

Cartfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github "ReSwift/ReSwift" ~> 2.0

Cartfile.resolved

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github "ReSwift/ReSwift" "2.0.0"

CounterExample.xcodeproj/project.pbxproj

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,31 @@
1212
3C135C351D53E29400EC9FC9 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3C135C331D53E29400EC9FC9 /* Main.storyboard */; };
1313
3C135C371D53E29400EC9FC9 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3C135C361D53E29400EC9FC9 /* Assets.xcassets */; };
1414
3C135C3A1D53E29400EC9FC9 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3C135C381D53E29400EC9FC9 /* LaunchScreen.storyboard */; };
15+
3C135C461D53E94C00EC9FC9 /* ReSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3C135C451D53E94C00EC9FC9 /* ReSwift.framework */; };
16+
3C135C471D53E94C00EC9FC9 /* ReSwift.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3C135C451D53E94C00EC9FC9 /* ReSwift.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
17+
3C135C4C1D53EC0F00EC9FC9 /* Reducers in Resources */ = {isa = PBXBuildFile; fileRef = 3C135C491D53EC0F00EC9FC9 /* Reducers */; };
18+
3C135C4D1D53EC0F00EC9FC9 /* State in Resources */ = {isa = PBXBuildFile; fileRef = 3C135C4A1D53EC0F00EC9FC9 /* State */; };
19+
3C135C4E1D53EC0F00EC9FC9 /* Store in Resources */ = {isa = PBXBuildFile; fileRef = 3C135C4B1D53EC0F00EC9FC9 /* Store */; };
20+
3C135C501D53EC6600EC9FC9 /* Actions in Resources */ = {isa = PBXBuildFile; fileRef = 3C135C4F1D53EC6600EC9FC9 /* Actions */; };
21+
3C135C601D547F7700EC9FC9 /* AppState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C135C5F1D547F7700EC9FC9 /* AppState.swift */; };
22+
3C135C651D55C92200EC9FC9 /* Actions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C135C641D55C92200EC9FC9 /* Actions.swift */; };
23+
3C135C671D55C94300EC9FC9 /* CounterReducer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C135C661D55C94300EC9FC9 /* CounterReducer.swift */; };
1524
/* End PBXBuildFile section */
1625

26+
/* Begin PBXCopyFilesBuildPhase section */
27+
3C135C441D53E44A00EC9FC9 /* Embed Frameworks */ = {
28+
isa = PBXCopyFilesBuildPhase;
29+
buildActionMask = 2147483647;
30+
dstPath = "";
31+
dstSubfolderSpec = 10;
32+
files = (
33+
3C135C471D53E94C00EC9FC9 /* ReSwift.framework in Embed Frameworks */,
34+
);
35+
name = "Embed Frameworks";
36+
runOnlyForDeploymentPostprocessing = 0;
37+
};
38+
/* End PBXCopyFilesBuildPhase section */
39+
1740
/* Begin PBXFileReference section */
1841
3C135C2C1D53E29400EC9FC9 /* CounterExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CounterExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
1942
3C135C2F1D53E29400EC9FC9 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
@@ -22,13 +45,22 @@
2245
3C135C361D53E29400EC9FC9 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
2346
3C135C391D53E29400EC9FC9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
2447
3C135C3B1D53E29400EC9FC9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
48+
3C135C451D53E94C00EC9FC9 /* ReSwift.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ReSwift.framework; path = Carthage/Build/iOS/ReSwift.framework; sourceTree = "<group>"; };
49+
3C135C491D53EC0F00EC9FC9 /* Reducers */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Reducers; path = /Users/colineberhardt/Projects/CounterExample/CounterExample/CounterExample/Reducers; sourceTree = "<absolute>"; };
50+
3C135C4A1D53EC0F00EC9FC9 /* State */ = {isa = PBXFileReference; lastKnownFileType = folder; name = State; path = /Users/colineberhardt/Projects/CounterExample/CounterExample/CounterExample/State; sourceTree = "<absolute>"; };
51+
3C135C4B1D53EC0F00EC9FC9 /* Store */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Store; path = /Users/colineberhardt/Projects/CounterExample/CounterExample/CounterExample/Store; sourceTree = "<absolute>"; };
52+
3C135C4F1D53EC6600EC9FC9 /* Actions */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Actions; path = /Users/colineberhardt/Projects/CounterExample/CounterExample/CounterExample/Actions; sourceTree = "<absolute>"; };
53+
3C135C5F1D547F7700EC9FC9 /* AppState.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AppState.swift; path = State/AppState.swift; sourceTree = "<group>"; };
54+
3C135C641D55C92200EC9FC9 /* Actions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Actions.swift; path = Actions/Actions.swift; sourceTree = "<group>"; };
55+
3C135C661D55C94300EC9FC9 /* CounterReducer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CounterReducer.swift; path = Reducers/CounterReducer.swift; sourceTree = "<group>"; };
2556
/* End PBXFileReference section */
2657

2758
/* Begin PBXFrameworksBuildPhase section */
2859
3C135C291D53E29400EC9FC9 /* Frameworks */ = {
2960
isa = PBXFrameworksBuildPhase;
3061
buildActionMask = 2147483647;
3162
files = (
63+
3C135C461D53E94C00EC9FC9 /* ReSwift.framework in Frameworks */,
3264
);
3365
runOnlyForDeploymentPostprocessing = 0;
3466
};
@@ -38,6 +70,7 @@
3870
3C135C231D53E29400EC9FC9 = {
3971
isa = PBXGroup;
4072
children = (
73+
3C135C451D53E94C00EC9FC9 /* ReSwift.framework */,
4174
3C135C2E1D53E29400EC9FC9 /* CounterExample */,
4275
3C135C2D1D53E29400EC9FC9 /* Products */,
4376
);
@@ -54,6 +87,9 @@
5487
3C135C2E1D53E29400EC9FC9 /* CounterExample */ = {
5588
isa = PBXGroup;
5689
children = (
90+
3C135C631D55C91800EC9FC9 /* Reducers */,
91+
3C135C621D55C91300EC9FC9 /* State */,
92+
3C135C611D55C90900EC9FC9 /* Actions */,
5793
3C135C2F1D53E29400EC9FC9 /* AppDelegate.swift */,
5894
3C135C311D53E29400EC9FC9 /* ViewController.swift */,
5995
3C135C331D53E29400EC9FC9 /* Main.storyboard */,
@@ -64,6 +100,30 @@
64100
path = CounterExample;
65101
sourceTree = "<group>";
66102
};
103+
3C135C611D55C90900EC9FC9 /* Actions */ = {
104+
isa = PBXGroup;
105+
children = (
106+
3C135C641D55C92200EC9FC9 /* Actions.swift */,
107+
);
108+
name = Actions;
109+
sourceTree = "<group>";
110+
};
111+
3C135C621D55C91300EC9FC9 /* State */ = {
112+
isa = PBXGroup;
113+
children = (
114+
3C135C5F1D547F7700EC9FC9 /* AppState.swift */,
115+
);
116+
name = State;
117+
sourceTree = "<group>";
118+
};
119+
3C135C631D55C91800EC9FC9 /* Reducers */ = {
120+
isa = PBXGroup;
121+
children = (
122+
3C135C661D55C94300EC9FC9 /* CounterReducer.swift */,
123+
);
124+
name = Reducers;
125+
sourceTree = "<group>";
126+
};
67127
/* End PBXGroup section */
68128

69129
/* Begin PBXNativeTarget section */
@@ -74,6 +134,7 @@
74134
3C135C281D53E29400EC9FC9 /* Sources */,
75135
3C135C291D53E29400EC9FC9 /* Frameworks */,
76136
3C135C2A1D53E29400EC9FC9 /* Resources */,
137+
3C135C441D53E44A00EC9FC9 /* Embed Frameworks */,
77138
);
78139
buildRules = (
79140
);
@@ -122,9 +183,13 @@
122183
isa = PBXResourcesBuildPhase;
123184
buildActionMask = 2147483647;
124185
files = (
186+
3C135C4E1D53EC0F00EC9FC9 /* Store in Resources */,
125187
3C135C3A1D53E29400EC9FC9 /* LaunchScreen.storyboard in Resources */,
188+
3C135C4D1D53EC0F00EC9FC9 /* State in Resources */,
189+
3C135C4C1D53EC0F00EC9FC9 /* Reducers in Resources */,
126190
3C135C371D53E29400EC9FC9 /* Assets.xcassets in Resources */,
127191
3C135C351D53E29400EC9FC9 /* Main.storyboard in Resources */,
192+
3C135C501D53EC6600EC9FC9 /* Actions in Resources */,
128193
);
129194
runOnlyForDeploymentPostprocessing = 0;
130195
};
@@ -135,6 +200,9 @@
135200
isa = PBXSourcesBuildPhase;
136201
buildActionMask = 2147483647;
137202
files = (
203+
3C135C601D547F7700EC9FC9 /* AppState.swift in Sources */,
204+
3C135C671D55C94300EC9FC9 /* CounterReducer.swift in Sources */,
205+
3C135C651D55C92200EC9FC9 /* Actions.swift in Sources */,
138206
3C135C321D53E29400EC9FC9 /* ViewController.swift in Sources */,
139207
3C135C301D53E29400EC9FC9 /* AppDelegate.swift in Sources */,
140208
);
@@ -251,6 +319,10 @@
251319
isa = XCBuildConfiguration;
252320
buildSettings = {
253321
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
322+
FRAMEWORK_SEARCH_PATHS = (
323+
"$(inherited)",
324+
"$(PROJECT_DIR)/Carthage/Build/iOS",
325+
);
254326
INFOPLIST_FILE = CounterExample/Info.plist;
255327
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
256328
PRODUCT_BUNDLE_IDENTIFIER = com.reswift.CounterExample;
@@ -262,6 +334,10 @@
262334
isa = XCBuildConfiguration;
263335
buildSettings = {
264336
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
337+
FRAMEWORK_SEARCH_PATHS = (
338+
"$(inherited)",
339+
"$(PROJECT_DIR)/Carthage/Build/iOS",
340+
);
265341
INFOPLIST_FILE = CounterExample/Info.plist;
266342
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
267343
PRODUCT_BUNDLE_IDENTIFIER = com.reswift.CounterExample;

CounterExample.xcodeproj/xcuserdata/colineberhardt.xcuserdatad/xcschemes/CounterExample.xcscheme

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,22 @@
55
<BuildAction
66
parallelizeBuildables = "YES"
77
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "3C135C2B1D53E29400EC9FC9"
18+
BuildableName = "CounterExample.app"
19+
BlueprintName = "CounterExample"
20+
ReferencedContainer = "container:CounterExample.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
824
</BuildAction>
925
<TestAction
1026
buildConfiguration = "Debug"
@@ -13,6 +29,15 @@
1329
shouldUseLaunchSchemeArgsEnv = "YES">
1430
<Testables>
1531
</Testables>
32+
<MacroExpansion>
33+
<BuildableReference
34+
BuildableIdentifier = "primary"
35+
BlueprintIdentifier = "3C135C2B1D53E29400EC9FC9"
36+
BuildableName = "CounterExample.app"
37+
BlueprintName = "CounterExample"
38+
ReferencedContainer = "container:CounterExample.xcodeproj">
39+
</BuildableReference>
40+
</MacroExpansion>
1641
<AdditionalOptions>
1742
</AdditionalOptions>
1843
</TestAction>
@@ -26,6 +51,16 @@
2651
debugDocumentVersioning = "YES"
2752
debugServiceExtension = "internal"
2853
allowLocationSimulation = "YES">
54+
<BuildableProductRunnable
55+
runnableDebuggingMode = "0">
56+
<BuildableReference
57+
BuildableIdentifier = "primary"
58+
BlueprintIdentifier = "3C135C2B1D53E29400EC9FC9"
59+
BuildableName = "CounterExample.app"
60+
BlueprintName = "CounterExample"
61+
ReferencedContainer = "container:CounterExample.xcodeproj">
62+
</BuildableReference>
63+
</BuildableProductRunnable>
2964
<AdditionalOptions>
3065
</AdditionalOptions>
3166
</LaunchAction>
@@ -35,6 +70,16 @@
3570
savedToolIdentifier = ""
3671
useCustomWorkingDirectory = "NO"
3772
debugDocumentVersioning = "YES">
73+
<BuildableProductRunnable
74+
runnableDebuggingMode = "0">
75+
<BuildableReference
76+
BuildableIdentifier = "primary"
77+
BlueprintIdentifier = "3C135C2B1D53E29400EC9FC9"
78+
BuildableName = "CounterExample.app"
79+
BlueprintName = "CounterExample"
80+
ReferencedContainer = "container:CounterExample.xcodeproj">
81+
</BuildableReference>
82+
</BuildableProductRunnable>
3883
</ProfileAction>
3984
<AnalyzeAction
4085
buildConfiguration = "Debug">

CounterExample/Actions/Actions.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import ReSwift
2+
3+
struct CounterActionIncrease: Action {}
4+
struct CounterActionDecrease: Action {}

CounterExample/AppDelegate.swift

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
//
88

99
import UIKit
10+
import ReSwift
11+
12+
let mainStore = Store<AppState>(
13+
reducer: CounterReducer(),
14+
state: nil
15+
)
1016

1117
@UIApplicationMain
1218
class AppDelegate: UIResponder, UIApplicationDelegate {
@@ -15,32 +21,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
1521

1622

1723
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
18-
// Override point for customization after application launch.
1924
return true
2025
}
2126

22-
func applicationWillResignActive(application: UIApplication) {
23-
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
24-
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
25-
}
26-
27-
func applicationDidEnterBackground(application: UIApplication) {
28-
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
29-
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
30-
}
31-
32-
func applicationWillEnterForeground(application: UIApplication) {
33-
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
34-
}
35-
36-
func applicationDidBecomeActive(application: UIApplication) {
37-
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
38-
}
39-
40-
func applicationWillTerminate(application: UIApplication) {
41-
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
42-
}
43-
44-
4527
}
4628

0 commit comments

Comments
 (0)