Code Monkey home page Code Monkey logo

app-architecture's People

Contributors

chriseidhof avatar floriankugler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

app-architecture's Issues

Final code missing

Hey guys, first of all apologies if this is not the correct way to contact you.

Second and the most important is to thank you for your great content (book and videos are so good).

Third, It seems as that the code is not updated, at least not for Recordings-MVVM-C app, or not synced with the videos (video 05). You made a lot of refactoring which I really want to explore but can't find the updated code. Is it possible to push it? even on a separate branch is ok.

Thanks!

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?

There are conflicts over tableView's reload in FolderViewController

tableView.reloadData in folder.didSet conflicts with tableView.deleteRows or tableView.insertRows, so the app will crash on creating or deleting folders.

Two solutions:

  • Only one update strategy. Delete tableView.deleteRows and tableView.insertRows, or call tableView.reloadData() imperatively instead of auto call in folder.didSet.
  • Add a condition to tableView.reloadData() in folder.didSet. For example, add a updatingInteractive instance variable, set to true on start of deleteItem(item:) and insert(item:) methods, set to false on end.

Project: Recordings-controller-owned-networking*

MVC+VS Time Travel functionality is underwhelmed when presenting views

In the MVC+VS version of the Recordings application, one of the features that can be implemented with ease thanks to the architecture is the Time Travel Debugging.

I noticed that when traveling through the history of the View States, in case a view is presented on top of the actual View Hierarchy you lose access to the slide until you dismiss the actual view, which adds another view state to the history, in this case the culprit is the recording screen. Is that behaviour expected? If not, or even if it is, how would be a good way to not lose access to the slider when the history contains a screen that is presented on top of the actual view context?

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.

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?

Outdated Cartfile in MVVM-C project

I was getting an xcodebuild error when running carthage update --platform iOS for the MVVM-C project as it couldn't build RxDataSources. I got it to work by updating the cartfile to this:

github "ReactiveX/RxSwift" ~> 4.0.0
github "RxSwiftCommunity/RxDataSources" ~> 3.0

I don't want to create a PR because I'm not sure if this was just an issue for me.

[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

Workaround for bug when observing optionals with KVO

// TODO: change.newValue should never be `nil`, but when observing an optional property that's set to `nil`, then change.newValue is `nil` instead of `Optional(nil)`. This is the bug report for this: https://bugs.swift.org/browse/SR-6066
guard let newValue = change.newValue else { return }
onChange(newValue)

This can be worked around with some funny casting:

let newValue = change.newValue ?? (nil as Any? as! Value)
onChange(newValue)

Then we can also observe optionals correctly.

Thanks to the awesome help of Jordan Rose of the Swift team for providing the workaround!

License

Would it be possible to put the example projects under an open source license like the MIT license?

Can there be an easier way to get a full version of the code?

Hello,

I bought the book. I clicked the download link, pressed the .epub and it opened in Books. 👍

I bought the videos. I clicked the download link, pressed the .m4v and it opened in Quicktime Player. 👍

I cloned this repository. I clicked on the Xcode project and got build errors. And then it started a chain nightmare of updating Carthage, fixing brew, fixing macOS permissions, reading about how Carthage maybe only builds for latest Swift version (4.2) while RxSwift.framework is built for 4.0.2 through git issues etc. etc.

Can the dependencies be uploaded, or can there be a step-by-step guide where I can 100% make sure that the project builds? I feel like the code is part of the "product" and it's sad that everyone who clones it has to potentially go through hours of re-configuration. Some of this maybe will be unavoidable (ex. getting an older version of Xcode), but at least that's the only step I would have to take.

(P.S. The particular project that I mentioned is MVVM-C)

Handling network errors in MVC

In MVC (model owned networking), after the View Controller initiates a network call, the UI only changes when the store gets updated on completion of the call. How would one update the UI to reflect network errors in this case, because the store wont update when there's no data fetched?

Should it just be propagated via the callback of the network call? (In the example in the book, there's a callback that is used only for stopping the refreshControl - should errors be made available here?)

refreshControl?.beginRefreshing()

task = folder.loadContents { [weak self] in
    // Make error available here?
    self?.refreshControl?.endRefreshing()
}

The timer in Recorder doesn't start first time

The callback of AVAudioSession.requestRecordPermission may not be called on main thread, so the timer in start method may doesn't start, due to absence of runloop.

The solution:

AVAudioSession.sharedInstance().requestRecordPermission() { allowed in
	DispatchQueue.main.async {
		if allowed {
			self.start(url)
		} else {
			self.update(nil)
		}
	}
}

Massive Coordinator

Is it a bad thing if the Coordinator becomes huge? If it is what are good solutions?

Thanks!

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]

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.