Skip to content
This repository has been archived by the owner on Nov 24, 2021. It is now read-only.

Commit

Permalink
Fixes #111 and removed swift 3 warnings (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
batjo authored and 3lvis committed Nov 29, 2017
1 parent 7eed38a commit a9d2982
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Demo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.sample.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
};
name = Debug;
Expand All @@ -975,7 +975,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.sample.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
};
name = Release;
Expand Down
4 changes: 2 additions & 2 deletions Library/Helper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ public class Helper: NSObject {
let letters = "ABCDEFGHIJKL"
var string = ""
for _ in 0 ... 5 {
let token = UInt32(letters.characters.count)
let token = UInt32(letters.count)
let letterIndex = Int(arc4random_uniform(token))
let firstChar = Array(letters.characters)[letterIndex]
let firstChar = Array(letters)[letterIndex]
string.append(firstChar)
}

Expand Down
10 changes: 5 additions & 5 deletions Source/DATASource+NSFetchedResultsControllerDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ extension DATASource: NSFetchedResultsControllerDelegate {
}
break
case .update:
if let indexPath = indexPath {
if tableView.indexPathsForVisibleRows?.index(of: indexPath) != nil {
if let cell = tableView.cellForRow(at: indexPath) {
self.configure(cell, indexPath: indexPath)
if let newIndexPath = newIndexPath {
if tableView.indexPathsForVisibleRows?.index(of: newIndexPath) != nil {
if let cell = tableView.cellForRow(at: newIndexPath) {
self.configure(cell, indexPath: newIndexPath)
}

if let anObject = anObject as? NSManagedObject {
self.delegate?.dataSource?(self, didUpdateObject: anObject, atIndexPath: indexPath)
self.delegate?.dataSource?(self, didUpdateObject: anObject, atIndexPath: newIndexPath)
}
}
}
Expand Down

0 comments on commit a9d2982

Please sign in to comment.