Skip to content

Commit

Permalink
Merge branch 'release/1.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
malcommac committed Nov 24, 2019
2 parents a0215bc + dc8b5fb commit 8fc1882
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 15 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,4 @@ fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
.DS_Store
7 changes: 7 additions & 0 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Configs/Owl.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0.4</string>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
4 changes: 4 additions & 0 deletions Owl.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,7 @@
APPLICATION_EXTENSION_API_ONLY = YES;
CLANG_ENABLE_MODULES = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
CURRENT_PROJECT_VERSION = 0;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
Expand All @@ -906,6 +907,7 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 1.1.1;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = "com.Owl.Owl-iOS";
PRODUCT_NAME = Owl;
Expand All @@ -921,6 +923,7 @@
APPLICATION_EXTENSION_API_ONLY = YES;
CLANG_ENABLE_MODULES = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
CURRENT_PROJECT_VERSION = 0;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
Expand All @@ -929,6 +932,7 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 1.1.1;
PRODUCT_BUNDLE_IDENTIFIER = "com.Owl.Owl-iOS";
PRODUCT_NAME = Owl;
SKIP_INSTALL = YES;
Expand Down
2 changes: 1 addition & 1 deletion OwlKit.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "OwlKit"
s.version = "1.1.0"
s.version = "1.1.1"
s.summary = "A declarative type-safe framework for building fast and flexible list with Tables & Collections"
s.description = <<-DESC
Owl offers a data-driven declarative approach for building fast & flexible list in iOS. It supports both UICollectionView & UITableView; UIStackView is on the way!.
Expand Down
1 change: 1 addition & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import PackageDescription

let package = Package(
name: "Owl",
platforms: [.iOS(.v10)],
products: [
// Products define the executables and libraries produced by a package, and make them visible to other packages.
.library(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public extension CollectionCellAdapter {
public let indexPath: IndexPath?

/// Represented model instance
public let element: Model
public let element: Model?

/// Managed source collection
public var collection: UICollectionView? {
Expand Down Expand Up @@ -50,7 +50,7 @@ public extension CollectionCellAdapter {
/// - path: cell's path
/// - collection: parent cell's collection instance
internal init(element: Any?, cell: Any?, path: IndexPath?) {
self.element = element as! Model
self.element = element as? Model
self.cell = cell as? Cell
self.indexPath = path
}
Expand Down
6 changes: 4 additions & 2 deletions Sources/Owl/Collection/CollectionDirector.swift
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,10 @@ public extension CollectionDirector {
}

func collectionView(_ collectionView: UICollectionView, didEndDisplaying cell: UICollectionViewCell, forItemAt indexPath: IndexPath) {
let (model, adapter) = context(forItemAt: indexPath)
let _ = adapter.dispatchEvent(.endDisplay, model: model, cell: cell, path: indexPath, params: nil)
guard let adapter = adapterForCell(cell) else {
return
}
let _ = adapter.dispatchEvent(.endDisplay, model: nil, cell: cell, path: indexPath, params: nil)
}

private func adapterForCellClass(_ cell: UICollectionViewCell?) -> CollectionCellAdapterProtocol? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public extension CollectionHeaderFooterAdapterProtocol {

}

public class CollectionHeaderFooterAdapter<View: UICollectionReusableView>: CollectionHeaderFooterAdapterProtocol {
open class CollectionHeaderFooterAdapter<View: UICollectionReusableView>: CollectionHeaderFooterAdapterProtocol {

/// This is the cell type used to dequeue the model. You should not alter it.
public var modelCellType: Any.Type = View.self
Expand Down
6 changes: 6 additions & 0 deletions Sources/Owl/Shared/Protocols/ElementRepresentable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ public protocol Differentiable {
func isContentEqual(to other: Differentiable) -> Bool
}

public extension Differentiable {
func isContentEqual(to other: Differentiable) -> Bool {
return self.differenceIdentifier == other.differenceIdentifier
}
}

// MARK: - ElementRepresentable -

public protocol ElementRepresentable: Differentiable {
Expand Down
4 changes: 2 additions & 2 deletions Sources/Owl/Table/Cell Adapters/TableCellAdapter+Events.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ public extension TableCellAdapter {
public let indexPath: IndexPath?

// Target element of the event.
public let element: Model
public let element: Model?

// Target static typed cell if available.
// This value maybe `nil` if, at the time of the request, no cell is contextually associable with the event.
public var cell: Cell?

internal init(item: Any? = nil, cell: Any? = nil, indexPath: IndexPath? = nil) {
self.element = item as! Model
self.element = item as? Model
self.cell = cell as? Cell
self.indexPath = indexPath
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public extension TableHeaderFooterAdapterProtocol {

// MARK: - TableHeaderFooterAdapter -

public class TableHeaderFooterAdapter<View: UITableViewHeaderFooterView>: TableHeaderFooterAdapterProtocol {
open class TableHeaderFooterAdapter<View: UITableViewHeaderFooterView>: TableHeaderFooterAdapterProtocol {

// MARK: - Public Properties -

Expand Down
7 changes: 4 additions & 3 deletions Sources/Owl/Table/TableDirector.swift
Original file line number Diff line number Diff line change
Expand Up @@ -703,9 +703,10 @@ extension TableDirector: UITableViewDataSource, UITableViewDelegate {
}

public func tableView(_ tableView: UITableView, didEndDisplaying cell: UITableViewCell, forRowAt indexPath: IndexPath) {
//let adapter = adapterForCellClass(tableView.cellForRow(at: indexPath))
let (model, adapter) = context(forItemAt: indexPath)
let _ = adapter.dispatchEvent(.endDisplay, model: model, cell: cell, path: indexPath, params: nil)
guard let adapter = adapterForCellClass(cell) else {
return
}
let _ = adapter.dispatchEvent(.endDisplay, model: nil, cell: cell, path: indexPath, params: nil)
}

public func tableView(_ tableView: UITableView, shouldShowMenuForRowAt indexPath: IndexPath) -> Bool {
Expand Down
4 changes: 2 additions & 2 deletions Sources/Owl/Table/TableSection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import UIKit

public class TableSection: Equatable, Copying, DifferentiableSection {
open class TableSection: Equatable, Copying, DifferentiableSection {

// MARK: - Public Properties -

Expand Down Expand Up @@ -95,7 +95,7 @@ public class TableSection: Equatable, Copying, DifferentiableSection {

// MARK: - Initialization -

required init(original: TableSection) {
required public init(original: TableSection) {
self.allElements = original.allElements
self.identifier = original.identifier
self.headerTitle = original.headerTitle
Expand Down

0 comments on commit 8fc1882

Please sign in to comment.