Jason Lee 10 år sedan
förälder
incheckning
9df0852a37

+ 12 - 12
kneet2.xcodeproj/project.pbxproj

@@ -1670,7 +1670,7 @@
 				ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				DEBUG_INFORMATION_FORMAT = dwarf;
-				ENABLE_BITCODE = NO;
+				ENABLE_BITCODE = YES;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
 					"$(PROJECT_DIR)",
@@ -1684,7 +1684,7 @@
 				INFOPLIST_FILE = kneet2/Info.plist;
 				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
-				ONLY_ACTIVE_ARCH = NO;
+				ONLY_ACTIVE_ARCH = YES;
 				PRODUCT_BUNDLE_IDENTIFIER = com.ntels.kneet2;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 			};
@@ -1697,7 +1697,7 @@
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
-				ENABLE_BITCODE = NO;
+				ENABLE_BITCODE = YES;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
 					"$(PROJECT_DIR)",
@@ -1711,7 +1711,7 @@
 				INFOPLIST_FILE = kneet2/Info.plist;
 				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
-				ONLY_ACTIVE_ARCH = YES;
+				ONLY_ACTIVE_ARCH = NO;
 				PRODUCT_BUNDLE_IDENTIFIER = com.ntels.kneet2;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 			};
@@ -1723,9 +1723,9 @@
 			buildSettings = {
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
-				CODE_SIGN_IDENTITY = "";
-				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
-				ENABLE_BITCODE = NO;
+				CODE_SIGN_IDENTITY = "iPhone Distribution";
+				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: nTels (SJUCW4VV44)";
+				ENABLE_BITCODE = YES;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
 					"$(PROJECT_DIR)",
@@ -1739,7 +1739,7 @@
 				INFOPLIST_FILE = kneet2/Info.plist;
 				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
-				ONLY_ACTIVE_ARCH = YES;
+				ONLY_ACTIVE_ARCH = NO;
 				PRODUCT_BUNDLE_IDENTIFIER = com.ntels.kneet2;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE = "34b05e0e-24a8-4ad6-a44d-6a23686f9bb1";
@@ -1752,9 +1752,9 @@
 			buildSettings = {
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
-				CODE_SIGN_IDENTITY = "";
-				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
-				ENABLE_BITCODE = NO;
+				CODE_SIGN_IDENTITY = "iPhone Distribution";
+				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: nTels (SJUCW4VV44)";
+				ENABLE_BITCODE = YES;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
 					"$(PROJECT_DIR)",
@@ -1768,7 +1768,7 @@
 				INFOPLIST_FILE = kneet2/Info.plist;
 				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
-				ONLY_ACTIVE_ARCH = YES;
+				ONLY_ACTIVE_ARCH = NO;
 				PRODUCT_BUNDLE_IDENTIFIER = com.ntels.kneet2;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE = "e6b53037-cdb3-4127-b538-61d7bcf2a910";

+ 25 - 8
kneet2/Base.lproj/HomeMember.storyboard

@@ -236,7 +236,7 @@
                                                 <rect key="frame" x="0.0" y="0.0" width="50" height="50"/>
                                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                                 <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
-                                                    <rect key="frame" x="0.0" y="0.0" width="50" height="50"/>
+                                                    <rect key="frame" x="0.0" y="0.0" width="160" height="160"/>
                                                     <autoresizingMask key="autoresizingMask"/>
                                                     <subviews>
                                                         <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="457-Hm-o4g" userLabel="View - Container">
@@ -407,7 +407,7 @@
                                                 <rect key="frame" x="0.0" y="0.0" width="50" height="50"/>
                                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                                 <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
-                                                    <rect key="frame" x="0.0" y="0.0" width="50" height="50"/>
+                                                    <rect key="frame" x="0.0" y="0.0" width="160" height="160"/>
                                                     <autoresizingMask key="autoresizingMask"/>
                                                     <subviews>
                                                         <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="rPe-eM-rB6" userLabel="View - Container">
@@ -557,6 +557,7 @@
                                             <constraints>
                                                 <constraint firstItem="ikh-Ij-LRr" firstAttribute="leading" secondItem="41f-mD-her" secondAttribute="leading" id="Fcf-0o-M2p"/>
                                                 <constraint firstAttribute="trailing" secondItem="ikh-Ij-LRr" secondAttribute="trailing" id="K5z-SR-QUg"/>
+                                                <constraint firstItem="ikh-Ij-LRr" firstAttribute="width" secondItem="41f-mD-her" secondAttribute="width" id="P4F-yJ-ylF"/>
                                                 <constraint firstAttribute="bottom" secondItem="ikh-Ij-LRr" secondAttribute="bottom" id="ZqE-Qm-ydz"/>
                                                 <constraint firstItem="ikh-Ij-LRr" firstAttribute="top" secondItem="41f-mD-her" secondAttribute="top" id="uJl-xp-0eh"/>
                                             </constraints>
@@ -567,6 +568,7 @@
                                                 <mask key="constraints">
                                                     <exclude reference="Fcf-0o-M2p"/>
                                                     <exclude reference="K5z-SR-QUg"/>
+                                                    <exclude reference="P4F-yJ-ylF"/>
                                                     <exclude reference="ZqE-Qm-ydz"/>
                                                     <exclude reference="uJl-xp-0eh"/>
                                                 </mask>
@@ -578,6 +580,7 @@
                                                 <mask key="constraints">
                                                     <include reference="Fcf-0o-M2p"/>
                                                     <include reference="K5z-SR-QUg"/>
+                                                    <include reference="P4F-yJ-ylF"/>
                                                     <include reference="ZqE-Qm-ydz"/>
                                                     <include reference="uJl-xp-0eh"/>
                                                 </mask>
@@ -591,6 +594,7 @@
                                 <animations/>
                                 <constraints>
                                     <constraint firstAttribute="trailing" secondItem="l0a-wm-olW" secondAttribute="trailing" id="Db1-FS-mYm"/>
+                                    <constraint firstItem="1BG-fl-tMC" firstAttribute="width" secondItem="cgw-Um-cGw" secondAttribute="width" id="DfL-AH-oOg"/>
                                     <constraint firstAttribute="bottom" secondItem="1BG-fl-tMC" secondAttribute="bottom" constant="70" id="O5p-VA-klX"/>
                                     <constraint firstItem="1BG-fl-tMC" firstAttribute="leading" secondItem="cgw-Um-cGw" secondAttribute="leading" id="XdC-zV-cUI"/>
                                     <constraint firstAttribute="trailing" secondItem="1BG-fl-tMC" secondAttribute="trailing" id="YHl-t1-60r"/>
@@ -604,13 +608,14 @@
                                         <exclude reference="1BG-fl-tMC"/>
                                     </mask>
                                     <mask key="constraints">
+                                        <exclude reference="Db1-FS-mYm"/>
+                                        <exclude reference="hyE-w4-aQ9"/>
+                                        <exclude reference="tth-uM-k5b"/>
+                                        <exclude reference="DfL-AH-oOg"/>
                                         <exclude reference="O5p-VA-klX"/>
                                         <exclude reference="XdC-zV-cUI"/>
                                         <exclude reference="YHl-t1-60r"/>
                                         <exclude reference="bKl-6r-OUv"/>
-                                        <exclude reference="Db1-FS-mYm"/>
-                                        <exclude reference="hyE-w4-aQ9"/>
-                                        <exclude reference="tth-uM-k5b"/>
                                     </mask>
                                 </variation>
                                 <variation key="heightClass=regular-widthClass=compact">
@@ -619,13 +624,14 @@
                                         <include reference="1BG-fl-tMC"/>
                                     </mask>
                                     <mask key="constraints">
+                                        <include reference="Db1-FS-mYm"/>
+                                        <include reference="hyE-w4-aQ9"/>
+                                        <include reference="tth-uM-k5b"/>
+                                        <exclude reference="DfL-AH-oOg"/>
                                         <include reference="O5p-VA-klX"/>
                                         <include reference="XdC-zV-cUI"/>
                                         <include reference="YHl-t1-60r"/>
                                         <include reference="bKl-6r-OUv"/>
-                                        <include reference="Db1-FS-mYm"/>
-                                        <include reference="hyE-w4-aQ9"/>
-                                        <include reference="tth-uM-k5b"/>
                                     </mask>
                                 </variation>
                             </view>
@@ -636,8 +642,19 @@
                             <constraint firstItem="cgw-Um-cGw" firstAttribute="top" secondItem="FRX-jq-RY9" secondAttribute="bottom" constant="-20" id="3gE-oH-Ndo"/>
                             <constraint firstItem="uin-sv-GXR" firstAttribute="top" secondItem="cgw-Um-cGw" secondAttribute="bottom" id="Rbk-2o-wXs"/>
                             <constraint firstItem="cgw-Um-cGw" firstAttribute="leading" secondItem="bEt-FP-UIs" secondAttribute="leading" id="XCL-yV-xkb"/>
+                            <constraint firstItem="cgw-Um-cGw" firstAttribute="width" secondItem="bEt-FP-UIs" secondAttribute="width" id="fsj-vK-S8S"/>
                             <constraint firstAttribute="trailing" secondItem="cgw-Um-cGw" secondAttribute="trailing" id="sVd-K5-zWy"/>
                         </constraints>
+                        <variation key="default">
+                            <mask key="constraints">
+                                <exclude reference="fsj-vK-S8S"/>
+                            </mask>
+                        </variation>
+                        <variation key="heightClass=regular-widthClass=compact">
+                            <mask key="constraints">
+                                <exclude reference="fsj-vK-S8S"/>
+                            </mask>
+                        </variation>
                     </view>
                     <simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina4"/>
                     <connections>

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 25 - 23
kneet2/Base.lproj/Main.storyboard


+ 176 - 15
kneet2/Base.lproj/Things.storyboard

@@ -62,7 +62,72 @@
                                                         <include reference="H1b-Dm-mp4"/>
                                                     </mask>
                                                 </variation>
+                                                <connections>
+                                                    <action selector="btnOptionTouched:" destination="G75-Hx-lyG" eventType="touchUpInside" id="u8t-Iy-sS5"/>
+                                                </connections>
                                             </button>
+                                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="b77-do-r3s" userLabel="View - EditMode">
+                                                <rect key="frame" x="0.0" y="0.0" width="240" height="128"/>
+                                                <subviews>
+                                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="gcJ-aN-OjQ">
+                                                        <rect key="frame" x="-23" y="-15" width="46" height="30"/>
+                                                        <animations/>
+                                                        <constraints>
+                                                            <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="46" id="Q0D-n2-6RV"/>
+                                                            <constraint firstAttribute="width" constant="46" id="TBE-Ll-YzX"/>
+                                                        </constraints>
+                                                        <fontDescription key="fontDescription" type="system" pointSize="15"/>
+                                                        <state key="normal" title="닫기"/>
+                                                        <variation key="default">
+                                                            <mask key="constraints">
+                                                                <exclude reference="Q0D-n2-6RV"/>
+                                                                <exclude reference="TBE-Ll-YzX"/>
+                                                            </mask>
+                                                        </variation>
+                                                        <variation key="heightClass=regular-widthClass=compact">
+                                                            <mask key="constraints">
+                                                                <include reference="Q0D-n2-6RV"/>
+                                                                <include reference="TBE-Ll-YzX"/>
+                                                            </mask>
+                                                        </variation>
+                                                        <connections>
+                                                            <action selector="btnCloseOnEditModeTouched:" destination="G75-Hx-lyG" eventType="touchUpInside" id="0HE-bj-aAh"/>
+                                                        </connections>
+                                                    </button>
+                                                </subviews>
+                                                <animations/>
+                                                <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                                <constraints>
+                                                    <constraint firstItem="gcJ-aN-OjQ" firstAttribute="top" secondItem="b77-do-r3s" secondAttribute="top" constant="5" id="EUh-2h-RdY"/>
+                                                    <constraint firstAttribute="trailing" secondItem="gcJ-aN-OjQ" secondAttribute="trailing" id="GCF-s4-OlR"/>
+                                                    <constraint firstAttribute="width" constant="140" id="eAV-02-TR9">
+                                                        <variation key="heightClass=regular-widthClass=compact" constant="50"/>
+                                                    </constraint>
+                                                    <constraint firstAttribute="bottom" secondItem="gcJ-aN-OjQ" secondAttribute="bottom" constant="5" id="kpc-ux-qjT"/>
+                                                </constraints>
+                                                <variation key="default">
+                                                    <mask key="subviews">
+                                                        <exclude reference="gcJ-aN-OjQ"/>
+                                                    </mask>
+                                                    <mask key="constraints">
+                                                        <exclude reference="eAV-02-TR9"/>
+                                                        <exclude reference="GCF-s4-OlR"/>
+                                                        <exclude reference="kpc-ux-qjT"/>
+                                                        <exclude reference="EUh-2h-RdY"/>
+                                                    </mask>
+                                                </variation>
+                                                <variation key="heightClass=regular-widthClass=compact">
+                                                    <mask key="subviews">
+                                                        <include reference="gcJ-aN-OjQ"/>
+                                                    </mask>
+                                                    <mask key="constraints">
+                                                        <include reference="eAV-02-TR9"/>
+                                                        <include reference="GCF-s4-OlR"/>
+                                                        <include reference="kpc-ux-qjT"/>
+                                                        <include reference="EUh-2h-RdY"/>
+                                                    </mask>
+                                                </variation>
+                                            </view>
                                         </subviews>
                                         <animations/>
                                         <color key="backgroundColor" red="0.94901960784313721" green="0.94901960784313721" blue="0.94901960784313721" alpha="1" colorSpace="calibratedRGB"/>
@@ -70,6 +135,10 @@
                                             <constraint firstItem="dCL-Ql-eHd" firstAttribute="top" secondItem="qAY-8c-k5A" secondAttribute="top" constant="43" id="8zZ-Ab-drp">
                                                 <variation key="heightClass=regular-widthClass=compact" constant="30"/>
                                             </constraint>
+                                            <constraint firstAttribute="trailing" secondItem="b77-do-r3s" secondAttribute="trailing" id="Bjm-Ax-kA4">
+                                                <variation key="heightClass=regular-widthClass=compact" constant="-50"/>
+                                            </constraint>
+                                            <constraint firstItem="b77-do-r3s" firstAttribute="top" secondItem="qAY-8c-k5A" secondAttribute="top" constant="25" id="Ig9-8h-pEy"/>
                                             <constraint firstAttribute="trailing" secondItem="bsD-dR-bxK" secondAttribute="trailing" constant="8" id="Lix-dJ-aRk"/>
                                             <constraint firstItem="bsD-dR-bxK" firstAttribute="top" secondItem="qAY-8c-k5A" secondAttribute="top" constant="30" id="Nqk-Py-Z09"/>
                                             <constraint firstItem="dCL-Ql-eHd" firstAttribute="leading" secondItem="qAY-8c-k5A" secondAttribute="leading" constant="10" id="Yvx-uf-tCy"/>
@@ -78,35 +147,44 @@
                                                 <variation key="heightClass=regular-widthClass=compact" constant="20"/>
                                             </constraint>
                                             <constraint firstAttribute="height" constant="80" id="oxc-Y6-2xq"/>
+                                            <constraint firstAttribute="bottom" secondItem="b77-do-r3s" secondAttribute="bottom" constant="15" id="rfk-4l-ESu"/>
                                         </constraints>
                                         <variation key="default">
                                             <mask key="subviews">
                                                 <exclude reference="dCL-Ql-eHd"/>
                                                 <exclude reference="bsD-dR-bxK"/>
+                                                <exclude reference="b77-do-r3s"/>
                                             </mask>
                                             <mask key="constraints">
                                                 <exclude reference="oxc-Y6-2xq"/>
-                                                <exclude reference="Lix-dJ-aRk"/>
-                                                <exclude reference="Nqk-Py-Z09"/>
-                                                <exclude reference="kiP-a2-DJw"/>
                                                 <exclude reference="8zZ-Ab-drp"/>
                                                 <exclude reference="Yvx-uf-tCy"/>
                                                 <exclude reference="lg7-QO-MDR"/>
+                                                <exclude reference="Lix-dJ-aRk"/>
+                                                <exclude reference="Nqk-Py-Z09"/>
+                                                <exclude reference="kiP-a2-DJw"/>
+                                                <exclude reference="Bjm-Ax-kA4"/>
+                                                <exclude reference="Ig9-8h-pEy"/>
+                                                <exclude reference="rfk-4l-ESu"/>
                                             </mask>
                                         </variation>
                                         <variation key="heightClass=regular-widthClass=compact">
                                             <mask key="subviews">
                                                 <include reference="dCL-Ql-eHd"/>
                                                 <include reference="bsD-dR-bxK"/>
+                                                <include reference="b77-do-r3s"/>
                                             </mask>
                                             <mask key="constraints">
                                                 <include reference="oxc-Y6-2xq"/>
-                                                <include reference="Lix-dJ-aRk"/>
-                                                <include reference="Nqk-Py-Z09"/>
-                                                <include reference="kiP-a2-DJw"/>
                                                 <include reference="8zZ-Ab-drp"/>
                                                 <include reference="Yvx-uf-tCy"/>
                                                 <include reference="lg7-QO-MDR"/>
+                                                <include reference="Lix-dJ-aRk"/>
+                                                <include reference="Nqk-Py-Z09"/>
+                                                <include reference="kiP-a2-DJw"/>
+                                                <include reference="Bjm-Ax-kA4"/>
+                                                <include reference="Ig9-8h-pEy"/>
+                                                <include reference="rfk-4l-ESu"/>
                                             </mask>
                                         </variation>
                                     </view>
@@ -167,7 +245,7 @@
                                         <rect key="frame" x="0.0" y="0.0" width="240" height="128"/>
                                         <animations/>
                                         <collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="0.0" minimumInteritemSpacing="0.0" id="pSf-xV-CbI">
-                                            <size key="itemSize" width="160" height="180"/>
+                                            <size key="itemSize" width="160" height="197"/>
                                             <size key="headerReferenceSize" width="0.0" height="0.0"/>
                                             <size key="footerReferenceSize" width="320" height="160"/>
                                             <inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
@@ -177,7 +255,7 @@
                                                 <rect key="frame" x="0.0" y="0.0" width="50" height="50"/>
                                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                                 <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
-                                                    <rect key="frame" x="0.0" y="0.0" width="160" height="180"/>
+                                                    <rect key="frame" x="0.0" y="0.0" width="160" height="197"/>
                                                     <autoresizingMask key="autoresizingMask"/>
                                                     <subviews>
                                                         <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Wmr-To-ocg" userLabel="View - Container">
@@ -207,24 +285,77 @@
                                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" placeholderIntrinsicWidth="120" placeholderIntrinsicHeight="15" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1Lt-lt-OzG" customClass="CustomLabel">
                                                                     <rect key="frame" x="-42" y="-21" width="42" height="21"/>
                                                                     <animations/>
+                                                                    <constraints>
+                                                                        <constraint firstAttribute="height" constant="15" id="tva-v4-6H2"/>
+                                                                    </constraints>
                                                                     <fontDescription key="fontDescription" type="system" pointSize="15"/>
                                                                     <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
                                                                     <nil key="highlightedColor"/>
+                                                                    <variation key="default">
+                                                                        <mask key="constraints">
+                                                                            <exclude reference="tva-v4-6H2"/>
+                                                                        </mask>
+                                                                    </variation>
+                                                                    <variation key="heightClass=regular-widthClass=compact">
+                                                                        <mask key="constraints">
+                                                                            <include reference="tva-v4-6H2"/>
+                                                                        </mask>
+                                                                    </variation>
                                                                 </label>
-                                                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" placeholderIntrinsicWidth="120" placeholderIntrinsicHeight="18" text="Label" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mX8-a5-5Y9" customClass="CustomLabel">
+                                                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" placeholderIntrinsicWidth="120" placeholderIntrinsicHeight="35" text="Label" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mX8-a5-5Y9" customClass="CustomLabel">
                                                                     <rect key="frame" x="-42" y="-21" width="42" height="21"/>
                                                                     <animations/>
+                                                                    <constraints>
+                                                                        <constraint firstAttribute="height" constant="35" id="cde-0k-Xdr"/>
+                                                                    </constraints>
                                                                     <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                                                     <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
                                                                     <nil key="highlightedColor"/>
+                                                                    <variation key="default">
+                                                                        <mask key="constraints">
+                                                                            <exclude reference="cde-0k-Xdr"/>
+                                                                        </mask>
+                                                                    </variation>
+                                                                    <variation key="heightClass=regular-widthClass=compact">
+                                                                        <mask key="constraints">
+                                                                            <include reference="cde-0k-Xdr"/>
+                                                                        </mask>
+                                                                    </variation>
                                                                 </label>
+                                                                <button opaque="NO" contentMode="scaleToFill" placeholderIntrinsicWidth="120" placeholderIntrinsicHeight="35" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="3Gy-eK-die" customClass="CustomButton">
+                                                                    <rect key="frame" x="-23" y="-15" width="46" height="30"/>
+                                                                    <animations/>
+                                                                    <color key="backgroundColor" red="1" green="0.43137254899999999" blue="0.16862745100000001" alpha="1" colorSpace="calibratedRGB"/>
+                                                                    <constraints>
+                                                                        <constraint firstAttribute="width" constant="120" id="1kK-Gu-x1O"/>
+                                                                        <constraint firstAttribute="height" constant="35" id="g9X-Pt-6O9"/>
+                                                                        <constraint firstAttribute="height" constant="35" id="mhh-Gh-h1Y"/>
+                                                                    </constraints>
+                                                                    <state key="normal" title="삭제"/>
+                                                                    <variation key="default">
+                                                                        <mask key="constraints">
+                                                                            <exclude reference="1kK-Gu-x1O"/>
+                                                                            <exclude reference="g9X-Pt-6O9"/>
+                                                                            <exclude reference="mhh-Gh-h1Y"/>
+                                                                        </mask>
+                                                                    </variation>
+                                                                    <variation key="heightClass=regular-widthClass=compact">
+                                                                        <mask key="constraints">
+                                                                            <include reference="1kK-Gu-x1O"/>
+                                                                            <include reference="g9X-Pt-6O9"/>
+                                                                            <exclude reference="mhh-Gh-h1Y"/>
+                                                                        </mask>
+                                                                    </variation>
+                                                                </button>
                                                             </subviews>
                                                             <animations/>
                                                             <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                                                             <constraints>
+                                                                <constraint firstItem="mX8-a5-5Y9" firstAttribute="top" secondItem="1Lt-lt-OzG" secondAttribute="bottom" constant="20" id="A75-bv-Xbg"/>
                                                                 <constraint firstAttribute="trailing" secondItem="mX8-a5-5Y9" secondAttribute="trailing" constant="20" id="BM9-pa-Ewl"/>
+                                                                <constraint firstItem="3Gy-eK-die" firstAttribute="centerX" secondItem="mX8-a5-5Y9" secondAttribute="centerX" id="BWo-H6-aA8"/>
+                                                                <constraint firstItem="3Gy-eK-die" firstAttribute="centerY" secondItem="mX8-a5-5Y9" secondAttribute="centerY" id="Bdl-Eo-JQJ"/>
                                                                 <constraint firstItem="GEl-sR-WOv" firstAttribute="top" secondItem="Wmr-To-ocg" secondAttribute="top" constant="25" id="DUQ-bF-v76"/>
-                                                                <constraint firstItem="mX8-a5-5Y9" firstAttribute="top" secondItem="1Lt-lt-OzG" secondAttribute="bottom" constant="20" id="MJr-8r-bTn"/>
                                                                 <constraint firstItem="mX8-a5-5Y9" firstAttribute="leading" secondItem="Wmr-To-ocg" secondAttribute="leading" constant="20" id="c4a-Bs-qaO"/>
                                                                 <constraint firstItem="1Lt-lt-OzG" firstAttribute="leading" secondItem="Wmr-To-ocg" secondAttribute="leading" constant="20" id="hPb-bj-Skh"/>
                                                                 <constraint firstItem="GEl-sR-WOv" firstAttribute="centerX" secondItem="Wmr-To-ocg" secondAttribute="centerX" id="nNm-2V-XfR"/>
@@ -236,6 +367,7 @@
                                                                     <exclude reference="GEl-sR-WOv"/>
                                                                     <exclude reference="1Lt-lt-OzG"/>
                                                                     <exclude reference="mX8-a5-5Y9"/>
+                                                                    <exclude reference="3Gy-eK-die"/>
                                                                 </mask>
                                                                 <mask key="constraints">
                                                                     <exclude reference="DUQ-bF-v76"/>
@@ -243,8 +375,10 @@
                                                                     <exclude reference="hPb-bj-Skh"/>
                                                                     <exclude reference="tc4-JE-jUs"/>
                                                                     <exclude reference="vSK-XC-HuZ"/>
+                                                                    <exclude reference="BWo-H6-aA8"/>
+                                                                    <exclude reference="Bdl-Eo-JQJ"/>
+                                                                    <exclude reference="A75-bv-Xbg"/>
                                                                     <exclude reference="BM9-pa-Ewl"/>
-                                                                    <exclude reference="MJr-8r-bTn"/>
                                                                     <exclude reference="c4a-Bs-qaO"/>
                                                                 </mask>
                                                             </variation>
@@ -253,6 +387,7 @@
                                                                     <include reference="GEl-sR-WOv"/>
                                                                     <include reference="1Lt-lt-OzG"/>
                                                                     <include reference="mX8-a5-5Y9"/>
+                                                                    <include reference="3Gy-eK-die"/>
                                                                 </mask>
                                                                 <mask key="constraints">
                                                                     <include reference="DUQ-bF-v76"/>
@@ -260,8 +395,10 @@
                                                                     <include reference="hPb-bj-Skh"/>
                                                                     <include reference="tc4-JE-jUs"/>
                                                                     <include reference="vSK-XC-HuZ"/>
+                                                                    <include reference="BWo-H6-aA8"/>
+                                                                    <include reference="Bdl-Eo-JQJ"/>
+                                                                    <include reference="A75-bv-Xbg"/>
                                                                     <include reference="BM9-pa-Ewl"/>
-                                                                    <include reference="MJr-8r-bTn"/>
                                                                     <include reference="c4a-Bs-qaO"/>
                                                                 </mask>
                                                             </variation>
@@ -277,6 +414,7 @@
                                                     <constraint firstItem="Wmr-To-ocg" firstAttribute="leading" secondItem="D3V-aV-2CV" secondAttribute="leading" id="mKI-Qc-6Dm"/>
                                                     <constraint firstAttribute="bottom" secondItem="Wmr-To-ocg" secondAttribute="bottom" id="xgc-fw-WGy"/>
                                                 </constraints>
+                                                <size key="customSize" width="160" height="197"/>
                                                 <variation key="default">
                                                     <mask key="subviews">
                                                         <exclude reference="Wmr-To-ocg"/>
@@ -300,6 +438,7 @@
                                                     </mask>
                                                 </variation>
                                                 <connections>
+                                                    <outlet property="btnDelete" destination="3Gy-eK-die" id="QXe-kp-fUs"/>
                                                     <outlet property="btnDevice" destination="GEl-sR-WOv" id="x1g-eJ-zEb"/>
                                                     <outlet property="lblDeviceName" destination="1Lt-lt-OzG" id="Q18-cg-OQo"/>
                                                     <outlet property="lblDeviceStatus" destination="mX8-a5-5Y9" id="uPk-bu-eFf"/>
@@ -309,7 +448,7 @@
                                                 <rect key="frame" x="0.0" y="0.0" width="50" height="50"/>
                                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                                 <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
-                                                    <rect key="frame" x="0.0" y="0.0" width="160" height="180"/>
+                                                    <rect key="frame" x="0.0" y="0.0" width="160" height="197"/>
                                                     <autoresizingMask key="autoresizingMask"/>
                                                     <subviews>
                                                         <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="lc2-ET-pbH" userLabel="View - Container">
@@ -340,7 +479,9 @@
                                                             <animations/>
                                                             <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                                                             <constraints>
-                                                                <constraint firstItem="0RZ-9d-BLx" firstAttribute="centerY" secondItem="lc2-ET-pbH" secondAttribute="centerY" id="Awc-y8-H33"/>
+                                                                <constraint firstItem="0RZ-9d-BLx" firstAttribute="centerY" secondItem="lc2-ET-pbH" secondAttribute="centerY" id="Awc-y8-H33">
+                                                                    <variation key="heightClass=regular-widthClass=compact" constant="-3.5"/>
+                                                                </constraint>
                                                                 <constraint firstItem="0RZ-9d-BLx" firstAttribute="centerX" secondItem="lc2-ET-pbH" secondAttribute="centerX" id="HaX-r5-ZrL"/>
                                                             </constraints>
                                                             <variation key="default">
@@ -373,7 +514,7 @@
                                                     <constraint firstItem="lc2-ET-pbH" firstAttribute="top" secondItem="OL4-Af-cch" secondAttribute="top" id="heV-Zz-MoY"/>
                                                     <constraint firstAttribute="trailing" secondItem="lc2-ET-pbH" secondAttribute="trailing" id="sbp-ux-AaK"/>
                                                 </constraints>
-                                                <size key="customSize" width="160" height="180"/>
+                                                <size key="customSize" width="160" height="197"/>
                                                 <variation key="default">
                                                     <mask key="subviews">
                                                         <exclude reference="lc2-ET-pbH"/>
@@ -562,6 +703,8 @@
                         <outlet property="addHubContainerView" destination="4XN-6C-LGr" id="HU8-lm-6z1"/>
                         <outlet property="btnAddHub" destination="ZuT-kM-VdB" id="S1x-Nq-sPW"/>
                         <outlet property="collectionView" destination="Xfm-Om-Wkr" id="Wk3-RF-8Xd"/>
+                        <outlet property="constraintEditModeRight" destination="Bjm-Ax-kA4" id="3W0-xT-otk"/>
+                        <outlet property="editModeView" destination="b77-do-r3s" id="hZ3-pf-SNJ"/>
                         <outlet property="lblTitle" destination="dCL-Ql-eHd" id="em7-9X-zLw"/>
                         <outlet property="mainView" destination="Z09-xT-S74" id="ZYa-A6-bFn"/>
                     </connections>
@@ -825,6 +968,19 @@
                                                     </variation>
                                                 </tableViewCellContentView>
                                                 <animations/>
+                                                <constraints>
+                                                    <constraint firstItem="afL-97-7bS" firstAttribute="width" secondItem="eAC-dN-TM9" secondAttribute="width" id="f62-mB-Q5X"/>
+                                                </constraints>
+                                                <variation key="default">
+                                                    <mask key="constraints">
+                                                        <exclude reference="f62-mB-Q5X"/>
+                                                    </mask>
+                                                </variation>
+                                                <variation key="heightClass=regular-widthClass=compact">
+                                                    <mask key="constraints">
+                                                        <include reference="f62-mB-Q5X"/>
+                                                    </mask>
+                                                </variation>
                                                 <connections>
                                                     <outlet property="btnAdd" destination="KUg-1A-K5q" id="AjJ-Uu-pVG"/>
                                                     <outlet property="imgvDevice" destination="Gio-Ab-TKc" id="cEN-MV-r3A"/>
@@ -2433,7 +2589,9 @@
                     </view>
                     <simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina4"/>
                     <connections>
+                        <outlet property="btnDoStart" destination="KOy-yw-R7J" id="bzj-zV-vBt"/>
                         <outlet property="constraintPopViewTop" destination="NEB-fh-McR" id="pDd-2A-Sn0"/>
+                        <outlet property="lblComment" destination="a3D-x1-xkf" id="Xk7-XB-0pj"/>
                         <outlet property="lblManufacturer" destination="6lz-jd-px8" id="Zm9-DJ-Z5n"/>
                         <outlet property="lblSensorName" destination="EZS-rz-DXQ" id="yh1-xa-r4E"/>
                         <outlet property="maskView" destination="ycx-Rz-Brd" id="J5O-9m-dFl"/>
@@ -3003,7 +3161,10 @@
                     </view>
                     <simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina4"/>
                     <connections>
+                        <outlet property="btnAction" destination="7ZI-tW-frd" id="Gmq-hK-4vV"/>
                         <outlet property="constraintPopViewTop" destination="ViT-aH-bRh" id="JIW-u0-L72"/>
+                        <outlet property="lblDesc" destination="D5h-JM-Mcd" id="how-Wc-5v1"/>
+                        <outlet property="lblTitle" destination="wUw-E3-H25" id="b5Y-KC-WaN"/>
                         <outlet property="maskView" destination="x1Y-pV-Kvg" id="S5V-Nf-SUF"/>
                         <outlet property="popView" destination="C69-kl-Ojv" id="Mtn-dQ-d8M"/>
                     </connections>

+ 1 - 0
kneet2/Classes/Definitions.h

@@ -316,6 +316,7 @@ typedef NS_ENUM(NSInteger, KNMenuId) {
 
 //UI Constants
 #define kfNavigationBarHeight   60.0f
+#define kfMainTabBarHeight      70.0f
 #define kfBoxCap                1.0f
 #define kfPageBottomMargin      20.0f
 #define kfTransitionRightDur    0.3f

+ 1 - 0
kneet2/Classes/Model/DeviceModel.h

@@ -22,6 +22,7 @@
 //@property (copy, nonatomic) NSString *imageFileName;
 @property (copy, nonatomic) NSString *nodeId;
 @property (copy, nonatomic) NSString *nodeName;
+@property (copy, nonatomic) NSString *groupName;
 
 @property (copy, nonatomic) NSString *createDatetime;
 @property (copy, nonatomic) NSString *updateDatetime;

+ 2 - 2
kneet2/Classes/ViewControllers/HomeMemberScreens/HomeMemberViewController.m

@@ -293,7 +293,7 @@
 
 #pragma mark - UI Events
 
-- (void)btnDeleteOnEditModeTouched:(id)sender {
+- (IBAction)btnDeleteOnEditModeTouched:(id)sender {
     if (!_isDeleteMode)
         return;
     
@@ -327,7 +327,7 @@
     }];
 }
 
-- (void)btnCloseOnEditModeTouched:(id)sender {
+- (IBAction)btnCloseOnEditModeTouched:(id)sender {
     [self toggleEditMode];
 }
 

+ 1 - 1
kneet2/Classes/ViewControllers/MainScreens/MainViewController.m

@@ -62,7 +62,7 @@
     //1-1. scroll top bottom
     
     //2. init scrollView
-    CGFloat height = IPHONE_HEIGHT - _tabBar.height;
+    CGFloat height = IPHONE_HEIGHT - kfMainTabBarHeight;
     [_scrollView setContentSize:CGSizeMake(IPHONE_WIDTH * 3, height)];
     _scrollView.pagingEnabled = YES;
     _scrollView.scrollEnabled = NO;

+ 7 - 0
kneet2/Classes/ViewControllers/ThingsScreens/ThingsAddCompleteViewController.h

@@ -12,9 +12,16 @@
 
 
 #pragma mark - Properties
+@property (assign, nonatomic) BOOL isDeleteMode;
+
 @property (weak, nonatomic) IBOutlet UIView *maskView;
 @property (weak, nonatomic) IBOutlet UIView *popView;
 
+@property (weak, nonatomic) IBOutlet CustomLabel *lblTitle;
+@property (weak, nonatomic) IBOutlet CustomLabel *lblDesc;
+@property (weak, nonatomic) IBOutlet CustomButton *btnAction;
+
+
 @property (weak, nonatomic) IBOutlet NSLayoutConstraint *constraintPopViewTop;
 
 #pragma mark - Instance Methods

+ 4 - 1
kneet2/Classes/ViewControllers/ThingsScreens/ThingsAddCompleteViewController.m

@@ -30,7 +30,10 @@
 
 
 - (void)initUI {
-    
+    if (_isDeleteMode) {
+        _lblTitle.text = @"삭제 성공";
+        _lblDesc.text = @"장치를 삭제했습니다";
+    }
 }
 
 - (void)viewDidAppear:(BOOL)animated {

+ 2 - 0
kneet2/Classes/ViewControllers/ThingsScreens/ThingsAddIncludeViewController.h

@@ -8,6 +8,7 @@
 
 #import "JDViewController.h"
 
+@class DeviceModel;
 @class CustomLabel;
 @class CustomButton;
 
@@ -17,6 +18,7 @@
 
 #pragma mark - Properties
 @property (weak, nonatomic) NSDictionary *addableDevice;
+@property (weak, nonatomic) DeviceModel *removableDevice;
 
 @property (weak, nonatomic) IBOutlet UIView *maskView;
 @property (weak, nonatomic) IBOutlet UIView *popView;

+ 30 - 2
kneet2/Classes/ViewControllers/ThingsScreens/ThingsAddIncludeViewController.m

@@ -60,7 +60,14 @@
 }
 
 - (void)prepareViewDidLoad {
-    [self requestIncludeDevice];
+    
+    if (_addableDevice) {
+        _lblDesc.text = [NSString stringWithFormat:@"%@의\n00 버튼을\n00 누르세요", _addableDevice[@"deviceName"]];
+        [self requestIncludeDevice];
+    } else if (_removableDevice) {
+        _lblDesc.text = [NSString stringWithFormat:@"%@의\n00 버튼을\n00 누르세요", _removableDevice.deviceName];
+        [self requestExcludeDevice];
+    }
 }
 
 #pragma mark - Main Logic
@@ -84,6 +91,25 @@
     }];
 }
 
+- (void)requestExcludeDevice {
+    NSString *path = [NSString stringWithFormat:API_DELETE_DEVICE_EXCLUSION, [JDFacade facade].loginUser.homehubDeviceId];
+    
+    [[RequestHandler handler] sendAsyncRequestAPIPath:path method:ksHTTPRequestDELETE parameters:nil modelClass:[DeviceModel class] showLoadingView:YES completion:^(id responseObject) {
+        if (!responseObject) {//응답결과가 잘못되었거나 없을 경우,
+            return;
+        }
+        
+        DeviceModel *device = (DeviceModel *)responseObject;
+        
+        if (device) {//API 성공 ,
+            [self requestCheckInclustion:device.commandId];
+        }
+    } failure:^(id errorObject) {
+        JDErrorModel *error = (JDErrorModel *)errorObject;
+        [[JDFacade facade] alert:error.errorMessage];
+    }];
+}
+
 - (void)requestCheckInclustion:(NSString *)commandId {
     
     if (!_timer) {
@@ -116,13 +142,15 @@
                 //retry
                 return;
                 
-            } else if ([device.status isEqualToString:KNEET_DEVICE_INCLUSION]) {
+            } else if ([device.status isEqualToString:KNEET_DEVICE_INCLUSION] || [device.status isEqualToString:KNEET_DEVICE_EXCLUSION]) {
                 //success
                 if (_timer) {
                     [_timer invalidate];
                     _timer = nil;
                 }
                 ThingsAddCompleteViewController *vc = [CommonUtil instantiateViewControllerWithIdentifier:@"ThingsAddCompleteViewController" storyboardName:@"Things"];
+                vc.isDeleteMode = [device.status isEqualToString:KNEET_DEVICE_EXCLUSION];
+                
                 vc.providesPresentationContextTransitionStyle = YES;
                 vc.definesPresentationContext = YES;
                 

+ 5 - 0
kneet2/Classes/ViewControllers/ThingsScreens/ThingsAddStartViewController.h

@@ -8,6 +8,7 @@
 
 #import "JDViewController.h"
 
+@class DeviceModel;
 @class CustomLabel;
 @class CustomButton;
 
@@ -16,12 +17,16 @@
 
 #pragma mark - Properties
 @property (weak, nonatomic) NSDictionary *addableDevice;
+@property (weak, nonatomic) DeviceModel *removableDevice;
+@property (weak, nonatomic) NSArray *removableGroups;
 
 @property (weak, nonatomic) IBOutlet UIView *maskView;
 @property (weak, nonatomic) IBOutlet UIView *popView;
 
 @property (weak, nonatomic) IBOutlet CustomLabel *lblSensorName;
 @property (weak, nonatomic) IBOutlet CustomLabel *lblManufacturer;
+@property (weak, nonatomic) IBOutlet CustomLabel *lblComment;
+@property (weak, nonatomic) IBOutlet CustomButton *btnDoStart;
 
 @property (weak, nonatomic) IBOutlet NSLayoutConstraint *constraintPopViewTop;
 

+ 29 - 4
kneet2/Classes/ViewControllers/ThingsScreens/ThingsAddStartViewController.m

@@ -14,6 +14,7 @@
 #import "ThingsAddIncludeViewController.h"
 
 #import "ThingsAddStartViewController.h"
+#import "DeviceModel.h"
 
 @interface ThingsAddStartViewController () {
 
@@ -36,7 +37,14 @@
 
 
 - (void)initUI {
-    
+    if (_addableDevice) {
+        [_btnDoStart setTitle:@"추가 시작" forState:UIControlStateNormal];
+        _lblComment.text = @"장치 근처로 이동 후\n추가시작 버튼을 누르세요";
+        
+    } else if (_removableDevice) {
+        [_btnDoStart setTitle:@"삭제 시작" forState:UIControlStateNormal];
+        _lblComment.text = @"장치 근처로 이동 후\n삭제시작 버튼을 누르세요";
+    }
 }
 
 - (void)viewDidAppear:(BOOL)animated {
@@ -55,9 +63,25 @@
 }
 
 - (void)prepareViewDidLoad {
-    
-    _lblSensorName.text = _addableDevice[@"nodeName"];
-    _lblManufacturer.text = _addableDevice[@"manufacturer"];
+
+    if (_addableDevice) {//inclusion
+        _lblSensorName.text = _addableDevice[@"nodeName"];
+        _lblManufacturer.text = _addableDevice[@"manufacturer"];
+        
+    } else if (_removableDevice) {//exclusion
+        _lblSensorName.text = _removableDevice.deviceName;
+        
+        if (_removableGroups) {
+            NSMutableString *groups = [[NSMutableString alloc] init];
+            for (DeviceModel *device in _removableGroups) {
+                NSString *prefix = [groups isEmptyString] ? ksEmptyString : @",";
+                [groups appendFormat:@"%@%@", prefix, device.deviceName];
+            }
+            
+            _lblManufacturer.text = [NSString stringWithFormat:@"이 장치를 삭제하면 %@도 함께 삭제됩니다", groups];
+            _lblManufacturer.backgroundColor = kUITextColor02;
+        }
+    }
 }
 
 
@@ -75,6 +99,7 @@
     
     ThingsAddIncludeViewController *vc = [CommonUtil instantiateViewControllerWithIdentifier:@"ThingsAddIncludeViewController" storyboardName:@"Things"];
     vc.addableDevice = _addableDevice;
+    vc.removableDevice = _removableDevice;
     
     vc.providesPresentationContextTransitionStyle = YES;
     vc.definesPresentationContext = YES;

+ 8 - 0
kneet2/Classes/ViewControllers/ThingsScreens/ThingsViewController.h

@@ -19,6 +19,10 @@
 @property (weak, nonatomic) IBOutlet UIView *addHubContainerView;
 @property (weak, nonatomic) IBOutlet UICollectionView *collectionView;
 @property (weak, nonatomic) IBOutlet CustomButton *btnAddHub;
+@property (weak, nonatomic) IBOutlet UIView *editModeView;
+
+@property (weak, nonatomic) IBOutlet NSLayoutConstraint *constraintEditModeRight;
+
 
 #pragma mark - Instance Methods
 - (void)prepareViewDidLoad;
@@ -26,6 +30,9 @@
 - (void)updateDevice:(DeviceModel *)device;
 - (IBAction)btnAddHubTouched:(id)sender;
 
+- (IBAction)btnOptionTouched:(id)sender;
+- (IBAction)btnCloseOnEditModeTouched:(id)sender;
+
 @end
 
 @class CustomButton;
@@ -38,6 +45,7 @@
 @property (weak, nonatomic) IBOutlet CustomButton *btnDevice;
 @property (weak, nonatomic) IBOutlet CustomLabel *lblDeviceName;
 @property (weak, nonatomic) IBOutlet CustomLabel *lblDeviceStatus;
+@property (weak, nonatomic) IBOutlet CustomButton *btnDelete;
 
 @end
 

+ 59 - 13
kneet2/Classes/ViewControllers/ThingsScreens/ThingsViewController.m

@@ -25,6 +25,8 @@
 
 #import "ThingsViewController.h"
 #import "UIButton+WebCache.h"
+#import "ThingsAddViewController.h"
+#import "ThingsAddStartViewController.h"
 
 #define kfThingsTableViewCellHeight 100.0f
 
@@ -39,8 +41,8 @@
 @implementation ThingsCollectionViewCell
 
 - (void)awakeFromNib {
+    _btnDelete.hidden = YES;
 }
-
 @end
 
 @implementation ThingsAddCollectionViewCell
@@ -72,6 +74,7 @@
     [super viewDidLoad];
 
     [self initUI];
+    [[JDFacade facade] showFlex];
 }
 
 - (void)viewWillAppear:(BOOL)animated {
@@ -87,7 +90,6 @@
     _collectionView.backgroundColor = kUIBgColor01;
     
     if ([JDFacade facade].loginUser.homehubDeviceId && ![[JDFacade facade].loginUser.homehubDeviceId isEmptyString]) {
-        [self generateOptionButton];
         [self setThingsPopoverOptions];
     }
     
@@ -115,7 +117,7 @@
                                       @"target": weakSelf,
                                       @"selector": [NSValue valueWithPointer:@selector(refreshDeviceList)]}];
 
-    if ([JDFacade facade].loginUser.level > 10) {//권한
+    if ([JDFacade facade].loginUser.level == 90) {//권한
         [_popooverOptionArray addObject:@{@"menuName" : NSLocalizedString(@"추가", @"추가"),
                                           @"iconName": @"tp_01_img_bg_morepopup_icon_group_deviceadd",
                                           @"target": weakSelf,
@@ -124,7 +126,7 @@
         [_popooverOptionArray addObject:@{@"menuName" : NSLocalizedString(@"삭제", @"삭제"),
                                           @"iconName": @"tp_01_img_bg_morepopup_icon_group_deviceadd",
                                           @"target": weakSelf,
-                                          @"selector": [NSValue valueWithPointer:@selector(deleteDevice)]}];
+                                          @"selector": [NSValue valueWithPointer:@selector(toggleEditMode)]}];
     }
 }
 
@@ -167,10 +169,19 @@
     [self presentViewController:vc animated:YES completion:nil];
 }
 
-- (void)deleteDevice {
+- (void)toggleEditMode {
+    _isDeleteMode = !_isDeleteMode;
+    
+    [_collectionView reloadData];
+    
+    _constraintEditModeRight.constant = _isDeleteMode ? 0 : -_editModeView.width;
     
+    [UIView animateWithDuration:kfAnimationDur animations:^{
+        [self.view layoutIfNeeded];
+    }];
 }
 
+
 - (void)refreshDeviceList {
     [self performSelector:@selector(requestDeviceList) withObject:nil afterDelay:0.0f];
 }
@@ -256,11 +267,21 @@
         
         cell.lblDeviceName.text = device.deviceName;
         
-        NSString *deviceStatus = [[JDFacade facade].loginUser.homehubOnlineState isEqualToString:@"OFF"] ? @"OFFLINE" : device.contentValue;
-        cell.lblDeviceStatus.text = deviceStatus;
+        cell.btnDelete.hidden = !_isDeleteMode;
+        cell.lblDeviceStatus.hidden = _isDeleteMode;
+        if (!cell.lblDeviceStatus.hidden) {
+            NSString *deviceStatus = [[JDFacade facade].loginUser.homehubOnlineState isEqualToString:@"OFF"] ? @"OFFLINE" : device.contentValue;
+            cell.lblDeviceStatus.text = deviceStatus;
+        } else {
+            cell.btnDelete.value = device;
+            if (![cell.btnDelete actionsForTarget:self forControlEvent:UIControlEventTouchUpInside]) {
+                [cell.btnDelete addTarget:self action:@selector(btnDeleteTouched:) forControlEvents:UIControlEventTouchUpInside];
+            }
+        }
         
         rcell = cell;
-    } else {
+        
+    } else {//디바이스 추가 옵션
         ThingsAddCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"AddCollectionCellIdentifier" forIndexPath:indexPath];
         
         if (![cell.btnAdd actionsForTarget:self forControlEvent:UIControlEventTouchUpInside]) {
@@ -272,11 +293,31 @@
     return rcell;
 }
 
+- (void)btnDeleteTouched:(id)sender {
+    CustomButton *btn = (CustomButton *)sender;
+    
+    DeviceModel *device = (DeviceModel *)btn.value;
+    
+    ThingsAddStartViewController *vc = [CommonUtil instantiateViewControllerWithIdentifier:@"ThingsAddStartViewController" storyboardName:@"Things"];
+    vc.removableDevice = device;
+    if (device.groupName && ![device.groupName isEmptyString]) {
+        vc.removableGroups = [_deviceList filteredArrayUsingPredicateFormat:@"groupName == %@", device.groupName]; //group devices
+    }
+    
+    vc.providesPresentationContextTransitionStyle = YES;
+    vc.definesPresentationContext = YES;
+    
+    [vc setModalPresentationStyle:UIModalPresentationOverCurrentContext];
+    
+    [self presentViewController:vc animated:NO completion:nil];
+}
+
 
 - (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView
            viewForSupplementaryElementOfKind:(NSString *)kind
                                  atIndexPath:(NSIndexPath *)indexPath
 {
+
     ThingsCollectionFooterView *footerView = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionFooter
                                                                                     withReuseIdentifier:@"FooterIdentifier" forIndexPath:indexPath];
     if (![footerView.btnAdd actionsForTarget:self forControlEvent:UIControlEventTouchUpInside]) {
@@ -298,11 +339,11 @@
 
 - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
     if (IPHONE_WIDTH == 414.0f) {//아이폰 6일 경우,
-        return CGSizeMake(212.0f, 160.0f);
+        return CGSizeMake(212.0f, 197.0f);
     } else if (IPHONE_WIDTH == 375.0f) {//아이폰 6+일경우
-        return CGSizeMake(187.5, 160.0f);
+        return CGSizeMake(187.5, 197.0f);
     }
-    return CGSizeMake(160.0f, 160.0f);
+    return CGSizeMake(160.0f, 197.0f);
 }
 
 - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
@@ -315,14 +356,19 @@
 }
 
 
-
-
 #pragma mark - UI Events
 - (void)btnAddHubTouched:(id)sender {
     
     [[JDFacade facade] gotoHomeHubRegistration];
 }
 
+- (IBAction)btnOptionTouched:(id)sender {
+    [self toggleOptions:sender];
+}
+
+- (IBAction)btnCloseOnEditModeTouched:(id)sender {
+    [self toggleEditMode];
+}
 
 #pragma mark - MemoryWarning
 - (void)didReceiveMemoryWarning