A cross-platform Reddit client built in SwiftUI

Overview

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
Issues
  • TestFlight

    TestFlight

    I'd be interested in testing this out through TestFlight. An email invite ([email protected]) would be wonderful, and/or you could generate a public TestFlight link and put it on the repository.

    opened by AustinConlon 12
  • Allows for single and double tap on each post

    Allows for single and double tap on each post

    Fixes https://github.com/carson-katri/reddit-swiftui/issues/9

    Quite a lot of changes in order to achieve this:

    • had to activate the navigation link programmatically in order to capture single and double tap
    • NavigationLink activated based on new view state for selected post tag
    • moved the RequestView to the ContentView so the selected post wouldn't reload the whole PostList and repeat the request
    • PostList now initialised with Listing object
    • setting the contentShape of the PostView in the list in order to capture hits in the whole area, otherwise it would land on the NavigationLink behind
    • adding two tap gestures in order of precedence
    • set the default frame for the new spinner to guarantee a minimum size while loading

    The only secondary effect from this solution I wasn't able to fix is that now cells don't get a selected state like before. Hopefully someone knows how to fix that, otherwise can be a good bug to follow up with.

    opened by banaslee 6
  • [Help] to Work on my machine and I contributo to project!

    [Help] to Work on my machine and I contributo to project!

    [HELP] i need help to branch oauth work on my machine, i get error when o compile project, error in Request not found!

    opened by mauriliofilho 5
  • When post author = comment author, set comment author color

    When post author = comment author, set comment author color

    Change the comment author color to the accentColor if the comment author is the same as the post author.

    macOS: macOS

    iOS: iOS

    opened by SirArkimedes 3
  • [macOS] Clicking on the post list text, the NavigationLink isn't triggered

    [macOS] Clicking on the post list text, the NavigationLink isn't triggered

    What happens: When clicking on any of the text, or elements, that are in the List on macOS, the NavigationLink destination isn't triggered.

    An example: When clicking on the text that is enclosed within the red box, macOS The PostDetailView destination does not get triggered. The only way to trigger the PostDetailView is to click outside of the Text elements.

    Additional details: Removing the .onTapGesture(count: 2) from macOS' PostView will allow the clicks to be passed through again. Though, this obviously removes the double click to open a new window functionality.

    bug 
    opened by SirArkimedes 3
  • Comments don't load

    Comments don't load

    opened by NSExceptional 3
  • Fix MetadataView reference

    Fix MetadataView reference

    Fixes MetadataView.swift file reference in Xcode project.

    opened by iltercengiz 2
  • Unable To Build

    Unable To Build

    Unable to build the project due to WatchKit.

    This app could not be installed at this time.
    Domain: IXUserPresentableErrorDomain
    Code: 1
    Failure Reason: Could not install at this time.
    Recovery Suggestion: Watch-only apps cannot be contained in companion apps installed on the companion.
    --
    Watch-only apps cannot be contained in companion apps installed on the companion.
    Domain: MIInstallerErrorDomain
    Code: 135
    User Info: {
        FunctionName = "-[MIInstallableBundle _validateCompanionAppStateInWatchKitApp:withVersion:error:]";
        LegacyErrorString = WatchOnlyAppOnCompanion;
        SourceFileLine = 611;
    }
    --
    
    
    System Information
    
    macOS Version 10.15.6 (Build 19G46c)
    Xcode 12.0 (17175.2)
    
    opened by Benetos 2
  • Xcode Build Fail - MacOS

    Xcode Build Fail - MacOS

    I get this error:

    Showing Recent Issues No account for team "FH9CW55WY5". (Add a new account in the Accounts preference pane or verify that your accounts have valid credentials.)

    opened by syddo 2
  • [macOS] Adjust padding of List items on sidebar

    [macOS] Adjust padding of List items on sidebar

    When clicking on an item in the sidebar, the padding of the selected state was 0 on top and bottom. This adjusts that padding to give a bit more breathing room to the content in the list!

    opened by SirArkimedes 2
  • Error on picking up item from the sidebar

    Error on picking up item from the sidebar

    Hi, actually accidentally typed in this word for searching skimming through the app IDE XCode 12 AppDelegate swift 2021-03-04 19-15-54

    the video snippet is here for more details: https://disk.yandex.ru/i/2e0nPs0srgkfug

    bug macOS Only 
    opened by The-Igor 1
  • Use SFSymbols on macOS Big Sur

    Use SFSymbols on macOS Big Sur

    Hi

    So that extension on NSImage on macOS makes a blank image and has a placeholder input string to maybe do something with in the future or...?

    Thanks in advance.

    bug enhancement good first issue 
    opened by 01GOD 1
  • PostList Content Cut Short

    PostList Content Cut Short

    I believe this is when all posts are text-only posts, the right side of the content in the PostList is cut off (roughly the same amount as if a thumbnail would be there). On both iOS and macOS

    image image bug 
    opened by pqhf5kd 0
  • PostDetailView Title - Text Wrapping macOS

    PostDetailView Title - Text Wrapping macOS

    Currently the post title becomes multiline on iOS but is truncated on macOS.

    Simulator Screen Shot - iPhone SE (1st generation) - 2020-08-19 at 16 35 22

    Screenshot 2020-08-19 at 16 34 16
    opened by pqhf5kd 2
  • Blue Selection trigged when List (Blur) Selection expected

    Blue Selection trigged when List (Blur) Selection expected

    NavigationLink and List selection state seem to be overlapping.

    There are two ways this happens:

      • select a post
      • see the post now has a grey selected background
      • tap section header
      • see the selected post now has a blue selected background
      • all consecutive selections will have a blue background as well
    1. Click on the edge of the list item (outside the text or images)

    Perhaps make the click area fill the space so that clicking on the edge won't cause a selection.

    good first issue macOS Only 
    opened by carson-katri 2
  • Pagination

    Pagination

    Any plan to add pagination to the post list?

    enhancement good first issue 
    opened by reinhardt1053 3
  • OAuth-based Actions

    OAuth-based Actions

    This includes support for:

    • Logging in
    • Viewing profile
    • Voting
    • Commenting

    Eventually, the following will be supported as well:

    • Replying to comment
    • Posting
    • Saving

    Let me know of any other features you think should be included (or implement them yourself if you can/want).

    enhancement 
    opened by carson-katri 0
Releases(v1.0b1)
Owner
Carson Katri
| WWDC19 Scholarship Winner | Mobile + Web |
Carson Katri
Completed Project for Cross Platform Image Filter SwiftUI macOS & iOS App

Completed Project for Cross Platform Image Filter SwiftUI macOS & iOS App Follow the tutorial at alfianlosari.com Features Filter image using predefin

Alfian Losari 49 Jul 1, 2021
An open-source SwiftUI Stack Overflow client

StackOv A SwiftUI Stackoverflow client We are currently in the developing process of the next version of StackOv app. The demo version of StackOv is a

Surf 203 Jul 21, 2021
An app to count down the days until upcoming milestones.

Milestones An app to count down the days until upcoming milestones. We all have something to look forward to. Built to try out the Swift Composable Ar

JP Simard 168 Jul 29, 2021
Jetpack Compose and SwiftUI based Kotlin Multiplatform sample project (based on CityBikes API).

Jetpack Compose and SwiftUI based Kotlin Multiplatform sample project (based on CityBikes API).

John O'Reilly 266 Jul 28, 2021
💻 Democratizing Snippet Management (macOS/Win/Linux)

To Lepton users around the world in more than 130 countries: We hope you all stay safe, healthy, and strong as we get through the COVID-19 pandemic. L

CosmoX 8.7k Aug 4, 2021
iOS app that detects LaTeX symbols from drawings. Built using PencilKit, SwiftUI, Combine and CoreML for iOS 14 and macOS 11.

DeTeXt Finding the symbol you want to use in LaTeX can be hard since you can't memorize all the possible commands and packages for every symbol you mi

Venkat 21 Jul 14, 2021
The standalone app based on official debugger of React Native, and includes React Inspector / Redux DevTools

React Native Debugger Run the redux example of react-navigation with Redux DevTools setup This is a standalone app for debugging React Native apps: Ba

Jhen-Jie Hong 8.7k Jul 21, 2021
Convenient secure logging during development release in Swift 3, 4 5

Colorful, flexible, lightweight logging for Swift 3, Swift 4 & Swift 5. Great for development & release with support for Console, File & cloud platfor

SwiftyBeaver 5.3k Jul 30, 2021
Frugal and native macOS Syncthing application bundle

Syncthing for macOS Introduction syncthing-macos project is a native macOS Syncthing tray application bundle. It bundles its own syncthing instance an

The Syncthing Project 1.2k Aug 2, 2021
macOS app that contains a full Ruby installation (for use with Ruby/Gosu)

Ruby.app Universal application wrapper to deploy Ruby apps on OS X (using MRI/C Ruby, not MacRuby or JRuby). So far, it has only been used to release

The Gosu Library 34 Jan 17, 2021
Catch: Broadcatching made easy.

Catch: Broadcatching made easy. Catch is the easiest way to do broadcatching on the Mac. Just add your feeds and new episodes will be downloaded as th

Giorgio Calderolla 387 Jul 21, 2021
:closed_book: Swift Logging Utility for Xcode Google Docs

QorumLogs Swift Logging Utility in Xcode & Google Docs Log Levels class MyAwesomeViewController: UIViewController { override func viewDidLoad() {

Goktug Yilmaz 782 Jul 16, 2021
Create native Mac applications from command line scripts.

Platypus Platypus is a developer tool that creates native Mac applications from command line scripts such as shell scripts or Python, Perl, Ruby, Tcl,

Sveinbjorn Thordarson 1.8k Jul 26, 2021
A minimal, beautifully designed music player for OS X.

Sonora A minimal, beautifully designed music player for the Mac Developed by Indragie Karunaratne Designed by Tyler Murphy Sonora (previously sold on

Sonora for Mac 925 Jul 26, 2021