Skip to content

Commit

Permalink
#18 lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Yerin Hwang committed Aug 30, 2017
1 parent 964c74e commit 30b10bc
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Fling.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */ = {
Expand Down
8 changes: 4 additions & 4 deletions fling/Cart view/CartViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class CartViewController: UIViewController {
if cart.recipes.count == 0 {
drawEmpty()
}

updateTotalPrice()
cartTableView.allowsSelection = true
}
Expand Down Expand Up @@ -72,7 +72,7 @@ class CartViewController: UIViewController {
}
totalPriceLabel.text = total.addPriceTag()
}

func drawEmpty() {
let none = UIImage.init(named: "none.png")
let noneView = UIImageView()
Expand All @@ -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 = "담긴 레시피가 없습니다."
Expand Down Expand Up @@ -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()
}
Expand Down
4 changes: 2 additions & 2 deletions fling/Home view/CRVHomeTopHeader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class CRVHomeTopHeader: UICollectionReusableView {
flingHotLabel = UILabel()

super.init(frame: frame)

makeHeaderImage()

let xPadding = CGFloat(30)
Expand Down Expand Up @@ -84,7 +84,7 @@ class CRVHomeTopHeader: UICollectionReusableView {
headerFilter.alpha = 0.6
self.addSubview(headerImage)
}

func searchRecipe() {
let url = keywordInput.text!
popupClose()
Expand Down
12 changes: 5 additions & 7 deletions fling/Home view/HomeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class HomeViewController: UIViewController {
network.getFlingRecipe()
network.getSeason()
}

override func viewDidAppear(_ animated: Bool) {
self.flagForCollectionView = false
}
Expand Down Expand Up @@ -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]
Expand All @@ -275,7 +274,6 @@ extension HomeViewController: UICollectionViewDelegate, UICollectionViewDataSour
}
self.network.getRecipeWith(recipeId: recipeCell.rid)
}

}
}

Expand Down
4 changes: 2 additions & 2 deletions fling/Order view/OrderViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 { //바로 주문하기
//
Expand Down
6 changes: 3 additions & 3 deletions fling/Refrigerator view/RefrigeratorViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand All @@ -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
Expand Down Expand Up @@ -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()
}
Expand Down

0 comments on commit 30b10bc

Please sign in to comment.