🖼 Gallery App for Harvest (Elm Architecture + Optics) + SwiftUI + Combine.

Overview
Comments
  • Typing into Github search cause infinite loop of events

    Typing into Github search cause infinite loop of events

    Here is a video of a state app gets into:

    https://twitter.com/iospaulz/status/1221557272884563969

    HarvestLoopBug.mov.zip

    I was not able to type into the GitHub search bar as letters were processed in an incorrect order.

    opened by paulz 5
  • UITableViewAlertForLayoutOutsideViewHierarchy

    UITableViewAlertForLayoutOutsideViewHierarchy

    Within few seconds app generates over 1000 state changes while the time is running.

    Using Stopwatch cause app to freeze with the warning in the console: UITableViewAlertForLayoutOutsideViewHierarchy

    2020-01-26 14:18:28.959161-0800 Harvest-SwiftUI-Gallery[62071:3626159] [TableView] 
    Warning once only: UITableView was told to layout its visible cells and other contents without
     being in the view hierarchy (the table view or one of its superviews has not been added to a 
    window). This may cause bugs by forcing views inside the table view to load and perform layout 
    without accurate information (e.g. table view bounds, trait collection, layout margins, safe area 
    insets, etc), and will also cause unnecessary performance overhead due to extra layout passes. 
    Make a symbolic breakpoint at UITableViewAlertForLayoutOutsideViewHierarchy to catch this in 
    the debugger and see what caused this to occur, so you can avoid this action altogether if 
    possible, or defer it until the table view has been added to a window. Table view: 
    <_TtC7SwiftUIP33_BFB370BA5F1BADDC9D83021565761A4925UpdateCoalescingTableView: 0x7fbd1b127000; baseClass = UITableView; frame = (0 0; 375 320.667); clipsToBounds = YES; autoresize = W+H; gestureRecognizers = <NSArray: 0x60000300f5d0>; layer = <CALayer: 0x600003ed6a00>; contentOffset: {0, 0}; contentSize: {375, 132.9999974568685}; adjustedContentInset: {0, 0, 0, 0}; dataSource: <_TtGC7SwiftUIP10$10f027a4419ListCoreCoordinatorGVS_20SystemListDataSourceOs5Never_GOS_19SelectionManagerBoxS2___: 0x7fbd1976bbf0>>
    
    

    Simulator Screen Shot - iPhone 11 Pro - 2020-01-26 at 14 20 30

    Xcode: Version 11.3.1 (11C504)

    opened by paulz 2
  • Fix `NavigationLink` not working inside `List` iteration

    Fix `NavigationLink` not working inside `List` iteration

    This PR fixes the weird NavigationLink issue inside iterative List or ForEach that doesn't allow destination to get updated after its state changed.

    I become aware of this bug in Xcode 12.3, but may be already reproducible in earlier version.

    bug 
    opened by inamiy 0
  • Add `usesTimeTravel` flag

    Add `usesTimeTravel` flag

    Fixes the problems mentioned in https://github.com/inamiy/Harvest-SwiftUI-Gallery/issues/14#issuecomment-619478666 , #15, and possibly #16 .

    1. Go to Stopwatch
    2. Start Timer
    3. Back to main list
    4. Go to other screen
    5. All events get delayed or malformed due to Stopwatch (heavy task) is still running

    After investigation, the slowest task was not in Stopwatch but rather TimeTravel where it collects all previous states as histories. With having a rapid event-flow, I discovered time-travelling will be the dominant cause of the UI glitches. This can be simply solved by removing time-travelling feature.

    In this PR, usesTimeTravel is introduced so that one can easily test usesTimeTravel = false case, which is the normal non-debug configuration.

    opened by inamiy 0
  • Support macOS Catalyst

    Support macOS Catalyst

    This PR works around #1 by setting .navigationViewStyle(StackNavigationViewStyle()) so that more stable run on macOS Catalyst is possible.

    See also: https://twitter.com/paulcolton/status/1251162315291934720

    opened by inamiy 0
  • Add GameOfLife example

    Add GameOfLife example

    opened by inamiy 0
  • Make each screen's `effectMapping` as pure function

    Make each screen's `effectMapping` as pure function

    Successor of #7, #8 .

    This PR is a further work of #7 to remove static func effectMapping's arguments (dirty dependency injection) to resurrect back to a pure function, since a better dependency injection can now be achieved by #8 controlling the World .

    opened by inamiy 0
  • Control the World

    Control the World

    Retry of dependency injection #4 by controlling the World as Harvest is refactored in https://github.com/inamiy/Harvest/pull/23 .

    cf. https://twitter.com/inamiy/status/1189593937830244353

    opened by inamiy 0
  • Revert

    Revert "Inject `urlSession` from `effectMapping` constructors"

    This reverts #4 commit e69f582d41f08230487766c2a105523b2bf0b171.

    Replacing to a better implementation introduced in https://github.com/inamiy/Harvest/pull/23 .

    opened by inamiy 0
  • Add .github/workflows/main.yml

    Add .github/workflows/main.yml

    opened by inamiy 0
  • Inject `urlSession` from `effectMapping` constructors

    Inject `urlSession` from `effectMapping` constructors

    This PR injects urlSession from outside of effectMapping by adding a constructor injection parameter, as questioned from @thomvis : https://twitter.com/thomvis/status/1189262950642663424

    By the way, instead of passing around those dependencies, using a singleton as their container e.g. https://www.pointfree.co/blog/posts/21-how-to-control-the-world is also a valid and simpler solution.

    opened by inamiy 0
  • macOS Catalyst + SwiftUI + Harvest?

    macOS Catalyst + SwiftUI + Harvest?

    I'm testing Harvest/HarvestStore out for use in a hybrid iOS/macOS project that I'm starting. I took the Gallery Application, and launched it on macOS. -- At a first glance it looks great!!

    But when I go to use various screens, I started to notice various glitches:

    • CounterExample click on the +/- counters -- nothing visibly happens.
    • StateDiagram click on any of the buttons -- nothing visibly happens.
    • GithubExample example crashes on load of the search results with EXC_BAD_INSTRUCTION
    • TodoExample -- some things work, some filtering shows stale/blank data on Todo Items? Typing to add a new todo is an instant crash
    • StopwatchExample -- everything works fine -- this is strange because of the other screen glitches!

    It looks to me like these examples are being partially torn from their state somehow. So they're editing the global state, but reading from a blank new state, or they're editing local state, but reading from Global state.

    Any advice? -- I'm not sure if the appropriate place to file this question is here, or on the main Harvest Repo?

    opened by fbartho 3
Owner
Yasuhiro Inami
Functional Programmer at @delyjp / KURASHIRU / クラシル. Interests: Swift / Haskell / PureScript / Elm / Rust / TypeScript / Category Theory
Yasuhiro Inami
Best architecture for SwiftUI + CombineBest architecture for SwiftUI + Combine

Best architecture for SwiftUI + Combine The content of the presentation: First of the proposed architectures - MVP + C Second of the proposed architec

Kyrylo Triskalo 3 Sep 1, 2022
A demo app to showcase testable, modern iOS development with SwiftUI and Combine on MVVM-C architecture.

Coinz_App_iOS A demo app to showcase testable, modern iOS development with SwiftUI and Combine on MVVM-C architecture. Tech Stack: Swift, SwiftUI, Com

Burhan Aras 0 Dec 26, 2021
content for Using Combine - notes on learning Combine with UIKit and SwiftUI

SwiftUI-Notes A collection of notes, project pieces, playgrounds and ideas on learning and using SwiftUI and Combine. Changes, corrections, and feedba

Joseph Heck 1.7k Dec 27, 2022
An iOS template project using SwiftUI, Combine and MVVM-C software architecture

SwiftUI-MVVM-C A template project that uses SwiftUI for UI, Combine for event handling, MVVM-C for software architecture. I have done some small proje

Huy Nguyen 107 Jan 2, 2023
UDF (Unidirectional Data Flow) architecture on SwiftUI/Combine

The license The SwiftUI-UDF stays under a dual license (email confirmation required): It can be Free for non-commercial use, public repository or star

Max Kuznetsov 13 Nov 10, 2022
Anime schedule, korean subtitle for iOS with SwiftUI + Combine and MVVM architecture

AniTime Anime schedule, korean subtitle for iOS with SwiftUI + Combine and MVVM architecture I'm developing a new one for the SwiftUI life cycle annou

Kwangmin Bae 8 Mar 14, 2022
Gallery of Marvel comics characters 🕷

Marvelgram app Marvelgram app - is a gallery of Marvel comics characters. Figma design JSON-data from endpoint Overview Launch Search Details Layout F

Mikhail Chaus 3 Nov 12, 2022
Mvi Architecture for SwiftUI Apps. MVI is a unidirectional data flow architecture.

Mvi-SwiftUI If you like to read this on Medium , you can find it here MVI Architecture for SwiftUI Apps MVI Architecture Model-View-Intent (MVI) is a

null 12 Dec 7, 2022
Unidirectional reactive architecture using new Apple Combine framework

Unidirectional Reactive Architecture. This is a Combine implemetation of ReactiveFeedback and RxFeedback

null 687 Nov 25, 2022
Github repo search with using mvvm-c and clean architecture and using combine swift

GitSearchWithMVVM-C-CleanArchitecture Github repo search with using mvvm-c and clean architecture and using combine swift. Content Overview How To Run

Muhammad Qasim Majeed 1 Mar 16, 2022
SwiftUI Resume - A simple resume writed by swiftUI + Combine

SwiftUI_Resume a simple "resume" writed by swiftUI + Combine

null 15 Apr 27, 2022
Porting the example app from our Advanced iOS App Architecture book from UIKit to SwiftUI.

SwiftUI example app: Koober We're porting the example app from our Advanced iOS App Architecture book from UIKit to SwiftUI and we are sharing the cod

raywenderlich 55 Dec 19, 2022
SwiftUI & Combine app using MovieDB API. With a custom Flux (Redux) implementation.

MovieSwiftUI MovieSwiftUI is an application that uses the MovieDB API and is built with SwiftUI. It demos some SwiftUI (& Combine) concepts. The goal

Thomas Ricouard 6.2k Jan 8, 2023
An example APOD app with SwiftUI and Combine using NASA API

SwiftUI-APOD An example Astronomy Picture of the Day(APOD) application using SwiftUI and Combine under iOS 13 Requirement Xcode 11 macOS 10.15 Catalin

Liang Yi 22 Oct 16, 2022
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 73 Dec 8, 2022
Simple app to show usage of SwiftUI and Combine

Podcasts Simple app to show usage of SwiftUI and Combine. The app shows a list of podcasts fetched from listennotes and it can be played. Status: Work

Alberto Penas Amor 27 Oct 4, 2022
A Simple ToDo app developed using SwiftUI, Combine and Coredata

SwiftUI_Tasks Tasks is simple ToDo app developed using SwiftUI and Coredata which having features like Add,Delete,Rearrange and send notification base

Shankar Madeshvaran 77 Dec 18, 2022
A to-do list app using SwiftUI and combine with restful api.

Todo Combine SwiftUI It's an experiment project for the brand new SwiftUI + Combine + restful API with dark mode Build follow restfult to-do-api to ru

jamfly 14 Feb 21, 2022