├── .gitignore
├── CONTRIBUTING.md
├── LICENSE
├── Podfile
├── Podfile.lock
├── README.md
├── SwiftUI-Combine.xcodeproj
└── project.pbxproj
├── SwiftUI-Combine.xcworkspace
├── contents.xcworkspacedata
└── xcshareddata
│ └── IDEWorkspaceChecks.plist
├── SwiftUI-Combine
├── AppDelegate.swift
├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ ├── 100.png
│ │ ├── 1024.png
│ │ ├── 114.png
│ │ ├── 120.png
│ │ ├── 144.png
│ │ ├── 152.png
│ │ ├── 167.png
│ │ ├── 180.png
│ │ ├── 20.png
│ │ ├── 29.png
│ │ ├── 40.png
│ │ ├── 50.png
│ │ ├── 57.png
│ │ ├── 58.png
│ │ ├── 60.png
│ │ ├── 72.png
│ │ ├── 76.png
│ │ ├── 80.png
│ │ ├── 87.png
│ │ └── Contents.json
│ └── Contents.json
├── Base.lproj
│ └── LaunchScreen.storyboard
├── Info.plist
├── Preview Content
│ └── Preview Assets.xcassets
│ │ └── Contents.json
├── SceneDelegate.swift
├── ViewModels
│ └── UserViewModel.swift
└── Views
│ └── ContentView.swift
├── SwiftUI-CombineTests
├── Info.plist
└── SwiftUI_CombineTests.swift
└── images
├── demo.gif
├── screenshot-dark2.png
├── screenshot.png
├── swiftui-128x128.png
└── swiftui-512x512.png
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | # Created by https://www.gitignore.io/api/xcode,swift,macos,objective-c
3 | # Edit at https://www.gitignore.io/?templates=xcode,swift,macos,objective-c
4 |
5 | ### macOS ###
6 | # General
7 | .DS_Store
8 | .AppleDouble
9 | .LSOverride
10 |
11 | # Icon must end with two \r
12 | Icon
13 |
14 | # Thumbnails
15 | ._*
16 |
17 | # Files that might appear in the root of a volume
18 | .DocumentRevisions-V100
19 | .fseventsd
20 | .Spotlight-V100
21 | .TemporaryItems
22 | .Trashes
23 | .VolumeIcon.icns
24 | .com.apple.timemachine.donotpresent
25 |
26 | # Directories potentially created on remote AFP share
27 | .AppleDB
28 | .AppleDesktop
29 | Network Trash Folder
30 | Temporary Items
31 | .apdisk
32 |
33 | ### Objective-C ###
34 | # Xcode
35 | #
36 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
37 |
38 | ## Build generated
39 | build/
40 | DerivedData/
41 |
42 | ## Various settings
43 | *.pbxuser
44 | !default.pbxuser
45 | *.mode1v3
46 | !default.mode1v3
47 | *.mode2v3
48 | !default.mode2v3
49 | *.perspectivev3
50 | !default.perspectivev3
51 | xcuserdata/
52 |
53 | ## Other
54 | *.moved-aside
55 | *.xccheckout
56 | *.xcscmblueprint
57 |
58 | ## Obj-C/Swift specific
59 | *.hmap
60 | *.ipa
61 | *.dSYM.zip
62 | *.dSYM
63 |
64 | # CocoaPods
65 | # We recommend against adding the Pods directory to your .gitignore. However
66 | # you should judge for yourself, the pros and cons are mentioned at:
67 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
68 | Pods/
69 | # Add this line if you want to avoid checking in source code from the Xcode workspace
70 | # *.xcworkspace
71 |
72 | # Carthage
73 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
74 | # Carthage/Checkouts
75 |
76 | Carthage/Build
77 |
78 | # fastlane
79 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
80 | # screenshots whenever they are needed.
81 | # For more information about the recommended setup visit:
82 | # https://docs.fastlane.tools/best-practices/source-control/#source-control
83 |
84 | fastlane/report.xml
85 | fastlane/Preview.html
86 | fastlane/screenshots/**/*.png
87 | fastlane/test_output
88 |
89 | # Code Injection
90 | # After new code Injection tools there's a generated folder /iOSInjectionProject
91 | # https://github.com/johnno1962/injectionforxcode
92 |
93 | iOSInjectionProject/
94 |
95 | ### Objective-C Patch ###
96 |
97 | ### Swift ###
98 | # Xcode
99 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
100 |
101 |
102 |
103 |
104 |
105 | ## Playgrounds
106 | timeline.xctimeline
107 | playground.xcworkspace
108 |
109 | # Swift Package Manager
110 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
111 | # Packages/
112 | # Package.pins
113 | # Package.resolved
114 | .build/
115 |
116 | # CocoaPods
117 | # We recommend against adding the Pods directory to your .gitignore. However
118 | # you should judge for yourself, the pros and cons are mentioned at:
119 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
120 | # Pods/
121 | # Add this line if you want to avoid checking in source code from the Xcode workspace
122 | # *.xcworkspace
123 |
124 | # Carthage
125 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
126 | # Carthage/Checkouts
127 |
128 |
129 | # Accio dependency management
130 | Dependencies/
131 | .accio/
132 |
133 | # fastlane
134 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
135 | # screenshots whenever they are needed.
136 | # For more information about the recommended setup visit:
137 | # https://docs.fastlane.tools/best-practices/source-control/#source-control
138 |
139 |
140 | # Code Injection
141 | # After new code Injection tools there's a generated folder /iOSInjectionProject
142 | # https://github.com/johnno1962/injectionforxcode
143 |
144 |
145 | ### Xcode ###
146 | # Xcode
147 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
148 |
149 | ## User settings
150 |
151 | ## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
152 |
153 | ## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
154 |
155 | ## Xcode Patch
156 | *.xcodeproj/*
157 | !*.xcodeproj/project.pbxproj
158 | !*.xcodeproj/xcshareddata/
159 | !*.xcworkspace/contents.xcworkspacedata
160 | /*.gcno
161 |
162 | ### Xcode Patch ###
163 | **/xcshareddata/WorkspaceSettings.xcsettings
164 |
165 | # End of https://www.gitignore.io/api/xcode,swift,macos,objective-c
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # How to become a contributor and submit your own code
2 |
3 | ## Contributor License Agreements
4 |
5 | We'd love to accept your patches! Before we can take them, we have to jump
6 | a couple of legal hurdles.
7 |
8 | Please fill out either the individual or corporate Contributor License Agreement
9 | (CLA).
10 |
11 | * If you are an individual writing original source code and you're sure you
12 | own the intellectual property, then you'll need to sign an
13 | [individual CLA](https://developers.google.com/open-source/cla/individual).
14 | * If you work for a company that wants to allow you to contribute your work,
15 | then you'll need to sign a
16 | [corporate CLA](https://developers.google.com/open-source/cla/corporate).
17 |
18 | Follow either of the two links above to access the appropriate CLA and
19 | instructions for how to sign and return it. Once we receive it, we'll be able to
20 | accept your pull requests.
21 |
22 | ## Contributing a patch
23 |
24 | 1. Submit an issue describing your proposed change to the repo in question.
25 | 1. The repo owner will respond to your issue promptly.
26 | 1. If your proposed change is accepted, and you haven't already done so, sign a
27 | Contributor License Agreement (see details above).
28 | 1. Fork the desired repo, develop and test your code changes.
29 | 1. Ensure that your code adheres to the existing style in the sample to which
30 | you are contributing. Refer to the
31 | [Google Cloud Platform Samples Style Guide](https://github.com/GoogleCloudPlatform/Template/wiki/style.html)
32 | for the recommended coding standards for this organization.
33 | 1. Ensure that your code has an appropriate set of unit tests which all pass.
34 | 1. Submit a pull request.
35 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment the next line to define a global platform for your project
2 | # platform :ios, '9.0'
3 |
4 | target 'SwiftUI-Combine' do
5 | # Comment the next line if you don't want to use dynamic frameworks
6 | use_frameworks!
7 |
8 | # Pods for SwiftUI-Combine
9 | pod 'Navajo-Swift'
10 |
11 | target 'SwiftUI-CombineTests' do
12 | inherit! :search_paths
13 | # Pods for testing
14 | end
15 |
16 | end
17 |
--------------------------------------------------------------------------------
/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - Navajo-Swift (2.1.0)
3 |
4 | DEPENDENCIES:
5 | - Navajo-Swift
6 |
7 | SPEC REPOS:
8 | https://github.com/cocoapods/specs.git:
9 | - Navajo-Swift
10 |
11 | SPEC CHECKSUMS:
12 | Navajo-Swift: 57b93e73efbfbf452433efbff04402de56beff51
13 |
14 | PODFILE CHECKSUM: 21a261f53df521c3dd277f00f37c6d4e9069747d
15 |
16 | COCOAPODS: 1.7.5
17 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
9 | [![Contributors][contributors-shield]][contributors-url]
10 | [![Forks][forks-shield]][forks-url]
11 | [![Stargazers][stars-shield]][stars-url]
12 | [![Issues][issues-shield]][issues-url]
13 | [![MIT License][license-shield]][license-url]
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
SwiftUI & Combine
23 |
24 |
25 | Getting Started with SwiftUI & Combine
26 |
27 | Explore the docs »
28 |
29 |
30 | View Demo
31 | ·
32 | Report Bug
33 | ·
34 | Request Feature
35 |
36 |
37 |
38 |
39 |
40 |
41 | ## Table of Contents
42 |
43 | * [About the Project](#about-the-project)
44 | * [Built With](#built-with)
45 | * [Getting Started](#getting-started)
46 | * [Prerequisites](#prerequisites)
47 | * [Installation](#installation)
48 | * [Usage](#usage)
49 | * [Roadmap](#roadmap)
50 | * [Contributing](#contributing)
51 | * [License](#license)
52 | * [Contact](#contact)
53 | * [Acknowledgements](#acknowledgements)
54 |
55 |
56 | ## About The Project
57 |
58 | ![SwiftUI & Combine Screen Demo][product-demo]
59 |
60 | ### Built With
61 |
62 | * [SwiftUI](https://developer.apple.com/xcode/swiftui/)
63 | * [Combine](https://developer.apple.com/documentation/combine)
64 |
65 |
66 | ## Getting Started
67 |
68 | To get a local copy up and running follow these simple steps.
69 |
70 | ### Prerequisites
71 |
72 | This project uses Cocoapods to manage dependencies.
73 |
74 | * If you haven't done so already, install Cocoapods:
75 |
76 | ```bash
77 | sudo gem install cocoapods
78 | ```
79 |
80 | ### Installation
81 |
82 | 1. Clone the repo
83 | ```bash
84 | git clone https://github.com/peterfriese/SwiftUI-Combine.git
85 | ```
86 | 2. Install Cocoapods
87 | ```bash
88 | pod install
89 | ```
90 | 3. Open the workspace
91 | ```bash
92 | xed .
93 | ```
94 |
95 |
96 | ## Usage
97 |
98 | Use this space to show useful examples of how a project can be used. Additional screenshots, code examples and demos work well in this space. You may also link to more resources.
99 |
100 |
101 | ## Contributing
102 |
103 | Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.
104 |
105 | 1. Fork the project
106 | 2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
107 | 3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
108 | 4. Push to the branch (`git push origin feature/AmazingFeature`)
109 | 5. Open a pull request
110 |
111 |
112 | ## License
113 |
114 | Copyright 2019 Google, Inc.
115 |
116 | Licensed to the Apache Software Foundation (ASF) under one or more contributor
117 | license agreements. See the NOTICE file distributed with this work for
118 | additional information regarding copyright ownership. The ASF licenses this
119 | file to you under the Apache License, Version 2.0 (the "License"); you may not
120 | use this file except in compliance with the License. You may obtain a copy of
121 | the License at
122 |
123 | http://www.apache.org/licenses/LICENSE-2.0
124 |
125 | Unless required by applicable law or agreed to in writing, software
126 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
127 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
128 | License for the specific language governing permissions and limitations under
129 | the License.
130 |
131 |
132 | ## Disclaimer
133 |
134 | This is not an official Google Product.
135 |
136 |
137 | ## Contact
138 |
139 | Peter Friese - [@peterfriese](https://twitter.com/peterfriese)
140 |
141 | Project Link: [https://github.com/peterfriese/SwiftUI-Combine](https://github.com/peterfrese/SwiftUI-Combine)
142 |
143 |
144 | ## Acknowledgements
145 |
150 |
151 |
152 |
153 | [contributors-shield]: https://img.shields.io/github/contributors/peterfriese/SwiftUI-Combine.svg?style=flat-square
154 | [contributors-url]: https://github.com/peterfriese/SwiftUI-Combine/graphs/contributors
155 |
156 | [forks-shield]: https://img.shields.io/github/forks/peterfriese/SwiftUI-Combine.svg?style=flat-square
157 | [forks-url]: https://github.com/peterfriese/SwiftUI-Combine/network/members
158 |
159 | [stars-shield]: https://img.shields.io/github/stars/peterfriese/SwiftUI-Combine.svg?style=flat-square
160 | [stars-url]: https://github.com/peterfriese/SwiftUI-Combine/stargazers
161 |
162 | [issues-shield]: https://img.shields.io/github/issues/peterfriese/SwiftUI-Combine.svg?style=flat-square
163 | [issues-url]: https://github.com/peterfriese/SwiftUI-Combine/issues
164 |
165 | [license-shield]: https://img.shields.io/github/license/peterfriese/SwiftUI-Combine.svg?style=flat-square
166 | [license-url]: https://github.com/peterfriese/SwiftUI-Combine/blob/master/LICENSE
167 |
168 | [linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=flat-square&logo=linkedin&colorB=555
169 | [linkedin-url]: https://linkedin.com/in/othneildrew
170 | [product-screenshot]: images/screenshot.png
171 | [product-demo]: images/demo.gif
172 |
--------------------------------------------------------------------------------
/SwiftUI-Combine.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 51;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 882C7EAA231D7ADF00B9AFC5 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 882C7EA9231D7ADF00B9AFC5 /* AppDelegate.swift */; };
11 | 882C7EAC231D7ADF00B9AFC5 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 882C7EAB231D7ADF00B9AFC5 /* SceneDelegate.swift */; };
12 | 882C7EAE231D7ADF00B9AFC5 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 882C7EAD231D7ADF00B9AFC5 /* ContentView.swift */; };
13 | 882C7EB0231D7AE000B9AFC5 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 882C7EAF231D7AE000B9AFC5 /* Assets.xcassets */; };
14 | 882C7EB3231D7AE000B9AFC5 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 882C7EB2231D7AE000B9AFC5 /* Preview Assets.xcassets */; };
15 | 882C7EB6231D7AE000B9AFC5 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 882C7EB4231D7AE000B9AFC5 /* LaunchScreen.storyboard */; };
16 | 882C7EC1231D7AE100B9AFC5 /* SwiftUI_CombineTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 882C7EC0231D7AE100B9AFC5 /* SwiftUI_CombineTests.swift */; };
17 | 88AC600223294399007E504C /* UserViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88AC600123294399007E504C /* UserViewModel.swift */; };
18 | F4EAB782D9A69D55169AA082 /* Pods_SwiftUI_CombineTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EAED7B4B2E771F456C8D9A44 /* Pods_SwiftUI_CombineTests.framework */; };
19 | FA4B1DD302AA565FF9C19D95 /* Pods_SwiftUI_Combine.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 10ACBDCE50933F4EC1241D62 /* Pods_SwiftUI_Combine.framework */; };
20 | /* End PBXBuildFile section */
21 |
22 | /* Begin PBXContainerItemProxy section */
23 | 882C7EBD231D7AE100B9AFC5 /* PBXContainerItemProxy */ = {
24 | isa = PBXContainerItemProxy;
25 | containerPortal = 882C7E9E231D7ADF00B9AFC5 /* Project object */;
26 | proxyType = 1;
27 | remoteGlobalIDString = 882C7EA5231D7ADF00B9AFC5;
28 | remoteInfo = "SwiftUI-Combine";
29 | };
30 | /* End PBXContainerItemProxy section */
31 |
32 | /* Begin PBXFileReference section */
33 | 10ACBDCE50933F4EC1241D62 /* Pods_SwiftUI_Combine.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwiftUI_Combine.framework; sourceTree = BUILT_PRODUCTS_DIR; };
34 | 599086138F71BEBCF45931C6 /* Pods-SwiftUI-Combine.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftUI-Combine.release.xcconfig"; path = "Target Support Files/Pods-SwiftUI-Combine/Pods-SwiftUI-Combine.release.xcconfig"; sourceTree = ""; };
35 | 882C7EA6231D7ADF00B9AFC5 /* SwiftUI-Combine.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "SwiftUI-Combine.app"; sourceTree = BUILT_PRODUCTS_DIR; };
36 | 882C7EA9231D7ADF00B9AFC5 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
37 | 882C7EAB231D7ADF00B9AFC5 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; };
38 | 882C7EAD231D7ADF00B9AFC5 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; };
39 | 882C7EAF231D7AE000B9AFC5 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
40 | 882C7EB2231D7AE000B9AFC5 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; };
41 | 882C7EB5231D7AE000B9AFC5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
42 | 882C7EB7231D7AE000B9AFC5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
43 | 882C7EBC231D7AE100B9AFC5 /* SwiftUI-CombineTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "SwiftUI-CombineTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
44 | 882C7EC0231D7AE100B9AFC5 /* SwiftUI_CombineTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftUI_CombineTests.swift; sourceTree = ""; };
45 | 882C7EC2231D7AE100B9AFC5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
46 | 88AC600123294399007E504C /* UserViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserViewModel.swift; sourceTree = ""; };
47 | 90842E7EA5DF6F7316755E72 /* Pods-SwiftUI-Combine.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftUI-Combine.debug.xcconfig"; path = "Target Support Files/Pods-SwiftUI-Combine/Pods-SwiftUI-Combine.debug.xcconfig"; sourceTree = ""; };
48 | A874CED7A50631579A1CC107 /* Pods-SwiftUI-CombineTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftUI-CombineTests.debug.xcconfig"; path = "Target Support Files/Pods-SwiftUI-CombineTests/Pods-SwiftUI-CombineTests.debug.xcconfig"; sourceTree = ""; };
49 | E12A138418FFFE624CC418C6 /* Pods-SwiftUI-CombineTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftUI-CombineTests.release.xcconfig"; path = "Target Support Files/Pods-SwiftUI-CombineTests/Pods-SwiftUI-CombineTests.release.xcconfig"; sourceTree = ""; };
50 | EAED7B4B2E771F456C8D9A44 /* Pods_SwiftUI_CombineTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwiftUI_CombineTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
51 | /* End PBXFileReference section */
52 |
53 | /* Begin PBXFrameworksBuildPhase section */
54 | 882C7EA3231D7ADF00B9AFC5 /* Frameworks */ = {
55 | isa = PBXFrameworksBuildPhase;
56 | buildActionMask = 2147483647;
57 | files = (
58 | FA4B1DD302AA565FF9C19D95 /* Pods_SwiftUI_Combine.framework in Frameworks */,
59 | );
60 | runOnlyForDeploymentPostprocessing = 0;
61 | };
62 | 882C7EB9231D7AE100B9AFC5 /* Frameworks */ = {
63 | isa = PBXFrameworksBuildPhase;
64 | buildActionMask = 2147483647;
65 | files = (
66 | F4EAB782D9A69D55169AA082 /* Pods_SwiftUI_CombineTests.framework in Frameworks */,
67 | );
68 | runOnlyForDeploymentPostprocessing = 0;
69 | };
70 | /* End PBXFrameworksBuildPhase section */
71 |
72 | /* Begin PBXGroup section */
73 | 645D7801FE25E8A20FA5A557 /* Frameworks */ = {
74 | isa = PBXGroup;
75 | children = (
76 | 10ACBDCE50933F4EC1241D62 /* Pods_SwiftUI_Combine.framework */,
77 | EAED7B4B2E771F456C8D9A44 /* Pods_SwiftUI_CombineTests.framework */,
78 | );
79 | name = Frameworks;
80 | sourceTree = "";
81 | };
82 | 7A0740E42B9ECC47EA99F52D /* Pods */ = {
83 | isa = PBXGroup;
84 | children = (
85 | 90842E7EA5DF6F7316755E72 /* Pods-SwiftUI-Combine.debug.xcconfig */,
86 | 599086138F71BEBCF45931C6 /* Pods-SwiftUI-Combine.release.xcconfig */,
87 | A874CED7A50631579A1CC107 /* Pods-SwiftUI-CombineTests.debug.xcconfig */,
88 | E12A138418FFFE624CC418C6 /* Pods-SwiftUI-CombineTests.release.xcconfig */,
89 | );
90 | path = Pods;
91 | sourceTree = "";
92 | };
93 | 882C7E9D231D7ADF00B9AFC5 = {
94 | isa = PBXGroup;
95 | children = (
96 | 882C7EA8231D7ADF00B9AFC5 /* SwiftUI-Combine */,
97 | 882C7EBF231D7AE100B9AFC5 /* SwiftUI-CombineTests */,
98 | 882C7EA7231D7ADF00B9AFC5 /* Products */,
99 | 7A0740E42B9ECC47EA99F52D /* Pods */,
100 | 645D7801FE25E8A20FA5A557 /* Frameworks */,
101 | );
102 | sourceTree = "";
103 | };
104 | 882C7EA7231D7ADF00B9AFC5 /* Products */ = {
105 | isa = PBXGroup;
106 | children = (
107 | 882C7EA6231D7ADF00B9AFC5 /* SwiftUI-Combine.app */,
108 | 882C7EBC231D7AE100B9AFC5 /* SwiftUI-CombineTests.xctest */,
109 | );
110 | name = Products;
111 | sourceTree = "";
112 | };
113 | 882C7EA8231D7ADF00B9AFC5 /* SwiftUI-Combine */ = {
114 | isa = PBXGroup;
115 | children = (
116 | 88AC5FFF23294361007E504C /* ViewModels */,
117 | 88AC60002329436F007E504C /* Views */,
118 | 882C7EA9231D7ADF00B9AFC5 /* AppDelegate.swift */,
119 | 882C7EAB231D7ADF00B9AFC5 /* SceneDelegate.swift */,
120 | 882C7EAF231D7AE000B9AFC5 /* Assets.xcassets */,
121 | 882C7EB4231D7AE000B9AFC5 /* LaunchScreen.storyboard */,
122 | 882C7EB7231D7AE000B9AFC5 /* Info.plist */,
123 | 882C7EB1231D7AE000B9AFC5 /* Preview Content */,
124 | );
125 | path = "SwiftUI-Combine";
126 | sourceTree = "";
127 | };
128 | 882C7EB1231D7AE000B9AFC5 /* Preview Content */ = {
129 | isa = PBXGroup;
130 | children = (
131 | 882C7EB2231D7AE000B9AFC5 /* Preview Assets.xcassets */,
132 | );
133 | path = "Preview Content";
134 | sourceTree = "";
135 | };
136 | 882C7EBF231D7AE100B9AFC5 /* SwiftUI-CombineTests */ = {
137 | isa = PBXGroup;
138 | children = (
139 | 882C7EC0231D7AE100B9AFC5 /* SwiftUI_CombineTests.swift */,
140 | 882C7EC2231D7AE100B9AFC5 /* Info.plist */,
141 | );
142 | path = "SwiftUI-CombineTests";
143 | sourceTree = "";
144 | };
145 | 88AC5FFF23294361007E504C /* ViewModels */ = {
146 | isa = PBXGroup;
147 | children = (
148 | 88AC600123294399007E504C /* UserViewModel.swift */,
149 | );
150 | path = ViewModels;
151 | sourceTree = "";
152 | };
153 | 88AC60002329436F007E504C /* Views */ = {
154 | isa = PBXGroup;
155 | children = (
156 | 882C7EAD231D7ADF00B9AFC5 /* ContentView.swift */,
157 | );
158 | path = Views;
159 | sourceTree = "";
160 | };
161 | /* End PBXGroup section */
162 |
163 | /* Begin PBXNativeTarget section */
164 | 882C7EA5231D7ADF00B9AFC5 /* SwiftUI-Combine */ = {
165 | isa = PBXNativeTarget;
166 | buildConfigurationList = 882C7EC5231D7AE100B9AFC5 /* Build configuration list for PBXNativeTarget "SwiftUI-Combine" */;
167 | buildPhases = (
168 | 6C0DC6CFC852FB8A2593FA93 /* [CP] Check Pods Manifest.lock */,
169 | 882C7EA2231D7ADF00B9AFC5 /* Sources */,
170 | 882C7EA3231D7ADF00B9AFC5 /* Frameworks */,
171 | 882C7EA4231D7ADF00B9AFC5 /* Resources */,
172 | 9097C35BE50017624621435F /* [CP] Embed Pods Frameworks */,
173 | );
174 | buildRules = (
175 | );
176 | dependencies = (
177 | );
178 | name = "SwiftUI-Combine";
179 | productName = "SwiftUI-Combine";
180 | productReference = 882C7EA6231D7ADF00B9AFC5 /* SwiftUI-Combine.app */;
181 | productType = "com.apple.product-type.application";
182 | };
183 | 882C7EBB231D7AE100B9AFC5 /* SwiftUI-CombineTests */ = {
184 | isa = PBXNativeTarget;
185 | buildConfigurationList = 882C7EC8231D7AE100B9AFC5 /* Build configuration list for PBXNativeTarget "SwiftUI-CombineTests" */;
186 | buildPhases = (
187 | 6131D054C8597DB651A4CC6E /* [CP] Check Pods Manifest.lock */,
188 | 882C7EB8231D7AE100B9AFC5 /* Sources */,
189 | 882C7EB9231D7AE100B9AFC5 /* Frameworks */,
190 | 882C7EBA231D7AE100B9AFC5 /* Resources */,
191 | );
192 | buildRules = (
193 | );
194 | dependencies = (
195 | 882C7EBE231D7AE100B9AFC5 /* PBXTargetDependency */,
196 | );
197 | name = "SwiftUI-CombineTests";
198 | productName = "SwiftUI-CombineTests";
199 | productReference = 882C7EBC231D7AE100B9AFC5 /* SwiftUI-CombineTests.xctest */;
200 | productType = "com.apple.product-type.bundle.unit-test";
201 | };
202 | /* End PBXNativeTarget section */
203 |
204 | /* Begin PBXProject section */
205 | 882C7E9E231D7ADF00B9AFC5 /* Project object */ = {
206 | isa = PBXProject;
207 | attributes = {
208 | LastSwiftUpdateCheck = 1100;
209 | LastUpgradeCheck = 1100;
210 | ORGANIZATIONNAME = "Google LLC";
211 | TargetAttributes = {
212 | 882C7EA5231D7ADF00B9AFC5 = {
213 | CreatedOnToolsVersion = 11.0;
214 | };
215 | 882C7EBB231D7AE100B9AFC5 = {
216 | CreatedOnToolsVersion = 11.0;
217 | TestTargetID = 882C7EA5231D7ADF00B9AFC5;
218 | };
219 | };
220 | };
221 | buildConfigurationList = 882C7EA1231D7ADF00B9AFC5 /* Build configuration list for PBXProject "SwiftUI-Combine" */;
222 | compatibilityVersion = "Xcode 9.3";
223 | developmentRegion = en;
224 | hasScannedForEncodings = 0;
225 | knownRegions = (
226 | en,
227 | Base,
228 | );
229 | mainGroup = 882C7E9D231D7ADF00B9AFC5;
230 | productRefGroup = 882C7EA7231D7ADF00B9AFC5 /* Products */;
231 | projectDirPath = "";
232 | projectRoot = "";
233 | targets = (
234 | 882C7EA5231D7ADF00B9AFC5 /* SwiftUI-Combine */,
235 | 882C7EBB231D7AE100B9AFC5 /* SwiftUI-CombineTests */,
236 | );
237 | };
238 | /* End PBXProject section */
239 |
240 | /* Begin PBXResourcesBuildPhase section */
241 | 882C7EA4231D7ADF00B9AFC5 /* Resources */ = {
242 | isa = PBXResourcesBuildPhase;
243 | buildActionMask = 2147483647;
244 | files = (
245 | 882C7EB6231D7AE000B9AFC5 /* LaunchScreen.storyboard in Resources */,
246 | 882C7EB3231D7AE000B9AFC5 /* Preview Assets.xcassets in Resources */,
247 | 882C7EB0231D7AE000B9AFC5 /* Assets.xcassets in Resources */,
248 | );
249 | runOnlyForDeploymentPostprocessing = 0;
250 | };
251 | 882C7EBA231D7AE100B9AFC5 /* Resources */ = {
252 | isa = PBXResourcesBuildPhase;
253 | buildActionMask = 2147483647;
254 | files = (
255 | );
256 | runOnlyForDeploymentPostprocessing = 0;
257 | };
258 | /* End PBXResourcesBuildPhase section */
259 |
260 | /* Begin PBXShellScriptBuildPhase section */
261 | 6131D054C8597DB651A4CC6E /* [CP] Check Pods Manifest.lock */ = {
262 | isa = PBXShellScriptBuildPhase;
263 | buildActionMask = 2147483647;
264 | files = (
265 | );
266 | inputFileListPaths = (
267 | );
268 | inputPaths = (
269 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
270 | "${PODS_ROOT}/Manifest.lock",
271 | );
272 | name = "[CP] Check Pods Manifest.lock";
273 | outputFileListPaths = (
274 | );
275 | outputPaths = (
276 | "$(DERIVED_FILE_DIR)/Pods-SwiftUI-CombineTests-checkManifestLockResult.txt",
277 | );
278 | runOnlyForDeploymentPostprocessing = 0;
279 | shellPath = /bin/sh;
280 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
281 | showEnvVarsInLog = 0;
282 | };
283 | 6C0DC6CFC852FB8A2593FA93 /* [CP] Check Pods Manifest.lock */ = {
284 | isa = PBXShellScriptBuildPhase;
285 | buildActionMask = 2147483647;
286 | files = (
287 | );
288 | inputFileListPaths = (
289 | );
290 | inputPaths = (
291 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
292 | "${PODS_ROOT}/Manifest.lock",
293 | );
294 | name = "[CP] Check Pods Manifest.lock";
295 | outputFileListPaths = (
296 | );
297 | outputPaths = (
298 | "$(DERIVED_FILE_DIR)/Pods-SwiftUI-Combine-checkManifestLockResult.txt",
299 | );
300 | runOnlyForDeploymentPostprocessing = 0;
301 | shellPath = /bin/sh;
302 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
303 | showEnvVarsInLog = 0;
304 | };
305 | 9097C35BE50017624621435F /* [CP] Embed Pods Frameworks */ = {
306 | isa = PBXShellScriptBuildPhase;
307 | buildActionMask = 2147483647;
308 | files = (
309 | );
310 | inputFileListPaths = (
311 | "${PODS_ROOT}/Target Support Files/Pods-SwiftUI-Combine/Pods-SwiftUI-Combine-frameworks-${CONFIGURATION}-input-files.xcfilelist",
312 | );
313 | name = "[CP] Embed Pods Frameworks";
314 | outputFileListPaths = (
315 | "${PODS_ROOT}/Target Support Files/Pods-SwiftUI-Combine/Pods-SwiftUI-Combine-frameworks-${CONFIGURATION}-output-files.xcfilelist",
316 | );
317 | runOnlyForDeploymentPostprocessing = 0;
318 | shellPath = /bin/sh;
319 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SwiftUI-Combine/Pods-SwiftUI-Combine-frameworks.sh\"\n";
320 | showEnvVarsInLog = 0;
321 | };
322 | /* End PBXShellScriptBuildPhase section */
323 |
324 | /* Begin PBXSourcesBuildPhase section */
325 | 882C7EA2231D7ADF00B9AFC5 /* Sources */ = {
326 | isa = PBXSourcesBuildPhase;
327 | buildActionMask = 2147483647;
328 | files = (
329 | 882C7EAA231D7ADF00B9AFC5 /* AppDelegate.swift in Sources */,
330 | 88AC600223294399007E504C /* UserViewModel.swift in Sources */,
331 | 882C7EAC231D7ADF00B9AFC5 /* SceneDelegate.swift in Sources */,
332 | 882C7EAE231D7ADF00B9AFC5 /* ContentView.swift in Sources */,
333 | );
334 | runOnlyForDeploymentPostprocessing = 0;
335 | };
336 | 882C7EB8231D7AE100B9AFC5 /* Sources */ = {
337 | isa = PBXSourcesBuildPhase;
338 | buildActionMask = 2147483647;
339 | files = (
340 | 882C7EC1231D7AE100B9AFC5 /* SwiftUI_CombineTests.swift in Sources */,
341 | );
342 | runOnlyForDeploymentPostprocessing = 0;
343 | };
344 | /* End PBXSourcesBuildPhase section */
345 |
346 | /* Begin PBXTargetDependency section */
347 | 882C7EBE231D7AE100B9AFC5 /* PBXTargetDependency */ = {
348 | isa = PBXTargetDependency;
349 | target = 882C7EA5231D7ADF00B9AFC5 /* SwiftUI-Combine */;
350 | targetProxy = 882C7EBD231D7AE100B9AFC5 /* PBXContainerItemProxy */;
351 | };
352 | /* End PBXTargetDependency section */
353 |
354 | /* Begin PBXVariantGroup section */
355 | 882C7EB4231D7AE000B9AFC5 /* LaunchScreen.storyboard */ = {
356 | isa = PBXVariantGroup;
357 | children = (
358 | 882C7EB5231D7AE000B9AFC5 /* Base */,
359 | );
360 | name = LaunchScreen.storyboard;
361 | sourceTree = "";
362 | };
363 | /* End PBXVariantGroup section */
364 |
365 | /* Begin XCBuildConfiguration section */
366 | 882C7EC3231D7AE100B9AFC5 /* Debug */ = {
367 | isa = XCBuildConfiguration;
368 | buildSettings = {
369 | ALWAYS_SEARCH_USER_PATHS = NO;
370 | CLANG_ANALYZER_NONNULL = YES;
371 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
372 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
373 | CLANG_CXX_LIBRARY = "libc++";
374 | CLANG_ENABLE_MODULES = YES;
375 | CLANG_ENABLE_OBJC_ARC = YES;
376 | CLANG_ENABLE_OBJC_WEAK = YES;
377 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
378 | CLANG_WARN_BOOL_CONVERSION = YES;
379 | CLANG_WARN_COMMA = YES;
380 | CLANG_WARN_CONSTANT_CONVERSION = YES;
381 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
382 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
383 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
384 | CLANG_WARN_EMPTY_BODY = YES;
385 | CLANG_WARN_ENUM_CONVERSION = YES;
386 | CLANG_WARN_INFINITE_RECURSION = YES;
387 | CLANG_WARN_INT_CONVERSION = YES;
388 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
389 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
390 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
391 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
392 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
393 | CLANG_WARN_STRICT_PROTOTYPES = YES;
394 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
395 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
396 | CLANG_WARN_UNREACHABLE_CODE = YES;
397 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
398 | COPY_PHASE_STRIP = NO;
399 | DEBUG_INFORMATION_FORMAT = dwarf;
400 | ENABLE_STRICT_OBJC_MSGSEND = YES;
401 | ENABLE_TESTABILITY = YES;
402 | GCC_C_LANGUAGE_STANDARD = gnu11;
403 | GCC_DYNAMIC_NO_PIC = NO;
404 | GCC_NO_COMMON_BLOCKS = YES;
405 | GCC_OPTIMIZATION_LEVEL = 0;
406 | GCC_PREPROCESSOR_DEFINITIONS = (
407 | "DEBUG=1",
408 | "$(inherited)",
409 | );
410 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
411 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
412 | GCC_WARN_UNDECLARED_SELECTOR = YES;
413 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
414 | GCC_WARN_UNUSED_FUNCTION = YES;
415 | GCC_WARN_UNUSED_VARIABLE = YES;
416 | IPHONEOS_DEPLOYMENT_TARGET = 13.0;
417 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
418 | MTL_FAST_MATH = YES;
419 | ONLY_ACTIVE_ARCH = YES;
420 | SDKROOT = iphoneos;
421 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
422 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
423 | };
424 | name = Debug;
425 | };
426 | 882C7EC4231D7AE100B9AFC5 /* Release */ = {
427 | isa = XCBuildConfiguration;
428 | buildSettings = {
429 | ALWAYS_SEARCH_USER_PATHS = NO;
430 | CLANG_ANALYZER_NONNULL = YES;
431 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
432 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
433 | CLANG_CXX_LIBRARY = "libc++";
434 | CLANG_ENABLE_MODULES = YES;
435 | CLANG_ENABLE_OBJC_ARC = YES;
436 | CLANG_ENABLE_OBJC_WEAK = YES;
437 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
438 | CLANG_WARN_BOOL_CONVERSION = YES;
439 | CLANG_WARN_COMMA = YES;
440 | CLANG_WARN_CONSTANT_CONVERSION = YES;
441 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
442 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
443 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
444 | CLANG_WARN_EMPTY_BODY = YES;
445 | CLANG_WARN_ENUM_CONVERSION = YES;
446 | CLANG_WARN_INFINITE_RECURSION = YES;
447 | CLANG_WARN_INT_CONVERSION = YES;
448 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
449 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
450 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
451 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
452 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
453 | CLANG_WARN_STRICT_PROTOTYPES = YES;
454 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
455 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
456 | CLANG_WARN_UNREACHABLE_CODE = YES;
457 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
458 | COPY_PHASE_STRIP = NO;
459 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
460 | ENABLE_NS_ASSERTIONS = NO;
461 | ENABLE_STRICT_OBJC_MSGSEND = YES;
462 | GCC_C_LANGUAGE_STANDARD = gnu11;
463 | GCC_NO_COMMON_BLOCKS = YES;
464 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
465 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
466 | GCC_WARN_UNDECLARED_SELECTOR = YES;
467 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
468 | GCC_WARN_UNUSED_FUNCTION = YES;
469 | GCC_WARN_UNUSED_VARIABLE = YES;
470 | IPHONEOS_DEPLOYMENT_TARGET = 13.0;
471 | MTL_ENABLE_DEBUG_INFO = NO;
472 | MTL_FAST_MATH = YES;
473 | SDKROOT = iphoneos;
474 | SWIFT_COMPILATION_MODE = wholemodule;
475 | SWIFT_OPTIMIZATION_LEVEL = "-O";
476 | VALIDATE_PRODUCT = YES;
477 | };
478 | name = Release;
479 | };
480 | 882C7EC6231D7AE100B9AFC5 /* Debug */ = {
481 | isa = XCBuildConfiguration;
482 | baseConfigurationReference = 90842E7EA5DF6F7316755E72 /* Pods-SwiftUI-Combine.debug.xcconfig */;
483 | buildSettings = {
484 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
485 | CODE_SIGN_STYLE = Automatic;
486 | DEVELOPMENT_ASSET_PATHS = "\"SwiftUI-Combine/Preview Content\"";
487 | DEVELOPMENT_TEAM = YGAZHQXHH4;
488 | ENABLE_PREVIEWS = YES;
489 | INFOPLIST_FILE = "SwiftUI-Combine/Info.plist";
490 | LD_RUNPATH_SEARCH_PATHS = (
491 | "$(inherited)",
492 | "@executable_path/Frameworks",
493 | );
494 | PRODUCT_BUNDLE_IDENTIFIER = "dev.peterfriese.SwiftUI-Combine";
495 | PRODUCT_NAME = "$(TARGET_NAME)";
496 | SWIFT_VERSION = 5.0;
497 | TARGETED_DEVICE_FAMILY = "1,2";
498 | };
499 | name = Debug;
500 | };
501 | 882C7EC7231D7AE100B9AFC5 /* Release */ = {
502 | isa = XCBuildConfiguration;
503 | baseConfigurationReference = 599086138F71BEBCF45931C6 /* Pods-SwiftUI-Combine.release.xcconfig */;
504 | buildSettings = {
505 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
506 | CODE_SIGN_STYLE = Automatic;
507 | DEVELOPMENT_ASSET_PATHS = "\"SwiftUI-Combine/Preview Content\"";
508 | DEVELOPMENT_TEAM = YGAZHQXHH4;
509 | ENABLE_PREVIEWS = YES;
510 | INFOPLIST_FILE = "SwiftUI-Combine/Info.plist";
511 | LD_RUNPATH_SEARCH_PATHS = (
512 | "$(inherited)",
513 | "@executable_path/Frameworks",
514 | );
515 | PRODUCT_BUNDLE_IDENTIFIER = "dev.peterfriese.SwiftUI-Combine";
516 | PRODUCT_NAME = "$(TARGET_NAME)";
517 | SWIFT_VERSION = 5.0;
518 | TARGETED_DEVICE_FAMILY = "1,2";
519 | };
520 | name = Release;
521 | };
522 | 882C7EC9231D7AE100B9AFC5 /* Debug */ = {
523 | isa = XCBuildConfiguration;
524 | baseConfigurationReference = A874CED7A50631579A1CC107 /* Pods-SwiftUI-CombineTests.debug.xcconfig */;
525 | buildSettings = {
526 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
527 | BUNDLE_LOADER = "$(TEST_HOST)";
528 | CODE_SIGN_STYLE = Automatic;
529 | DEVELOPMENT_TEAM = YGAZHQXHH4;
530 | INFOPLIST_FILE = "SwiftUI-CombineTests/Info.plist";
531 | IPHONEOS_DEPLOYMENT_TARGET = 13.0;
532 | LD_RUNPATH_SEARCH_PATHS = (
533 | "$(inherited)",
534 | "@executable_path/Frameworks",
535 | "@loader_path/Frameworks",
536 | );
537 | PRODUCT_BUNDLE_IDENTIFIER = "dev.peterfriese.SwiftUI-CombineTests";
538 | PRODUCT_NAME = "$(TARGET_NAME)";
539 | SWIFT_VERSION = 5.0;
540 | TARGETED_DEVICE_FAMILY = "1,2";
541 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwiftUI-Combine.app/SwiftUI-Combine";
542 | };
543 | name = Debug;
544 | };
545 | 882C7ECA231D7AE100B9AFC5 /* Release */ = {
546 | isa = XCBuildConfiguration;
547 | baseConfigurationReference = E12A138418FFFE624CC418C6 /* Pods-SwiftUI-CombineTests.release.xcconfig */;
548 | buildSettings = {
549 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
550 | BUNDLE_LOADER = "$(TEST_HOST)";
551 | CODE_SIGN_STYLE = Automatic;
552 | DEVELOPMENT_TEAM = YGAZHQXHH4;
553 | INFOPLIST_FILE = "SwiftUI-CombineTests/Info.plist";
554 | IPHONEOS_DEPLOYMENT_TARGET = 13.0;
555 | LD_RUNPATH_SEARCH_PATHS = (
556 | "$(inherited)",
557 | "@executable_path/Frameworks",
558 | "@loader_path/Frameworks",
559 | );
560 | PRODUCT_BUNDLE_IDENTIFIER = "dev.peterfriese.SwiftUI-CombineTests";
561 | PRODUCT_NAME = "$(TARGET_NAME)";
562 | SWIFT_VERSION = 5.0;
563 | TARGETED_DEVICE_FAMILY = "1,2";
564 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwiftUI-Combine.app/SwiftUI-Combine";
565 | };
566 | name = Release;
567 | };
568 | /* End XCBuildConfiguration section */
569 |
570 | /* Begin XCConfigurationList section */
571 | 882C7EA1231D7ADF00B9AFC5 /* Build configuration list for PBXProject "SwiftUI-Combine" */ = {
572 | isa = XCConfigurationList;
573 | buildConfigurations = (
574 | 882C7EC3231D7AE100B9AFC5 /* Debug */,
575 | 882C7EC4231D7AE100B9AFC5 /* Release */,
576 | );
577 | defaultConfigurationIsVisible = 0;
578 | defaultConfigurationName = Release;
579 | };
580 | 882C7EC5231D7AE100B9AFC5 /* Build configuration list for PBXNativeTarget "SwiftUI-Combine" */ = {
581 | isa = XCConfigurationList;
582 | buildConfigurations = (
583 | 882C7EC6231D7AE100B9AFC5 /* Debug */,
584 | 882C7EC7231D7AE100B9AFC5 /* Release */,
585 | );
586 | defaultConfigurationIsVisible = 0;
587 | defaultConfigurationName = Release;
588 | };
589 | 882C7EC8231D7AE100B9AFC5 /* Build configuration list for PBXNativeTarget "SwiftUI-CombineTests" */ = {
590 | isa = XCConfigurationList;
591 | buildConfigurations = (
592 | 882C7EC9231D7AE100B9AFC5 /* Debug */,
593 | 882C7ECA231D7AE100B9AFC5 /* Release */,
594 | );
595 | defaultConfigurationIsVisible = 0;
596 | defaultConfigurationName = Release;
597 | };
598 | /* End XCConfigurationList section */
599 | };
600 | rootObject = 882C7E9E231D7ADF00B9AFC5 /* Project object */;
601 | }
602 |
--------------------------------------------------------------------------------
/SwiftUI-Combine.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/SwiftUI-Combine.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/SwiftUI-Combine/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // SwiftUI-Combine
4 | //
5 | // Created by Peter Friese on 02/09/2019.
6 | // Copyright © 2019 Google LLC. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | @UIApplicationMain
12 | class AppDelegate: UIResponder, UIApplicationDelegate {
13 |
14 |
15 |
16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
17 | // Override point for customization after application launch.
18 | return true
19 | }
20 |
21 | // MARK: UISceneSession Lifecycle
22 |
23 | func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
24 | // Called when a new scene session is being created.
25 | // Use this method to select a configuration to create the new scene with.
26 | return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
27 | }
28 |
29 | func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) {
30 | // Called when the user discards a scene session.
31 | // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
32 | // Use this method to release any resources that were specific to the discarded scenes, as they will not return.
33 | }
34 |
35 |
36 | }
37 |
38 |
--------------------------------------------------------------------------------
/SwiftUI-Combine/Assets.xcassets/AppIcon.appiconset/100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterfriese/SwiftUI-Combine/659122389dee7029d2c5f7d92654c837e02a9cfa/SwiftUI-Combine/Assets.xcassets/AppIcon.appiconset/100.png
--------------------------------------------------------------------------------
/SwiftUI-Combine/Assets.xcassets/AppIcon.appiconset/1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterfriese/SwiftUI-Combine/659122389dee7029d2c5f7d92654c837e02a9cfa/SwiftUI-Combine/Assets.xcassets/AppIcon.appiconset/1024.png
--------------------------------------------------------------------------------
/SwiftUI-Combine/Assets.xcassets/AppIcon.appiconset/114.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterfriese/SwiftUI-Combine/659122389dee7029d2c5f7d92654c837e02a9cfa/SwiftUI-Combine/Assets.xcassets/AppIcon.appiconset/114.png
--------------------------------------------------------------------------------
/SwiftUI-Combine/Assets.xcassets/AppIcon.appiconset/120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterfriese/SwiftUI-Combine/659122389dee7029d2c5f7d92654c837e02a9cfa/SwiftUI-Combine/Assets.xcassets/AppIcon.appiconset/120.png
--------------------------------------------------------------------------------
/SwiftUI-Combine/Assets.xcassets/AppIcon.appiconset/144.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterfriese/SwiftUI-Combine/659122389dee7029d2c5f7d92654c837e02a9cfa/SwiftUI-Combine/Assets.xcassets/AppIcon.appiconset/144.png
--------------------------------------------------------------------------------
/SwiftUI-Combine/Assets.xcassets/AppIcon.appiconset/152.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterfriese/SwiftUI-Combine/659122389dee7029d2c5f7d92654c837e02a9cfa/SwiftUI-Combine/Assets.xcassets/AppIcon.appiconset/152.png
--------------------------------------------------------------------------------
/SwiftUI-Combine/Assets.xcassets/AppIcon.appiconset/167.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterfriese/SwiftUI-Combine/659122389dee7029d2c5f7d92654c837e02a9cfa/SwiftUI-Combine/Assets.xcassets/AppIcon.appiconset/167.png
--------------------------------------------------------------------------------
/SwiftUI-Combine/Assets.xcassets/AppIcon.appiconset/180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterfriese/SwiftUI-Combine/659122389dee7029d2c5f7d92654c837e02a9cfa/SwiftUI-Combine/Assets.xcassets/AppIcon.appiconset/180.png
--------------------------------------------------------------------------------
/SwiftUI-Combine/Assets.xcassets/AppIcon.appiconset/20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterfriese/SwiftUI-Combine/659122389dee7029d2c5f7d92654c837e02a9cfa/SwiftUI-Combine/Assets.xcassets/AppIcon.appiconset/20.png
--------------------------------------------------------------------------------
/SwiftUI-Combine/Assets.xcassets/AppIcon.appiconset/29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterfriese/SwiftUI-Combine/659122389dee7029d2c5f7d92654c837e02a9cfa/SwiftUI-Combine/Assets.xcassets/AppIcon.appiconset/29.png
--------------------------------------------------------------------------------
/SwiftUI-Combine/Assets.xcassets/AppIcon.appiconset/40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterfriese/SwiftUI-Combine/659122389dee7029d2c5f7d92654c837e02a9cfa/SwiftUI-Combine/Assets.xcassets/AppIcon.appiconset/40.png
--------------------------------------------------------------------------------
/SwiftUI-Combine/Assets.xcassets/AppIcon.appiconset/50.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterfriese/SwiftUI-Combine/659122389dee7029d2c5f7d92654c837e02a9cfa/SwiftUI-Combine/Assets.xcassets/AppIcon.appiconset/50.png
--------------------------------------------------------------------------------
/SwiftUI-Combine/Assets.xcassets/AppIcon.appiconset/57.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterfriese/SwiftUI-Combine/659122389dee7029d2c5f7d92654c837e02a9cfa/SwiftUI-Combine/Assets.xcassets/AppIcon.appiconset/57.png
--------------------------------------------------------------------------------
/SwiftUI-Combine/Assets.xcassets/AppIcon.appiconset/58.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterfriese/SwiftUI-Combine/659122389dee7029d2c5f7d92654c837e02a9cfa/SwiftUI-Combine/Assets.xcassets/AppIcon.appiconset/58.png
--------------------------------------------------------------------------------
/SwiftUI-Combine/Assets.xcassets/AppIcon.appiconset/60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterfriese/SwiftUI-Combine/659122389dee7029d2c5f7d92654c837e02a9cfa/SwiftUI-Combine/Assets.xcassets/AppIcon.appiconset/60.png
--------------------------------------------------------------------------------
/SwiftUI-Combine/Assets.xcassets/AppIcon.appiconset/72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterfriese/SwiftUI-Combine/659122389dee7029d2c5f7d92654c837e02a9cfa/SwiftUI-Combine/Assets.xcassets/AppIcon.appiconset/72.png
--------------------------------------------------------------------------------
/SwiftUI-Combine/Assets.xcassets/AppIcon.appiconset/76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterfriese/SwiftUI-Combine/659122389dee7029d2c5f7d92654c837e02a9cfa/SwiftUI-Combine/Assets.xcassets/AppIcon.appiconset/76.png
--------------------------------------------------------------------------------
/SwiftUI-Combine/Assets.xcassets/AppIcon.appiconset/80.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterfriese/SwiftUI-Combine/659122389dee7029d2c5f7d92654c837e02a9cfa/SwiftUI-Combine/Assets.xcassets/AppIcon.appiconset/80.png
--------------------------------------------------------------------------------
/SwiftUI-Combine/Assets.xcassets/AppIcon.appiconset/87.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterfriese/SwiftUI-Combine/659122389dee7029d2c5f7d92654c837e02a9cfa/SwiftUI-Combine/Assets.xcassets/AppIcon.appiconset/87.png
--------------------------------------------------------------------------------
/SwiftUI-Combine/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "40.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "60.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "29.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "58.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "87.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "80.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "120.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "57x57",
47 | "idiom" : "iphone",
48 | "filename" : "57.png",
49 | "scale" : "1x"
50 | },
51 | {
52 | "size" : "57x57",
53 | "idiom" : "iphone",
54 | "filename" : "114.png",
55 | "scale" : "2x"
56 | },
57 | {
58 | "size" : "60x60",
59 | "idiom" : "iphone",
60 | "filename" : "120.png",
61 | "scale" : "2x"
62 | },
63 | {
64 | "size" : "60x60",
65 | "idiom" : "iphone",
66 | "filename" : "180.png",
67 | "scale" : "3x"
68 | },
69 | {
70 | "size" : "20x20",
71 | "idiom" : "ipad",
72 | "filename" : "20.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "20x20",
77 | "idiom" : "ipad",
78 | "filename" : "40.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "29x29",
83 | "idiom" : "ipad",
84 | "filename" : "29.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "29x29",
89 | "idiom" : "ipad",
90 | "filename" : "58.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "40x40",
95 | "idiom" : "ipad",
96 | "filename" : "40.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "40x40",
101 | "idiom" : "ipad",
102 | "filename" : "80.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "50x50",
107 | "idiom" : "ipad",
108 | "filename" : "50.png",
109 | "scale" : "1x"
110 | },
111 | {
112 | "size" : "50x50",
113 | "idiom" : "ipad",
114 | "filename" : "100.png",
115 | "scale" : "2x"
116 | },
117 | {
118 | "size" : "72x72",
119 | "idiom" : "ipad",
120 | "filename" : "72.png",
121 | "scale" : "1x"
122 | },
123 | {
124 | "size" : "72x72",
125 | "idiom" : "ipad",
126 | "filename" : "144.png",
127 | "scale" : "2x"
128 | },
129 | {
130 | "size" : "76x76",
131 | "idiom" : "ipad",
132 | "filename" : "76.png",
133 | "scale" : "1x"
134 | },
135 | {
136 | "size" : "76x76",
137 | "idiom" : "ipad",
138 | "filename" : "152.png",
139 | "scale" : "2x"
140 | },
141 | {
142 | "size" : "83.5x83.5",
143 | "idiom" : "ipad",
144 | "filename" : "167.png",
145 | "scale" : "2x"
146 | },
147 | {
148 | "size" : "1024x1024",
149 | "idiom" : "ios-marketing",
150 | "filename" : "1024.png",
151 | "scale" : "1x"
152 | },
153 | {
154 | "size" : "24x24",
155 | "idiom" : "watch",
156 | "scale" : "2x",
157 | "role" : "notificationCenter",
158 | "subtype" : "38mm"
159 | },
160 | {
161 | "size" : "27.5x27.5",
162 | "idiom" : "watch",
163 | "scale" : "2x",
164 | "role" : "notificationCenter",
165 | "subtype" : "42mm"
166 | },
167 | {
168 | "size" : "29x29",
169 | "idiom" : "watch",
170 | "filename" : "58.png",
171 | "role" : "companionSettings",
172 | "scale" : "2x"
173 | },
174 | {
175 | "size" : "29x29",
176 | "idiom" : "watch",
177 | "filename" : "87.png",
178 | "role" : "companionSettings",
179 | "scale" : "3x"
180 | },
181 | {
182 | "size" : "40x40",
183 | "idiom" : "watch",
184 | "scale" : "2x",
185 | "role" : "appLauncher",
186 | "subtype" : "38mm"
187 | },
188 | {
189 | "size" : "44x44",
190 | "idiom" : "watch",
191 | "scale" : "2x",
192 | "role" : "appLauncher",
193 | "subtype" : "40mm"
194 | },
195 | {
196 | "size" : "50x50",
197 | "idiom" : "watch",
198 | "scale" : "2x",
199 | "role" : "appLauncher",
200 | "subtype" : "44mm"
201 | },
202 | {
203 | "size" : "86x86",
204 | "idiom" : "watch",
205 | "scale" : "2x",
206 | "role" : "quickLook",
207 | "subtype" : "38mm"
208 | },
209 | {
210 | "size" : "98x98",
211 | "idiom" : "watch",
212 | "scale" : "2x",
213 | "role" : "quickLook",
214 | "subtype" : "42mm"
215 | },
216 | {
217 | "size" : "108x108",
218 | "idiom" : "watch",
219 | "scale" : "2x",
220 | "role" : "quickLook",
221 | "subtype" : "44mm"
222 | },
223 | {
224 | "size" : "1024x1024",
225 | "idiom" : "watch-marketing",
226 | "filename" : "1024.png",
227 | "scale" : "1x"
228 | }
229 | ],
230 | "info" : {
231 | "version" : 1,
232 | "author" : "xcode"
233 | }
234 | }
--------------------------------------------------------------------------------
/SwiftUI-Combine/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/SwiftUI-Combine/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/SwiftUI-Combine/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE)
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UIApplicationSceneManifest
24 |
25 | UIApplicationSupportsMultipleScenes
26 |
27 | UISceneConfigurations
28 |
29 | UIWindowSceneSessionRoleApplication
30 |
31 |
32 | UISceneConfigurationName
33 | Default Configuration
34 | UISceneDelegateClassName
35 | $(PRODUCT_MODULE_NAME).SceneDelegate
36 |
37 |
38 |
39 |
40 | UILaunchStoryboardName
41 | LaunchScreen
42 | UIRequiredDeviceCapabilities
43 |
44 | armv7
45 |
46 | UISupportedInterfaceOrientations
47 |
48 | UIInterfaceOrientationPortrait
49 | UIInterfaceOrientationLandscapeLeft
50 | UIInterfaceOrientationLandscapeRight
51 |
52 | UISupportedInterfaceOrientations~ipad
53 |
54 | UIInterfaceOrientationPortrait
55 | UIInterfaceOrientationPortraitUpsideDown
56 | UIInterfaceOrientationLandscapeLeft
57 | UIInterfaceOrientationLandscapeRight
58 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/SwiftUI-Combine/Preview Content/Preview Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/SwiftUI-Combine/SceneDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SceneDelegate.swift
3 | // SwiftUI-Combine
4 | //
5 | // Created by Peter Friese on 02/09/2019.
6 | // Copyright © 2019 Google LLC. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import SwiftUI
11 |
12 | class SceneDelegate: UIResponder, UIWindowSceneDelegate {
13 |
14 | var window: UIWindow?
15 |
16 |
17 | func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
18 | // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
19 | // If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
20 | // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
21 |
22 | // Create the SwiftUI view that provides the window contents.
23 | let contentView = ContentView()
24 |
25 | // Use a UIHostingController as window root view controller.
26 | if let windowScene = scene as? UIWindowScene {
27 | let window = UIWindow(windowScene: windowScene)
28 | window.rootViewController = UIHostingController(rootView: contentView)
29 | self.window = window
30 | window.makeKeyAndVisible()
31 | }
32 | }
33 |
34 | func sceneDidDisconnect(_ scene: UIScene) {
35 | // Called as the scene is being released by the system.
36 | // This occurs shortly after the scene enters the background, or when its session is discarded.
37 | // Release any resources associated with this scene that can be re-created the next time the scene connects.
38 | // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead).
39 | }
40 |
41 | func sceneDidBecomeActive(_ scene: UIScene) {
42 | // Called when the scene has moved from an inactive state to an active state.
43 | // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
44 | }
45 |
46 | func sceneWillResignActive(_ scene: UIScene) {
47 | // Called when the scene will move from an active state to an inactive state.
48 | // This may occur due to temporary interruptions (ex. an incoming phone call).
49 | }
50 |
51 | func sceneWillEnterForeground(_ scene: UIScene) {
52 | // Called as the scene transitions from the background to the foreground.
53 | // Use this method to undo the changes made on entering the background.
54 | }
55 |
56 | func sceneDidEnterBackground(_ scene: UIScene) {
57 | // Called as the scene transitions from the foreground to the background.
58 | // Use this method to save data, release shared resources, and store enough scene-specific state information
59 | // to restore the scene back to its current state.
60 | }
61 |
62 |
63 | }
64 |
65 |
--------------------------------------------------------------------------------
/SwiftUI-Combine/ViewModels/UserViewModel.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UserViewModel.swift
3 | // SwiftUI-Combine
4 | //
5 | // Created by Peter Friese on 11/09/2019.
6 | // Copyright © 2019 Google LLC. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import Combine
11 | import Navajo_Swift
12 |
13 | class UserViewModel: ObservableObject {
14 | // input
15 | @Published var username = ""
16 | @Published var password = ""
17 | @Published var passwordAgain = ""
18 |
19 | // output
20 | @Published var usernameMessage = ""
21 | @Published var passwordMessage = ""
22 | @Published var isValid = false
23 |
24 | private var cancellableSet: Set = []
25 |
26 | private var isUsernameValidPublisher: AnyPublisher {
27 | $username
28 | .debounce(for: 0.8, scheduler: RunLoop.main)
29 | .removeDuplicates()
30 | .map { input in
31 | return input.count >= 3
32 | }
33 | .eraseToAnyPublisher()
34 | }
35 |
36 | private var isPasswordEmptyPublisher: AnyPublisher {
37 | $password
38 | .debounce(for: 0.8, scheduler: RunLoop.main)
39 | .removeDuplicates()
40 | .map { password in
41 | return password == ""
42 | }
43 | .eraseToAnyPublisher()
44 | }
45 |
46 | private var arePasswordsEqualPublisher: AnyPublisher {
47 | Publishers.CombineLatest($password, $passwordAgain)
48 | .debounce(for: 0.2, scheduler: RunLoop.main)
49 | .map { password, passwordAgain in
50 | return password == passwordAgain
51 | }
52 | .eraseToAnyPublisher()
53 | }
54 |
55 | private var passwordStrengthPublisher: AnyPublisher {
56 | $password
57 | .debounce(for: 0.2, scheduler: RunLoop.main)
58 | .removeDuplicates()
59 | .map { input in
60 | return Navajo.strength(ofPassword: input)
61 | }
62 | .eraseToAnyPublisher()
63 | }
64 |
65 | private var isPasswordStrongEnoughPublisher: AnyPublisher {
66 | passwordStrengthPublisher
67 | .map { strength in
68 | print(Navajo.localizedString(forStrength: strength))
69 | switch strength {
70 | case .reasonable, .strong, .veryStrong:
71 | return true
72 | default:
73 | return false
74 | }
75 | }
76 | .eraseToAnyPublisher()
77 | }
78 |
79 | enum PasswordCheck {
80 | case valid
81 | case empty
82 | case noMatch
83 | case notStrongEnough
84 | }
85 |
86 | private var isPasswordValidPublisher: AnyPublisher {
87 | Publishers.CombineLatest3(isPasswordEmptyPublisher, arePasswordsEqualPublisher, isPasswordStrongEnoughPublisher)
88 | .map { passwordIsEmpty, passwordsAreEqual, passwordIsStrongEnough in
89 | if (passwordIsEmpty) {
90 | return .empty
91 | }
92 | else if (!passwordsAreEqual) {
93 | return .noMatch
94 | }
95 | else if (!passwordIsStrongEnough) {
96 | return .notStrongEnough
97 | }
98 | else {
99 | return .valid
100 | }
101 | }
102 | .eraseToAnyPublisher()
103 | }
104 |
105 | private var isFormValidPublisher: AnyPublisher {
106 | Publishers.CombineLatest(isUsernameValidPublisher, isPasswordValidPublisher)
107 | .map { userNameIsValid, passwordIsValid in
108 | return userNameIsValid && (passwordIsValid == .valid)
109 | }
110 | .eraseToAnyPublisher()
111 | }
112 |
113 | init() {
114 | isUsernameValidPublisher
115 | .receive(on: RunLoop.main)
116 | .map { valid in
117 | valid ? "" : "User name must at least have 3 characters"
118 | }
119 | .assign(to: \.usernameMessage, on: self)
120 | .store(in: &cancellableSet)
121 |
122 | isPasswordValidPublisher
123 | .receive(on: RunLoop.main)
124 | .map { passwordCheck in
125 | switch passwordCheck {
126 | case .empty:
127 | return "Password must not be empty"
128 | case .noMatch:
129 | return "Passwords don't match"
130 | case .notStrongEnough:
131 | return "Password not strong enough"
132 | default:
133 | return ""
134 | }
135 | }
136 | .assign(to: \.passwordMessage, on: self)
137 | .store(in: &cancellableSet)
138 |
139 | isFormValidPublisher
140 | .receive(on: RunLoop.main)
141 | .assign(to: \.isValid, on: self)
142 | .store(in: &cancellableSet)
143 | }
144 |
145 | }
146 |
--------------------------------------------------------------------------------
/SwiftUI-Combine/Views/ContentView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ContentView.swift
3 | // SwiftUI-Combine
4 | //
5 | // Created by Peter Friese on 02/09/2019.
6 | // Copyright © 2019 Google LLC. All rights reserved.
7 | //
8 |
9 | import SwiftUI
10 |
11 | struct ContentView: View {
12 |
13 | @ObservedObject private var userViewModel = UserViewModel()
14 | @State var presentAlert = false
15 |
16 | var body: some View {
17 | Form {
18 | Section(footer: Text(userViewModel.usernameMessage).foregroundColor(.red)) {
19 | TextField("Username", text: $userViewModel.username)
20 | .autocapitalization(.none)
21 | }
22 | Section(footer: Text(userViewModel.passwordMessage).foregroundColor(.red)) {
23 | SecureField("Password", text: $userViewModel.password)
24 | SecureField("Password again", text: $userViewModel.passwordAgain)
25 | }
26 | Section {
27 | Button(action: { self.signUp() }) {
28 | Text("Sign up")
29 | }.disabled(!self.userViewModel.isValid)
30 | }
31 | }
32 | .sheet(isPresented: $presentAlert) {
33 | WelcomeView()
34 | }
35 | }
36 |
37 | func signUp() {
38 | self.presentAlert = true
39 | }
40 | }
41 |
42 | struct WelcomeView: View {
43 | var body: some View {
44 | Text("Welcome! Great to have you on board!")
45 | }
46 | }
47 |
48 | struct ContentView_Previews: PreviewProvider {
49 | static var previews: some View {
50 | ContentView()
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/SwiftUI-CombineTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE)
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/SwiftUI-CombineTests/SwiftUI_CombineTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SwiftUI_CombineTests.swift
3 | // SwiftUI-CombineTests
4 | //
5 | // Created by Peter Friese on 02/09/2019.
6 | // Copyright © 2019 Google LLC. All rights reserved.
7 | //
8 |
9 | import XCTest
10 | @testable import SwiftUI_Combine
11 |
12 | class SwiftUI_CombineTests: XCTestCase {
13 |
14 | override func setUp() {
15 | // Put setup code here. This method is called before the invocation of each test method in the class.
16 | }
17 |
18 | override func tearDown() {
19 | // Put teardown code here. This method is called after the invocation of each test method in the class.
20 | }
21 |
22 | func testExample() {
23 | // This is an example of a functional test case.
24 | // Use XCTAssert and related functions to verify your tests produce the correct results.
25 | }
26 |
27 | func testPerformanceExample() {
28 | // This is an example of a performance test case.
29 | self.measure {
30 | // Put the code you want to measure the time of here.
31 | }
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/images/demo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterfriese/SwiftUI-Combine/659122389dee7029d2c5f7d92654c837e02a9cfa/images/demo.gif
--------------------------------------------------------------------------------
/images/screenshot-dark2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterfriese/SwiftUI-Combine/659122389dee7029d2c5f7d92654c837e02a9cfa/images/screenshot-dark2.png
--------------------------------------------------------------------------------
/images/screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterfriese/SwiftUI-Combine/659122389dee7029d2c5f7d92654c837e02a9cfa/images/screenshot.png
--------------------------------------------------------------------------------
/images/swiftui-128x128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterfriese/SwiftUI-Combine/659122389dee7029d2c5f7d92654c837e02a9cfa/images/swiftui-128x128.png
--------------------------------------------------------------------------------
/images/swiftui-512x512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peterfriese/SwiftUI-Combine/659122389dee7029d2c5f7d92654c837e02a9cfa/images/swiftui-512x512.png
--------------------------------------------------------------------------------