Skip to content

Commit

Permalink
remove stateful view and view+if helpers, we're going to move them in…
Browse files Browse the repository at this point in the history
…to a different utils library and keep nice components nice and simple (#41)
  • Loading branch information
brendanlensink authored Nov 24, 2022
1 parent 258a295 commit 2297d34
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 306 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.6.0]
- Removed stateful view and view+if helpers, to be moved into a separate utils library.

## [0.5.0]
- Add functionality to NiceText to allow setting a maximum dynamic type font size
- Add two helper functions to `View`, `if` and `iflet` that allow for optional view modifying
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
C614E74226E12DAB00F7F87C /* Theme.swift in Sources */ = {isa = PBXBuildFile; fileRef = C614E74126E12DAB00F7F87C /* Theme.swift */; };
C628F0D325C4A08B001331AB /* NotoSerif-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = C628F0D125C4A08B001331AB /* NotoSerif-Bold.ttf */; };
C628F0D425C4A08B001331AB /* NotoSerif-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = C628F0D225C4A08B001331AB /* NotoSerif-Regular.ttf */; };
C65289F326CF0DFF009D486B /* StatefulExampleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C65289F226CF0DFF009D486B /* StatefulExampleView.swift */; };
C671309E25C4948800F75E44 /* NiceComponentsExampleApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = C671309D25C4948800F75E44 /* NiceComponentsExampleApp.swift */; };
C67130A025C4948800F75E44 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C671309F25C4948800F75E44 /* ContentView.swift */; };
C67130A225C4948900F75E44 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C67130A125C4948900F75E44 /* Assets.xcassets */; };
Expand Down Expand Up @@ -194,7 +193,6 @@
files = (
C67130A025C4948800F75E44 /* ContentView.swift in Sources */,
C671309E25C4948800F75E44 /* NiceComponentsExampleApp.swift in Sources */,
C65289F326CF0DFF009D486B /* StatefulExampleView.swift in Sources */,
C614E74226E12DAB00F7F87C /* Theme.swift in Sources */,
C6CD255D25D6F0B1008026D5 /* SampleSignInView.swift in Sources */,
C6CD255825D6F01C008026D5 /* AllComponentsView.swift in Sources */,
Expand Down
3 changes: 0 additions & 3 deletions NiceComponentsExample/NiceComponentsExample/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ struct ContentView: View {
NavigationLink(destination: SampleSignInView()) {
Text("Sign In")
}
NavigationLink(destination: StatefulExampleView(viewModel: StatefulViewModel())) {
Text("Stateful View Example")
}
}
}
}
Expand Down

This file was deleted.

6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,6 @@ var body: some View {

```

### Using `StatefulView`

We've found with SwiftUI it's very common to have a view whose state changes based on some content state defined in its ViewModel. With `StatefulView`, you can pass in your current state, and the desired loaded state and have things automatically update as your state changes. You can also update your error, loading and noData states to suit your needs.

See [StatefulExampleView](https://github.com/steamclock/swiftui_components/blob/main/NiceComponentsExample/NiceComponentsExample/View/StatefulExampleView.swift) for a full example.

### Setting a Color Palette

Components are colored using a theme inspired by the [Material Design color system](https://material.io/design/color/the-color-system.html#color-theme-creation).
Expand Down
148 changes: 0 additions & 148 deletions Sources/NiceComponents/Components/StatefulView.swift

This file was deleted.

31 changes: 0 additions & 31 deletions Sources/NiceComponents/Helper/ContentLoadState.swift

This file was deleted.

29 changes: 0 additions & 29 deletions Sources/NiceComponents/Helper/View+If.swift

This file was deleted.

0 comments on commit 2297d34

Please sign in to comment.