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

View File

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

View File

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

View File

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

View File

@@ -87,7 +87,7 @@ class AnimationsController: NSObject, NSTableViewDataSource, NSTableViewDelegate
func tableViewSelectionDidChange(notification: NSNotification) { func tableViewSelectionDidChange(notification: NSNotification) {
let view: NSTableView = notification.object as! NSTableView let view: NSTableView = notification.object as! NSTableView
println("klicked \(view.selectedRow)") print("klicked \(view.selectedRow)")
__animations.setSelectedAnimationID(view.selectedRow) __animations.setSelectedAnimationID(view.selectedRow)
_gameView.resetView() _gameView.resetView()
@@ -97,7 +97,7 @@ class AnimationsController: NSObject, NSTableViewDataSource, NSTableViewDelegate
//_selectedAnimation = view.selectedRow //_selectedAnimation = view.selectedRow
println("klicked \(view.selectedRow)") print("klicked \(view.selectedRow)")
} }
func tableView(tableView: NSTableView, setObjectValue object: AnyObject?, forTableColumn tableColumn: NSTableColumn?, row: Int) { 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) { @IBAction func exportAnimations(send: AnyObject) {
var sendData: [UInt8] = [UInt8]() var sendData: [UInt8] = [UInt8]()
println("Import button pressed") print("Import button pressed")
// for each animation // for each animation
for ( var i = 0; i < __animations.count(); ++i ) { 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) // probably doesn't have a createPDF() method. self.createPDF(exportedFileURL)
} }
} // End block } // End block
println("save pressed") print("save pressed")
} }
@IBAction func openDocument(sender: AnyObject) { @IBAction func openDocument(sender: AnyObject) {
@@ -144,13 +144,13 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSTextFieldDelegate {
if myField.identifier == "IPADDR_FIELD" { if myField.identifier == "IPADDR_FIELD" {
if validIPAddress(myField.stringValue) { if validIPAddress(myField.stringValue) {
__prefData.setIPAddr(myField.stringValue) __prefData.setIPAddr(myField.stringValue)
println("Changing ip address field") print("Changing ip address field")
} }
} }
if myField.identifier == "PORTNR_FIELD" { if myField.identifier == "PORTNR_FIELD" {
if validPortNr(myField.integerValue) { if validPortNr(myField.integerValue) {
__prefData.setPortNr(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() { func resetView() {
println("Reset view") Swift.print("Reset view")
// goto first frame // goto first frame
self.firstButtonPressed() self.firstButtonPressed()
@@ -105,7 +105,7 @@ class GameView: SCNView {
if let rootNode = self.scene?.rootNode { if let rootNode = self.scene?.rootNode {
for childNode in rootNode.childNodes { for childNode in rootNode.childNodes {
let buttonNode: SCNNode = childNode as! SCNNode let buttonNode: SCNNode = childNode
if buttonNode.name == "myNextFrameButton" { if buttonNode.name == "myNextFrameButton" {
buttonNode.hidden = !nextFrame; buttonNode.hidden = !nextFrame;
} }
@@ -277,7 +277,7 @@ class GameView: SCNView {
func updateSpeedText() { func updateSpeedText() {
if let rootNode = self.scene?.rootNode { if let rootNode = self.scene?.rootNode {
for childNode in rootNode.childNodes { for childNode in rootNode.childNodes {
let buttonNode: SCNNode = childNode as! SCNNode let buttonNode: SCNNode = childNode
if buttonNode.name == "mySpeedText" { if buttonNode.name == "mySpeedText" {
let geometry:SCNText = buttonNode.geometry as! SCNText let geometry:SCNText = buttonNode.geometry as! SCNText
geometry.string = "Speed: \(__animations.animationSpeedInt()) ms" geometry.string = "Speed: \(__animations.animationSpeedInt()) ms"
@@ -320,7 +320,8 @@ class GameView: SCNView {
override func rightMouseDown(theEvent: NSEvent) { override func rightMouseDown(theEvent: NSEvent) {
let p = self.convertPoint(theEvent.locationInWindow, fromView: nil) 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 // check that we clicked on at least one object
if hitResults.count > 0 { if hitResults.count > 0 {
// retrieved the first clicked object // retrieved the first clicked object
@@ -345,7 +346,7 @@ class GameView: SCNView {
} }
} }
} }
} // }
} }
override func mouseDown(theEvent: NSEvent) { override func mouseDown(theEvent: NSEvent) {
@@ -357,7 +358,8 @@ class GameView: SCNView {
// check what nodes are clicked // check what nodes are clicked
let p = self.convertPoint(theEvent.locationInWindow, fromView: nil) 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 // check that we clicked on at least one object
if hitResults.count > 0 { if hitResults.count > 0 {
// retrieved the first clicked object // retrieved the first clicked object
@@ -415,7 +417,7 @@ class GameView: SCNView {
klickedColor = 253 // Maximum value klickedColor = 253 // Maximum value
}else{ }else{
klickedColor = UInt8(colorInt) klickedColor = UInt8(colorInt)
println(klickedColor) Swift.print(klickedColor)
} }
} }
// Move arrows to the clicked position // Move arrows to the clicked position
@@ -513,7 +515,7 @@ class GameView: SCNView {
} }
} }
} // }
super.mouseDown(theEvent) super.mouseDown(theEvent)
} }
@@ -528,7 +530,7 @@ class GameView: SCNView {
SCNTransaction.commit() SCNTransaction.commit()
} }
func rotateCamera(var x: CGFloat, var y: CGFloat) { func rotateCamera(x: CGFloat, y: CGFloat) {
// Save the angle for reset // Save the angle for reset
startAngle = startAngle + y startAngle = startAngle + y
@@ -614,7 +616,7 @@ class GameView: SCNView {
super.keyDown(theEvent) super.keyDown(theEvent)
} }
println(theEvent.keyCode); Swift.print(theEvent.keyCode);
//super.keyDown(theEvent) //super.keyDown(theEvent)

View File

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

View File

@@ -169,7 +169,7 @@ class PrimitivesScene: SCNScene {
override init() { override init() {
super.init() super.init()
var radius:CGFloat = 1.0 let radius:CGFloat = 1.0
let yCount = 4 let yCount = 4
let zCount = 4 let zCount = 4
@@ -239,11 +239,11 @@ class PrimitivesScene: SCNScene {
var y:CGFloat = edgePosY var y:CGFloat = edgePosY
for row in 0..<yCount { for _ in 0..<yCount { // row
var z:CGFloat = edgePosZ var z:CGFloat = edgePosZ
for depth in 0..<zCount { for _ in 0..<zCount { // depth
var x:CGFloat = edgePosX var x:CGFloat = edgePosX
for column in 0..<xCount { for _ in 0..<xCount { // column
let sphereGeometry = SCNSphere(radius: radius) let sphereGeometry = SCNSphere(radius: radius)
sphereGeometry.name = myIndex.description 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") 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" [logo]: http://cube4fun.net/images/Cube6-128j.png "Logo"
[overviewIMG1]: http://cube4fun.net/public/Overview-Pic1.png "Overview" [overviewIMG1]: http://cube4fun.net/images/Overview-Pic1.png "Overview"