diff --git a/CoreStore.xcodeproj/project.pbxproj b/CoreStore.xcodeproj/project.pbxproj index f074279..91f0791 100644 --- a/CoreStore.xcodeproj/project.pbxproj +++ b/CoreStore.xcodeproj/project.pbxproj @@ -2165,7 +2165,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0730; - LastUpgradeCheck = 1020; + LastUpgradeCheck = 1200; ORGANIZATIONNAME = "John Rommel Estropia"; TargetAttributes = { 2F03A52F19C5C6DA005002A5 = { @@ -3292,6 +3292,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -3363,6 +3364,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; diff --git a/CoreStore.xcodeproj/xcshareddata/xcschemes/CoreStore OSX.xcscheme b/CoreStore.xcodeproj/xcshareddata/xcschemes/CoreStore OSX.xcscheme index 2f268ef..0e3954f 100644 --- a/CoreStore.xcodeproj/xcshareddata/xcschemes/CoreStore OSX.xcscheme +++ b/CoreStore.xcodeproj/xcshareddata/xcschemes/CoreStore OSX.xcscheme @@ -1,6 +1,6 @@ diff --git a/Sources/ListSnapshot.swift b/Sources/ListSnapshot.swift index 9ed1f92..182fe63 100644 --- a/Sources/ListSnapshot.swift +++ b/Sources/ListSnapshot.swift @@ -597,20 +597,32 @@ public struct ListSnapshot: RandomAccessCollection, Hashable { self.diffableSnapshot.reloadSections(sectionIDs) } - - + // MARK: RandomAccessCollection public var startIndex: Index { - return self.diffableSnapshot.itemIdentifiers.startIndex + return 0 } public var endIndex: Index { - return self.diffableSnapshot.itemIdentifiers.endIndex + return self.diffableSnapshot.numberOfItems } - + + + // MARK: BidirectionalCollection + + public func index(_ i: Int, offsetBy distance: Int) -> Int { + + return i + distance + } + + public func distance(from start: Int, to end: Int) -> Int { + + return end - start + } + // MARK: Sequence