팝업 라이브러리 많은데... 뷰 컨트롤러가 편하다. 이미 있는 뷰컨을 붙이기도 좋다. (다들 공감하실 듯)
VC에 property 붙이고
@property (assign, nonatomic) IBOutlet UITextField *mTextDfctCnts;
@property (weak, nonatomic) IBOutlet UILabel *mHiddenNipt;
@property (nonatomic, strong) NSString *mDongCd;
@property (nonatomic, strong) NSString *mNohs;
호출할 때 세팅해 주고 호출하면 된다.
#import "HJH_Nipt.h"
- (IBAction)onClickNipt:(id)sender {
HJH_Nipt *areaSelectView = [[HJH_Nipt alloc] initWithNibName:@"HJH_Nipt" bundle:nil];
areaSelectView.mDongCd = mDongCd;
areaSelectView.mNohs = mNohs;
areaSelectView.mTextDfctCnts = mTextDfctCnts;
areaSelectView.mHiddenNipt = _mHiddenNipt;
self.navigationController.modalPresentationStyle = UIModalPresentationCurrentContext;
[self presentModalViewController:areaSelectView animated:YES];
areaSelectView.view.alpha = 0;
[UIView animateWithDuration:0.5 animations:^{
areaSelectView.view.alpha = 1.0;
}];
}
xib는 덤. Swift에서도 잘 쓰는 패턴이지만 왠만하면 스토리 보드로 하려고 한다.(팝업에 뭔 스토리 보드냐만... Swift UI 까지는 아니더라도 보낼 껀 보내줘야 한다는 생각이다.)
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
<device id="retina4_0" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="HJH_Nipt">
<connections>
<outlet property="mBackgroundView" destination="Lb2-JR-zbW" id="4Cg-J5-AMD"/>
<outlet property="mBtnClose" destination="T4o-ib-duN" id="pJi-NV-1U1"/>
<outlet property="mBtnSubmit" destination="dOR-Xt-bzK" id="KzB-bv-P6O"/>
<outlet property="mTableViewMainList" destination="DcY-JW-cU7" id="Rte-nI-gdt"/>
<outlet property="mTextViewCnt" destination="Lb2-JR-zbW" id="wAS-6v-0Co"/>
<outlet property="pantaegi" destination="N2a-Bs-zGH" id="ngu-Vc-jMj"/>
<outlet property="view" destination="1" id="43"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="1">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="000000000" heightSizable="YES"/>
<subviews>
<view clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="N2a-Bs-zGH" userLabel="pantaegi">
<rect key="frame" x="26" y="37" width="267" height="443"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="dOR-Xt-bzK">
<rect key="frame" x="157" y="390" width="70" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
<state key="normal" title="점검요청">
<color key="titleColor" systemColor="systemBlueColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<connections>
<action selector="onClickSubmit:" destination="-1" eventType="touchUpInside" id="sqI-Hp-Hca"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="T4o-ib-duN">
<rect key="frame" x="52" y="390" width="56" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
<state key="normal" title="닫기">
<color key="titleColor" systemColor="systemBlueColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<connections>
<action selector="onClickClose:" destination="-1" eventType="touchUpInside" id="cZf-88-3b1"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="별매품 현황" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hlE-i0-sBR">
<rect key="frame" x="95" y="44" width="130" height="46"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="19"/>
<color key="textColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<tableView clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" alwaysBounceVertical="YES" style="plain" separatorStyle="none" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="DcY-JW-cU7">
<rect key="frame" x="26" y="98" width="267" height="252"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<connections>
<outlet property="dataSource" destination="-1" id="ags-GI-0bR"/>
<outlet property="delegate" destination="-1" id="yef-C7-2gK"/>
</connections>
</tableView>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" fixedFrame="YES" text="점검 요청 내역" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="Lb2-JR-zbW">
<rect key="frame" x="30" y="358" width="259" height="59"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="textColor" systemColor="labelColor" cocoaTouchSystemColor="darkTextColor"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
</textView>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<simulatedNavigationBarMetrics key="simulatedTopBarMetrics" barStyle="black" prompted="NO"/>
<point key="canvasLocation" x="138.75" y="119.36619718309859"/>
</view>
</objects>
</document>
'C++' 카테고리의 다른 글
UIViewController 중첩 (0) | 2021.05.18 |
---|---|
SOAP protocol (0) | 2021.05.18 |
실무 : 데이터를 넘기는 방법 - SQLite 이용... (0) | 2021.05.18 |
서버 개발자와 작업시 찾기 힘든 에러... (0) | 2021.05.18 |
순수 학문으로 다시 돌아 갑니다. (0) | 2021.05.18 |
최근댓글