GithubHelp home page GithubHelp logo

openswiftuiproject / openswiftui Goto Github PK

View Code? Open in Web Editor NEW
797.0 16.0 25.0 1.24 MB

[WIP] Open source implementation of Apple's SwiftUI.

Home Page: https://swiftpackageindex.com/OpenSwiftUIProject/OpenSwiftUI/main/documentation/openswiftui

License: MIT License

Swift 94.78% C 4.03% Objective-C 0.94% Shell 0.25%

openswiftui's Introduction

OpenSwiftUI

codecov

OpenSwiftUI is an open source implementation of Apple's SwiftUI

The project is for the following purposes:

  • Build GUI app on non-Apple platform (eg. Linux & Windows)
  • Diagnose and debug SwiftUI issues on Apple platform

And the API design is to stay the same as the original SwiftUI API as possible.

Currently, this project is in early development.

You can find the API documentation here.

Warning

This package use a lot of hidden API and private framework on Apple platform.

Please DO NOT use this package in Apple's production environment(eg. App Store).

Otherwize it may break your build or crash your app at any future SDK/OS update.

Usage

See Example folder and try it with ExampleApp

Important

Clone OpenGraph in the same directory before running the example.

See Example/README.md for more detail.

Build

Build without testing framework

./Scripts/build

Build with Library Evolution

./Scripts/openswiftui_swiftinterface

Supported platforms

The table below describes the current level of support that OpenSwiftUI has for various platforms:

Platform CI Status Support Status Build Test Deploy
SwiftUI Compatibility Compatibility tests
macOS macOS ⭐️⭐️⭐️ *1
iOS iOS ⭐️⭐️⭐️⭐️ *2
Ubuntu 22.04 Ubuntu ⭐️⭐️ *3
Wasm Ubuntu ⭐️ *4
Windows None Not supported yet

Note

The cross-platform OpenGraph is not fully implemented.

It is only API compatible with AttributeGraph now.

So most of the core feature is only available on Apple platform built with AttributeGraph varient.

License

See LICENSE file - MIT

Related Projects

Star History

Star History Chart

Footnotes

  1. AppKit and other UI framework backend is not intergrated yet.

  2. UIKit intergration is partly implemented. No Render support yet.

  3. Build and test is supported. But some feature is cut due to known Swift compiler issue.

  4. Build is supported. Test is not supported yet dut to upstream issue.

openswiftui's People

Contributors

kyle-ye avatar dark-existed avatar finestructure avatar revolter avatar

Stargazers

Roman Ustinov avatar Wiktor Wójcik avatar Ernest0N avatar Vyacheslav Khorkov avatar Zandy avatar  avatar Lakshmanan avatar adamz avatar  avatar Davide Casarin avatar Dominik Minta avatar Eslam Nasser avatar Samir Dahal avatar  avatar Javier Suárez avatar 机灵小不懂 avatar Raphaël Thériault avatar Nick Thompson avatar Simone Kalb avatar Yuki Langley avatar  avatar Joshua Harms avatar Federico Damián Schonborn avatar Sergey Khabibullin avatar Miguel de Icaza avatar  avatar Muhammad Umer avatar Julien Sagot avatar lizhuo2021 avatar Vakhid Betrakhmadov avatar Yash avatar E-Zou Shen avatar Longyue Han avatar Avi Wadhwa avatar PEXAVC avatar Karl avatar JongHoon avatar Jenya Korsun avatar devseu avatar YOUNG MO SONG avatar Song Chiwon avatar Mason Kim avatar mephrine avatar Oh Sung Ah avatar Khai avatar Lian avatar ADDICE avatar Qian Qian "Cubik"‎ avatar  avatar Jessica Ernst avatar Cavid Abbasaliyev avatar Lova avatar Sherrell Kroschel avatar Seagull avatar  avatar Jorge Pedroso avatar SENTINELITE avatar Aloisius avatar Maxi avatar Daniel Moura avatar Vyacheslav avatar Sherzod A. avatar Jermic avatar Hamid Mahmood avatar Reoooh avatar eastriver avatar  avatar  avatar Allen Lee avatar Ostholz avatar Guillaume Claverie avatar Miguel Piedrafita avatar  avatar elmooo avatar Uy Nguyễn Văn avatar Giovanni Noa avatar  avatar WiFi@憲有 avatar Yaoyao avatar Nekane avatar Snow Lukin avatar Gyuri Grell avatar Akivaev Mark avatar Uladzislau Volchyk avatar Brady avatar Ali Görkem Aksöz avatar Thomas Prezioso Jr. avatar ksparo avatar Alex Ehlke avatar Mihail Preis avatar Bibin Jaimon  avatar Thomas Hensel avatar Yoshihiro Kato avatar Pablo Ruiz-Berdejo avatar Greg Cotten avatar Joshua Pekera avatar Sang Hoon Ahn avatar Kokou AGBAVON avatar  avatar Zero.D.Saber avatar

Watchers

brian flagg avatar Roman Ustinov avatar Ahn Jung Min avatar  avatar Helbert Gomes avatar Tuan Vi avatar Lex avatar Jacob Rakidzich avatar eki avatar Doliant Huang avatar  avatar  avatar coffmark avatar Ungjae Lee avatar Felix F Xu avatar  avatar

openswiftui's Issues

constructing an object of class type 'Delegate' with a metatype value must use a 'required' initializer

class FallbackDelegateBox<Delegate: NSObject>: AnyFallbackDelegateBox {
    var storage: DelegateStorage
    
    enum DelegateStorage {
        case type(_ type: Delegate.Type)
        case instance(_ delegate: Delegate)
    }
   
    override var delegate: NSObject? {
        switch storage {
        case let .type(type):
            let delegate = type.init() // error: constructing an object of class type 'Delegate' with a metatype value must use a 'required' initializer
            ...
        }
        #endif
    }
}

Cannot look up associated type for imported conformance

Compiler issue on non-Darwin platform(Linux and WASM).

Cannot look up associated type for imported conformance:
(struct_type decl=_OpenGraph.(file).OGAttribute)
(associated_type_decl "_ObjectiveCType" access=public overridden=)
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
Stack dump:

How to run the Example by swift run?

Hi,

I can successfully run swift build for the project, but when I run swift run,

error: no executable product available

How can I run the examples?

Ubuntu 22, without Xcode.

Example and HostingExample code can't be built in Xcode 15.3

Hi Team,
I am trying to build the Example project in Xcode 15.3 and the simulator is 17.4
But I got a bunch of errors related to Multiple commands produce xxxxxxx
Is there any environment configuration that I set is wrong?

Here is the error message that I got, please check
Screenshot 2024-04-23 at 23 14 15

Thank you

_UIHostingView deinit crash

image
@MainActor
@Test
func testDemo() throws {
    struct ContentView: View {
        var name = ""
        var body: some View {
            AnyView(EmptyView())
        }
    }
    let vc = UIHostingController(rootView: ContentView())
    vc.triggerLayout()
}
extension UIHostingController {
    func triggerLayout() {
        let window = UIWindow(frame: CGRect(x: 0, y: 0, width: 100, height: 100))
        window.rootViewController = self
        window.makeKeyAndVisible()
        view.layoutSubviews()
    }
}

Commit Hash: a166851

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.