Skip to content

Commit

Permalink
Add view id and view score, change mp3 file.
Browse files Browse the repository at this point in the history
  • Loading branch information
AkkeyLab committed Nov 6, 2016
1 parent f805507 commit 5d7dadd
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 6 deletions.
12 changes: 6 additions & 6 deletions mezamaShare.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -220,27 +220,27 @@
66DB77781DCF6E9200D4F094 /* XIB */ = {
isa = PBXGroup;
children = (
66DB777A1DCF711500D4F094 /* ClearView.xib */,
66DB777E1DCF711500D4F094 /* StartUpView.xib */,
66DB777B1DCF711500D4F094 /* CreateRoomView.xib */,
66DB777C1DCF711500D4F094 /* EnterRoomView.xib */,
66DB777D1DCF711500D4F094 /* StampButtonView.xib */,
66DB777E1DCF711500D4F094 /* StartUpView.xib */,
66DB777F1DCF711500D4F094 /* WaitTimeView.xib */,
66DB777D1DCF711500D4F094 /* StampButtonView.xib */,
66DB77801DCF711500D4F094 /* WakeUpView.xib */,
66DB777A1DCF711500D4F094 /* ClearView.xib */,
);
name = XIB;
sourceTree = "<group>";
};
66DB77791DCF6EA800D4F094 /* Source */ = {
isa = PBXGroup;
children = (
66DB77881DCF715B00D4F094 /* ClearView.swift */,
66DB778C1DCF715B00D4F094 /* StartUpView.swift */,
66DB77891DCF715B00D4F094 /* CreateRoomView.swift */,
66DB778A1DCF715B00D4F094 /* EnterRoomView.swift */,
66DB778B1DCF715B00D4F094 /* StampButtonView.swift */,
66DB778C1DCF715B00D4F094 /* StartUpView.swift */,
66DB778D1DCF715B00D4F094 /* WaitTimeView.swift */,
66DB778B1DCF715B00D4F094 /* StampButtonView.swift */,
66DB778E1DCF715B00D4F094 /* WakeUpView.swift */,
66DB77881DCF715B00D4F094 /* ClearView.swift */,
);
name = Source;
sourceTree = "<group>";
Expand Down
5 changes: 5 additions & 0 deletions mezamaShare/Classes/View/Source/ClearView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@ import UIKit
class ClearView: UIView {

@IBOutlet weak var returnButton: UIButton!
@IBOutlet weak var pointLabel: UILabel!
private let userDefault = UserDefaults.standard

override func awakeFromNib() {
super.awakeFromNib()

returnButton.addTarget(MainViewController(), action: #selector(MainViewController.onReturn(sender:)), for: .touchUpInside)
if userDefault.object(forKey: "tapCount") != nil {
pointLabel.text = String( describing: userDefault.integer(forKey: "tapCount"))
}
}
}
5 changes: 5 additions & 0 deletions mezamaShare/Classes/View/Source/CreateRoomView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,18 @@ class CreateRoomView: UIView {

@IBOutlet weak var makeButton: UIButton!
@IBOutlet weak var inputID: UIButton!
@IBOutlet weak var idLabel: UILabel!
@IBOutlet weak var timePicker: UIDatePicker!
private var setTime: String = "00:00"
private let userDefault = UserDefaults.standard

override func awakeFromNib() {
super.awakeFromNib()

if userDefault.object(forKey: "myID") != nil {
idLabel.text = userDefault.object(forKey: "myID") as? String
}

makeButton.addTarget(MainViewController(), action: #selector(MainViewController.onMakrRoom(sender:)), for: .touchUpInside)
inputID.addTarget(MainViewController(), action: #selector(MainViewController.onInputID(sender:)), for: .touchUpInside)
timePicker.setValue(UIColor.white, forKey: "textColor")
Expand Down
21 changes: 21 additions & 0 deletions mezamaShare/Classes/View/Source/StampButtonView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ class StampButtonView: UIView {
@IBOutlet weak var button4: UIButton!
@IBOutlet weak var button5: UIButton!
@IBOutlet weak var button6: UIButton!
@IBOutlet weak var countLabel: UILabel!
private let userDefault = UserDefaults.standard
private var tapCount: Int = 0


// let audioPlay = AudioPlay()
Expand All @@ -34,6 +37,7 @@ class StampButtonView: UIView {
override func awakeFromNib() {
super.awakeFromNib()

countLabel.text = "100"
buttonSetup()
}

Expand All @@ -55,20 +59,37 @@ class StampButtonView: UIView {

@IBAction func onButton1(_ sender: UIButton) {
bkImage1.shake(toward: .top, amount: 0.5, duration: 0.5, delay: 0.0)
count()
}
@IBAction func onButton2(_ sender: UIButton) {
bkImage2.shake(toward: .top, amount: 0.5, duration: 0.5, delay: 0.0)
count()
}
@IBAction func onButton3(_ sender: UIButton) {
bkImage3.shake(toward: .top, amount: 0.5, duration: 0.5, delay: 0.0)
count()
}
@IBAction func onButton4(_ sender: UIButton) {
bkImage4.shake(toward: .top, amount: 0.5, duration: 0.5, delay: 0.0)
count()
}
@IBAction func onButton5(_ sender: UIButton) {
bkImage5.shake(toward: .top, amount: 0.5, duration: 0.5, delay: 0.0)
count()
}
@IBAction func onButton6(_ sender: UIButton) {
bkImage6.shake(toward: .top, amount: 0.5, duration: 0.5, delay: 0.0)

}

func count() {
tapCount += 1
if tapCount > 100 {
countLabel.text = "0"
} else {
countLabel.text = String(100 - tapCount)
}
userDefault.set(tapCount, forKey: "tapCount")
self.userDefault.synchronize()
}
}
10 changes: 10 additions & 0 deletions mezamaShare/Classes/View/Source/WaitTimeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,15 @@
import UIKit

class WaitTimeView: UIView {
@IBOutlet weak var roomNameLabel: UILabel!
@IBOutlet weak var myID: UILabel!
private let userDefault = UserDefaults.standard

override func awakeFromNib() {
super.awakeFromNib()
if userDefault.object(forKey: "myID") != nil {
roomNameLabel.text = userDefault.object(forKey: "myID") as? String
myID.text = userDefault.object(forKey: "myID") as? String
}
}
}
14 changes: 14 additions & 0 deletions mezamaShare/Classes/View/XIB/ClearView.xib
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,28 @@
<constraint firstAttribute="width" secondItem="7ly-oh-ACL" secondAttribute="height" multiplier="343:100" id="gUR-2Q-UnD"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="100" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="QG2-yz-vZg">
<rect key="frame" x="16" y="485" width="222" height="55"/>
<color key="backgroundColor" red="0.12549019610000001" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="width" constant="222" id="2l3-1y-SGX"/>
<constraint firstAttribute="width" secondItem="QG2-yz-vZg" secondAttribute="height" multiplier="222:55" id="yha-0t-M0d"/>
</constraints>
<fontDescription key="fontDescription" type="system" weight="black" pointSize="30"/>
<color key="textColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="0.12549019610000001" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="Idc-Ir-z73" firstAttribute="top" secondItem="7ly-oh-ACL" secondAttribute="bottom" constant="8" id="6k8-bQ-BRi"/>
<constraint firstAttribute="bottom" secondItem="PRC-Wu-8kk" secondAttribute="bottom" constant="20" id="7fN-fQ-wNB"/>
<constraint firstItem="7ly-oh-ACL" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="16" id="8LT-K5-Y0q"/>
<constraint firstItem="PRC-Wu-8kk" firstAttribute="top" secondItem="QG2-yz-vZg" secondAttribute="bottom" constant="8" id="Adr-jT-JLE"/>
<constraint firstItem="XqU-ho-c1g" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="16" id="BJT-kV-7Cs"/>
<constraint firstItem="PRC-Wu-8kk" firstAttribute="top" secondItem="7ly-oh-ACL" secondAttribute="bottom" constant="8" id="F0S-do-7FD"/>
<constraint firstItem="XqU-ho-c1g" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="8" id="KOc-ls-kXd"/>
<constraint firstItem="QG2-yz-vZg" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="16" id="PBz-dg-MKI"/>
<constraint firstAttribute="bottom" secondItem="Idc-Ir-z73" secondAttribute="bottom" constant="20" id="WGE-kh-0FG"/>
<constraint firstAttribute="trailing" secondItem="PRC-Wu-8kk" secondAttribute="trailing" constant="16" id="fKa-Oj-1IL"/>
<constraint firstAttribute="trailing" secondItem="Idc-Ir-z73" secondAttribute="trailing" constant="16" id="jxM-WS-he6"/>
Expand All @@ -58,6 +71,7 @@
<nil key="simulatedStatusBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<connections>
<outlet property="pointLabel" destination="QG2-yz-vZg" id="wgJ-u2-4Ck"/>
<outlet property="returnButton" destination="PRC-Wu-8kk" id="OmA-kb-bc5"/>
</connections>
<point key="canvasLocation" x="33.5" y="54.5"/>
Expand Down
1 change: 1 addition & 0 deletions mezamaShare/Classes/View/XIB/CreateRoomView.xib
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
<nil key="simulatedStatusBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<connections>
<outlet property="idLabel" destination="fRU-96-rIT" id="Ggj-uF-9Yu"/>
<outlet property="inputID" destination="ElJ-i8-hM3" id="pcn-E1-Stw"/>
<outlet property="makeButton" destination="kLP-1Z-6ce" id="zlC-zR-5wZ"/>
<outlet property="timePicker" destination="at9-bj-QqP" id="nz6-fi-EOO"/>
Expand Down
1 change: 1 addition & 0 deletions mezamaShare/Classes/View/XIB/StampButtonView.xib
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@
<outlet property="button4" destination="xWU-bi-oVG" id="l9P-AG-CS0"/>
<outlet property="button5" destination="i1J-rQ-uZz" id="9sp-9T-IJ9"/>
<outlet property="button6" destination="FGr-fd-Le4" id="rMs-uf-USj"/>
<outlet property="countLabel" destination="urk-KS-lNo" id="vbG-lV-gQQ"/>
</connections>
<point key="canvasLocation" x="33.5" y="27.5"/>
</view>
Expand Down
4 changes: 4 additions & 0 deletions mezamaShare/Classes/View/XIB/WaitTimeView.xib
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@
</constraints>
<nil key="simulatedStatusBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<connections>
<outlet property="myID" destination="Aq2-36-9Ek" id="muh-rm-173"/>
<outlet property="roomNameLabel" destination="dOc-Wm-475" id="U0a-Wr-Gdl"/>
</connections>
<point key="canvasLocation" x="33.5" y="54.5"/>
</view>
</objects>
Expand Down
Binary file modified mezamaShare/Resources/Audio/mezamashare_good-morning.mp3
Binary file not shown.

0 comments on commit 5d7dadd

Please sign in to comment.