Skip to content

Commit

Permalink
メイン
Browse files Browse the repository at this point in the history
  • Loading branch information
n-seiji committed Aug 5, 2019
1 parent 93ca8fc commit 2ac1fe9
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 12 deletions.
Binary file not shown.
30 changes: 20 additions & 10 deletions 駐ring/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,33 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Khb-Gj-vGr">
<rect key="frame" x="33" y="181" width="295" height="106"/>
<rect key="frame" x="33" y="212" width="295" height="106"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="54"/>
<state key="normal" title="get"/>
<fontDescription key="fontDescription" type="system" pointSize="77"/>
<state key="normal" title="Get"/>
<connections>
<action selector="button:" destination="BYZ-38-t0r" eventType="touchUpInside" id="tAA-rs-oEM"/>
<segue destination="YDK-o1-LkP" kind="show" id="46N-bI-2KQ"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Hv9-py-X6D">
<rect key="frame" x="105" y="366" width="165" height="86"/>
<rect key="frame" x="105" y="438" width="165" height="86"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="50"/>
<state key="normal" title="reset"/>
<state key="normal" title="Reset"/>
<connections>
<action selector="reset:" destination="BYZ-38-t0r" eventType="touchUpInside" id="P40-rN-6rL"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="hGA-cI-3pQ">
<rect key="frame" x="139" y="350" width="98" height="72"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="50"/>
<state key="normal" title="Print"/>
<connections>
<action selector="review:" destination="BYZ-38-t0r" eventType="touchUpInside" id="uxc-UD-eTY"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
Expand All @@ -49,15 +58,16 @@
<!--View ControllerA-->
<scene sceneID="Z4d-Xp-i31">
<objects>
<viewController id="YDK-o1-LkP" customClass="ViewControllerA" customModule="駐ring" customModuleProvider="target" sceneMemberID="viewController">
<viewController storyboardIdentifier="map" id="YDK-o1-LkP" customClass="ViewControllerA" customModule="駐ring" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="FZM-vR-hZN">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="zTB-YM-37G">
<rect key="frame" x="162" y="565" width="51" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="goback"/>
<rect key="frame" x="134" y="549" width="107" height="72"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="50"/>
<state key="normal" title="Back"/>
<connections>
<segue destination="BYZ-38-t0r" kind="show" id="01S-t6-zae"/>
</connections>
Expand All @@ -69,7 +79,7 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="7AR-xH-7U3" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="60" y="-64"/>
<point key="canvasLocation" x="60" y="-64.31784107946028"/>
</scene>
</scenes>
</document>
15 changes: 13 additions & 2 deletions 駐ring/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ class ViewController: UIViewController {

// 「リセット」ボタンに対応
@IBAction func reset(_ sender: Any) {
initialText1 = "000.0000" //初期化テキスト
initialText2 = "000.0000" //初期化テキスト
initialText1 = "999.0000" //初期化テキスト
initialText2 = "999.0000" //初期化テキスト
// DocumentディレクトリのfileURLを取得
if let documentDirectoryFileURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).last {
// ディレクトリのパスにファイル名をつなげてファイルのフルパスを作る
Expand All @@ -186,6 +186,17 @@ class ViewController: UIViewController {
}
}

@IBAction func review(_ sender: Any) {
if atof(contents1) != 999 {
//まずは、同じstororyboard内であることをここで定義します
let storyboard: UIStoryboard = self.storyboard!
//ここで移動先のstoryboardを選択(今回の場合は先ほどsecondと名付けたのでそれを書きます)
let second = storyboard.instantiateViewController(withIdentifier: "map")
//ここが実際に移動するコードとなります
self.present(second, animated: true, completion: nil)
}
}

@IBAction func watch_map(_ sender: UIButton) {
self.view.addSubview(googleMap)
}
Expand Down

0 comments on commit 2ac1fe9

Please sign in to comment.