Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
mattneub committed Oct 23, 2016
1 parent f971d93 commit 6cc94ee
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Expand Up @@ -72,7 +72,7 @@ class ViewController: UIViewController {
get {
if _myBigData == nil {
let fm = FileManager.default
let f = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent("myBigData")
let f = fm.temporaryDirectory.appendingPathComponent("myBigData")
if let d = try? Data(contentsOf:f) {
print("loaded big data from disk")
self._myBigData = d
Expand Down
Expand Up @@ -47,8 +47,8 @@ extension AppDelegate {
case .ended:
let anim = self.anim as! UIViewPropertyAnimator
let ctx = self.context!
let vc2 = ctx.viewController(forKey:.to)!
anim.addAnimations {
let vc2 = ctx.viewController(forKey:.to)!
v.frame = ctx.finalFrame(for: vc2)
}
let factor = 1 - anim.fractionComplete
Expand Down
Expand Up @@ -48,7 +48,7 @@ class MasterViewController : UITableViewController {
}

override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
print(self.tableView.indexPathForSelectedRow)
print(self.tableView.indexPathForSelectedRow as Any)
if let dest = segue.destination as? DetailViewController {
let cm = self.model[self.lastSelection.row]
dest.detailItem = UIImage(named:cm.name)
Expand Down
Expand Up @@ -54,8 +54,7 @@ class ViewController : UIViewController {
get {
if _myBigData == nil {
let fm = FileManager.default
let f = URL(fileURLWithPath: NSTemporaryDirectory())
.appendingPathComponent("myBigData")
let f = fm.temporaryDirectory.appendingPathComponent("myBigData")
if let d = try? Data(contentsOf:f) {
print("loaded big data from disk")
self._myBigData = d
Expand Down Expand Up @@ -91,7 +90,8 @@ class ViewController : UIViewController {
func saveAndReleaseMyBigData() {
if let myBigData = self.myBigData {
print("unloading big data")
let f = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent("myBigData")
let fm = FileManager.default
let f = fm.temporaryDirectory.appendingPathComponent("myBigData")
try? myBigData.write(to:f)
self.myBigData = nil
}
Expand Down

0 comments on commit 6cc94ee

Please sign in to comment.