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
Comments
  • 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
  • [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
  • 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
  • Create previews for the Shared views

    Create previews for the Shared views

    This creates some previews for the views that are inside of the Shared directory. Additionally, I created a consolidated place to generate 'example' versions of some of the models that are used in these views. Feel free to suggest different ways to do this, if desired.

    PostView: PostView

    PostDetailView: PostDetailView

    CommentsView: CommentsView

    opened by SirArkimedes 1
  • 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
  • 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
  • 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 73 Dec 19, 2022
Repository for App IOS Reddit Top 50

iOS Reddit Top50 Repository for App IOS Reddit Top 50 App shows a list for the Top 50 posts in [Reddit] - www.reddit.com/top Requirements iOS 14.0+ Xc

Luiz Felipe Teixeira 3 Jul 5, 2021
A Safari extension that redirects Twitter, YouTube, Reddit, and more to privacy friendly alternatives.

Privacy Redirect for Safari A configurable web extension that redirects Twitter, YouTube, Reddit, Google Maps, Google Search, and Google Translate to

null 101 Dec 16, 2022
E-commerce app built in SwiftUI. Built in the course SwiftUI Masterclass in Udemy.

Touchdown-SwiftUI E-commerce app built in SwiftUI. Built in the course SwiftUI Masterclass in Udemy. Main components and concepts used: @EnvironmentOb

Jorge Martinez 5 Aug 18, 2022
Tanukis-Stash - Open source e621 client for iOS built with SwiftUI

The Tanuki's Stash The worlds first e621 client for iOS, iPadOS, and macOS built

Jay 3 Jul 29, 2022
A completely native Discord client for macOS built 100% in Swift and SwiftUI

Swiftcord A completely native Discord client for macOS built 100% in Swift and SwiftUI This project aims to create a fully functional native Discord c

CryptoAlgo-Dev 1.1k Jan 9, 2023
Swift iPhone and iPad Client for Polls API, using Hyperdrive API client

Polls Client This is a Swift iPhone and iPad client for the Polls API - a simple application allowing users to view polls and vote in them. Polls is a

Apiary 34 Jul 15, 2022
Basic cross Linux/Darwin/Win(?) Posix aliases for Swift

Basic cross Linux/Darwin/Win(?) Posix aliases for Swift

The Noze Consortium 2 Nov 9, 2021
RippleQueries is an iOS application built as assessment task at Ripple Egypt. Built Using MVVM (Model-View-ViewModel) and Clean Architecture concepts

RippleRepositories RippleRepositories is an iOS application built as an assessment task at Ripple Egypt. Built Using RxSwift & MVVM (Model-View-ViewMo

Muhammad Ewaily 3 Sep 16, 2021
Social Media platform build with swiftUI and Firebase with google and apple account integration for Signing In Users

Social Media platform build with swiftUI and Firebase with google and apple account integration for Signing In Users . Providing Users availability to upload posts and images add caption allowing other users to comment , with Find section to explore new people , new stories , User Profile section to allow the user to take control of his account .

Devang Papinwar 2 Jul 11, 2022
A platform to showcase your side projects/apps

A platform to discuss/showcase your side projects What is this? Inspired by this twitter thread Indie Apps Showcases is a platform for indie app devel

An Tran 25 Dec 27, 2022
iOS On-Device Game Cheat Creation/Sharing Platform and Software

CheatManager CheatManager is a mobile platform, used for installation/distribution/creation of mobile game cheats/hacks. This platform is completely d

Project Manticore 49 Jan 2, 2023
EU Digital COVID Certificate Kit for the Apple Platform  (unofficial)

EU Digital COVID Certificate Kit A Swift Package to decode, verify and validate EU Digital COVID Certificates for iOS, tvOS, watchOS and macOS Disclai

Sven Tiigi 32 Oct 4, 2022
Moit: a single delivery platform for college students living in dormitories

Moit: a single delivery platform for college students living in dormitories

LeeProgrammer 0 Nov 9, 2021
Open-source platform that raises awareness of the injustice and often forgotten names of racial inequality.

Welcome to the Say Their Names project. Our aim is to build an open-source platform that raises awareness of the injustice and often forgotten names of racial inequality at the hands of law enforcement. We strive to identify and amplify verified organizations to ensure donations are reaching those who can make the most impact with it.

Say Their Names 249 Nov 10, 2022
Event management iOS app for organizers using Open Event Platform

Open Event Organizer iOS App Event management app for organizers using Open Event Platform Roadmap Make the app functionality and UI/UX similar to the

FOSSASIA 1.5k Dec 29, 2022
A small SwiftUI based chat client for IRC, using swift-nio-irc

NeoIRC A simple Internet Relay Chat client implemented using SwiftNIO and SwiftUI. Inspired by: For maximum NIO someone (I’m tempted) should adopt NIO

The Noze Consortium 18 Jun 22, 2022
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 235 Dec 17, 2022
Basic Unsplash client for iOS made with SwiftUI (beta).

PapersSwiftUI Basic Unsplash client for iOS made with SwiftUI (beta). Note SwiftUI is still in beta and I'm also still learning how it works. To-Do: P

Don 19 Dec 17, 2022