Skip to content

Commit

Permalink
Merge pull request #274 from TeamWeathy/develop
Browse files Browse the repository at this point in the history
앱스토어 1.1.2 버전
  • Loading branch information
seu11ee authored Aug 3, 2021
2 parents c41340b + 54520ee commit 11bc411
Show file tree
Hide file tree
Showing 10 changed files with 116 additions and 48 deletions.
4 changes: 2 additions & 2 deletions Weathy/Weathy.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1266,7 +1266,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.1.6;
MARKETING_VERSION = 1.1.8;
PRODUCT_BUNDLE_IDENTIFIER = com.weathy.weathy;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand All @@ -1289,7 +1289,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.1.6;
MARKETING_VERSION = 1.1.8;
PRODUCT_BUNDLE_IDENTIFIER = com.weathy.weathy;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand Down
12 changes: 6 additions & 6 deletions Weathy/Weathy/Resources/Storyboards/Calendar/Calendar.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -484,14 +484,15 @@
</constraints>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="calendarBtnArrow" translatesAutoresizingMaskIntoConstraints="NO" id="Zop-PL-sAi">
<rect key="frame" x="236.33333333333334" y="33.666666666666671" width="11.333333333333343" height="6.6666666666666643"/>
<rect key="frame" x="234.66666666666666" y="33" width="11" height="6"/>
<constraints>
<constraint firstAttribute="width" secondItem="Zop-PL-sAi" secondAttribute="height" multiplier="10.5:6" id="xFW-hg-Ww3"/>
</constraints>
</imageView>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" bounces="NO" scrollEnabled="NO" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" bouncesZoom="NO" editable="NO" text="2021. 1" translatesAutoresizingMaskIntoConstraints="NO" id="MLH-qw-EFI" customClass="SpacedTextView" customModule="Weathy" customModuleProvider="target">
<rect key="frame" x="135.33333333333334" y="12" width="119.33333333333334" height="50"/>
<rect key="frame" x="137.66666666666666" y="12" width="115" height="48"/>
<constraints>
<constraint firstAttribute="width" constant="115" id="S6d-60-41k"/>
<constraint firstAttribute="width" secondItem="MLH-qw-EFI" secondAttribute="height" multiplier="115:48" id="bZX-nQ-PUJ"/>
</constraints>
<inset key="scrollIndicatorInsets" minX="8" minY="8" maxX="0.0" maxY="0.0"/>
Expand All @@ -516,7 +517,7 @@
</connections>
</button>
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" bounces="NO" pagingEnabled="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="uOT-xR-3sR">
<rect key="frame" x="35" y="62" width="320" height="109"/>
<rect key="frame" x="35" y="59.999999999999993" width="320" height="109.33333333333331"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstAttribute="width" secondItem="uOT-xR-3sR" secondAttribute="height" multiplier="308:105" id="n3d-MH-o8i"/>
Expand Down Expand Up @@ -632,7 +633,7 @@
</cells>
</collectionView>
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" bounces="NO" pagingEnabled="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" contentInsetAdjustmentBehavior="never" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="bb2-V1-BIL">
<rect key="frame" x="35" y="97.666666666666657" width="320" height="300"/>
<rect key="frame" x="35" y="95.666666666666657" width="320" height="300"/>
<color key="backgroundColor" red="0.95294117649999999" green="0.4431372549" blue="0.53333333329999999" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="300" id="smh-DP-FEY"/>
Expand Down Expand Up @@ -793,7 +794,7 @@
</cells>
</collectionView>
<stackView opaque="NO" userInteractionEnabled="NO" contentMode="scaleToFill" distribution="fillEqually" translatesAutoresizingMaskIntoConstraints="NO" id="jUc-Bh-1hY">
<rect key="frame" x="35" y="80" width="320" height="17.666666666666671"/>
<rect key="frame" x="35" y="78" width="320" height="17.666666666666671"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="BGD-Gk-BMk">
<rect key="frame" x="0.0" y="0.0" width="45.666666666666664" height="17.666666666666668"/>
Expand Down Expand Up @@ -866,7 +867,6 @@
<constraint firstItem="jUc-Bh-1hY" firstAttribute="centerX" secondItem="j9k-NW-X9X" secondAttribute="centerX" id="ogb-TP-h6Y"/>
<constraint firstAttribute="bottom" secondItem="9Mq-yL-8s0" secondAttribute="bottom" id="prY-LM-ZcZ"/>
<constraint firstItem="GZs-Aw-Oxd" firstAttribute="top" secondItem="j9k-NW-X9X" secondAttribute="top" constant="9" id="t3g-Jq-5Br"/>
<constraint firstItem="MLH-qw-EFI" firstAttribute="width" secondItem="j9k-NW-X9X" secondAttribute="width" multiplier="115:375" id="w9p-bo-8Ho"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Inp-Yt-33o">
Expand Down
1 change: 1 addition & 0 deletions Weathy/Weathy/Sources/VCs/Calendar/CalendarDetailVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@ class CalendarDetailVC: UIViewController{
print("selected!",selectedDate)
}
if todayWeathyFlag || recordViewFlag{
calendarVC.yearMonthTextView.text = selectedDate.currentYearMonth
calendarVC.selectedDate = selectedDate
print("selectedDate",selectedDate)
calendarVC.picker.date = selectedDate
Expand Down
27 changes: 20 additions & 7 deletions Weathy/Weathy/Sources/VCs/ModifyWeathy/ModifyWeathyTagVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -630,9 +630,14 @@ extension ModifyWeathyTagVC: UICollectionViewDataSource {

}

DispatchQueue.main.async{
self.tagCollectionView.reloadData()
self.tagTitleCollectionView.reloadData()
if tagTitles[titleIndex].tagTab[indexPath.item].isSelected {
setTagSelected(cell: collectionView.cellForItem(at: indexPath) as! RecordTagCVC)
} else {
setTagUnselected(cell: collectionView.cellForItem(at: indexPath) as! RecordTagCVC)
}

UIView.performWithoutAnimation {
self.tagTitleCollectionView.reloadItems(at: [IndexPath(item: titleIndex, section: 0)])
}

if tagTitles[0].count >= 1 || tagTitles[1].count >= 1 || tagTitles[2].count >= 1 ||
Expand Down Expand Up @@ -683,10 +688,18 @@ extension ModifyWeathyTagVC: UICollectionViewDelegateFlowLayout {

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {

let cellWidth : CGFloat = collectionView.frame.width/4 - 6
let cellHeight : CGFloat = collectionView.frame.height

return CGSize(width: cellWidth, height: cellHeight)
if collectionView == tagTitleCollectionView {
let cellWidth : CGFloat = collectionView.frame.width/4 - 6
let cellHeight : CGFloat = collectionView.frame.height

return CGSize(width: cellWidth, height: cellHeight)
} else {
if let cell = collectionView.cellForItem(at: indexPath) {
return CGSize(width: cell.frame.width, height: cell.frame.height)
}

return CGSize(width: 0, height: 0)
}

}

Expand Down
22 changes: 12 additions & 10 deletions Weathy/Weathy/Sources/VCs/Record/RecordNVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,19 @@ extension RecordNVC {
case .plusRecord:
print("플러스 버튼에서의 접근")
/// 앱 델리게이트에서 년, 월, 일을 받아와 문자열로 변환
let appDelgate: AppDelegate = UIApplication.shared.delegate as! AppDelegate
let appDelegate: AppDelegate = UIApplication.shared.delegate as! AppDelegate

dateString = "\(String((appDelgate.overviewData?.dailyWeather.date.year)!))-\(String(format: "%02d", appDelgate.overviewData!.dailyWeather.date.month))-\(String(format: "%02d", appDelgate.overviewData!.dailyWeather.date.day))"

/// 년, 월, 일을 Date 형식으로 변환
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
dateFormatter.locale = Locale(identifier: "ko-Kr")

let dateTimeString: String = "\(dateString) 00:00:00"
dateToday = dateFormatter.date(from: dateTimeString)
if let savedData = appDelegate.overviewData {
dateString = "\(String((savedData.dailyWeather.date.year)!))-\(String(format: "%02d", savedData.dailyWeather.date.month))-\(String(format: "%02d", savedData.dailyWeather.date.day))"

/// 년, 월, 일을 Date 형식으로 변환
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
dateFormatter.locale = Locale(identifier: "ko-Kr")

let dateTimeString: String = "\(dateString) 00:00:00"
dateToday = dateFormatter.date(from: dateTimeString)
}

case .calendarRecord:
print("캘린더에서의 접근")
Expand Down
6 changes: 3 additions & 3 deletions Weathy/Weathy/Sources/VCs/Record/RecordTagAddPopupVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class RecordTagAddPopupVC: UIViewController {
}

@IBAction func addBtnTap(_ sender: Any) {
if tagCount < 50{
if tagCount < 100{
self.callAddTagService()
}
else {
Expand All @@ -107,7 +107,7 @@ extension RecordTagAddPopupVC {
titleLabel.font = UIFont.SDGothicSemiBold18
titleLabel.textColor = UIColor.mintIcon
titleLabel.lineSetting(kernValue: -0.9)
titleLabel.text = "\(tagCategory) 추가하기 (\(tagCount)/50)"
titleLabel.text = "\(tagCategory) 추가하기 (\(tagCount)/100)"

subTitleLabel.font = UIFont.SDGothicRegular16
subTitleLabel.textColor = UIColor.subGrey6
Expand Down Expand Up @@ -188,7 +188,7 @@ extension RecordTagAddPopupVC {

/// 태그 개수 하나 추가, 타이틀에 반영
self.tagCount += 1
self.titleLabel.text = "\(self.tagCategory) 추가하기 (\(self.tagCount)/50)"
self.titleLabel.text = "\(self.tagCategory) 추가하기 (\(self.tagCount)/100)"
}

case .requestErr(let msg):
Expand Down
8 changes: 4 additions & 4 deletions Weathy/Weathy/Sources/VCs/Record/RecordTagDeleteVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,10 @@ extension RecordTagDeleteVC: UICollectionViewDataSource {
self.tagCount -= 1
}


DispatchQueue.main.async{
self.tagCollectionView.reloadData()
self.tagTitleCollectionView.reloadData()
if tagTitles[titleIndex].tagTab[indexPath.item].isSelected {
setTagSelected(cell: collectionView.cellForItem(at: indexPath) as! RecordTagCVC)
} else {
setTagUnselected(cell: collectionView.cellForItem(at: indexPath) as! RecordTagCVC)
}

if tagTitles[0].count >= 1 || tagTitles[1].count >= 1 || tagTitles[2].count >= 1 ||
Expand Down
29 changes: 22 additions & 7 deletions Weathy/Weathy/Sources/VCs/Record/RecordTagVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ extension RecordTagVC: UICollectionViewDataSource {
if indexPath.item == 0 {
// print("I'm chosen")

if tagTitles[titleIndex].tagTab.count <= 50 {
if tagTitles[titleIndex].tagTab.count <= 100 {
guard let dvc = self.storyboard?.instantiateViewController(identifier: "RecordTagAddPopupVC") as? RecordTagAddPopupVC else {
return
}
Expand Down Expand Up @@ -599,11 +599,16 @@ extension RecordTagVC: UICollectionViewDataSource {

}

DispatchQueue.main.async{
self.tagCollectionView.reloadData()
self.tagTitleCollectionView.reloadData()
if tagTitles[titleIndex].tagTab[indexPath.item].isSelected {
setTagSelected(cell: collectionView.cellForItem(at: indexPath) as! RecordTagCVC)
} else {
setTagUnselected(cell: collectionView.cellForItem(at: indexPath) as! RecordTagCVC)
}

UIView.performWithoutAnimation {
self.tagTitleCollectionView.reloadItems(at: [IndexPath(item: titleIndex, section: 0)])
}

if tagTitles[0].count >= 1 || tagTitles[1].count >= 1 || tagTitles[2].count >= 1 ||
tagTitles[3].count >= 1 {
self.setNextBtnActivated()
Expand Down Expand Up @@ -658,10 +663,20 @@ extension RecordTagVC: UICollectionViewDelegateFlowLayout {

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {

let cellWidth : CGFloat = collectionView.frame.width/4 - 6
let cellHeight : CGFloat = collectionView.frame.height
if collectionView == tagTitleCollectionView {
let cellWidth : CGFloat = collectionView.frame.width/4 - 6
let cellHeight : CGFloat = collectionView.frame.height

return CGSize(width: cellWidth, height: cellHeight)
} else {
if let cell = collectionView.cellForItem(at: indexPath) {
return CGSize(width: cell.frame.width, height: cell.frame.height)
}

return CGSize(width: 0, height: 0)
}


return CGSize(width: cellWidth, height: cellHeight)

}

Expand Down
7 changes: 4 additions & 3 deletions Weathy/Weathy/Sources/VCs/Record/RecordTextVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,11 @@ extension RecordTextVC {
if let loadData = data as? ModifyWeathyData {
print(loadData)
}
self.presentingViewController?.presentingViewController?.dismiss(animated: true) {
NotificationCenter.default.post(name: NSNotification.Name(rawValue: "RecordUpdated"), object: 0)
}
// self.presentingViewController?.presentingViewController?.dismiss(animated: true) {
// NotificationCenter.default.post(name: NSNotification.Name(rawValue: "RecordUpdated"), object: 0)
// }
// self.showToast(message: "웨디에 내용이 추가되었어요!")
self.exitToCalendar()

case .requestErr(let msg):
print("requestErr")
Expand Down
48 changes: 42 additions & 6 deletions Weathy/Weathy/Sources/VCs/Tabbar/TabbarVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import UIKit
import SystemConfiguration

class TabbarVC: UIViewController {
static let identifier = "TabbarVC"
Expand Down Expand Up @@ -40,6 +41,12 @@ class TabbarVC: UIViewController {
}
}

override func viewWillAppear(_ animated: Bool) {
if !isInternetAvailable() {
self.showToast(message: "네트워크 연결을 확인해주세요!")
}
}

@objc func recordSuccess(_ noti: Notification) {
selectButton(buttonName: .calendarButton)
scrollView.setContentOffset(CGPoint(x: scrollView.frame.width, y: 0), animated: false)
Expand Down Expand Up @@ -89,6 +96,29 @@ class TabbarVC: UIViewController {

}

func isInternetAvailable() -> Bool {
var zeroAddress = sockaddr_in()
zeroAddress.sin_len = UInt8(MemoryLayout.size(ofValue: zeroAddress))
zeroAddress.sin_family = sa_family_t(AF_INET)

let defaultRouteReachability = withUnsafePointer(to: &zeroAddress) {
$0.withMemoryRebound(to: sockaddr.self, capacity: 1) {zeroSockAddress in
SCNetworkReachabilityCreateWithAddress(nil, zeroSockAddress)
}
}

var flags = SCNetworkReachabilityFlags()

if !SCNetworkReachabilityGetFlags(defaultRouteReachability!, &flags) {
return false
}

let isReachable = flags.contains(.reachable)
let needsConnection = flags.contains(.connectionRequired)

return (isReachable && !needsConnection)
}

// MARK: - IBActions

/// Main 버튼
Expand All @@ -109,13 +139,19 @@ class TabbarVC: UIViewController {
self.showToast(message: "웨디는 하루에 하나만 기록할 수 있어요.")
}
else{
let nextStoryboard = UIStoryboard(name: "RecordStart", bundle: nil)
guard let vc = nextStoryboard.instantiateViewController(withIdentifier: RecordNVC.identifier) as? RecordNVC else { return }

vc.origin = .plusRecord
vc.modalPresentationStyle = .fullScreen
let appDelegate: AppDelegate = UIApplication.shared.delegate as! AppDelegate

present(vc, animated: true, completion: nil)
if let _ = appDelegate.overviewData {
let nextStoryboard = UIStoryboard(name: "RecordStart", bundle: nil)
guard let vc = nextStoryboard.instantiateViewController(withIdentifier: RecordNVC.identifier) as? RecordNVC else { return }

vc.origin = .plusRecord
vc.modalPresentationStyle = .fullScreen

present(vc, animated: true, completion: nil)
} else {
self.showToast(message: "네트워크 연결을 확인해주세요!")
}
}
}

Expand Down

0 comments on commit 11bc411

Please sign in to comment.