Update Xcode 7

This commit is contained in:
workinghard
2015-10-03 20:04:55 -07:00
committed by Nik
parent e1224d2b44
commit 7b6d40d161
10 changed files with 58 additions and 48 deletions

View File

@@ -231,7 +231,9 @@
ADCB864D1AC6471C00E300C7 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0620;
LastSwiftMigration = 0700;
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0700;
ORGANIZATIONNAME = "Nikolai Rinas";
TargetAttributes = {
ADCB86541AC6471C00E300C7 = {
@@ -335,6 +337,7 @@
CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
@@ -407,6 +410,7 @@
"$(PROJECT_DIR)",
"$(PROJECT_DIR)/Cube4Fun/Poco",
);
PRODUCT_BUNDLE_IDENTIFIER = "nikolairinas.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Cube4Fun/src/Cube4Fun-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@@ -429,6 +433,7 @@
"$(PROJECT_DIR)",
"$(PROJECT_DIR)/Cube4Fun/Poco",
);
PRODUCT_BUNDLE_IDENTIFIER = "nikolairinas.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Cube4Fun/src/Cube4Fun-Bridging-Header.h";
USER_HEADER_SEARCH_PATHS = /opt/local/include;

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0620"
LastUpgradeVersion = "0700"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -37,10 +37,10 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
@@ -62,15 +62,18 @@
ReferencedContainer = "container:Cube4Fun.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
@@ -86,10 +89,10 @@
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">

View File

@@ -9,7 +9,7 @@
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>nikolairinas.$(PRODUCT_NAME:rfc1034identifier)</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>

View File

@@ -206,14 +206,14 @@ class Animations: NSObject {
func addAnimation() {
_animationArray.append(self.newAnimation())
println("append Animation. count: \(_animationArray.count)")
print("append Animation. count: \(_animationArray.count)")
}
func newAnimation() -> (NSMutableDictionary) {
println("create new animation")
print("create new animation")
return [AnimName: "Animation1", AnimKey: "1=anim1", AnimDuration: 10, AnimSpeed: 500, AnimFrames: self.newFrame()]
}
func newFrame() -> (NSMutableData) {
println("create new frame")
print("create new frame")
return NSMutableData(bytes: _emptyFrame, length: 64)
}
func addFrame() {
@@ -232,18 +232,18 @@ class Animations: NSObject {
// Insert empty frame at the current position
// Get Array
var myData: NSMutableData = (self.getAnimation(_animationSelected)).objectForKey(AnimFrames) as! NSMutableData
var myDataBytes = self.getAnimDataSelected()
let myData: NSMutableData = (self.getAnimation(_animationSelected)).objectForKey(AnimFrames) as! NSMutableData
let myDataBytes = self.getAnimDataSelected()
// Get startPositions of the selected frame
var frameStartPos = (self.getAnimationFrameID()-1)*64
let frameStartPos = (self.getAnimationFrameID()-1)*64
// Append one empty frame at the end
self.addFrame()
var lastArrPos: Int = myData.length - 1
println("Framestart: \(frameStartPos)")
println("Framelength: \(lastArrPos)")
print("Framestart: \(frameStartPos)")
print("Framelength: \(lastArrPos)")
// copy frames
while ( lastArrPos >= frameStartPos + 64) {
@@ -260,18 +260,18 @@ class Animations: NSObject {
func deleteDisplFrame() {
println("delete frame")
print("delete frame")
// Get Array
var myData: NSMutableData = (self.getAnimation(_animationSelected)).objectForKey(AnimFrames) as! NSMutableData
var myDataBytes = self.getAnimDataSelected()
let myData: NSMutableData = (self.getAnimation(_animationSelected)).objectForKey(AnimFrames) as! NSMutableData
let myDataBytes = self.getAnimDataSelected()
// Get startPositions of the selected frame
var frameStartPos = (self.getAnimationFrameID()-1)*64
var lastArrPos: Int = myData.length - 1 - 64
println("Framestart: \(frameStartPos)")
println("Framelength: \(lastArrPos)")
let lastArrPos: Int = myData.length - 1 - 64
print("Framestart: \(frameStartPos)")
print("Framelength: \(lastArrPos)")
// copy frames (fill deleted frame)
while ( frameStartPos <= lastArrPos ) {
@@ -352,7 +352,7 @@ class Animations: NSObject {
func setLEDColor(color: UInt8, led: Int) {
//println("Led pressed: \(led)")
var myByte: [UInt8] = [color]
let myByte: [UInt8] = [color]
let myData: NSMutableData = (self.getAnimation(_animationSelected)).objectForKey(AnimFrames) as! NSMutableData
let bytePosition = NSMakeRange(((self.getAnimationFrameID()-1)*64)+led, 1)
myData.replaceBytesInRange(bytePosition, withBytes: myByte)

View File

@@ -87,7 +87,7 @@ class AnimationsController: NSObject, NSTableViewDataSource, NSTableViewDelegate
func tableViewSelectionDidChange(notification: NSNotification) {
let view: NSTableView = notification.object as! NSTableView
println("klicked \(view.selectedRow)")
print("klicked \(view.selectedRow)")
__animations.setSelectedAnimationID(view.selectedRow)
_gameView.resetView()
@@ -97,7 +97,7 @@ class AnimationsController: NSObject, NSTableViewDataSource, NSTableViewDelegate
//_selectedAnimation = view.selectedRow
println("klicked \(view.selectedRow)")
print("klicked \(view.selectedRow)")
}
func tableView(tableView: NSTableView, setObjectValue object: AnyObject?, forTableColumn tableColumn: NSTableColumn?, row: Int) {
@@ -174,7 +174,7 @@ class AnimationsController: NSObject, NSTableViewDataSource, NSTableViewDelegate
@IBAction func exportAnimations(send: AnyObject) {
var sendData: [UInt8] = [UInt8]()
println("Import button pressed")
print("Import button pressed")
// for each animation
for ( var i = 0; i < __animations.count(); ++i ) {

View File

@@ -77,7 +77,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSTextFieldDelegate {
// probably doesn't have a createPDF() method. self.createPDF(exportedFileURL)
}
} // End block
println("save pressed")
print("save pressed")
}
@IBAction func openDocument(sender: AnyObject) {
@@ -144,13 +144,13 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSTextFieldDelegate {
if myField.identifier == "IPADDR_FIELD" {
if validIPAddress(myField.stringValue) {
__prefData.setIPAddr(myField.stringValue)
println("Changing ip address field")
print("Changing ip address field")
}
}
if myField.identifier == "PORTNR_FIELD" {
if validPortNr(myField.integerValue) {
__prefData.setPortNr(myField.integerValue)
println("Changing port number")
print("Changing port number")
}
}
}

View File

@@ -42,7 +42,7 @@ class GameView: SCNView {
}
func resetView() {
println("Reset view")
Swift.print("Reset view")
// goto first frame
self.firstButtonPressed()
@@ -105,7 +105,7 @@ class GameView: SCNView {
if let rootNode = self.scene?.rootNode {
for childNode in rootNode.childNodes {
let buttonNode: SCNNode = childNode as! SCNNode
let buttonNode: SCNNode = childNode
if buttonNode.name == "myNextFrameButton" {
buttonNode.hidden = !nextFrame;
}
@@ -277,7 +277,7 @@ class GameView: SCNView {
func updateSpeedText() {
if let rootNode = self.scene?.rootNode {
for childNode in rootNode.childNodes {
let buttonNode: SCNNode = childNode as! SCNNode
let buttonNode: SCNNode = childNode
if buttonNode.name == "mySpeedText" {
let geometry:SCNText = buttonNode.geometry as! SCNText
geometry.string = "Speed: \(__animations.animationSpeedInt()) ms"
@@ -320,7 +320,8 @@ class GameView: SCNView {
override func rightMouseDown(theEvent: NSEvent) {
let p = self.convertPoint(theEvent.locationInWindow, fromView: nil)
if let hitResults = self.hitTest(p, options: nil) {
let hitResults = self.hitTest(p, options: nil)
// if let hitResults = self.hitTest(p, options: nil) {
// check that we clicked on at least one object
if hitResults.count > 0 {
// retrieved the first clicked object
@@ -345,7 +346,7 @@ class GameView: SCNView {
}
}
}
}
// }
}
override func mouseDown(theEvent: NSEvent) {
@@ -357,7 +358,8 @@ class GameView: SCNView {
// check what nodes are clicked
let p = self.convertPoint(theEvent.locationInWindow, fromView: nil)
if let hitResults = self.hitTest(p, options: nil) {
let hitResults = self.hitTest(p, options: nil)
// if let hitResults = self.hitTest(p, options: nil) {
// check that we clicked on at least one object
if hitResults.count > 0 {
// retrieved the first clicked object
@@ -415,7 +417,7 @@ class GameView: SCNView {
klickedColor = 253 // Maximum value
}else{
klickedColor = UInt8(colorInt)
println(klickedColor)
Swift.print(klickedColor)
}
}
// Move arrows to the clicked position
@@ -513,7 +515,7 @@ class GameView: SCNView {
}
}
}
// }
super.mouseDown(theEvent)
}
@@ -528,7 +530,7 @@ class GameView: SCNView {
SCNTransaction.commit()
}
func rotateCamera(var x: CGFloat, var y: CGFloat) {
func rotateCamera(x: CGFloat, y: CGFloat) {
// Save the angle for reset
startAngle = startAngle + y
@@ -614,7 +616,7 @@ class GameView: SCNView {
super.keyDown(theEvent)
}
println(theEvent.keyCode);
Swift.print(theEvent.keyCode);
//super.keyDown(theEvent)

View File

@@ -124,9 +124,9 @@ class GameViewController: NSViewController { // SCNSceneRendererDelegate
// Open connection to the LED cube
let established = CubeNetworkObj.openConnection(__prefData.ipAddr(), port: UInt32(__prefData.portNR()))
if established {
println("connection established")
print("connection established")
}else{
println("connection failed")
print("connection failed")
}
__animations.sendFrame()
@@ -153,7 +153,7 @@ class GameViewController: NSViewController { // SCNSceneRendererDelegate
scene.rootNode.addChildNode(cameraNode)
// place the camera
var newAngle = (CGFloat)(20.0)*(CGFloat)(M_PI)/180.0
let newAngle = (CGFloat)(20.0)*(CGFloat)(M_PI)/180.0
//newAngle += currentAngle
// cameraNode.transform = SCNMatrix4MakeRotation(-0.5, 0, 0, 1)

View File

@@ -169,7 +169,7 @@ class PrimitivesScene: SCNScene {
override init() {
super.init()
var radius:CGFloat = 1.0
let radius:CGFloat = 1.0
let yCount = 4
let zCount = 4
@@ -239,11 +239,11 @@ class PrimitivesScene: SCNScene {
var y:CGFloat = edgePosY
for row in 0..<yCount {
for _ in 0..<yCount { // row
var z:CGFloat = edgePosZ
for depth in 0..<zCount {
for _ in 0..<zCount { // depth
var x:CGFloat = edgePosX
for column in 0..<xCount {
for _ in 0..<xCount { // column
let sphereGeometry = SCNSphere(radius: radius)
sphereGeometry.name = myIndex.description
@@ -277,7 +277,7 @@ class PrimitivesScene: SCNScene {
}
required init(coder aDecoder: NSCoder) {
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}

View File

@@ -60,5 +60,5 @@ The application is written in a new apple programming language [Swift](https://d
[logo]: http://cube4fun.net/public/Cube6-128j.png "Logo"
[overviewIMG1]: http://cube4fun.net/public/Overview-Pic1.png "Overview"
[logo]: http://cube4fun.net/images/Cube6-128j.png "Logo"
[overviewIMG1]: http://cube4fun.net/images/Overview-Pic1.png "Overview"