Selaa lähdekoodia

ios 버그 수정

서용하 6 vuotta sitten
vanhempi
commit
9c4864f7a6

+ 11 - 9
MCPlus/Adapter/PhotoCollectionViewAdapter.swift

@@ -12,7 +12,7 @@ import UIKit
 class PhotoCollectionViewAdapter: NSObject {
     var list:[(String,[Photo])]?
     //체크 확인용
-    var selectedArr = Set<IndexPath>()
+    //var selectedArr = Set<IndexPath>()
     
     var columnCount:CGFloat = UIDevice.current.userInterfaceIdiom == .pad ? 6 : 3
 }
@@ -59,7 +59,7 @@ extension PhotoCollectionViewAdapter:UICollectionViewDataSource, UICollectionVie
         cell.album.image = image
         
         //체크가 되었을 경우 표시를 다르게 한다
-        if self.selectedArr.contains(indexPath){
+        if list[indexPath.first ?? 0].1[indexPath.row].isChecked{
             cell.check.isChecked = true
         }else{
             cell.check.isChecked = false
@@ -147,13 +147,15 @@ extension PhotoCollectionViewAdapter:UICollectionViewDataSource, UICollectionVie
     
     func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
         //체크된 인덱스가 존재하는지 여부
-        let isSelected = self.selectedArr.filter({$0 == indexPath}).count > 0
-        //존재할경우 해당 아이템을 제거후 반환
-        if isSelected{
-            self.selectedArr = self.selectedArr.filter({$0 != indexPath})
-        }else{
-            self.selectedArr.insert(indexPath)
-        }
+        guard let list = list else{ return }
+        list[indexPath.first ?? 0].1[indexPath.row].isChecked.toggle()
+//        let isSelected = self.selectedArr.filter({$0 == indexPath}).count > 0
+//        //존재할경우 해당 아이템을 제거후 반환
+//        if isSelected{
+//            self.selectedArr = self.selectedArr.filter({$0 != indexPath})
+//        }else{
+//            self.selectedArr.insert(indexPath)
+//        }
         collectionView.reloadItems(at: [indexPath])
     }
     

+ 68 - 78
MCPlus/Base.lproj/Main.storyboard

@@ -7,6 +7,7 @@
         <deployment identifier="iOS"/>
         <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="Stack View standard spacing" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <customFonts key="customFonts">
@@ -189,7 +190,7 @@
                                 <rect key="frame" x="0.0" y="44" width="375" height="48"/>
                                 <subviews>
                                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="환부이미지촬영" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2Gz-wR-Tkc">
-                                        <rect key="frame" x="130" y="12.999999999999998" width="115.33333333333331" height="22.333333333333329"/>
+                                        <rect key="frame" x="127" y="13.666666666666664" width="121.33333333333331" height="21"/>
                                         <fontDescription key="fontDescription" name="NanumSquareB" family="NanumSquare" pointSize="19"/>
                                         <nil key="textColor"/>
                                         <nil key="highlightedColor"/>
@@ -227,13 +228,13 @@
                                         <rect key="frame" x="0.0" y="0.0" width="89.666666666666671" height="110"/>
                                         <subviews>
                                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="홍길동" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ZS3-lT-QK3">
-                                                <rect key="frame" x="21.333333333333329" y="17" width="47" height="21"/>
+                                                <rect key="frame" x="20.333333333333332" y="17" width="49.333333333333343" height="20"/>
                                                 <fontDescription key="fontDescription" name="NanumSquareB" family="NanumSquare" pointSize="18"/>
                                                 <nil key="textColor"/>
                                                 <nil key="highlightedColor"/>
                                             </label>
                                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fKT-hb-N98">
-                                                <rect key="frame" x="0.0" y="55" width="89.666666666666671" height="38"/>
+                                                <rect key="frame" x="0.0" y="56.666666666666657" width="89.666666666666671" height="36.333333333333343"/>
                                                 <attributedString key="attributedText">
                                                     <fragment content="내용">
                                                         <attributes>
@@ -270,13 +271,13 @@
                                         <rect key="frame" x="89.666666666666686" y="0.0" width="90" height="110"/>
                                         <subviews>
                                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="A1000100" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4un-kx-8PH">
-                                                <rect key="frame" x="4" y="17" width="82" height="21"/>
+                                                <rect key="frame" x="0.0" y="17" width="90" height="20"/>
                                                 <fontDescription key="fontDescription" name="NanumSquareB" family="NanumSquare" pointSize="18"/>
                                                 <nil key="textColor"/>
                                                 <nil key="highlightedColor"/>
                                             </label>
                                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ecd-Ow-N4X">
-                                                <rect key="frame" x="0.0" y="55" width="90" height="38"/>
+                                                <rect key="frame" x="0.0" y="56.666666666666657" width="90" height="36.333333333333343"/>
                                                 <attributedString key="attributedText">
                                                     <fragment>
                                                         <string key="content">내용 텍스트 
@@ -292,12 +293,13 @@
                                         </subviews>
                                         <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                         <constraints>
-                                            <constraint firstAttribute="trailing" secondItem="Ecd-Ow-N4X" secondAttribute="trailing" id="Ok3-pD-ons"/>
+                                            <constraint firstItem="Ecd-Ow-N4X" firstAttribute="centerX" secondItem="4un-kx-8PH" secondAttribute="centerX" id="3JV-zp-UxY"/>
+                                            <constraint firstAttribute="trailing" secondItem="Ecd-Ow-N4X" secondAttribute="trailing" id="4Mk-SP-UiH"/>
+                                            <constraint firstItem="4un-kx-8PH" firstAttribute="leading" secondItem="HsK-mM-rVT" secondAttribute="leading" id="9ll-zO-Bjh"/>
                                             <constraint firstItem="4un-kx-8PH" firstAttribute="top" secondItem="HsK-mM-rVT" secondAttribute="top" constant="17" id="QWn-IJ-DRB"/>
                                             <constraint firstAttribute="bottom" secondItem="Ecd-Ow-N4X" secondAttribute="bottom" priority="750" constant="17" id="RhN-kn-DpX"/>
-                                            <constraint firstItem="Ecd-Ow-N4X" firstAttribute="leading" secondItem="HsK-mM-rVT" secondAttribute="leading" id="kNP-cF-Uph"/>
                                             <constraint firstItem="Ecd-Ow-N4X" firstAttribute="top" relation="greaterThanOrEqual" secondItem="4un-kx-8PH" secondAttribute="bottom" constant="17" id="pbv-2w-6Wm"/>
-                                            <constraint firstItem="4un-kx-8PH" firstAttribute="centerX" secondItem="HsK-mM-rVT" secondAttribute="centerX" id="sRz-sE-1n5"/>
+                                            <constraint firstItem="Ecd-Ow-N4X" firstAttribute="leading" secondItem="HsK-mM-rVT" secondAttribute="leading" id="rra-sj-1HK"/>
                                         </constraints>
                                         <userDefinedRuntimeAttributes>
                                             <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
@@ -315,7 +317,7 @@
                                         <rect key="frame" x="179.66666666666666" y="0.0" width="89.666666666666657" height="110"/>
                                         <subviews>
                                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mtS-Sd-L2M">
-                                                <rect key="frame" x="0.0" y="55" width="89.666666666666671" height="38"/>
+                                                <rect key="frame" x="0.0" y="56.666666666666657" width="89.666666666666671" height="36.333333333333343"/>
                                                 <attributedString key="attributedText"/>
                                                 <nil key="highlightedColor"/>
                                             </label>
@@ -342,13 +344,13 @@
                                         <rect key="frame" x="269.33333333333331" y="0.0" width="89.666666666666686" height="110"/>
                                         <subviews>
                                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="20 / M" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="KLU-Vc-9DU">
-                                                <rect key="frame" x="18.666666666666686" y="17" width="52" height="21"/>
+                                                <rect key="frame" x="17.666666666666689" y="17" width="54.333333333333343" height="20"/>
                                                 <fontDescription key="fontDescription" name="NanumSquareB" family="NanumSquare" pointSize="18"/>
                                                 <nil key="textColor"/>
                                                 <nil key="highlightedColor"/>
                                             </label>
                                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1NT-Lz-aBT">
-                                                <rect key="frame" x="0.0" y="55" width="89.666666666666671" height="38"/>
+                                                <rect key="frame" x="0.0" y="56.666666666666657" width="89.666666666666671" height="36.333333333333343"/>
                                                 <attributedString key="attributedText">
                                                     <fragment>
                                                         <string key="content">내용 텍스트 
@@ -386,7 +388,6 @@
                                 <color key="backgroundColor" red="0.93333333333333335" green="0.93333333333333335" blue="0.90196078431372551" alpha="1" colorSpace="calibratedRGB"/>
                                 <constraints>
                                     <constraint firstItem="1NT-Lz-aBT" firstAttribute="centerY" secondItem="mtS-Sd-L2M" secondAttribute="centerY" id="KQ3-8H-kf0"/>
-                                    <constraint firstItem="mtS-Sd-L2M" firstAttribute="centerY" secondItem="Ecd-Ow-N4X" secondAttribute="centerY" id="TF5-Ku-P3S"/>
                                     <constraint firstAttribute="height" priority="250" constant="100" id="X5a-ED-z7e"/>
                                     <constraint firstItem="fKT-hb-N98" firstAttribute="centerY" secondItem="Ecd-Ow-N4X" secondAttribute="centerY" id="zfr-GM-lhF"/>
                                 </constraints>
@@ -397,10 +398,10 @@
                                 </userDefinedRuntimeAttributes>
                             </stackView>
                             <view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="x3X-mc-6dm">
-                                <rect key="frame" x="8" y="208" width="359" height="43"/>
+                                <rect key="frame" x="8" y="208" width="359" height="42"/>
                                 <subviews>
                                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="2018-10-10 외래 or 입원, 진료과" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mLD-MC-fGV">
-                                        <rect key="frame" x="16" y="11" width="327" height="21"/>
+                                        <rect key="frame" x="16" y="11" width="327" height="20"/>
                                         <fontDescription key="fontDescription" name="NanumSquareB" family="NanumSquare" pointSize="18"/>
                                         <color key="textColor" red="0.39215686274509803" green="0.60392156862745094" blue="0.9882352941176471" alpha="1" colorSpace="calibratedRGB"/>
                                         <nil key="highlightedColor"/>
@@ -420,33 +421,36 @@
                                 </userDefinedRuntimeAttributes>
                             </view>
                             <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Twe-8h-6Au">
-                                <rect key="frame" x="0.0" y="251" width="375" height="527"/>
+                                <rect key="frame" x="0.0" y="250" width="375" height="528"/>
                                 <subviews>
                                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Dat-yv-K6v">
-                                        <rect key="frame" x="0.0" y="10" width="375" height="517"/>
+                                        <rect key="frame" x="0.0" y="10" width="375" height="518"/>
                                         <color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                     </view>
                                     <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="camera_lo" translatesAutoresizingMaskIntoConstraints="NO" id="ME9-uU-UZ3">
-                                        <rect key="frame" x="92" y="173" width="191" height="191"/>
+                                        <rect key="frame" x="92" y="173.66666666666669" width="191" height="191"/>
                                         <constraints>
                                             <constraint firstAttribute="width" secondItem="ME9-uU-UZ3" secondAttribute="height" multiplier="1:1" id="DoM-A7-iEK"/>
                                         </constraints>
                                     </imageView>
-                                    <stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="CvO-ai-fc0">
-                                        <rect key="frame" x="22" y="471" width="331" height="50"/>
+                                    <stackView opaque="NO" contentMode="scaleToFill" distribution="equalCentering" spacingType="standard" translatesAutoresizingMaskIntoConstraints="NO" id="CvO-ai-fc0">
+                                        <rect key="frame" x="22" y="472" width="331" height="50"/>
                                         <subviews>
                                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="944-gk-cQs">
-                                                <rect key="frame" x="0.0" y="0.0" width="97" height="50"/>
+                                                <rect key="frame" x="0.0" y="0.0" width="112.66666666666667" height="50"/>
                                                 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                                 <state key="normal" image="f_btn_list"/>
                                             </button>
                                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="yhJ-JG-Awk">
-                                                <rect key="frame" x="117" y="0.0" width="97" height="50"/>
+                                                <rect key="frame" x="120.66666666666666" y="0.0" width="90" height="50"/>
                                                 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                                <constraints>
+                                                    <constraint firstAttribute="width" secondItem="yhJ-JG-Awk" secondAttribute="height" multiplier="9:5" id="Seb-JO-wtA"/>
+                                                </constraints>
                                                 <state key="normal" image="f_btn_camera"/>
                                             </button>
                                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Wva-cH-tSz">
-                                                <rect key="frame" x="234" y="0.0" width="97" height="50"/>
+                                                <rect key="frame" x="218.66666666666666" y="0.0" width="112.33333333333334" height="50"/>
                                                 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                                 <state key="normal" image="f_btn_back"/>
                                             </button>
@@ -552,7 +556,7 @@
                                         </constraints>
                                     </view>
                                     <view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="r5V-JC-o3A">
-                                        <rect key="frame" x="8" y="48" width="359" height="110"/>
+                                        <rect key="frame" x="8" y="48" width="359" height="166"/>
                                         <color key="backgroundColor" red="0.94901960780000005" green="0.95294117649999999" blue="0.95686274510000002" alpha="1" colorSpace="calibratedRGB"/>
                                         <userDefinedRuntimeAttributes>
                                             <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
@@ -561,10 +565,10 @@
                                         </userDefinedRuntimeAttributes>
                                     </view>
                                     <stackView opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" distribution="fillEqually" translatesAutoresizingMaskIntoConstraints="NO" id="kno-vo-6Tg">
-                                        <rect key="frame" x="8" y="48" width="359" height="110"/>
+                                        <rect key="frame" x="8" y="48" width="359" height="166"/>
                                         <subviews>
                                             <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Go7-gm-l99">
-                                                <rect key="frame" x="0.0" y="0.0" width="89.666666666666671" height="110"/>
+                                                <rect key="frame" x="0.0" y="0.0" width="89.666666666666671" height="166"/>
                                                 <subviews>
                                                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="홍길동" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="caU-Qr-psb">
                                                         <rect key="frame" x="21.333333333333329" y="17" width="47" height="21"/>
@@ -573,7 +577,7 @@
                                                         <nil key="highlightedColor"/>
                                                     </label>
                                                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qe6-Vy-qzG">
-                                                        <rect key="frame" x="0.0" y="55" width="89.666666666666671" height="38"/>
+                                                        <rect key="frame" x="0.0" y="111" width="89.666666666666671" height="38"/>
                                                         <attributedString key="attributedText">
                                                             <fragment content="내용">
                                                                 <attributes>
@@ -607,7 +611,7 @@
                                                 </userDefinedRuntimeAttributes>
                                             </view>
                                             <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="drc-lw-GXk">
-                                                <rect key="frame" x="89.666666666666686" y="0.0" width="90" height="110"/>
+                                                <rect key="frame" x="89.666666666666686" y="0.0" width="90" height="166"/>
                                                 <subviews>
                                                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="A1000100" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wHc-QH-9WF">
                                                         <rect key="frame" x="4" y="17" width="82" height="21"/>
@@ -616,7 +620,7 @@
                                                         <nil key="highlightedColor"/>
                                                     </label>
                                                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Vg7-0U-jun">
-                                                        <rect key="frame" x="0.0" y="55" width="90" height="38"/>
+                                                        <rect key="frame" x="0.0" y="111" width="90" height="38"/>
                                                         <attributedString key="attributedText">
                                                             <fragment>
                                                                 <string key="content">내용 텍스트 
@@ -652,10 +656,10 @@
                                                 </userDefinedRuntimeAttributes>
                                             </view>
                                             <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9DH-3X-lFD">
-                                                <rect key="frame" x="179.66666666666666" y="0.0" width="89.666666666666657" height="110"/>
+                                                <rect key="frame" x="179.66666666666666" y="0.0" width="89.666666666666657" height="166"/>
                                                 <subviews>
                                                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1is-iz-dvA">
-                                                        <rect key="frame" x="0.0" y="55" width="89.666666666666671" height="38"/>
+                                                        <rect key="frame" x="0.0" y="111" width="89.666666666666671" height="38"/>
                                                         <attributedString key="attributedText"/>
                                                         <nil key="highlightedColor"/>
                                                     </label>
@@ -679,7 +683,7 @@
                                                 </userDefinedRuntimeAttributes>
                                             </view>
                                             <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="TAQ-4o-dJk">
-                                                <rect key="frame" x="269.33333333333331" y="0.0" width="89.666666666666686" height="110"/>
+                                                <rect key="frame" x="269.33333333333331" y="0.0" width="89.666666666666686" height="166"/>
                                                 <subviews>
                                                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="20 / M" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Bv4-jp-Xep">
                                                         <rect key="frame" x="18.666666666666686" y="17" width="52" height="21"/>
@@ -688,7 +692,7 @@
                                                         <nil key="highlightedColor"/>
                                                     </label>
                                                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="B3J-gw-Uea">
-                                                        <rect key="frame" x="0.0" y="55" width="89.666666666666671" height="38"/>
+                                                        <rect key="frame" x="0.0" y="111" width="89.666666666666671" height="38"/>
                                                         <attributedString key="attributedText">
                                                             <fragment>
                                                                 <string key="content">내용 텍스트 
@@ -737,7 +741,7 @@
                                         </userDefinedRuntimeAttributes>
                                     </stackView>
                                     <collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="jxM-6x-cdr">
-                                        <rect key="frame" x="8" y="166" width="359" height="478"/>
+                                        <rect key="frame" x="8" y="222" width="359" height="422"/>
                                         <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                         <collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="40" minimumInteritemSpacing="10" id="RHq-rA-QGF">
                                             <size key="itemSize" width="50" height="50"/>
@@ -894,54 +898,40 @@
                                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="o06-9o-mAW">
                                         <rect key="frame" x="8" y="684" width="359" height="50"/>
                                         <subviews>
-                                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Mfw-5C-ES1">
-                                                <rect key="frame" x="159" y="0.0" width="50" height="50"/>
-                                                <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
-                                                <constraints>
-                                                    <constraint firstAttribute="width" secondItem="Mfw-5C-ES1" secondAttribute="height" multiplier="1:1" id="bZS-H3-215"/>
-                                                </constraints>
-                                                <state key="normal" image="f_btn_a_camera"/>
-                                            </button>
-                                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Kib-cX-gbE">
-                                                <rect key="frame" x="209" y="0.0" width="50" height="50"/>
-                                                <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
-                                                <constraints>
-                                                    <constraint firstAttribute="width" secondItem="Kib-cX-gbE" secondAttribute="height" multiplier="1:1" id="7pe-30-jHw"/>
-                                                </constraints>
-                                                <state key="normal" image="f_btn_a_upload"/>
-                                            </button>
-                                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="bCe-v6-zcW">
-                                                <rect key="frame" x="259" y="0.0" width="50" height="50"/>
-                                                <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
-                                                <constraints>
-                                                    <constraint firstAttribute="width" secondItem="bCe-v6-zcW" secondAttribute="height" multiplier="1:1" id="wzu-0k-YBL"/>
-                                                </constraints>
-                                                <state key="normal" image="f_btn_a_del"/>
-                                            </button>
-                                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Lat-0u-BFo">
-                                                <rect key="frame" x="309" y="0.0" width="50" height="50"/>
-                                                <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
-                                                <constraints>
-                                                    <constraint firstAttribute="width" secondItem="Lat-0u-BFo" secondAttribute="height" multiplier="1:1" id="aLI-hI-oLK"/>
-                                                </constraints>
-                                                <state key="normal" image="f_btn_a_exit"/>
-                                            </button>
+                                            <stackView opaque="NO" contentMode="scaleToFill" distribution="equalSpacing" translatesAutoresizingMaskIntoConstraints="NO" id="K9h-ae-LbQ">
+                                                <rect key="frame" x="0.0" y="0.0" width="359" height="50"/>
+                                                <subviews>
+                                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Kib-cX-gbE">
+                                                        <rect key="frame" x="0.0" y="0.0" width="16" height="50"/>
+                                                        <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                                        <state key="normal" image="baseline_cloud"/>
+                                                    </button>
+                                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Mfw-5C-ES1">
+                                                        <rect key="frame" x="137.66666666666666" y="0.0" width="50" height="50"/>
+                                                        <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                                        <constraints>
+                                                            <constraint firstAttribute="width" secondItem="Mfw-5C-ES1" secondAttribute="height" multiplier="1:1" id="bZS-H3-215"/>
+                                                        </constraints>
+                                                        <state key="normal" image="f_btn_a_camera"/>
+                                                    </button>
+                                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="bCe-v6-zcW">
+                                                        <rect key="frame" x="309" y="0.0" width="50" height="50"/>
+                                                        <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                                        <constraints>
+                                                            <constraint firstAttribute="width" secondItem="bCe-v6-zcW" secondAttribute="height" multiplier="1:1" id="wzu-0k-YBL"/>
+                                                        </constraints>
+                                                        <state key="normal" image="f_btn_a_del"/>
+                                                    </button>
+                                                </subviews>
+                                            </stackView>
                                         </subviews>
                                         <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                         <constraints>
-                                            <constraint firstItem="Lat-0u-BFo" firstAttribute="top" secondItem="o06-9o-mAW" secondAttribute="top" id="2I5-fR-tZb"/>
-                                            <constraint firstAttribute="bottom" secondItem="Mfw-5C-ES1" secondAttribute="bottom" id="2hD-f1-6G1"/>
-                                            <constraint firstItem="bCe-v6-zcW" firstAttribute="leading" secondItem="Kib-cX-gbE" secondAttribute="trailing" id="2yf-fr-uDF"/>
-                                            <constraint firstAttribute="bottom" secondItem="Lat-0u-BFo" secondAttribute="bottom" id="55g-VX-oVw"/>
-                                            <constraint firstItem="Kib-cX-gbE" firstAttribute="top" secondItem="o06-9o-mAW" secondAttribute="top" id="GPe-qA-WN9"/>
-                                            <constraint firstItem="Mfw-5C-ES1" firstAttribute="top" secondItem="o06-9o-mAW" secondAttribute="top" id="QG2-Jf-PXh"/>
-                                            <constraint firstAttribute="trailing" secondItem="Lat-0u-BFo" secondAttribute="trailing" id="Y4b-MT-xev"/>
-                                            <constraint firstAttribute="bottom" secondItem="bCe-v6-zcW" secondAttribute="bottom" id="emH-mo-B8V"/>
-                                            <constraint firstItem="Kib-cX-gbE" firstAttribute="leading" secondItem="Mfw-5C-ES1" secondAttribute="trailing" id="ffM-Gl-mm4"/>
-                                            <constraint firstAttribute="bottom" secondItem="Kib-cX-gbE" secondAttribute="bottom" id="lAW-2h-5Y5"/>
+                                            <constraint firstAttribute="trailing" secondItem="K9h-ae-LbQ" secondAttribute="trailing" id="1fT-K9-uY0"/>
+                                            <constraint firstAttribute="bottom" secondItem="K9h-ae-LbQ" secondAttribute="bottom" id="CR0-hj-dQX"/>
+                                            <constraint firstItem="K9h-ae-LbQ" firstAttribute="top" secondItem="o06-9o-mAW" secondAttribute="top" id="eEX-Cr-OVP"/>
                                             <constraint firstAttribute="height" constant="50" id="m9f-aQ-Ii0"/>
-                                            <constraint firstItem="Lat-0u-BFo" firstAttribute="leading" secondItem="bCe-v6-zcW" secondAttribute="trailing" id="o7m-QI-yOH"/>
-                                            <constraint firstItem="bCe-v6-zcW" firstAttribute="top" secondItem="o06-9o-mAW" secondAttribute="top" id="yjm-0f-Iju"/>
+                                            <constraint firstItem="K9h-ae-LbQ" firstAttribute="leading" secondItem="o06-9o-mAW" secondAttribute="leading" id="tj9-ni-zaE"/>
                                         </constraints>
                                     </view>
                                 </subviews>
@@ -988,7 +978,6 @@
                         <outlet property="allUserAlbumCheck" destination="vZ9-I9-ilh" id="1Ho-qV-RRd"/>
                         <outlet property="allUserAlbumLabel" destination="5Bj-pK-noF" id="nAB-ww-HN9"/>
                         <outlet property="cameraButton" destination="Mfw-5C-ES1" id="fdI-ee-YgL"/>
-                        <outlet property="cancelButton" destination="Lat-0u-BFo" id="ac4-hb-Azl"/>
                         <outlet property="closeButton" destination="FQZ-R2-nMR" id="oul-w8-NcW"/>
                         <outlet property="deleteButton" destination="bCe-v6-zcW" id="60s-Nl-A9a"/>
                         <outlet property="deptNmLabel" destination="qe6-Vy-qzG" id="ofo-b1-JDK"/>
@@ -1420,6 +1409,7 @@
     </scenes>
     <resources>
         <image name="backward" width="30" height="30"/>
+        <image name="baseline_cloud" width="36" height="36"/>
         <image name="camera_lo" width="660" height="660"/>
         <image name="chk_default" width="49" height="48"/>
         <image name="close" width="30" height="30"/>

+ 2 - 2
MCPlus/CustomFiles/kunkuk/Info.plist

@@ -15,7 +15,7 @@
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
-	<string>24</string>
+	<string>25</string>
 	<key>CFBundleURLTypes</key>
 	<array>
 		<dict>
@@ -30,7 +30,7 @@
 		</dict>
 	</array>
 	<key>CFBundleVersion</key>
-	<string>24</string>
+	<string>25</string>
 	<key>DomainName</key>
 	<string>https://app.hyumc.com/</string>
 	<key>Fabric</key>

+ 21 - 0
MCPlus/Images.xcassets/baseline_cloud.imageset/Contents.json

@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "baseline_cloud.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
MCPlus/Images.xcassets/baseline_cloud.imageset/baseline_cloud.png


+ 1 - 0
MCPlus/Model/Photo.swift

@@ -14,6 +14,7 @@ class Photo: CustomStringConvertible, Codable {
     var date:String?
     var key:String?
     var isSended:Bool = false
+    var isChecked:Bool = false
 }
 
 extension Photo{

+ 12 - 0
MCPlus/ViewControllers/CustomCameraViewController.swift

@@ -117,6 +117,8 @@ class CustomCameraViewController: UIViewController {
 extension CustomCameraViewController{
     override func viewDidLoad() {
         super.viewDidLoad()
+        
+        
     
         session = AVCaptureSession()
         session!.sessionPreset = AVCaptureSession.Preset.photo
@@ -160,6 +162,16 @@ extension CustomCameraViewController{
     override func viewDidAppear(_ animated: Bool) {
         super.viewDidAppear(animated)
         
+        AVCaptureDevice.requestAccess(for: AVMediaType.video, completionHandler: { (granted: Bool) -> Void in
+            if granted == true {
+                // User granted
+            } else {
+                // User rejected
+                self.showAlert("카메라 권한이 없습니다. 권한에 동의해 주세요.", "", "확인", nil, { [weak self](action) in
+                    self?.finish()
+                })
+            }
+        })
     }
     
     override func viewDidLayoutSubviews() {

+ 58 - 58
MCPlus/ViewControllers/LockScreen/ScreenLockViewController.swift

@@ -162,64 +162,64 @@ extension ScreenLockViewController{
     
     override func viewWillAppear(_ animated: Bool) {
         
-        guard #available(iOS 11.0, *) else{ return }
-        
-        //지문인식
-        let context = LAContext()
-        var error2:NSError?
-        guard context.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &error2) else {
-            return
-        }
-        
-        if context.biometryType == .faceID{
-            return
-        }
-        
-        let error:AutoreleasingUnsafeMutablePointer<NSError?>? = nil
-
-        let temp = self.userDefaults.object(forKey: "fingerprint") as? String
-        var isSwitchOn = true
-
-        if let _temp = temp{
-            isSwitchOn = temp != "OFF"
-        }else{
-            // 지문입력 받음
-        }
-
-        let lockScreenDao = LockScreenDAO.sharedInstance
-        print("lockScreenDao.pwInputType >>>>>>>>>>>>> \(lockScreenDao.pwInputType)")
-
-        // 지문입력은 락을 풀때만 사용해야 한다.
-        var isUnlockStatus = false
-
-        if lockScreenDao.pwInputType == LockScreenDAO.PASSWORD_INPUT_TYPE(rawValue: 2){
-            isUnlockStatus = true
-        }
-
-        if isUnlockStatus, isSwitchOn, context.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: error){
-            context.evaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, localizedReason: "지문을 입력해주세요") { (success, error) in
-                if error != nil{
-                    print("Touch 지원하지 않음")
-                    return
-                }
-
-                guard success == true else{
-                    print("@@@@실패")
-                    return
-                }
-
-                print("@@@@성공") // 지문 인증 성공했을때
-                let now = Date()
-                let dateFormatString = "yyyy-MM-dd hh:mm:ss"
-                let date = now.fromString(format: dateFormatString)
-                print(date)
-
-                // String으로 저장
-                self.userDefaults.set(date, forKey: "fingerprintAuthTime")
-                self.dismissSelf()
-
-            }
-        }
+//        guard #available(iOS 11.0, *) else{ return }
+//
+//        //지문인식
+//        let context = LAContext()
+//        var error2:NSError?
+//        guard context.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &error2) else {
+//            return
+//        }
+//
+//        if context.biometryType == .faceID{
+//            return
+//        }
+//
+//        let error:AutoreleasingUnsafeMutablePointer<NSError?>? = nil
+//
+//        let temp = self.userDefaults.object(forKey: "fingerprint") as? String
+//        var isSwitchOn = true
+//
+//        if let _temp = temp{
+//            isSwitchOn = temp != "OFF"
+//        }else{
+//            // 지문입력 받음
+//        }
+//
+//        let lockScreenDao = LockScreenDAO.sharedInstance
+//        print("lockScreenDao.pwInputType >>>>>>>>>>>>> \(lockScreenDao.pwInputType)")
+//
+//        // 지문입력은 락을 풀때만 사용해야 한다.
+//        var isUnlockStatus = false
+//
+//        if lockScreenDao.pwInputType == LockScreenDAO.PASSWORD_INPUT_TYPE(rawValue: 2){
+//            isUnlockStatus = true
+//        }
+//
+//        if isUnlockStatus, isSwitchOn, context.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: error){
+//            context.evaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, localizedReason: "지문을 입력해주세요") { (success, error) in
+//                if error != nil{
+//                    print("Touch 지원하지 않음")
+//                    return
+//                }
+//
+//                guard success == true else{
+//                    print("@@@@실패")
+//                    return
+//                }
+//
+//                print("@@@@성공") // 지문 인증 성공했을때
+//                let now = Date()
+//                let dateFormatString = "yyyy-MM-dd hh:mm:ss"
+//                let date = now.fromString(format: dateFormatString)
+//                print(date)
+//
+//                // String으로 저장
+//                self.userDefaults.set(date, forKey: "fingerprintAuthTime")
+//                self.dismissSelf()
+//
+//            }
+//        }
         
     }
     

+ 53 - 34
MCPlus/ViewControllers/PhotoViewController.swift

@@ -133,6 +133,8 @@ class PhotoViewController: UIViewController{
     var list = MutableProperty<[(String,[Photo])]?>(nil)
     
     static var reUploadItem = MutableProperty<Photo?>(nil)
+    
+    var allSelectCheckFlag = MutableProperty<Bool>(false)
 
     var successCount = 0
     var failCount = 0
@@ -163,6 +165,17 @@ extension PhotoViewController{
             self?.uploadItem(value)
         }
         
+        allSelectCheckFlag.signal.observe { [weak self](item) in
+            guard let value = item.value as? Bool else{ return }
+            guard let list = self?.adapter.list else{ return }
+            for item in list{
+                for item2 in item.1{
+                    item2.isChecked = value
+                }
+            }
+            self?.photoCollectionView.reloadData()
+        }
+        
     }
     
     override func viewWillLayoutSubviews() {
@@ -182,21 +195,24 @@ extension PhotoViewController{
     func okAction(){
         successCount = 0
         failCount = 0
-        guard self.adapter.selectedArr.count > 0 else{
-            self.showAlert("파일을 한 개 이상 선택해주세요", "", "확인")
+        let isCheckCount = self.adapter.list?.filter({
+            $0.1.filter({$0.isChecked}).count > 0
+        }).count ?? 0
+        guard isCheckCount > 0 else{
+//            self.showAlert("파일을 한 개 이상 선택해주세요", "", "확인")
             return
         }
         //비동기화 통신코드 동기화 구현 필요
-        for indexPath in self.adapter.selectedArr{
-            guard let list = self.list.value else{ return }
-            
-            let photos = list[indexPath.first ?? 0].1
-            let photo = photos[indexPath.row]
-            //선택된 사진이 이미 보낸적이 있다면 업데이트하지 않는다
-            if photo.isSended == false{
-                self.uploadItem(photo)
+        guard let list = self.adapter.list else{ return }
+        for item in list{
+            for item2 in item.1{
+                //선택된 사진이 이미 보낸적이 있다면 업데이트하지 않는다
+                if item2.isChecked && item2.isSended == false{
+                    self.uploadItem(item2)
+                }else{
+                    continue
+                }
             }
-            self.adapter.selectedArr = self.adapter.selectedArr.filter({$0 != indexPath})
         }
         
         if let parent = self.parent as? PictureViewController{
@@ -255,26 +271,31 @@ extension PhotoViewController{
     
     //선택된 사진 삭제
     func deleteAction(){
-        guard self.adapter.selectedArr.count > 0 else{
-            self.showAlert("파일을 한 개 이상 선택해주세요", "", "확인")
+        let isCheckCount = self.adapter.list?.filter({
+            $0.1.filter({$0.isChecked}).count > 0
+        }).count ?? 0
+        guard isCheckCount > 0 else{
+//            self.showAlert("파일을 한 개 이상 선택해주세요", "", "확인")
             return
         }
         
         self.showAlert("정말 삭제하시겠습니까?", "", "확인", "취소", { [weak self] (action) in
             guard let `self` = self else{ return }
-            for indexPath in self.adapter.selectedArr{
-                guard let list = self.list.value else{ return }
-                
-                let photos = list[indexPath.first ?? 0].1
-                let photo = photos[indexPath.row]
-                do {
-                    if let file = photo.file{
-                        self.fileDelete(file: file)
+            guard let list = self.adapter.list else{ return }
+            for item in list{
+                for item2 in item.1{
+                    if item2.isChecked{
+                        do {
+                            if let file = item2.file{
+                                self.fileDelete(file: file)
+                            }
+                            
+                            let _ = item2.delete()
+                        }
+                    }else{
+                        continue
                     }
-                    
-                    let _ = photo.delete()
                 }
-                self.adapter.selectedArr = self.adapter.selectedArr.filter({$0 != indexPath})
             }
             
             self.reloadTable()
@@ -315,6 +336,12 @@ extension PhotoViewController{
         }else{
             self.list.value = Photo.allList(user: user)
         }
+        
+        if self.allSelectLabel.text == "전체선택"{
+            self.allSelectCheckFlag.value = false
+        }else{
+            self.allSelectCheckFlag.value = true
+        }
     }
     
     //커스텀 카메라 호출
@@ -335,20 +362,12 @@ extension PhotoViewController{
         if self.allSelectLabel.text == "전체선택"{
             self.allSelectLabel.text = "선택해제"
             self.allSelectCheck.isChecked = true
-            
-            for i in 0..<section{
-                let row = self.photoCollectionView.numberOfItems(inSection: i)
-                for j in 0..<row{
-                    selectedArr.insert(IndexPath(row: j, section: i))
-                }
-            }
+            self.allSelectCheckFlag.value = true
         }else{
             self.allSelectLabel.text = "전체선택"
             self.allSelectCheck.isChecked = false
+            self.allSelectCheckFlag.value = false
         }
-        
-        self.adapter.selectedArr = selectedArr
-        self.photoCollectionView.reloadData()
     }
     
     //전체앨범 or 선택환자