Skip to content

Commit

Permalink
Implement initial FetchedResultsCoordinator
Browse files Browse the repository at this point in the history
- update example project. completely rewrite.

ref #201
  • Loading branch information
jessesquires committed Jul 4, 2021
1 parent 7307ff4 commit f388105
Show file tree
Hide file tree
Showing 18 changed files with 608 additions and 454 deletions.
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,31 @@ The changelog for `JSQCoreDataKit`. Also see the [releases](https://github.com/j
NEXT
-----

- TBA

10.0.0
------

This release closes the [10.0.0 milestone](https://github.com/jessesquires/JSQCoreDataKit/milestone/21?closed=1).

### New

- Introduced a new component, `FetchedResultsCoordinator`, which handles all of the boilerplate for setting up an `NSFetchedResultsController` and updating the content of a `UICollectionView`. All you need to do is provide a `FetchedResultsCellConfiguration` and an `NSFetchRequest`. See the documentation and example project for details. (#201)

- Added `FetchedResultsController`, a generic subclass of `NSFetchedResultsController` that's nicer to use in Swift.

### Changed

- Upgraded to Xcode 12.5 and Swift 5.4

### Breaking

- Dropped support for old OS versions:
- iOS 14+ now required
- tvOS 14+ now required
- watchOS 6+ now required
- macOS 10.14+ now required

9.0.3
-----

Expand Down
36 changes: 22 additions & 14 deletions Example/ExampleApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@
objects = {

/* Begin PBXBuildFile section */
0BE5B6D1269113940015587B /* CollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BE5B6D0269113940015587B /* CollectionViewCell.swift */; };
0BE5B6D3269114BB0015587B /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BE5B6D2269114BB0015587B /* Extensions.swift */; };
0BE5B6DB269142F30015587B /* CompanyCellConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BE5B6DA269142F30015587B /* CompanyCellConfig.swift */; };
0BE5B6DD269144A30015587B /* EmployeeCellConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BE5B6DC269144A30015587B /* EmployeeCellConfig.swift */; };
0BE5B6E326916F1D0015587B /* CollectionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BE5B6E226916F1D0015587B /* CollectionViewController.swift */; };
885394211BC9E9DE00699506 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 885394201BC9E9DE00699506 /* AppDelegate.swift */; };
885394231BC9E9DE00699506 /* CompanyViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 885394221BC9E9DE00699506 /* CompanyViewController.swift */; };
885394261BC9E9DE00699506 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 885394241BC9E9DE00699506 /* Main.storyboard */; };
885394281BC9E9DE00699506 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 885394271BC9E9DE00699506 /* Assets.xcassets */; };
8853942B1BC9E9DE00699506 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 885394291BC9E9DE00699506 /* LaunchScreen.storyboard */; };
88B9F8C91BCA0A510053CD6D /* EmployeeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88B9F8C81BCA0A510053CD6D /* EmployeeViewController.swift */; };
Expand Down Expand Up @@ -67,10 +71,14 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
0BE5B6D0269113940015587B /* CollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollectionViewCell.swift; sourceTree = "<group>"; };
0BE5B6D2269114BB0015587B /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = "<group>"; };
0BE5B6DA269142F30015587B /* CompanyCellConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CompanyCellConfig.swift; sourceTree = "<group>"; };
0BE5B6DC269144A30015587B /* EmployeeCellConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmployeeCellConfig.swift; sourceTree = "<group>"; };
0BE5B6E226916F1D0015587B /* CollectionViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollectionViewController.swift; sourceTree = "<group>"; };
8853941D1BC9E9DE00699506 /* ExampleApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ExampleApp.app; sourceTree = BUILT_PRODUCTS_DIR; };
885394201BC9E9DE00699506 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
885394221BC9E9DE00699506 /* CompanyViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CompanyViewController.swift; sourceTree = "<group>"; };
885394251BC9E9DE00699506 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
885394271BC9E9DE00699506 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
8853942A1BC9E9DE00699506 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
8853942C1BC9E9DE00699506 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
Expand Down Expand Up @@ -135,11 +143,15 @@
children = (
885394201BC9E9DE00699506 /* AppDelegate.swift */,
885394271BC9E9DE00699506 /* Assets.xcassets */,
0BE5B6D0269113940015587B /* CollectionViewCell.swift */,
0BE5B6E226916F1D0015587B /* CollectionViewController.swift */,
0BE5B6DA269142F30015587B /* CompanyCellConfig.swift */,
885394221BC9E9DE00699506 /* CompanyViewController.swift */,
0BE5B6DC269144A30015587B /* EmployeeCellConfig.swift */,
88B9F8C81BCA0A510053CD6D /* EmployeeViewController.swift */,
0BE5B6D2269114BB0015587B /* Extensions.swift */,
8853942C1BC9E9DE00699506 /* Info.plist */,
885394291BC9E9DE00699506 /* LaunchScreen.storyboard */,
885394241BC9E9DE00699506 /* Main.storyboard */,
);
path = ExampleApp;
sourceTree = "<group>";
Expand Down Expand Up @@ -292,7 +304,6 @@
files = (
8853942B1BC9E9DE00699506 /* LaunchScreen.storyboard in Resources */,
885394281BC9E9DE00699506 /* Assets.xcassets in Resources */,
885394261BC9E9DE00699506 /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -310,8 +321,13 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
0BE5B6D3269114BB0015587B /* Extensions.swift in Sources */,
0BE5B6DD269144A30015587B /* EmployeeCellConfig.swift in Sources */,
0BE5B6DB269142F30015587B /* CompanyCellConfig.swift in Sources */,
885394231BC9E9DE00699506 /* CompanyViewController.swift in Sources */,
0BE5B6E326916F1D0015587B /* CollectionViewController.swift in Sources */,
88B9F8C91BCA0A510053CD6D /* EmployeeViewController.swift in Sources */,
0BE5B6D1269113940015587B /* CollectionViewCell.swift in Sources */,
885394211BC9E9DE00699506 /* AppDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -335,14 +351,6 @@
/* End PBXTargetDependency section */

/* Begin PBXVariantGroup section */
885394241BC9E9DE00699506 /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
885394251BC9E9DE00699506 /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
885394291BC9E9DE00699506 /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
Expand Down Expand Up @@ -402,7 +410,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -454,7 +462,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_VERSION = 5.0;
Expand Down
9 changes: 6 additions & 3 deletions Example/ExampleApp/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@ import UIKit

@UIApplicationMain
final class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?
let window = UIWindow()

func application(_ application: UIApplication,
// swiftlint:disable:next discouraged_optional_collection
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
true
let viewController = CompanyViewController()
let navigationController = UINavigationController(rootViewController: viewController)
self.window.rootViewController = navigationController
self.window.makeKeyAndVisible()
return true
}
}
Loading

0 comments on commit f388105

Please sign in to comment.