Skip to content

Commit

Permalink
Hide connect to another device button.
Browse files Browse the repository at this point in the history
  • Loading branch information
h-shan committed Jul 29, 2016
1 parent 7952029 commit 4102982
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion StrategicSoccer/ConnectionManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class ConnectionManager : NSObject{
func stringSend(message: String){
dispatch_async(dispatch_get_main_queue(), {
do {
try self.session.sendData(message.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)!, toPeers: self.connectedDevice!, withMode: MCSessionSendDataMode.Reliable)
try self.session.sendData(message.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)!, toPeers: self.connectedDevice!, withMode: MCSessionSendDataMode.Unreliable)
}
catch{
NSLog("%@","\(error)")
Expand Down
6 changes: 4 additions & 2 deletions StrategicSoccer/GameScene.swift
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,10 @@ class GameScene: SKScene, SKPhysicsContactDelegate {

override func update(currentTime: CFTimeInterval) {
if gType == .twoPhone && isHost{
viewController.parent.gameService.sendPosition(self)
viewController.parent.gameService.sendVelocities(self)
if loaded{
viewController.parent.gameService.sendPosition(self)
viewController.parent.gameService.sendVelocities(self)
}
if !loaded{
viewController.parent.gameService.sendLoad(loadNode)
}
Expand Down
9 changes: 5 additions & 4 deletions StrategicSoccer/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -981,10 +981,11 @@ PLAY MORE GAMES TO EARN COINS.</string>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="jS9-Co-kiM">
<rect key="frame" x="109" y="143" width="150" height="34"/>
<rect key="frame" x="94" y="140" width="180" height="40"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="width" constant="150" id="VgR-FN-lEF"/>
<constraint firstAttribute="height" constant="40" id="Q0i-VD-8xE"/>
<constraint firstAttribute="width" constant="180" id="VgR-FN-lEF"/>
</constraints>
<fontDescription key="fontDescription" name="Optima-Regular" family="Optima" pointSize="18"/>
<state key="normal" title="SINGLE PLAYER">
Expand All @@ -995,7 +996,7 @@ PLAY MORE GAMES TO EARN COINS.</string>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="rOR-Lg-LEu">
<rect key="frame" x="309" y="143" width="150" height="34"/>
<rect key="frame" x="294" y="140" width="180" height="40"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" name="Optima-Regular" family="Optima" pointSize="18"/>
<state key="normal" title="TWO PLAYERS">
Expand All @@ -1017,7 +1018,7 @@ PLAY MORE GAMES TO EARN COINS.</string>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="eEW-WU-dEc">
<rect key="frame" x="109" y="217" width="350" height="34"/>
<rect key="frame" x="94" y="220" width="380" height="34"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" name="Optima-Regular" family="Optima" pointSize="18"/>
<state key="normal" title="CONNECT TO ANOTHER DEVICE">
Expand Down
2 changes: 1 addition & 1 deletion StrategicSoccer/PlayViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class PlayViewController: UIViewController, UITableViewDelegate, UITableViewData
}
override func viewDidLoad() {
super.viewDidLoad()

ConnectToAnotherDevice.hidden = true
}
override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated)
Expand Down

0 comments on commit 4102982

Please sign in to comment.