Browse Source

Initial Commit

master
Lukas Bachschwell 4 years ago
parent
commit
1194c482e5
5 changed files with 101 additions and 6 deletions
  1. +3
    -0
      ClockTurn.xcodeproj/project.pbxproj
  2. +1
    -0
      ClockTurn/AppDelegate.swift
  3. +54
    -4
      ClockTurn/Base.lproj/Main.storyboard
  4. +5
    -2
      ClockTurn/Info.plist
  5. +38
    -0
      ClockTurn/ViewController.swift

+ 3
- 0
ClockTurn.xcodeproj/project.pbxproj View File

@@ -248,6 +248,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = ClockTurn/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.lbs.ClockTurn;
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -259,6 +260,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = ClockTurn/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.lbs.ClockTurn;
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -284,6 +286,7 @@
2BD975581C11A1EF006975BD /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};


+ 1
- 0
ClockTurn/AppDelegate.swift View File

@@ -16,6 +16,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
return true
}



+ 54
- 4
ClockTurn/Base.lproj/Main.storyboard View File

@@ -1,25 +1,75 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6211" systemVersion="14A298i" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9060" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6204"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9051"/>
</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="ClockTurn" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="t8D-dz-kwm">
<rect key="frame" x="0.0" y="152" width="320" height="150"/>
<animations/>
<color key="backgroundColor" red="0.18324335469342951" green="0.8775359948" blue="0.85880836594544896" alpha="1" colorSpace="calibratedRGB"/>
<state key="normal" title="Normal">
<color key="titleColor" red="0.94623655913978499" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
</state>
<connections>
<action selector="normal:" destination="BYZ-38-t0r" eventType="touchUpInside" id="Eg5-K3-2QL"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="M8Z-CV-SK3">
<rect key="frame" x="0.0" y="302" width="320" height="150"/>
<animations/>
<color key="backgroundColor" red="0.03434456504705663" green="0.33095503914696112" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<state key="normal" title="Backward">
<color key="titleColor" red="0.83832085840000004" green="0.8775359948" blue="0.87528198570000004" alpha="1" colorSpace="calibratedRGB"/>
</state>
<connections>
<action selector="backward:" destination="BYZ-38-t0r" eventType="touchUpInside" id="7eR-TM-jlt"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="P93-Ts-diL">
<rect key="frame" x="0.0" y="0.0" width="320" height="152"/>
<animations/>
<color key="backgroundColor" red="1" green="0.52718806483748826" blue="0.13980796598656298" alpha="1" colorSpace="calibratedRGB"/>
<color key="tintColor" red="0.91915844183221951" green="1" blue="0.98665738812806358" alpha="1" colorSpace="calibratedRGB"/>
<state key="normal" title="Forward">
<color key="titleColor" red="0.94623655913978499" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<color key="titleShadowColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
</state>
<connections>
<action selector="forward:" destination="BYZ-38-t0r" eventType="touchUpInside" id="r2L-La-dRF"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="rNk-mS-wEs">
<rect key="frame" x="0.0" y="450" width="320" height="118"/>
<animations/>
<color key="backgroundColor" red="1" green="0.041046944598614132" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<state key="normal" title="Ignite">
<color key="titleColor" red="0.83832085840000004" green="0.8775359948" blue="0.87528198570000004" alpha="1" colorSpace="calibratedRGB"/>
</state>
<connections>
<action selector="ignite:" destination="BYZ-38-t0r" eventType="touchUpInside" id="TBM-vQ-8Vm"/>
</connections>
</button>
</subviews>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="162" y="406"/>
</scene>
</scenes>
</document>

+ 5
- 2
ClockTurn/Info.plist View File

@@ -22,6 +22,11 @@
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
@@ -33,8 +38,6 @@
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>

+ 38
- 0
ClockTurn/ViewController.swift View File

@@ -10,6 +10,7 @@ import UIKit

class ViewController: UIViewController {

override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
@@ -20,6 +21,43 @@ class ViewController: UIViewController {
// Dispose of any resources that can be recreated.
}

@IBAction func forward(sender: AnyObject) {
self.sendClock("forward")
}

@IBAction func normal(sender: AnyObject) {
self.sendClock("normal")
}
@IBAction func backward(sender: AnyObject) {
self.sendClock("backward")
}
@IBAction func ignite(sender: AnyObject) {
self.sendClock("ig3") //does an ignite for 5 seconds in the clock....
}
func sendClock(macro: String){
let request = NSMutableURLRequest(URL: NSURL(string: "http://192.168.0.205:8080/" + macro)!)
request.HTTPMethod = "POST"
//let postString = "" // the body, empty in our case
//request.HTTPBody = postString.dataUsingEncoding(NSUTF8StringEncoding)
let task = NSURLSession.sharedSession().dataTaskWithRequest(request) {
data, response, error in
if error != nil {
print("error=\(error)")
return
}
print("response = \(response)")
let responseString = NSString(data: data!, encoding: NSUTF8StringEncoding)
print("responseString = \(responseString)")
}
task.resume()
}
}


Loading…
Cancel
Save