Search results for

xcode github

94,046 results found

Post

Replies

Boosts

Views

Activity

Grid mode in SpriteKit scene editor! NEED!
Xcode 7 has great tools for creation game levels.But why we can't use grid-mode in scene editor?! It is a really important thing!For example, I need to fast creation of my platformer-style game.So I need to put sprites and nodes fast and CORRECTLY (to correct positions)...Without grid-mode this work is horrible, slow and not effective... Cause itvery difficult to put nodes together fast and to correct positions, without overlapping and without one-pixel hole.What you think about it? And I wonder what Apple think about it?
3
0
1k
Jun ’15
Watch Simulator not loading watchOS apps in 7 beta
I searched to see if anyone else is having this problem, but haven't seen anything yet. When I try to load a program into the XCode 7 watch simulator, I get a failed to load application error and the app never loads into the simulator. I have tried restarting everything to no avail. Does anyone know how I might reset things so I can get my apps to load on the simulator? Thanks!
6
0
2.5k
Jun ’15
Reply to Failable initializers for Classes
You could do it like thisfunc randomlyDangerousInt() throws -> Int { let potential = arc4random() if (potential == UInt32.max) {throw NSError(domain: overflow, code:0, userInfo: nil)} if (potential % 4 == 0) {throw NSError(domain: invalid, code:666, userInfo: nil)} else {return Int(potential)} } class TestClass { let x: Int let y: Int let z: Int init?() { var shouldFail = false do {x = try randomlyDangerousInt()} catch {shouldFail = true; x = 0} do {y = try randomlyDangerousInt()} catch {shouldFail = true; y = 0} do {z = try randomlyDangerousInt()} catch {shouldFail = true; z = 0} if (shouldFail) {return nil} } } let a = TestClass() let b = TestClass() let c = TestClass()Or, you could make your class a struct if that would work (and then can return nil at any point during initialization), or encapsulate parts of your class in a separate struct like this:struct CTCResources { let x: Int let y: Int let z: Int init?() { do { x = try randomlyDanger
Topic: Programming Languages SubTopic: Swift Tags:
Jun ’15
XCode Interface Builder and Simulator basics
This is my first foray into iOS and using XCode development. After making a brisk start using iOS ToDo List tutorial...I have become stuck on following issues and cannot progress! Please help...How do I get different scenes to align in storyboard. I cant seem to drag the 3rd scene and align it to the other two. I have cleared all constraints.When creating Segues to link two scenes on canvas - the scenes are not on the full screen...How do I drag from on be scene to another AND scroll the screen at the same time?Utility area - How do we scroll further down to see content e.g. properties in Attributes Inspector? The frameworks at the bottom right of the screen seem to prevent this.iOS Simulator - Running the iOS introductory ToDo list tutorial - for some reason the table view controller starts in the middle of the screen and I cannot scroll up in the simulator.iOS Simulator - Navigation Controller's Navigation bar and the bar buttons don't show.
0
0
269
Jun ’15
libxml2.2.dylib -> libxml.2.2.tbd
With the move from .dylib to .tbd, a move I understand little of, my app is not enjoying the transition, and searching online, apparently it's not just mine (and not just libxml2.2).Here is my small error list:Undefined symbols for architecture x86_64: _htmlReadMemory, referenced from: _PerformHTMLXPathQueryWithEncoding in XPathQuery.o _xmlBufferCreate, referenced from: _DictionaryForNode in XPathQuery.o _xmlBufferFree, referenced from: _DictionaryForNode in XPathQuery.o _xmlFree, referenced from: _DictionaryForNode in XPathQuery.o _xmlFreeDoc, referenced from: _PerformHTMLXPathQueryWithEncoding in XPathQuery.o _PerformXMLXPathQueryWithEncoding in XPathQuery.o _xmlNodeDump, referenced from: _DictionaryForNode in XPathQuery.o _xmlNodeGetContent, referenced from: _DictionaryForNode in XPathQuery.o _xmlReadMemory, referenced from: _PerformXMLXPathQueryWithEncoding in XPathQuery.o _xmlXPathEvalExpression, referenced from: _PerformXPathQuery in XPathQuery.o _xmlXPathFreeContext, referenced from: _PerformXPathQuery
1
0
9.8k
Jun ’15
Reply to Is there a space for Xcode 7?
I'm wondering if there's a way to get the Watchkit 1.0 SDK on Xcode 7. I'm attempting to co-develop WK1.0 / WK2.0 now, and don't see a way to set WK deployment to 1.0 and programmatically choose which communications methods (e.g., WatchConnectivity Framework for WK2.0 vs. openParentApplication for iOS 8 / WK1.0). Anyone have suggestions?
Jun ’15
Reply to Need Help With WatchKit
I think that the openParentApplication() is the fallback you would use on Watchkit 1.0 / iOS 8.x deployments. For the Watchkit 2.0 / iOS 9.x deployments, the WatchConnectivity framework is the way to go. I'm not sure how to implement the if #available() tests though, since it appears that Watchkit 1.0 SDK is missing from Xcode 7 currently. Additionally, we'd probably have to assume that the user will be forced to upgrade both iOS (to 9.x) and Watch OS (to 2.x) simultaneously when the production versions are rolled out, so we can use some variant of if #available(iOS 9.0, Watchkit 2.0, *) for our tests.Any thoughts on writing Watchkit 2.0 apps that also run on WK 1.0? Or just assume we push a new version, and keep a couple of branches (yuck!)?[edit] It appears that you can add a WatchKit 1.0 target to the project, and then share some files between the two variants. Now, I still need to find out how to get WatchKit 1.0 sdk into Xcode 7...
Topic: App & System Services SubTopic: General Tags:
Jun ’15
Single & Double quotes corrupting text
In all my text editors, when I type either a single or double quote mark for a variable, El Capitan is doing odd things with the text characters immediately after the quote, such as adding a diacritic mark or just deleting the text or putting the quote mark on the other side of the last letter so that it is outside the quotes. It makes writing code very frustrating. I've search through system preferences to see if there was something affecting quotes in El Capitan, but haven't found anything yet. This happens even in the Xcode beta for El Capitan, as well as Sublime Text 3, Atom, Visual Studio Code and even in TextEdit.
1
0
551
Jun ’15
Reply to CalendarUnit
OptionSets are handled differently now in Swift 2.0 and use set syntax instead of bitwise operators to join and test them.Option sets support set literal syntax, and set-like methods such as contains: object.invokeMethodWithOptions([.OptionA, .OptionB]) object.invokeMethodWithOptions([]) if options.contains(.OptionC) { // .OptionC is set }See the Xcode 7 beta release notes or either of the following threads for more info:https://forums.developer.apple.com/thread/4561https://forums.developer.apple.com/thread/3623
Topic: App & System Services SubTopic: Core OS Tags:
Jun ’15
Reply to .m and .h files not being added to target
If you select the file and open the Assistant Editor pane on the right side of the main Xcode project window (using the button in the toolbar or the menu View>AssistantEditor>ShowAssistantEditor), one of the sections in the File Inspector has checkboxes which let you manually set which Targets the files should be added to.Sorry, but I don't know why you're not getting the option when you create the files.
Jun ’15
Reply to watchOS 2 framework failing
I'm seeing the same thing, but the more I struggle, the more I think this is expected. If you notice, when you add a new target, there's a new Watch Framework target. If I add a new Watch framework, I have no problem doing an @import of it. Think about the current frameworks. The framework code lives on your phone. The reason shared frameworks worked before was because the Watch extension and iPhone app both were on your phone. Now, the code for the Watch extension and the iPhone app are on separate devices. While the code might be the same, the code is hosted on physically separate devices. An official comment from Apple would be good, but after messing with search paths for a while and then thinking about the situation, I think it's accurate to say that your shared code is going to need to be duplicated. In my case, this is several constants and networking code.It would be great if Xcode could do this duplication for us, in some sort of omni-framework that automatically gets installed on both devic
Topic: App & System Services SubTopic: Core OS Tags:
Jun ’15
Reply to Can't build and run watchOS 2
I have no idea how to get it working either and there's a rather ominous log saying starting services on a paired watch isn't supported in the system log.6/13/15 7:27:41.953 PM Xcode[31093]: AMDeviceSecureStartService (thread 0x70000158f000): Starting services on paired watches not supported
Topic: App & System Services SubTopic: Core OS Tags:
Jun ’15
Reply to Swift from the commandline
Another way of drawing in the window is to not use an NSView, but draw directly into the window:NSGraphicsContext.setCurrentContext(window.graphicsContext) NSColor.redColor().set() NSRectFill(NSRect(x:0,y:0,width:100,height:100)) window.flushWindow()The steps here are:Setting the current graphics context (a global variable for the thread) to the graphics context of the windowSetting the current color of the graphics context to redFilling a rectangle in the graphics contextFlushing the contents so that the result is visibleAnd now you can show a window and draw into it only using the command line.Even though this is possible, depending on what you want to do it is probably better to use the playgrounds in Xcode, since they work in a similiar way to a command line, but actually runs in the same kind of environment as normal applications.
Topic: Programming Languages SubTopic: Swift Tags:
Jun ’15
Reply to Problem with Overlapped Textures and Transparent Pixels
Tia, sorry... as I stated, I wasn't sure if I was posting to the correct forum or not. I did not notice the issue with xcode 6, I am noticing it with xcode 7. Because my project required an upgrade/compatability check (from what I read... to a new version of swift) I assumed the issue would either be a change in swift or a bug in xcode. If anyone can move this post for me to the correct forum please do.LCS, I appreciate the response. I have tried specifying the pixel size manually.When I load the textures outside the atlas they overlap perfectly. Unfortunately that results in a much slower program. I am curious however about your mention of collision detection maybe causing the cropping?
Topic: Programming Languages SubTopic: Swift Tags:
Jun ’15
Reply to Named parameter HORROR
It was my mistake to put a syntax suggestion in the original post. I should have stopped short of that. Because it has moved the focus from where I was aiming.I thought it was evident from the code, but I will labour the point:func X( a:Int, b:Int) { print(a,b) }a and b are equivalent to one another. This is the same deal in every programming language I've ever come across.But at the call site, X(1, b:2)b requires different treatment from a.The first parameter is treated differently from the others.I am appalled by the ugliness of this. It flies in the face of intelligent language design. It creates an unwelcome speed-bump to every Swift programmer.I retract my original assertion, in retrospect this is what I should've written:I would personally prefer all cases to work, although I can see an argument for requiring consistency at the call site. However, whichever choice is made, it should go without saying that the equivalence of the parameters should be reflected in the syntax at t
Topic: Programming Languages SubTopic: Swift Tags:
Jun ’15