Swift is a programming language designed by Apple for creating iOS and OS X apps. Swift builds upon the foundation of C and Objective-C.

learn more… | top users | synonyms

-3
votes
0answers
21 views

How to restart a program when there is a collision in swift [closed]

I need some help working with collisions in SpriteKit in Swift. I have two variables and when they collide I want the program to restart. I am very new to coding so a simple answer would be ...
2
votes
1answer
95 views

Would I rather use Core Data or save files to the system?

I'm developing an iOS app which basically fetches a JSON from a remote location, parses it and instantiates classes for a couple of its elements. For some visualization, this should give you a basic ...
1
vote
2answers
124 views

Decorator design pattern in swift

Im reading "Head first design patterns" (here you can find exact example mentioned in book) While going through Decorator design pattern, everything was crisp and clear until i stumbled into this ...
1
vote
0answers
90 views

Ways to do callback, when and where

I've recently started to do some more complicated programming with network-related work on iOS with Swift. This introduced a lot of asynchronous code not only in networking but also some exchange of ...
0
votes
2answers
232 views

Workaround for unit testing Core Data in Swift

I am still pretty new to programming, but my first app was recently approved and is now for sale on the App Store. My app uses Core Data and is written in Swift. After some initial difficulties, I ...
0
votes
2answers
234 views

Using the optional 'self' reference in instance methods in Swift as a matter of style

Swift allows optional prefixing of method calls and property references to the current object instance via self. Removing these prefixes can declutter code but, depending on the length of the method ...
0
votes
0answers
146 views

Usage of MVVM in iOS

I'm an iOS developer and I'm guilty of having Massive View Controllers in my projects so I've been searching for a better way to structure my projects and came across the MVVM (Model-View-ViewModel) ...
-2
votes
1answer
149 views

Swift and PDF do they mix? [closed]

Couple of quick questions. First I have zero programming experience but somehow I have an app about 2/3 of the way done. The bulk of my app will be essentially a book to which I am adding one or two ...
1
vote
1answer
405 views

Swift Protocol Naming Conventions [closed]

Coming from a mainly c# background, I'm used to using the term "interface" for describing an object with no implementation that defines behaviour. In c#, the convention is to prepend interface names ...
19
votes
5answers
3k views

Why design a modern language without an exception-handling mechanism?

Many modern languages provide rich exception handling features, but Apple's Swift programming language does not provide an exception handling mechanism. Steeped in exceptions as I am, I'm having ...
27
votes
2answers
2k views

Do modern languages still use parser generators?

I was researching about the gcc compiler suite on wikipedia here, when this came up: GCC started out using LALR parsers generated with Bison, but gradually switched to hand-written ...
20
votes
2answers
13k views

Can Swift be used for anything besides iOS and OSX apps? [closed]

I'm liking Swift, a lot. But making an iOS or OSX native app isn't totally what I would want to do with it. Is it possible for Swift to be used in other contexts? Like say a web application that runs ...
83
votes
5answers
31k views

How can Swift be so much faster than Objective-C in these comparisons?

Apple launched its new programming language Swift at WWDC14. In the presentation, they made some performance comparisons between Objective-C and Python. The following is a picture of one of their ...