Skip to content

Commit

Permalink
Add exported imports to allow using DTModelStorage API's without impo…
Browse files Browse the repository at this point in the history
…rting them.
  • Loading branch information
DenTelezhkin committed Apr 29, 2020
1 parent f05a15f commit 1d6f94e
Show file tree
Hide file tree
Showing 23 changed files with 35 additions and 26 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.

# Next

### Changed

* It's not longer necessary to import DTModelStorage framework to use it's API's. `import DTCollectionViewManager` now implicitly exports `DTModelStorage` as well.

## [7.0.0](https://github.com/DenTelezhkin/DTCollectionViewManager/releases/tag/7.0.0)

* `willCommitMenuWithAnimator` method has been made unavailable for Xcode 11.2, because `UICollectionViewDelegate` method it used has been removed from UIKit on Xcode 11.2.
Expand Down
4 changes: 4 additions & 0 deletions DTCollectionViewManager.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
9A99AA881B8A219300428802 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9A99AA871B8A219300428802 /* Assets.xcassets */; };
9A99AA8B1B8A219300428802 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9A99AA891B8A219300428802 /* LaunchScreen.storyboard */; };
9AA83F1C22D4D77700C20E87 /* DTModelStorage in Frameworks */ = {isa = PBXBuildFile; productRef = 9AA83F1B22D4D77700C20E87 /* DTModelStorage */; };
9ABE13FB24599CE2008874D2 /* Exports.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9ABE13FA24599CE2008874D2 /* Exports.swift */; };
9ADFC8EF1B8B73A300AB4CD9 /* SectionsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9ADFC8EE1B8B73A300AB4CD9 /* SectionsViewController.swift */; };
9ADFC8F41B8B76A000AB4CD9 /* SolidColorCollectionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9ADFC8F21B8B76A000AB4CD9 /* SolidColorCollectionCell.swift */; };
9ADFC8F51B8B76A000AB4CD9 /* SolidColorCollectionCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9ADFC8F31B8B76A000AB4CD9 /* SolidColorCollectionCell.xib */; };
Expand Down Expand Up @@ -237,6 +238,7 @@
9A99AA871B8A219300428802 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
9A99AA8A1B8A219300428802 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
9A99AA911B8A219300428802 /* Tests-iOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Tests-iOS.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
9ABE13FA24599CE2008874D2 /* Exports.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Exports.swift; sourceTree = "<group>"; };
9AC532381BE5F77F006CB18A /* Tests-tvOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Tests-tvOS.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
9ADFC8EE1B8B73A300AB4CD9 /* SectionsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SectionsViewController.swift; sourceTree = "<group>"; };
9ADFC8F21B8B76A000AB4CD9 /* SolidColorCollectionCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SolidColorCollectionCell.swift; path = Cells/SolidColorCollectionCell.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -397,6 +399,7 @@
3E33C72822B81BB0006FBB21 /* CollectionViewUpdater.swift */,
3E33C72A22B81BB0006FBB21 /* DTCollectionViewManager+Registration.swift */,
3E33C72B22B81BB0006FBB21 /* DTCollectionViewDelegateWrapper.swift */,
9ABE13FA24599CE2008874D2 /* Exports.swift */,
);
path = DTCollectionViewManager;
sourceTree = "<group>";
Expand Down Expand Up @@ -791,6 +794,7 @@
3E33C72D22B81BC4006FBB21 /* DTCollectionViewManagerAnomalyHandler.swift in Sources */,
3E33C73B22B81BC4006FBB21 /* DTCollectionViewDelegateWrapper.swift in Sources */,
3E33C73122B81BC4006FBB21 /* DTCollectionViewManager.swift in Sources */,
9ABE13FB24599CE2008874D2 /* Exports.swift in Sources */,
3E33C72F22B81BC4006FBB21 /* DTCollectionViewDelegate.swift in Sources */,
3E33C73722B81BC4006FBB21 /* DTCollectionViewDropPlaceholderContext.swift in Sources */,
);
Expand Down
1 change: 0 additions & 1 deletion Example/Cells/CollectionContainingCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import UIKit
import DTCollectionViewManager
import DTModelStorage

class CollectionContainingCell: UICollectionViewCell, DTCollectionViewManageable, ModelTransfer {

Expand Down
1 change: 0 additions & 1 deletion Example/MasterViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//

import UIKit
import DTModelStorage
import DTCollectionViewManager

class MasterViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
Expand Down
1 change: 0 additions & 1 deletion Example/SectionsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import UIKit
import DTCollectionViewManager
import DTModelStorage

func randomColor() -> UIColor {
let randomRed:CGFloat = CGFloat(drand48())
Expand Down
7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,6 @@ Add package into Project settings -> Swift Packages

## Quick start

`DTCollectionViewManager` framework has two parts - core framework, and storage classes. Import them both to your view controller class to start:

```swift
import DTCollectionViewManager
import DTModelStorage
```

Let's say you have an array of Posts you want to display in UICollectionView. To quickly show them using DTCollectionViewManager, here's what you need to do:

* Create UICollectionViewCell subclass, let's say PostCell. Adopt ModelTransfer protocol
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public enum DTCollectionViewManagerAnomaly: Equatable, CustomStringConvertible,
public var description: String {
switch self {
case .nilCellModel(let indexPath): return "DTCollectionViewManagerAnomaly.nilCellModel(\(indexPath))"
case .nilSupplementaryModel(let indexPath): return "DTCollectionViewManagerAnomaly.nilSupplementaryModel(\(indexPath))"
case .nilSupplementaryModel(let kind, let indexPath): return "DTCollectionViewManagerAnomaly.nilSupplementaryModel(\(indexPath)) for kind \(kind)"
case .noCellMappingFound(modelDescription: let description, indexPath: let indexPath): return "DTCollectionViewManagerAnomaly.noCellMappingFound(\(description), \(indexPath))"
case .noSupplementaryMappingFound(modelDescription: let description, kind: let kind, indexPath: let indexPath): return "DTCollectionViewManagerAnomaly.noSupplementaryMappingFound(\(description), \(kind), \(indexPath))"
case .differentCellReuseIdentifier(mappingReuseIdentifier: let mappingIdentifier, cellReuseIdentifier: let cellIdentifier): return "DTCollectionViewManagerAnomaly.differentCellReuseIdentifier(\(mappingIdentifier), \(cellIdentifier))"
Expand Down
26 changes: 26 additions & 0 deletions Sources/DTCollectionViewManager/Exports.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//
// Exports.swift
// DTCollectionViewManager
//
// Created by Denys Telezhkin on 29.04.2020.
// Copyright © 2020 Denys Telezhkin. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

@_exported import DTModelStorage
1 change: 0 additions & 1 deletion Sources/Tests/AnomaliesTestCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import XCTest
import DTCollectionViewManager
import DTModelStorage

enum TestAnomaly : Equatable, CustomDebugStringConvertible {
case itemEventCalledWithCellType(ObjectIdentifier)
Expand Down
1 change: 0 additions & 1 deletion Sources/Tests/CollectionViewBatchUpdatesTestCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import XCTest
import XCTest
import DTCollectionViewManager
import DTModelStorage

// This unit test shows problem, described in https://github.com/DenTelezhkin/DTCollectionViewManager/issues/23 and https://github.com/DenTelezhkin/DTCollectionViewManager/issues/27

Expand Down
1 change: 0 additions & 1 deletion Sources/Tests/CollectionViewFactoryTestCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import XCTest
@testable import DTCollectionViewManager
import DTModelStorage

fileprivate class UpdatableModel {
var value: Bool = false
Expand Down
1 change: 0 additions & 1 deletion Sources/Tests/CreationTestCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import XCTest
import DTCollectionViewManager
import DTModelStorage

class FooCell : UICollectionViewCell, ModelTransfer
{
Expand Down
1 change: 0 additions & 1 deletion Sources/Tests/DataSourceTestCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//

import XCTest
import DTModelStorage
import DTCollectionViewManager

class DataSourceTestCase: XCTestCase {
Expand Down
1 change: 0 additions & 1 deletion Sources/Tests/DelegateForwardingTestCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import UIKit
import XCTest
import DTModelStorage
@testable import DTCollectionViewManager

class DelegateCollectionViewController: DTSupplementaryTestCollectionController, UICollectionViewDelegateFlowLayout {
Expand Down
1 change: 0 additions & 1 deletion Sources/Tests/DiffableDatasourcesTestCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import XCTest
@testable import DTCollectionViewManager
import DTModelStorage

@available(iOS 13, tvOS 13, *)
extension NSDiffableDataSourceSnapshot {
Expand Down
1 change: 0 additions & 1 deletion Sources/Tests/Fixtures/NiblessHeaderFooterView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import Foundation
import UIKit
import DTCollectionViewManager
import DTModelStorage

class NiblessHeaderFooterView : UICollectionReusableView, ModelTransfer
{
Expand Down
1 change: 0 additions & 1 deletion Sources/Tests/Helpers/DTTestCollectionController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//

import UIKit
import DTModelStorage
import DTCollectionViewManager

class DTCellTestCollectionController: UIViewController, DTCollectionViewManageable {
Expand Down
1 change: 0 additions & 1 deletion Sources/Tests/MappingTestCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//

import XCTest
import DTModelStorage
@testable import DTCollectionViewManager

class MappingTestCase: XCTestCase {
Expand Down
1 change: 0 additions & 1 deletion Sources/Tests/ReactingToEventsTestCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//

import XCTest
import DTModelStorage
@testable import DTCollectionViewManager

#if os(iOS)
Expand Down
1 change: 0 additions & 1 deletion Sources/Tests/StoryboardMappingTestCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//

import XCTest
import DTModelStorage
@testable import DTCollectionViewManager

class StoryboardMappingTestCase: XCTestCase {
Expand Down
1 change: 0 additions & 1 deletion Sources/Tests/SupplementaryEventsTestCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//

import XCTest
import DTModelStorage
import DTCollectionViewManager

class ReactingSupplementaryCollectionController: DTSupplementaryTestCollectionController
Expand Down
1 change: 0 additions & 1 deletion Sources/Tests/SupplementaryMappingTestCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//

import XCTest
import DTModelStorage
import DTCollectionViewManager

class SupplementaryMappingTestCase: XCTestCase {
Expand Down
1 change: 0 additions & 1 deletion Sources/Tests/VIewModelMappingCustomizableTestCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import XCTest
import DTCollectionViewManager
import DTModelStorage

class IntCell : UICollectionViewCell, ModelTransfer {
func update(with model: Int) {
Expand Down

0 comments on commit 1d6f94e

Please sign in to comment.