Skip to content

Commit

Permalink
Merge pull request #230 from woowahan-techcamp/junekim
Browse files Browse the repository at this point in the history
#207 이슈들
  • Loading branch information
wooooooong authored Aug 29, 2017
2 parents 1a1300d + 626d888 commit 029bc53
Show file tree
Hide file tree
Showing 16 changed files with 95 additions and 21 deletions.
45 changes: 45 additions & 0 deletions iOSProject/pyunrihae/.swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
disabled_rules:
- force_cast
- force_try
- function_body_length
- line_length
- nesting
- todo
- type_body_length
- type_name
- variable_name

cyclomatic_complexity:
- 24 # warning
- 25 # error

function_parameter_count:
- 16 # warning
- 17 # error

line_length:
- 200 # warning
- 300 # error

force_cast: warning # implicitly. String! -> warning
force_try:
severity: warning # explicitly. try! -> warning

type_body_length:
- 300 # warning
- 400 # error

# or they can set both explicitly
file_length:
warning: 500
error: 800

type_name:
min_length: 4 # only warning
max_length: # warning and error
warning: 30
error: 35

excluded:
- Pods
- pyunrihae/YNSearch
24 changes: 24 additions & 0 deletions iOSProject/pyunrihae/pyunrihae.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@
9865E54A1F3C436000014795 /* ProductReviewTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9865E5491F3C436000014795 /* ProductReviewTableViewCell.swift */; };
9865E54E1F3C576D00014795 /* Image.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9865E54D1F3C576D00014795 /* Image.swift */; };
9865E56C1F42E55E00014795 /* BigImageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9865E56B1F42E55E00014795 /* BigImageViewController.swift */; };
986A888D1F55666600FFAED1 /* star0.png in Resources */ = {isa = PBXBuildFile; fileRef = 986A88871F55666600FFAED1 /* star0.png */; };
986A888E1F55666600FFAED1 /* star05.png in Resources */ = {isa = PBXBuildFile; fileRef = 986A88881F55666600FFAED1 /* star05.png */; };
986A888F1F55666600FFAED1 /* star15.png in Resources */ = {isa = PBXBuildFile; fileRef = 986A88891F55666600FFAED1 /* star15.png */; };
986A88901F55666600FFAED1 /* star25.png in Resources */ = {isa = PBXBuildFile; fileRef = 986A888A1F55666600FFAED1 /* star25.png */; };
986A88911F55666600FFAED1 /* star35.png in Resources */ = {isa = PBXBuildFile; fileRef = 986A888B1F55666600FFAED1 /* star35.png */; };
986A88921F55666600FFAED1 /* star45.png in Resources */ = {isa = PBXBuildFile; fileRef = 986A888C1F55666600FFAED1 /* star45.png */; };
98768AA01F39A5D600654C19 /* DataManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98C5AAD71F342C3900610115 /* DataManager.swift */; };
989FA79A1F511E40001D1E42 /* ReviewPopupView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 989FA7991F511E40001D1E42 /* ReviewPopupView.swift */; };
989FA79C1F511E59001D1E42 /* ReviewPopupView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 989FA79B1F511E59001D1E42 /* ReviewPopupView.xib */; };
Expand Down Expand Up @@ -185,6 +191,12 @@
9865E5491F3C436000014795 /* ProductReviewTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProductReviewTableViewCell.swift; sourceTree = "<group>"; };
9865E54D1F3C576D00014795 /* Image.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Image.swift; sourceTree = "<group>"; };
9865E56B1F42E55E00014795 /* BigImageViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BigImageViewController.swift; sourceTree = "<group>"; };
986A88871F55666600FFAED1 /* star0.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = star0.png; sourceTree = "<group>"; };
986A88881F55666600FFAED1 /* star05.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = star05.png; sourceTree = "<group>"; };
986A88891F55666600FFAED1 /* star15.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = star15.png; sourceTree = "<group>"; };
986A888A1F55666600FFAED1 /* star25.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = star25.png; sourceTree = "<group>"; };
986A888B1F55666600FFAED1 /* star35.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = star35.png; sourceTree = "<group>"; };
986A888C1F55666600FFAED1 /* star45.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = star45.png; sourceTree = "<group>"; };
989FA7991F511E40001D1E42 /* ReviewPopupView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReviewPopupView.swift; sourceTree = "<group>"; };
989FA79B1F511E59001D1E42 /* ReviewPopupView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ReviewPopupView.xib; sourceTree = "<group>"; };
989FA79F1F52BEC8001D1E42 /* Popup.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Popup.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -395,6 +407,12 @@
98F865911F4407A700C2F333 /* ic_my.png */,
98F865921F4407A700C2F333 /* ic_ranking_selected.png */,
98F865931F4407A700C2F333 /* ic_ranking.png */,
986A88871F55666600FFAED1 /* star0.png */,
986A88881F55666600FFAED1 /* star05.png */,
986A88891F55666600FFAED1 /* star15.png */,
986A888A1F55666600FFAED1 /* star25.png */,
986A888B1F55666600FFAED1 /* star35.png */,
986A888C1F55666600FFAED1 /* star45.png */,
98F865941F4407A700C2F333 /* ic_review_selected.png */,
98F865951F4407A700C2F333 /* ic_review.png */,
989FA7A71F53EA9A001D1E42 /* empty_star.png */,
Expand Down Expand Up @@ -696,6 +714,7 @@
0EC14C9B1F51B34D00D257E1 /* kakaolink_btn_small.png in Resources */,
98F172F41F32EDB70044FD0D /* LaunchScreen.storyboard in Resources */,
98CBA0C21F467E7D003D0370 /* ic_add.png in Resources */,
986A888E1F55666600FFAED1 /* star05.png in Resources */,
98D5691E1F4BE6DA002693E9 /* bad.png in Resources */,
9865E5181F39C2A000014795 /* stars.png in Resources */,
98F8658B1F44021000C2F333 /* logo_cu.png in Resources */,
Expand All @@ -705,6 +724,7 @@
98F8658C1F44021000C2F333 /* logo_7eleven.png in Resources */,
98CBA0C41F467EE5003D0370 /* ic_dropdown.png in Resources */,
98F8659A1F4407A700C2F333 /* ic_ranking_selected.png in Resources */,
986A88921F55666600FFAED1 /* star45.png in Resources */,
98F865851F43FB1A00C2F333 /* star4.png in Resources */,
98CBA0BE1F458E87003D0370 /* ic_login_enabled.png in Resources */,
98CBA0C01F466919003D0370 /* ic_review_write.png in Resources */,
Expand All @@ -715,6 +735,7 @@
98CBA0CA1F468196003D0370 /* ic_star.png in Resources */,
989FA7AC1F5521AB001D1E42 /* UsefulBadBtn.xib in Resources */,
98DED89C1F41732700CC4D63 /* Main.storyboard in Resources */,
986A88901F55666600FFAED1 /* star25.png in Resources */,
0E9724EC1F52905100AAAD91 /* ic_google_sign_in.png in Resources */,
98F865A31F442A3000C2F333 /* bg_login.png in Resources */,
98F865861F43FB1A00C2F333 /* star3.png in Resources */,
Expand All @@ -730,11 +751,14 @@
98F865871F43FB1A00C2F333 /* star5.png in Resources */,
98D9F2E41F418DF3009D0E10 /* YNSearch.xcassets in Resources */,
98B288601F53EF43007673FF /* ic_default_product.png in Resources */,
986A888D1F55666600FFAED1 /* star0.png in Resources */,
984395861F32F29A0016B67D /* GoogleService-Info.plist in Resources */,
986A888F1F55666600FFAED1 /* star15.png in Resources */,
98F865AB1F442F8B00C2F333 /* ic_password.png in Resources */,
98F865A71F442EE100C2F333 /* ic_close.png in Resources */,
98D569201F4BE6EC002693E9 /* useful.png in Resources */,
0E9724ED1F52905100AAAD91 /* ic_emailsignup.png in Resources */,
986A88911F55666600FFAED1 /* star35.png in Resources */,
98CBA0B81F458BA8003D0370 /* back_right.png in Resources */,
98F8659B1F4407A700C2F333 /* ic_ranking.png in Resources */,
98F865981F4407A700C2F333 /* ic_my_selected.png in Resources */,
Expand Down
11 changes: 0 additions & 11 deletions iOSProject/pyunrihae/pyunrihae/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate,GIDSignInDelegate{
GIDSignIn.sharedInstance().clientID = FirebaseApp.app()?.options.clientID
GIDSignIn.sharedInstance().delegate = self

_ = Auth.auth().addStateDidChangeListener { (auth, user) in
if user == nil {
do {
try Auth.auth().signOut()
User.sharedInstance = User.init()
NotificationCenter.default.post(name: NSNotification.Name("userLogined"), object: nil)
} catch let signOutError as NSError {
print ("Error signing out: %@", signOutError)
}
}
}
return true
}
func applicationWillResignActive(_ application: UIApplication) {
Expand Down
6 changes: 3 additions & 3 deletions iOSProject/pyunrihae/pyunrihae/LoginViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ class LoginViewController: UIViewController {
@IBAction func onEditingEmail(_ sender: Any) {
isValidSignup()
}
func isValidSignup(){
if Validator.isValidLogin(email: emailTextField.text!,password: passwordTextField.text!) {
func isValidSignup() {
if Validator.isValidLogin(email: emailTextField.text!, password: passwordTextField.text!) {
loginButton.isEnabled = true
}else{
}else {
loginButton.isEnabled = false
}
}
Expand Down
14 changes: 10 additions & 4 deletions iOSProject/pyunrihae/pyunrihae/MainViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class MainViewController: UIViewController {
self.productList = []
for product in self.appdelegate.productList {
if product.category == categoryBtns[selectedCategoryIndex].titleLabel?.text!{
self.productList.append(product)
self.productList.append(product)
}
}
DispatchQueue.main.async {
Expand Down Expand Up @@ -182,6 +182,7 @@ class MainViewController: UIViewController {
}
// 리뷰의 스크롤 이미지를 가져오는 함수
func setReviewScrollImages(){

var brand = ""
switch selectedBrandIndexFromTab {
case 0 : brand = "전체"
Expand All @@ -190,7 +191,6 @@ class MainViewController: UIViewController {
case 3 : brand = "7-eleven"
default : break
}
// indicatorView.startAnimating()
DataManager.getTop3ReviewByBrand(brand: brand) { (reviews) in
self.reviewList = reviews
if self.reviewScrollView != nil {
Expand Down Expand Up @@ -256,15 +256,21 @@ class MainViewController: UIViewController {
self.reviewScrollView.addSubview(reviewView)
xPosition += imageViewWidth
scrollViewSize += imageViewWidth
cnt = cnt + 1
cnt += 1
}
}
}
}
func setProductScrollView(){

// 기존에 붙어있던 subview를 제거
for subview in self.productScrollView.subviews {
subview.removeFromSuperview()
}


self.productScrollView.contentOffset.x = 0

if self.productScrollView != nil {
let imageViewWidth = self.productScrollView.frame.size.width;
let imageViewHeight = self.productScrollView.frame.size.height;
Expand Down Expand Up @@ -310,7 +316,7 @@ class MainViewController: UIViewController {
productView.isUserInteractionEnabled = true
self.productScrollView.addSubview(productView)
xPosition += imageViewWidth / 3.0
cnt = cnt + 1
cnt += 1
}
}
}
Expand Down
10 changes: 10 additions & 0 deletions iOSProject/pyunrihae/pyunrihae/Pyunrihae.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,20 @@
// Copyright © 2017년 busride. All rights reserved.
//

/*
* 편리해 앱에서
* 반복적으로 사용되는 함수들을 모아놓은 model입니다.
*/

import Foundation


class Pyunrihae {


/*
* 비회원일 때 로그인 필요 기능에 팝업 띄우기
*/
static func showLoginOptionPopup(_ controller : UIViewController){
let alertController = UIAlertController(title: "알림", message: "로그인 뒤 이용가능합니다.", preferredStyle: UIAlertControllerStyle.alert)
let DestructiveAction = UIAlertAction(title: "취소", style: UIAlertActionStyle.destructive) { (result : UIAlertAction) -> Void in
Expand Down
2 changes: 1 addition & 1 deletion iOSProject/pyunrihae/pyunrihae/UsefulBadBtnView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class UsefulBadBtnView: UIView {
}
@IBAction func tabBadBtn(_ sender: UIButton) {
if User.sharedInstance.email == "" {

NotificationCenter.default.post(name: NSNotification.Name("showLoginPopup"), object: self, userInfo: ["validator": validator])
} else {
let uid = User.sharedInstance.id
var reviewStatus = User.sharedInstance.review_like_list[reviewId]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ open class YNSearchViewController: UIViewController, UITextFieldDelegate {
}

open func ynSearchinit() {
self.ynSearchTextfieldView = YNSearchTextFieldView(frame: CGRect(x: 20, y: 64, width: width-40, height: 50))
self.ynSearchTextfieldView = YNSearchTextFieldView(frame: CGRect(x: 20, y: 0, width: width-40, height: 50))
self.ynSearchTextfieldView.ynSearchTextField.delegate = self
self.ynSearchTextfieldView.ynSearchTextField.addTarget(self, action: #selector(ynSearchTextfieldTextChanged(_:)), for: .editingChanged)
self.ynSearchTextfieldView.cancelButton.addTarget(self, action: #selector(ynSearchTextfieldcancelButtonClicked), for: .touchUpInside)
self.ynSearchTextfieldView.searchButton.addTarget(self, action: #selector(ynSearchTextfieldsearchButtonClicked), for: .touchUpInside)
self.view.addSubview(self.ynSearchTextfieldView)

self.ynSearchView = YNSearchView(frame: CGRect(x: 0, y: 114, width: width, height: height-70))
self.ynSearchView = YNSearchView(frame: CGRect(x: 0, y: 50, width: width, height: height-70))
self.view.addSubview(self.ynSearchView)
}

Expand Down
Binary file modified iOSProject/pyunrihae/pyunrihae/bad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added iOSProject/pyunrihae/pyunrihae/star0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added iOSProject/pyunrihae/pyunrihae/star05.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added iOSProject/pyunrihae/pyunrihae/star15.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added iOSProject/pyunrihae/pyunrihae/star25.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added iOSProject/pyunrihae/pyunrihae/star35.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added iOSProject/pyunrihae/pyunrihae/star45.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified iOSProject/pyunrihae/pyunrihae/useful.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 029bc53

Please sign in to comment.