From 30b10bc1db163a5819463430ebba2a390c422579 Mon Sep 17 00:00:00 2001 From: Yerin Hwang Date: Wed, 30 Aug 2017 17:14:26 +0900 Subject: [PATCH] #18 lint --- Fling.xcodeproj/project.pbxproj | 2 +- fling/Cart view/CartViewController.swift | 8 ++++---- fling/Home view/CRVHomeTopHeader.swift | 4 ++-- fling/Home view/HomeViewController.swift | 12 +++++------- fling/Order view/OrderViewController.swift | 4 ++-- .../RefrigeratorViewController.swift | 6 +++--- 6 files changed, 17 insertions(+), 19 deletions(-) diff --git a/Fling.xcodeproj/project.pbxproj b/Fling.xcodeproj/project.pbxproj index dc18bd2..dca0b9b 100644 --- a/Fling.xcodeproj/project.pbxproj +++ b/Fling.xcodeproj/project.pbxproj @@ -659,7 +659,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-fling/Pods-fling-frameworks.sh\"\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-fling/Pods-fling-frameworks.sh\"\nif which swiftlint >/dev/null; then\nswiftlint\nelse\necho \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n\n"; showEnvVarsInLog = 0; }; D677320498FC1AB34FFD9024 /* [CP] Check Pods Manifest.lock */ = { diff --git a/fling/Cart view/CartViewController.swift b/fling/Cart view/CartViewController.swift index d161fae..5743ff2 100644 --- a/fling/Cart view/CartViewController.swift +++ b/fling/Cart view/CartViewController.swift @@ -27,7 +27,7 @@ class CartViewController: UIViewController { if cart.recipes.count == 0 { drawEmpty() } - + updateTotalPrice() cartTableView.allowsSelection = true } @@ -72,7 +72,7 @@ class CartViewController: UIViewController { } totalPriceLabel.text = total.addPriceTag() } - + func drawEmpty() { let none = UIImage.init(named: "none.png") let noneView = UIImageView() @@ -81,7 +81,7 @@ class CartViewController: UIViewController { noneView.center.x = self.view.center.x noneView.center.y = self.view.center.y - 50 self.view.addSubview(noneView) - + let message = UILabel.init() message.font = UIFont.systemFont(ofSize: 14) message.text = "담긴 레시피가 없습니다." @@ -148,7 +148,7 @@ extension CartViewController: UITableViewDelegate, UITableViewDataSource { storage.saveCart(cart: cart) updateTotalPrice() tableView.deleteRows(at: [indexPath], with: UITableViewRowAnimation.automatic) - + if cart.recipes.count == 0 { drawEmpty() } diff --git a/fling/Home view/CRVHomeTopHeader.swift b/fling/Home view/CRVHomeTopHeader.swift index d9fc67b..89e7eff 100644 --- a/fling/Home view/CRVHomeTopHeader.swift +++ b/fling/Home view/CRVHomeTopHeader.swift @@ -32,7 +32,7 @@ class CRVHomeTopHeader: UICollectionReusableView { flingHotLabel = UILabel() super.init(frame: frame) - + makeHeaderImage() let xPadding = CGFloat(30) @@ -84,7 +84,7 @@ class CRVHomeTopHeader: UICollectionReusableView { headerFilter.alpha = 0.6 self.addSubview(headerImage) } - + func searchRecipe() { let url = keywordInput.text! popupClose() diff --git a/fling/Home view/HomeViewController.swift b/fling/Home view/HomeViewController.swift index 41d311d..429b184 100644 --- a/fling/Home view/HomeViewController.swift +++ b/fling/Home view/HomeViewController.swift @@ -81,7 +81,7 @@ class HomeViewController: UIViewController { network.getFlingRecipe() network.getSeason() } - + override func viewDidAppear(_ animated: Bool) { self.flagForCollectionView = false } @@ -260,13 +260,12 @@ extension HomeViewController: UICollectionViewDelegate, UICollectionViewDataSour homeView.endEditing(true) } } - + func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { - - if(self.flagForCollectionView == true){ - return; + if self.flagForCollectionView == true { + return } else { - self.flagForCollectionView = false; + self.flagForCollectionView = false var recipeCell = Recipe() if indexPath.section == 0 { recipeCell = self.recipes[indexPath.row] @@ -275,7 +274,6 @@ extension HomeViewController: UICollectionViewDelegate, UICollectionViewDataSour } self.network.getRecipeWith(recipeId: recipeCell.rid) } - } } diff --git a/fling/Order view/OrderViewController.swift b/fling/Order view/OrderViewController.swift index d067bc7..fd03ed0 100644 --- a/fling/Order view/OrderViewController.swift +++ b/fling/Order view/OrderViewController.swift @@ -31,14 +31,14 @@ class OrderViewController: UIViewController { let animated = UIImage.animatedImage(with: images, duration: 1.0)! rabbitImage.image = animated - + orderComplete() } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() } - + func orderComplete() { if myRecipe != nil { //바로 주문하기 // diff --git a/fling/Refrigerator view/RefrigeratorViewController.swift b/fling/Refrigerator view/RefrigeratorViewController.swift index 12c7c5f..ad731c8 100644 --- a/fling/Refrigerator view/RefrigeratorViewController.swift +++ b/fling/Refrigerator view/RefrigeratorViewController.swift @@ -35,7 +35,7 @@ class RefrigeratorViewController: UIViewController { fridge = appDelegate.fridge self.tableView.tableFooterView = UIView() self.tableView.separatorInset.right = 15 - + if fridge.materials.count == 0 { drawEmpty() } @@ -55,7 +55,7 @@ class RefrigeratorViewController: UIViewController { noneView.center.x = self.view.center.x noneView.center.y = self.view.center.y - 50 self.view.addSubview(noneView) - + message.font = UIFont.systemFont(ofSize: 14) message.text = "담긴 재료가 없습니다." message.textAlignment = .center @@ -96,7 +96,7 @@ extension RefrigeratorViewController: UITableViewDelegate, UITableViewDataSource fridge.remove(materialAt: indexPath.row) storage.saveFridge(fridge: fridge) tableView.deleteRows(at: [indexPath], with: UITableViewRowAnimation.automatic) - + if fridge.materials.count == 0 { drawEmpty() }