Giter Site home page Giter Site logo

reddit-swiftui's Introduction

A cross-platform Reddit client created in SwiftUI.

Get the Public Beta

Note: This project is far from complete. It still lacks many features of your typical Reddit client and has bugs (partly due to SwiftUI, but I'll take credit for some of them)

To show off SwiftUI's strength in cross-platform development, I did not use Mac Catalyst for this project. Instead, common UI code is shared between iOS, macOS, and watchOS.

Project Structure

  • Shared - Models, helpers, API, and any shared Views.
  • Reddit-[PLATFORM] - Each target folder contains a Views and Representable folder. Views holds platform-specific views, and Representable contains UIViewRepresentables or NSViewRepresentables.

macOS Specific Features

I've added several things to make the macOS app stand out:

  1. Double click - You can double click on a post to open a new window for the detail view.
  2. NSToolbar - This is implemented entirely in the AppDelegate, and uses standard Cocoa code which interfaces with the SwiftUI views.
  3. TouchBar - TODO

SF Symbols

Because macOS doesn't support SF Symbols, I have created the following extension to make sure shared code works. I would like to replace this with custom icons for macOS that it loads from XCAssets eventually:

/// `SwiftUI` compatibility
#if os(macOS)
extension Image {
    init(systemName: String) {
        self.init(nsImage: NSImage())
    }
}
#endif

reddit-swiftui's People

Contributors

carson-katri avatar banaslee avatar sirarkimedes avatar pqhf5kd avatar

Watchers

James Cloos avatar

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.