Initial Commit

This commit is contained in:
Lukas Bachschwell 2016-01-03 11:44:36 +01:00
parent 1a14a8d1bc
commit 1194c482e5
5 changed files with 101 additions and 6 deletions

View File

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

View File

@ -16,6 +16,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch. // Override point for customization after application launch.
return true return true
} }

View File

@ -1,25 +1,75 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?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> <dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6204"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9051"/>
</dependencies> </dependencies>
<scenes> <scenes>
<!--View Controller--> <!--View Controller-->
<scene sceneID="tne-QT-ifu"> <scene sceneID="tne-QT-ifu">
<objects> <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> <layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/> <viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/> <viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides> </layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC"> <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"/> <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"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view> </view>
</viewController> </viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects> </objects>
<point key="canvasLocation" x="162" y="406"/>
</scene> </scene>
</scenes> </scenes>
</document> </document>

View File

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

View File

@ -10,6 +10,7 @@ import UIKit
class ViewController: UIViewController { class ViewController: UIViewController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib. // 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. // 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()
}
} }