Skip to content

Commit ac40450

Browse files
Removed pods from repository. Updated to Swift 4.2. Readme update
1 parent 55c852b commit ac40450

File tree

1,024 files changed

+303
-182995
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,024 files changed

+303
-182995
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ vendor/
3737
# you should judge for yourself, the pros and cons are mentioned at:
3838
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
3939
#
40-
# Pods/
40+
Pods/
4141

4242
# Carthage
4343
#

.swift-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0
1+
4.2

CleanArchitectureRxSwift.xcodeproj/project.pbxproj

Lines changed: 37 additions & 233 deletions
Large diffs are not rendered by default.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

CleanArchitectureRxSwift/AppDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
1414
var window: UIWindow?
1515

1616

17-
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
17+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
1818
let window = UIWindow(frame: UIScreen.main.bounds)
1919

2020
Application.shared.configureMainInterface(in: window)

CleanArchitectureRxSwift/Scenes/AllPosts/PostsViewController.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class PostsViewController: UIViewController {
1919
private func configureTableView() {
2020
tableView.refreshControl = UIRefreshControl()
2121
tableView.estimatedRowHeight = 64
22-
tableView.rowHeight = UITableViewAutomaticDimension
22+
tableView.rowHeight = UITableView.automaticDimension
2323
}
2424

2525
private func bindViewModel() {
@@ -38,8 +38,7 @@ class PostsViewController: UIViewController {
3838
//Bind Posts to UITableView
3939
output.posts.drive(tableView.rx.items(cellIdentifier: PostTableViewCell.reuseID, cellType: PostTableViewCell.self)) { tv, viewModel, cell in
4040
cell.bind(viewModel)
41-
42-
}.addDisposableTo(disposeBag)
41+
}.disposed(by: disposeBag)
4342
//Connect Create Post to UI
4443

4544
output.fetching

CleanArchitectureRxSwift/Scenes/CreatePost/CreatePostViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ final class CreatePostViewController: UIViewController {
2323
let output = viewModel.transform(input: input)
2424

2525
output.dismiss.drive()
26-
.addDisposableTo(disposeBag)
26+
.disposed(by: disposeBag)
2727
output.saveEnabled.drive(saveButton.rx.isEnabled)
28-
.addDisposableTo(disposeBag)
28+
.disposed(by: disposeBag)
2929
}
3030
}

CleanArchitectureRxSwift/Scenes/CreatePost/CreatePostViewModel.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ final class CreatePostViewModel: ViewModelType {
1919
}
2020

2121
func transform(input: Input) -> Output {
22-
let titleAndDetails = Driver.combineLatest(input.title, input.details) {
23-
$0
24-
}
22+
let titleAndDetails = Driver.combineLatest(input.title, input.details)
2523
let activityIndicator = ActivityIndicator()
2624

2725
let canSave = Driver.combineLatest(titleAndDetails, activityIndicator.asDriver()) {

CleanArchitectureRxSwift/Scenes/EditPost/EditPostViewController.swift

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,10 @@ final class EditPostViewController: UIViewController {
2323
message: "Are you sure you want to delete this post?",
2424
preferredStyle: .alert
2525
)
26-
27-
[("Yes", UIAlertActionStyle.destructive, { _ -> () in observer.onNext() }),
28-
("No", UIAlertActionStyle.cancel, { _ -> () in observer.onCompleted() })]
29-
.map({ UIAlertAction(title: $0, style: $1, handler: $2) })
30-
.forEach(alert.addAction)
26+
let yesAction = UIAlertAction(title: "Yes", style: .destructive, handler: { _ -> () in observer.onNext(()) })
27+
let noAction = UIAlertAction(title: "No", style: .cancel, handler: { _ -> () in observer.onNext(()) })
28+
alert.addAction(yesAction)
29+
alert.addAction(noAction)
3130

3231
self.present(alert, animated: true, completion: nil)
3332

@@ -51,7 +50,7 @@ final class EditPostViewController: UIViewController {
5150
output.save.drive(),
5251
output.error.drive(errorBinding),
5352
output.delete.drive()]
54-
.forEach({$0.addDisposableTo(disposeBag)})
53+
.forEach({$0.disposed(by: disposeBag)})
5554
}
5655

5756
var postBinding: UIBindingObserver<EditPostViewController, Post> {
@@ -68,7 +67,7 @@ final class EditPostViewController: UIViewController {
6867
message: "Something went wrong",
6968
preferredStyle: .alert)
7069
let action = UIAlertAction(title: "Dismiss",
71-
style: UIAlertActionStyle.cancel,
70+
style: UIAlertAction.Style.cancel,
7271
handler: nil)
7372
alert.addAction(action)
7473
vc.present(alert, animated: true, completion: nil)

CleanArchitectureRxSwift/Scenes/EditPost/EditPostViewModel.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ final class EditPostViewModel: ViewModelType {
2222
let saveTrigger = editing.skip(1) //we dont need initial state
2323
.filter { $0 == false }
2424
.mapToVoid()
25-
let titleAndDetails = Driver.combineLatest(input.title, input.details) {
26-
$0
27-
}
25+
let titleAndDetails = Driver.combineLatest(input.title, input.details)
2826
let post = Driver.combineLatest(Driver.just(self.post), titleAndDetails) { (post, titleAndDetails) -> Post in
2927
return Post(body: titleAndDetails.1, title: titleAndDetails.0, uid: post.uid, userId: post.userId, createdAt: post.createdAt)
3028
}.startWith(self.post)

0 commit comments

Comments
 (0)