A Swift implementation of a Flickr-search application that uses MVVM and ReactiveCocoa

Overview

ReactiveCocoa, Swift and MVVM

This application is a Swift-port of an MVVM / ReactiveCocoa example application I wrote a few months ago.

image

Instructions

This project uses a combination of both CocoaPods and git submodules. The reason for this is that the current version of ReactiveCocoa is not compatible with Swift, as detailed in this blog post.

This project uses CocoaPods, therefore to get started you must first install the dependencies:

pod install

Open the workspace in Xcode, and select the ReactiveSwiftFlickrSearch target, build and run.

Comments
  • Updates to work with Swift 1.2 / Xcode 6.3

    Updates to work with Swift 1.2 / Xcode 6.3

    Hey Colin – Thanks for the sample code! I made some (albeit quick/naive) changes to fix the build breakage caused by Swift 1.2 Xcode 6.3. Let me know if anything's not right.

    opened by patr1ck 2
  • 'RACSignal' does not have a member named 'NOT

    'RACSignal' does not have a member named 'NOT"

    used the latest sdwebimage and ReactiveCocoa pods, now I get an error in FlickrSearchViewController.swift, which says ''RACSignal' does not have a member named 'NOT".

    this happens on line: viewModel.executeSearch.executing.NOT() ~> RAC(loadingIndicator, "hidden")

    any idea what's wrong?

    opened by alexwald 2
  • correct typo in ViewModelServices

    correct typo in ViewModelServices

    I learned a lot from this project! Thanks!

    this pull request changes the spelling of "ViewMolde" to "ViewModel" in ViewModelServices.swift.

    opened by frankctan 1
  • ReactiveCocoa.h not found in BridgingHeader file

    ReactiveCocoa.h not found in BridgingHeader file

    Hey Colin, thanks for this example project! But unfortunately I cannot get it to run.

    What I have done:

    git clone https://github.com/ColinEberhardt/ReactiveSwiftFlickrSearch.git
    cd ReactiveSwiftFlickrSearch
    git submodule init
    git submodule update
    

    vim Podfile, change pod 'SDWebImage' to '3.7.1' as instructed per https://github.com/ColinEberhardt/ReactiveSwiftFlickrSearch/issues/1

    pod install
    open ReactiveSwiftFlickrSearch.xcworkspace
    

    Change target to ReactiveSwiftFlickrSearch cmd + B (Build)

    Error in BridgingHeader.h "ReactiveCocoa/ReactiveCocoa.h file not found" Since that file is located here: ReactiveCocoa/ReactiveCocoaFramework/ReactiveCocoa/ReactiveCocoa.h I tried changing the import line to that path but that didn't work.

    I have tried adding the ReactiveCocoa framework as a target dependency to the Flickr project, in Build Phases but to no avail. In Build phases then I pressed the topmost left plus button, chose "New Copy Files Phase", chose "Framework" as "Destination" and pressed the plus button i the bottom and chose ReactiveCocoa.framework and tried building, but to no avail.

    What am I doing wrong?

    I would very much like to get this project working!

    Thank you very much for any help!

    opened by Sajjon 1
  • SDWebImage compile error

    SDWebImage compile error

    Love this project, thanks. Now, SDWebImage 3.6 produces a compile error. https://github.com/rs/SDWebImage/issues/736 Updating Podfile to pod 'SDWebImage', '3.7.1' solves issue.

    opened by mmtootmm 1
  • Fix broken headings in Markdown files

    Fix broken headings in Markdown files

    GitHub changed the way Markdown headings are parsed, so this change fixes it.

    See bryant1410/readmesfix for more information.

    Tackles bryant1410/readmesfix#1

    opened by bryant1410 0
  • Update to the latest CocoaPods version (1.0.1).

    Update to the latest CocoaPods version (1.0.1).

    With the latest installed version of CocoaPods (1.0.1) pod install command fails with an error. The reason is that now you have to define Xcode target name in a Podfile. This commit adds the target name and updates CocoaPods version in the Podfile.lock.

    opened by artemsmikh 0
  • Diffs/animations, and multiple sections

    Diffs/animations, and multiple sections

    I love the concepts behind this library and I actually built my own for dealing with UICollectionView in a reactive manner.

    There's a couple of challenges/problems I've come across, some that this library faces too.

    • Multiple Sections

    This one isn't really a problem, I solved it by making my initializer look like:

    init(collectionView: UICollectionView, dataSignal: SignalProducer<[[T]], NoError>, supplementarySignal: SignalProducer<[String: [T]], NoError>?) { }
    

    where the data signal is an array of arrays to represent multiple sections. I'm not sure that there is a better way to do it.

    • Diffs

    Every time the data signal changes, the table view reloads all it's data. But what about, instead of using AnyObject, use generic parameters that conform to Equatable so you can produce diffs of the previous and current data arrays?

    This becomes really tricky when dealing with multiple sections because it's hard to produce a diff on multi-dimensional arrays, especially in a reactive way. Right now, I'm using Dwift to produce the diffs but the closest I can come right now is calculating the diffs as a side-effect:

            self.data.producer.observeOn(UIScheduler()).throttle(0.1, onScheduler: QueueScheduler.mainQueueScheduler).on(next: { [unowned self] in
                guard let collectionView = self.collectionView else { return }
                for (index, element) in $0.enumerate() {
                    if index == self.diffCalculators.count {
                        let calculator = CollectionViewDiffCalculator<T>(collectionView: collectionView, initialRows: element)
                        calculator.sectionIndex = index
                        self.diffCalculators.append(calculator)
    
                    } else {
                        let calculator = self.diffCalculators[index]
                        calculator.rows = element
                    }
                }
            })
                .takeUntil(self.willDeallocSignal())
                .start()
    

    @ColinEberhardt would you have any suggestions on how to improve upon that?

    opened by thebarndog 0
Owner
Colin Eberhardt
Hi - I'm Colin.
Colin Eberhardt
MVVM-Clean with DI implementation sample project

MVVM-Clean with Dependency Provider Introduction This project contains MVVM-Clean architecture and Dependency injection Folder Structure Every module

Faraz Ahmed Khan 3 Oct 20, 2022
Mini-application iOS native avec Xcode et Swift exploitant l'architecture MVVM et le framework Combine d'Apple pour la mise en place de la programmation réactive fonctionnelle, le tout avec UIKit.

iOS (Swift 5): Test MVVM avec Combine et UIKit L'architecture MVVM et la programmation réactive fonctionnelle sont très utlisées dans le développement

Koussaïla BEN MAMAR 2 Nov 5, 2022
MVVM-RXSWIFT-COMBINE- - Demo application populating posts from network request using

MVVM => RXSWIFT + COMBINE Demo application populating posts from network request

Amr Al-khayat 0 Jan 2, 2022
A small app that uses the private FlightUtilities.framework to show information about any flight.

FlightUtilities A small app that uses the private FlightUtilities.framework to show information about any flight given the airline code, flight code a

Patrick Balestra 31 Dec 20, 2022
This is Github user search demo app which made by many variety of design patterns.

iOSDesignPatternSamples This is Github user search demo app which made by many variety of design patterns. Application Structure SearchViewController.

Taiki Suzuki 679 Dec 11, 2022
iOS native app demo with Xcode and Swift using MVVM architecture and Apple's Combine framework for functional reactive programming, all with UIKit

iOS (Swift 5): MVVM test with Combine and UIKit MVVM and functional reactive programming (FRP) are very used in iOS development inside companies. Here

Koussaïla BEN MAMAR 2 Dec 31, 2021
Exemplify a LazyVGrid in SwiftUI in a MVVM pattern with Mock Data and images in assets.

SwiftUI-LazyVGrid Exemplify a LazyVGrid in SwiftUI in a MVVM pattern with Mock Data and images in assets. Screenshots Samples IP & Credits All those b

Ethan Halprin 3 Aug 9, 2022
SpaceX rocket listing app using RxSwift and CLEAN Architecture with MVVM

Jibble SpaceX rocket listing app using RxSwift and CLEAN Architecture with MVVM Demo Features Reactive Bindings URL / JSON Parameter Encoding Filter Y

Ammad Akhtar 0 Dec 5, 2021
A demo demonstrates how to use combine and MVVM in the SwiftUI app

SwiftUI-MVVM-Combine A demo demonstrates how to use combine and MVVM in the Swif

Asa. Ga 7 Jul 5, 2022
This a simple swiftui app where i used mvvm architecture, coredata swiftui and so on..

SwiftUI MVVM COREDATA NOTE APP This a simple swiftui app where i used mvvm architecture, coredata swiftui and so on... #FEATURES SWIFTUI MVVM COREDATA

Isaias Cuvula 1 Jul 20, 2022
ProductListSwiftUI - SwiftUI Project to fetch product list using the fakestoreapi and the MVVM architectural pattern

ProductListSwiftUI SwiftUI Project to fetch product list using the fakestoreapi

Vitalii Shapovalov 4 Sep 16, 2022
MMVMi: A Validation Model for MVC and MVVM Design Patterns in iOS Applications

MMVMi MMVMi: A Validation Model for MVC and MVVM Design Patterns in iOS Applications Motivation Design patterns have gained popularity as they provide

Mariam AlJamea 11 Aug 19, 2022
Create a simple MVVM-C iOS architecture with Swift for starters

iOS-Architecture-MVVM MVVM+Coordinators IOS Architecture Tutorial By Bobby Pehtr

Mehrdad Ahmadian 0 Dec 30, 2021
NewsAppMVVM - A Swift iOS App created to practice MVVM Design Pattern

NewsAppMVVM A Swift iOS App created to practice MVVM Design Pattern. This app re

Jorge Roberto 1 Jan 3, 2022
Mvvm - Collection View Notes With Swift

CollectionViewNotes Haciendo apuntes para cuando pierda la memoria Comenzando ??

null 0 Jan 13, 2022
MVVM-of-SuYeon - Build an Instagram iOS App Clone with Cloud Firestore, Swift 5

MVVM-of-SuYeon Instagram Firestore App Clone | Swift 5 + iOS 14 | MVVM Build an

null 2 Feb 16, 2022
HotCoffee is learning project with MVVM, Generic,Swift 5, TableView

HotCoffee A simple Coffee Ordering app built using TableView, MVVM design pattern and Swift5. Tools Xcode Version 13.2.1 Framework -UIKit Architecture

Ghullam Abbas 2 Aug 26, 2022
Swift, UIkit, Anchorage, Clean Architecture, UICollectionViewDiffableDataSourcem, MVVM+Coordinators patterns

About the app iOS project realized with Swift, UIkit, Anchorage, Clean Architecture, UICollectionViewDiffableDataSource and MVVM + Coordinators patter

Luca Berardinelli 4 Dec 29, 2022
WhaleFull - MVVM + RxSwift + CTMediator + MJRefresh + DZNEmptyDataSet

WhaleFull ?? . MVVM + RxSwift + CTMediatror + MJRefresh + DZNEmptyDataSet Englis

77。 0 Mar 10, 2022