All Projects → SwiftWebUI → Swiftwebui

SwiftWebUI / Swiftwebui

Licence: apache-2.0
A demo implementation of SwiftUI for the Web

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Swiftwebui

SwiftUI-App
This swiftUI Demo is very simple & easy to understand. This swiftUI demo includes On-boarding screens, login screen, forgot password screen, sign up screen, home & logout.
Stars: ✭ 175 (-95.22%)
Mutual labels:  swiftui, swift5, swiftui-example
SwiftUIDemo
A demo app showing you how to build a table view and navigation interface with SwiftUI
Stars: ✭ 26 (-99.29%)
Mutual labels:  swiftui, swift5, swiftui-example
NYTimes-iOS
🗽 NY Times is an Minimal News 🗞 iOS app 📱 built to describe the use of SwiftSoup and CoreData with SwiftUI🔥
Stars: ✭ 152 (-95.85%)
Mutual labels:  swiftui, swift5, swiftui-example
iOS-SwiftUI-Firebase-Login-Example
Complete Sign up and Sign in Process for iOS SwiftUI - using Firebase Email and Password Authentication.
Stars: ✭ 37 (-98.99%)
Mutual labels:  swiftui, swift5, swiftui-example
StoryboardPreviewsBySwiftUI
Introduce how to make the Storyboard file and Xib file correspond to the preview function by SwiftUI.
Stars: ✭ 35 (-99.04%)
Mutual labels:  swiftui, swift5, swiftui-example
SwiftUI-Currency-Converter
Currency Converter project coded by SwiftUI and Swift5
Stars: ✭ 56 (-98.47%)
Mutual labels:  swiftui, swift5
Shift
Light-weight EventKit wrapper.
Stars: ✭ 31 (-99.15%)
Mutual labels:  swiftui, swift5
Beers
SwiftUI Experiment - Shows a list of beers fetched from Punk API (https://punkapi.com/), includes detail view for each beer
Stars: ✭ 20 (-99.45%)
Mutual labels:  swiftui, swiftui-example
Swipeable-View
Simple editActionsForRowAt functionality, written on SWIFTUI
Stars: ✭ 37 (-98.99%)
Mutual labels:  swiftui, swift5
SwiftUI.TextEdit
SwiftUI proof-of-concept text edit component
Stars: ✭ 71 (-98.06%)
Mutual labels:  swiftui, swiftui-example
BarChart
SwiftUI Bar Chart
Stars: ✭ 156 (-95.74%)
Mutual labels:  swiftui, swiftui-example
ACarousel
A carousel view for SwiftUI | SwiftUI 旋转木马效果
Stars: ✭ 124 (-96.61%)
Mutual labels:  swiftui, swift5
aprenda-swift
Uma lista de conteúdos para você aprender Swift
Stars: ✭ 429 (-88.29%)
Mutual labels:  swiftui, swift5
GameKitUI.swift
GameKit (GameCenter) for SwiftUI
Stars: ✭ 29 (-99.21%)
Mutual labels:  swiftui, swift5
OnlySwitch
⚙️ All-in-One menu bar app, hide 💻MacBook Pro's notch, dark mode, AirPods, Shortcuts
Stars: ✭ 1,288 (-64.84%)
Mutual labels:  swiftui, swift5
Tasky
Tasky is a task management app made with SwiftUI.
Stars: ✭ 22 (-99.4%)
Mutual labels:  swiftui, swiftui-example
SwiftUI-Tooltip
Easy Tooltip for your SwiftUI Project
Stars: ✭ 130 (-96.45%)
Mutual labels:  swiftui, swift5
SwiftyIllustrator
A tool for quickly converting Adobe Illustrator shapes into SwiftUI code.
Stars: ✭ 26 (-99.29%)
Mutual labels:  swiftui, swiftui-example
RRSettingsKit
A beautiful customizable settings screen created in SwiftUI
Stars: ✭ 118 (-96.78%)
Mutual labels:  swiftui, swiftui-example
SwiftUIRealtimeShoppingCart
SwiftUI Collaborative Shopping Cart with Firestore Database
Stars: ✭ 34 (-99.07%)
Mutual labels:  swiftui, swiftui-example

SwiftWebUI

Swift5.1 macOS tuxOS Travis

More details can be found on the related blog post at the Always Right Institute.

At WWDC 2019 Apple announced SwiftUI. A single "cross platform", "declarative" framework used to build tvOS, macOS, watchOS and iOS UIs. SwiftWebUI is bringing that to the Web ✔️

Disclaimer: This is a toy project! Do not use for production. Use it to learn more about SwiftUI and its inner workings.

SwiftWebUI

So what exactly is SwiftWebUI? It allows you to write SwiftUI Views which display in a web browser:

import SwiftWebUI

struct MainPage: View {
  @State var counter = 0
  
  func countUp() { 
    counter += 1 
  }
  
  var body: some View {
    VStack {
      Text("🥑🍞 #\(counter)")
        .padding(.all)
        .background(.green, cornerRadius: 12)
        .foregroundColor(.white)
        .onTapGesture(self.countUp)
    }
  }
}

Results in:

Unlike some other efforts this doesn't just render SwiftUI Views as HTML. It also sets up a connection between the browser and the code hosted in the Swift server, allowing for interaction - buttons, pickers, steppers, lists, navigation, you get it all!

In other words: SwiftWebUI is an implementation of (many but not all parts of) the SwiftUI API for the browser.

To repeat the Disclaimer: This is a toy project! Do not use for production. Use it to learn more about SwiftUI and its inner workings.

Requirements

Update 2019-07-08: There are three options to run SwiftWebUI:

macOS Catalina

One can use a macOS Catalina installation to run SwiftWebUI. Make sure that the Catalina version matches your Xcode 11 beta! (“Swift ABI” 🤦‍♀️)

Fortunately it is really easy to install Catalina on a separate APFS volume. And an installation of Xcode 11 is required to get the new Swift 5.1 features SwiftUI makes heavy use of. Got that? Very well!

Why is Catalina required? SwiftUI makes use of new Swift 5.1 runtime features (e.g. opaque result types). Those features are not available in the Swift 5 runtime that ships with Mojave. (another reason is the use of Combine which is only available in Catalina, though that part could be fixed using OpenCombine)

tuxOS

SwiftWebUI now runs on Linux using OpenCombine (also works without that, but then some things don't work, e.g. NavigationView).

A Swift 5.1 snapshot is required. We also provide a Docker image containing a 5.1 snapshot over here: helje5/swift.

Mojave

The Xcode 11beta iOS 13 simulators do run on Mojave. You might be able to run SwiftWebUI within an iOS app.

SwiftWebUI Hello World

To setup a SwiftWebUI project, create a "macOS tool project" in Xcode 11, then use the new SwiftPM integration and add https://github.com/SwiftWebUI/SwiftWebUI as a dependency.

Open the main.swift file and replace it's content with:

import SwiftWebUI

SwiftWebUI.serve(Text("Holy Cow!"))

Compile and run the app in Xcode, open Safari and hit http://localhost:1337/:

🥑🍞 AvocadoToast

A small SwiftWebUI sample based on the SwiftUI Essentials "Avocado Toast App". Find it over here: AvocadoToast.

Who

Brought to you by The Always Right Institute and ZeeZide. We like feedback, GitHub stars, cool contract work, presumably any form of praise you can think of.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].