Skip to content

Commit

Permalink
Docs > Update installation steps, remove deprecated features
Browse files Browse the repository at this point in the history
  • Loading branch information
supernintendo committed Dec 9, 2023
1 parent 482b359 commit a949e1d
Show file tree
Hide file tree
Showing 15 changed files with 287 additions and 257 deletions.
Binary file added guides/assets/images/first-ios.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added guides/assets/images/first-web.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified guides/assets/images/hello-ipad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified guides/assets/images/hello-iphone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified guides/assets/images/hello-mac.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added guides/assets/images/hello-watch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified guides/assets/images/hello-web.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
188 changes: 0 additions & 188 deletions guides/common-features/modifiers.md

This file was deleted.

16 changes: 6 additions & 10 deletions guides/common-features/render-patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ defmodule MyAppWeb.SharedComponents do
use Phoenix.Component
use LiveViewNative.Component

import ElixirconfChatWeb.Modclasses.SwiftUi, only: [modclass: 3]

def logo(%{format: :swiftui} = assigns) do
~SWIFTUI"""
<VStack>
Expand Down Expand Up @@ -106,7 +104,7 @@ end
### hello_live.swiftui.heex
```heex
<VStack id="template-ios">
<HStack modifiers={padding(5)}>
<HStack class="p-5">
<Text>A SwiftUI template, courtesy of hello_live.swiftui.heex</Text>
</HStack>
</VStack>
Expand All @@ -125,19 +123,17 @@ defmodule MyAppWeb.SharedComponents do
use Phoenix.Component
use LiveViewNative.Component

import ElixirconfChatWeb.Modclasses.SwiftUi, only: [modclass: 3]

def logo(%{format: :swiftui} = assigns) do
~SWIFTUI"""
<VStack>
<%= case @native.platform_config.user_interface_idiom do %>
<% "mac" -> %>
<%= case @target do %>
<% :mac -> %>
<Text>Hello macOS!</Text>
<% "pad" -> %>
<% :pad -> %>
<Text>Hello iPadOS!</Text>
<% "watch" -> %>
<% :watch -> %>
<Text>Hello watchOS!</Text>
<% "tv" -> %>
<% :tv -> %>
<Text>Hello tvOS!</Text>
<% _ -> %>
<Text>Hello iOS!</Text>
Expand Down
3 changes: 1 addition & 2 deletions guides/common-features/template-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ defmodule MyAppWeb.MyComponents do
<HStack>
<Image name={@album.cover} />
<VStack alignment="leading">
<Text modifiers={font_weight(:bold)}><%= song.title %></Text>
<Text class="bold"><%= song.title %></Text>
<Text><%= song.artist.name %></Text>
</VStack>
</HStack>
Expand Down Expand Up @@ -71,7 +71,6 @@ Here we can observe various semantic changes to port SwiftUI code to EEx:
2. The struct value `album` is an assign, `@album`, instead.
3. Instead of passing `album.songs` as an argument, we use a comprehension.
- `<Text>` elements take their arguments as values, similar to HTML.
4. We can't call a function on an element like in SwiftUI, so the `.fontWeight(.bold)` modifier function is called as `font_weight(:bold)` and passed to the `modifiers` attribute.

These conventions can generally be applied to all sorts of examples when using LiveView Native to build SwiftUI views.
Because LiveView Native is modular, each platform library will have its own way of "bridging the gap" between the Elixir
Expand Down
Loading

0 comments on commit a949e1d

Please sign in to comment.