Sample Code of the App Architecture Book

Overview

App Architecture

iOS Application Design Patterns in Swift

Welcome to the repository of the App Architecture book!

This repository hosts all sample code from the book: the Recordings sample app in seven different variants, plus a project from the accompanying videos that implements eight application design patterns within a single app.

Feedback

We'd love to hear your feedback. File an issue, send us an email, or send us a tweet.

Q&A

During the early-access period of this book we've recorded weekly Q&A sessions.

Enjoy!

Florian, Matt and Chris

Comments
  • One-App-Eight-Architectures mvc extension question

    One-App-Eight-Architectures mvc extension question

    I'm trying to understand why MultiViewController was extended for the MVC version. The function mvcDidLoad() and the action mvcButtonPressed() are typically just included in the ViewController class. I looked through the accompanying book and some of the videos and didn't see any mention of extending the ViewController under the MVC pattern. I also didn't see that with the Recordings application. Is there some benefit, structural or clarity to this?

    opened by BMinas 2
  • Violating basic principles in the

    Violating basic principles in the "One-App-Eight-Architectures" code

    In "One-App-Eight-Architectures" project you have created a model directly in a view controller. I understand that for simplification you have chosen this path. But for example in MVVM the view should not know about model. I think that this can be confusing for some people. I know - it's simple example app. But from the whole point of view - this is a book about app architectures so why to violate their basic principles and dependencies and bend them over when you try to teach them?

    opened by tomassliz 1
  • [Controller-Owned Networking] App crashes on inserting and deleting recordings

    [Controller-Owned Networking] App crashes on inserting and deleting recordings

    Fix: In FolderViewController folder property is a struct, so in methods deleteItem(item:) and insert(item:) changing the folder property will trigger didSet block with tableView.reloadData().

    Therefore, tableView.deleteRows(at: [IndexPath(row: index, section: 0)], with: .automatic) and self.tableView.insertRows(at: [IndexPath(row: self.folder.contents.endIndex-1, section: 0)], with: .automatic) are redundand and provoke a crash.
    Deleting these lines should fix it

    opened by gloomikon 0
  • MVC 模式下setName的时候更新有误

    MVC 模式下setName的时候更新有误

    FolderViewController.swift 中 if let changeReason = userInfo[Item.changeReasonKey] as? String { let oldValue = userInfo[Item.newValueKey] let newValue = userInfo[Item.oldValueKey] 应改为: if let changeReason = userInfo[Item.changeReasonKey] as? String { let oldValue = userInfo[Item.newValueKey] let newValue = userInfo[Item.oldValueKey]

    opened by tekizhong 0
  • MVVM-C example fails assertion, crashes on launch

    MVVM-C example fails assertion, crashes on launch

    The problem seems to be on line 20 of FolderViewController:

    viewModel.folderContents.bind(to: tableView.rx.items(dataSource: dataSource)).disposed(by: disposeBag)
    
    

    I'm getting the following:

    2019-05-23 12:20:09.318611-0300 Recordings[15921:6162304] Warning: Unable to create restoration in progress marker file
    Assertion failed: This is a feature to warn you that there is already a delegate (or data source) set somewhere previously. The action you are trying to perform will clear that delegate (data source) and that means that some of your features that depend on that delegate (data source) being set will likely stop working.
    If you are ok with this, try to set delegate (data source) to `nil` in front of this operation.
     This is the source object value: <UITableView: 0x7fa7e805c200; frame = (0 0; 375 812); clipsToBounds = YES; autoresize = W+H; gestureRecognizers = <NSArray: 0x60800005bdb0>; layer = <CALayer: 0x60000023a040>; contentOffset: {0, 0}; contentSize: {0, 0}; adjustedContentInset: {0, 0, 0, 0}>
     This is the original delegate (data source) value: <Recordings.FolderViewController: 0x7fa7e7d1a890>
    Hint: Maybe delegate was already set in xib or storyboard and now it's being overwritten in code.
    : file /Users/jeff/Developer/app-architecture/Recordings-MVVM-C/Pods/RxCocoa/RxCocoa/Common/DelegateProxyType.swift, line 222
    2019-05-23 12:20:15.881476-0300 Recordings[15921:6162304] Assertion failed: This is a feature to warn you that there is already a delegate (or data source) set somewhere previously. The action you are trying to perform will clear that delegate (data source) and that means that some of your features that depend on that delegate (data source) being set will likely stop working.
    

    This seems to happen in both Xcode 9.4.1 and 10.2 using RxSwift 4.0.0 and RxDataSources 3.0.2. Setting the tableView's delegate and dataSource to nil after super.viewDidLoad() fixes the issue for me.

    opened by jefflovejapan 2
  • RxSwift Projects Compiling Issues

    RxSwift Projects Compiling Issues

    I'm following the steps in the README to install RxSwift via Carthage, but running into complier issues. Specifically, No such module 'RxDataSources'.

    The only error I get when running carthage update --platform iOS is a build failure from xcodebuild, but I'm guessing is the same issue.

    Seems like everything is installed correctly.

    *** Fetching RxSwift
    *** Checking out RxDataSources at "3.0.2"
    *** Checking out RxSwift at "4.0.0"
    *** xcodebuild output can be found in /var/folders/vn/djlphdns25qcvv_53qqwcs9c000bsw/T/carthage-xcodebuild.CSrNEV.log
    *** Skipped downloading RxSwift.framework binary due to the error:
    	"API rate limit exceeded for 216.52.20.6. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)"
    *** Skipped downloading RxDataSources.framework binary due to the error:
    	"API rate limit exceeded for 216.52.20.6. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)"
    *** Building scheme "RxBlocking-iOS" in Rx.xcworkspace
    *** Building scheme "RxCocoa-iOS" in Rx.xcworkspace
    

    Any ideas? Anyone else run into this? I'd love to be able to build so I can play around and better grok reactive programming.

    opened by derrickshowers 1
SwiftUI sample app using Clean Architecture. Examples of working with CoreData persistence, networking, dependency injection, unit testing, and more.

Articles related to this project Clean Architecture for SwiftUI Programmatic navigation in SwiftUI project Separation of Concerns in Software Design C

Alexey Naumov 4k Dec 31, 2022
Sample project using VIPER architecture

VIPER-Persons Small project using a master and detail view Demonstrates the use of the following features: VIPER architecture (https://mutualmobile.co

Sebastian Wramba 43 Feb 11, 2022
Example of Clean Architecture of iOS app using RxSwift

Clean architecture with RxSwift Contributions are welcome and highly appreciated!! You can do this by: opening an issue to discuss the current solutio

null 3.6k Dec 29, 2022
Sample applications of iOS Design patterns written using swift.

ios-design-patterns This repo contains all my Sample applications of iOS Design patterns written using swift. Link for my Design patterns Blog : https

ShreeThaanu Raveendran 3 Nov 2, 2022
Reactant is a reactive architecture for iOS

Reactant Reactant is a foundation for rapid and safe iOS development. It allows you to cut down your development costs by improving reusability, testa

Brightify 374 Nov 22, 2022
Swift Interaction with VIPER Architecture

SwiftyVIPER SwiftyVIPER allows easy use of VIPER architecture throughout your iOS application. VIPER Architecture What is VIPER? Great question! VIPER

Cody Winton 121 Jan 2, 2023
YARCH iOS Architecture

YARCH is an architecture pattern developed primarly for iOS applications. You can ask any questions in our telegram channel. Russian version of the re

Alfa Digital 196 Jan 3, 2023
Clean Actor Model Architecture

CAMA Eonil, 2021. CAMA is short for "Clean Actor Model Architecture". As like it says, its CA(Clean Architecture) + AM(Actor model). AM here means AM

Eonil 1 Oct 10, 2021
This is an example of clean architecture and MVVM pattern written in swift

Swift Clean Architecture MVVM This is an example of clean architecture and MVVM pattern written in swift First of all thanks to all of those who made

null 19 Oct 12, 2022
MoneySafe - Application for tracking income and expenses and analyzing expenses. VIPER architecture, CoreData, Charts

?? MoneySafe ?? Application for tracking income and expenses and analyzing expen

Vladislav 5 Dec 27, 2022
Challenge-viper-finance - Project for VIPER Architecture Dev Sprints on Devpass

VIPER Challenge - Finance App ?? Neste desafio, aplicaremos conceitos da arquite

Devpass 15 Oct 11, 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
Quillow is an elegant book management app on the App Store that allows you to search, add and track the books you've consumed.

Quillow Quillow is an elegant book management app on the App Store that allows you to search, add and track the books you've consumed. Please use the

Daniyal Mohammed 3 Aug 29, 2022
Phone book app

Phone book app

Igor Kapustin 2 Sep 28, 2021
Request adapter for URL requests from "MovieLister" demo app (Swift for Good book, a chapter by Ben Scheirman)

RequestAdapter Request adapter for URL requests from "MovieLister" demo app (Swift for Good book, a chapter by Ben Scheirman) The code is taken from:

Mihaela Mihaljevic Jakic 0 Nov 22, 2021
Flip is a book tracking app built for iOS and iPadOS. Coming soon to watchOS and macOS.

Flip Flip is a project aimed at helping users manage their library of books. It has a clean user interface, allows users to sort and filter their libr

Jesal 4 Dec 8, 2022
WWDC2020 Swift Student Challenge - TheHackOfRayTracing playground book

wwdc2021 My wwdc2021 submission The HackOf RayTracing How to run Install swift playground from App Store on your Mac or iPad Double clik TheHackOfRayT

haoboxuxu 20 May 20, 2022
Swift APIs for getting book information from popular web services

Swift APIs for getting book information from popular web services

Brian Dewey 1 Sep 25, 2021
Library that holds multiple books loaded from json in a scroll view where each book can be tapped on, favorited, rated, and opened to read

Library that holds multiple books loaded from json in a scroll view where each book can be tapped on, favorited, rated, and opened to read. If a book is a favorite, an orange star appears on the book's cover. Page number, favorites, and ratings are saved for each session of the app.

Eli Hartnett 0 Dec 27, 2021
A cooking book provides recipes to perform certain action on SwiftUI

SwiftUI Recipes This is like a cooking book. provides recipes to perform certain action on SwiftUI Every Project will contain as many SwiftUI views as

Julio Ismael Robles 2 Nov 23, 2021