Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leverage UIKitNavigation #3180

Merged
merged 28 commits into from
Aug 13, 2024
Merged

Leverage UIKitNavigation #3180

merged 28 commits into from
Aug 13, 2024

Conversation

stephencelis
Copy link
Member

This draft PR demonstrates how to use the new UIKitNavigation beta tools in a Composable Architecture application.

We can merge when the tools are finalized and released.

@acosmicflamingo
Copy link
Contributor

acosmicflamingo commented Jun 19, 2024

Have you encountered any scoping issues when using UIBinding? The weirdest thing, I have two identical scopes but one works and the other gives me an error like below:

let binding = $store.scope(  // 1
  state: \.self,  // 2
  action: \.self // 3
)

// 1 error
Cannot call value of non-function type '_StoreUIBinding<AppMain.State, AppMain.Action, _>'
Value of type 'UIBinding<StoreOf<AppMain>>' (aka 'UIBinding<Store<AppMain.State, AppMain.Action>>') has
no dynamic member 'scope' using key path from root type 'AppMain.State'

// 2 error
Cannot infer key path type from context; consider explicitly specifying a root type

// 3 error
Cannot infer key path type from context; consider explicitly specifying a root type

If I get rid of $, then binding is of type Store<AppMain.State, AppMain.Action>

If I created a dummy function in UIBindable, then I get the following error:

extension UIBindable {
  public func scope2() {}
}

// Value of type 'UIBinding<StoreOf<AppMain>>' (aka 'UIBinding<Store<AppMain.State, AppMain.Action>>') has no
// dynamic member 'scopeMe2' using key path from root type 'AppMain.State'
let binding = $store.scope2() 

Edit: Whoops; there is a difference between @UIBindable and @UIBinding; that's what I was doing wrong. Hm, looks like I'm finally going to have to learn about the SwiftUI's rather similar terminology.

@stephencelis stephencelis marked this pull request as ready for review August 12, 2024 16:23
@mbrandonw mbrandonw merged commit dae1b9a into main Aug 13, 2024
6 checks passed
@mbrandonw mbrandonw deleted the uikit-navigation branch August 13, 2024 20:01
cgrindel-self-hosted-renovate bot referenced this pull request in cgrindel/rules_swift_package_manager Sep 15, 2024
…ure to from: "1.13.1" (#1210)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
|
[pointfreeco/swift-composable-architecture](https://togithub.com/pointfreeco/swift-composable-architecture)
| minor | `from: "1.12.1"` -> `from: "1.13.1"` |

---

### Release Notes

<details>
<summary>pointfreeco/swift-composable-architecture
(pointfreeco/swift-composable-architecture)</summary>

###
[`v1.13.1`](https://togithub.com/pointfreeco/swift-composable-architecture/releases/tag/1.13.1)

[Compare
Source](https://togithub.com/pointfreeco/swift-composable-architecture/compare/1.13.0...1.13.1)

#### What's Changed

- Fixed: Address regression in which `observe` was limited to platforms
that can import UIKit by bringing back an AppKit-compatible version
([https://github.com/pointfreeco/swift-composable-architecture/pull/3295](https://togithub.com/pointfreeco/swift-composable-architecture/pull/3295)).
- Infrastructure: Integration test fixes
([https://github.com/pointfreeco/swift-composable-architecture/pull/3294](https://togithub.com/pointfreeco/swift-composable-architecture/pull/3294)).

**Full Changelog**:
pointfreeco/swift-composable-architecture@1.13.0...1.13.1

###
[`v1.13.0`](https://togithub.com/pointfreeco/swift-composable-architecture/releases/tag/1.13.0)

[Compare
Source](https://togithub.com/pointfreeco/swift-composable-architecture/compare/1.12.1...1.13.0)

#### What's Changed

- Added: UIKit navigation and binding tools
([https://github.com/pointfreeco/swift-composable-architecture/pull/3180](https://togithub.com/pointfreeco/swift-composable-architecture/pull/3180)).
- Fixed: Update `Shared` to invoke `reportIssue`
([https://github.com/pointfreeco/swift-composable-architecture/pull/3258](https://togithub.com/pointfreeco/swift-composable-architecture/pull/3258)).
- Fixed: Address a few compiler warnings
([https://github.com/pointfreeco/swift-composable-architecture/pull/3279](https://togithub.com/pointfreeco/swift-composable-architecture/pull/3279)).
- Fixed: Avoid crash when writing to shared user defaults on a
background thread (thanks
[@&#8203;larryonoff](https://togithub.com/larryonoff),
[https://github.com/pointfreeco/swift-composable-architecture/pull/3285](https://togithub.com/pointfreeco/swift-composable-architecture/pull/3285)).
- Infrastructure: Typo fixes (thanks
[@&#8203;hmhv](https://togithub.com/hmhv),
[https://github.com/pointfreeco/swift-composable-architecture/pull/3267](https://togithub.com/pointfreeco/swift-composable-architecture/pull/3267);
[@&#8203;mltbnz](https://togithub.com/mltbnz),
[https://github.com/pointfreeco/swift-composable-architecture/pull/3268](https://togithub.com/pointfreeco/swift-composable-architecture/pull/3268)).
- Infrastructure: Update swiftlang repository link (thanks
[@&#8203;lamtrinhdev](https://togithub.com/lamtrinhdev),
[https://github.com/pointfreeco/swift-composable-architecture/pull/3270](https://togithub.com/pointfreeco/swift-composable-architecture/pull/3270)).
- Infrastructure: Updated a bunch of DocC references
([https://github.com/pointfreeco/swift-composable-architecture/pull/3287](https://togithub.com/pointfreeco/swift-composable-architecture/pull/3287)).

#### New Contributors

- [@&#8203;mltbnz](https://togithub.com/mltbnz) made their first
contribution in
[https://github.com/pointfreeco/swift-composable-architecture/pull/3268](https://togithub.com/pointfreeco/swift-composable-architecture/pull/3268)
- [@&#8203;lamtrinhdev](https://togithub.com/lamtrinhdev) made their
first contribution in
[https://github.com/pointfreeco/swift-composable-architecture/pull/3270](https://togithub.com/pointfreeco/swift-composable-architecture/pull/3270)

**Full Changelog**:
pointfreeco/swift-composable-architecture@1.12.1...1.13.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://togithub.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC41NS4wIiwidXBkYXRlZEluVmVyIjoiMzguNTUuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: cgrindel-self-hosted-renovate[bot] <139595543+cgrindel-self-hosted-renovate[bot]@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants