Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions iOS_Study_B.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
954B6B882AC57DAA00FDCFAB /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 954B6B862AC57DAA00FDCFAB /* Main.storyboard */; };
954B6B8A2AC57DAB00FDCFAB /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 954B6B892AC57DAB00FDCFAB /* Assets.xcassets */; };
954B6B8D2AC57DAB00FDCFAB /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 954B6B8B2AC57DAB00FDCFAB /* LaunchScreen.storyboard */; };
CC1B9E5D2ADC5C600038B543 /* SecondViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC1B9E5C2ADC5C600038B543 /* SecondViewController.swift */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -24,6 +25,7 @@
954B6B892AC57DAB00FDCFAB /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
954B6B8C2AC57DAB00FDCFAB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
954B6B8E2AC57DAB00FDCFAB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
CC1B9E5C2ADC5C600038B543 /* SecondViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecondViewController.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -60,6 +62,7 @@
954B6B822AC57DAA00FDCFAB /* SceneDelegate.swift */,
954B6B842AC57DAA00FDCFAB /* ViewController.swift */,
954B6B862AC57DAA00FDCFAB /* Main.storyboard */,
CC1B9E5C2ADC5C600038B543 /* SecondViewController.swift */,
954B6B892AC57DAB00FDCFAB /* Assets.xcassets */,
954B6B8B2AC57DAB00FDCFAB /* LaunchScreen.storyboard */,
954B6B8E2AC57DAB00FDCFAB /* Info.plist */,
Expand Down Expand Up @@ -138,6 +141,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
CC1B9E5D2ADC5C600038B543 /* SecondViewController.swift in Sources */,
954B6B852AC57DAA00FDCFAB /* ViewController.swift in Sources */,
954B6B812AC57DAA00FDCFAB /* AppDelegate.swift in Sources */,
954B6B832AC57DAA00FDCFAB /* SceneDelegate.swift in Sources */,
Expand Down
1 change: 0 additions & 1 deletion iOS_Study_B/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import UIKit
class AppDelegate: UIResponder, UIApplicationDelegate {



func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
Expand Down
85 changes: 80 additions & 5 deletions iOS_Study_B/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,24 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="target" sceneMemberID="viewController">
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="iOS_Study_B" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Jsn-8N-meu">
<rect key="frame" x="175.66666666666666" y="365.66666666666669" width="42" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="JiB-Nd-AxA">
<rect key="frame" x="159" y="458.66666666666669" width="75" height="35"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="plain" title="Button"/>
<connections>
<action selector="buttongonextVC:" destination="BYZ-38-t0r" eventType="touchUpInside" id="gef-B8-jer"/>
</connections>
</button>
</subviews>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="Jsn-8N-meu" firstAttribute="centerY" secondItem="8bC-Xf-vdC" secondAttribute="centerY" constant="-50" id="F8A-7K-LUH"/>
<constraint firstItem="Jsn-8N-meu" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="VAD-Fr-VB5"/>
<constraint firstItem="JiB-Nd-AxA" firstAttribute="centerY" secondItem="8bC-Xf-vdC" secondAttribute="centerY" constant="50" id="grC-RN-c65"/>
<constraint firstItem="JiB-Nd-AxA" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="lQV-kS-Qdn"/>
</constraints>
</view>
<connections>
<outlet property="label" destination="Jsn-8N-meu" id="ZrU-BQ-Dsu"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="126" y="-2"/>
</scene>
<!--Second View Controller-->
<scene sceneID="dDd-x9-7fO">
<objects>
<viewController storyboardIdentifier="SecondViewController" id="K7o-1Q-STr" customClass="SecondViewController" customModule="iOS_Study_B" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="FPz-hJ-sI1">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="MWs-NS-3QY">
<rect key="frame" x="159" y="458.66666666666669" width="75" height="35"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="plain" title="Button"/>
<connections>
<action selector="ButtonDismiss:" destination="K7o-1Q-STr" eventType="touchUpInside" id="QyW-7E-F20"/>
<action selector="buttonGonextVC:" destination="5cH-Dj-C6T" eventType="touchUpInside" id="8Ol-t2-Izj"/>
</connections>
</button>
<textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="3Uf-dq-VkQ">
<rect key="frame" x="59" y="359" width="275" height="34"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
</subviews>
<viewLayoutGuide key="safeArea" id="80c-9C-rKp"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="MWs-NS-3QY" firstAttribute="centerX" secondItem="FPz-hJ-sI1" secondAttribute="centerX" id="8Ub-ze-uWq"/>
<constraint firstItem="3Uf-dq-VkQ" firstAttribute="centerY" secondItem="FPz-hJ-sI1" secondAttribute="centerY" constant="-50" id="A5n-Iy-ccZ"/>
<constraint firstItem="3Uf-dq-VkQ" firstAttribute="centerX" secondItem="FPz-hJ-sI1" secondAttribute="centerX" id="Ks4-Jy-vls"/>
<constraint firstItem="3Uf-dq-VkQ" firstAttribute="width" secondItem="FPz-hJ-sI1" secondAttribute="width" multiplier="0.7" id="g4i-Xs-nsp"/>
<constraint firstItem="MWs-NS-3QY" firstAttribute="centerY" secondItem="FPz-hJ-sI1" secondAttribute="centerY" constant="50" id="uAW-Hy-Oqs"/>
</constraints>
</view>
<connections>
<outlet property="textfield" destination="3Uf-dq-VkQ" id="evz-Sw-WgS"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="wtY-Or-mxU" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
<exit id="5cH-Dj-C6T" userLabel="Exit" sceneMemberID="exit"/>
</objects>
<point key="canvasLocation" x="861" y="18"/>
</scene>
</scenes>
<resources>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
45 changes: 45 additions & 0 deletions iOS_Study_B/SecondViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
//
// SecondViewController.swift
// iOS_Study_B
//
// Created by 임아영 on 2023/10/16.
//

import UIKit

class SecondViewController: UIViewController, ChangeLabelDelegate {
func doChange() {
previoisViewContRoller?.label.text = self.textfield.text
}



@IBOutlet weak var textfield: UITextField!
var previoisViewContRoller : ViewController?


@IBAction func ButtonDismiss(_ sender: Any) {
doChange()
dismiss(animated: true, completion: nil)
}


override func viewDidLoad() {
super.viewDidLoad()

// Do any additional setup after loading the view.
previoisViewContRoller?.delegate = self
}


/*
// MARK: - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/

}
27 changes: 23 additions & 4 deletions iOS_Study_B/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,32 @@

import UIKit

class ViewController: UIViewController {
protocol ChangeLabelDelegate{
func doChange()
}

class ViewController: UIViewController {

@IBOutlet weak var label: UILabel!

@IBAction func buttongonextVC(_ sender: Any) {
guard let nextVC = storyboard?.instantiateViewController(withIdentifier: "SecondViewController")as? SecondViewController else {
return
}

nextVC.previoisViewContRoller = self
nextVC.modalPresentationStyle = .fullScreen
present(nextVC, animated: true, completion: nil)
}

var delegate : ChangeLabelDelegate?


override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}





}