Questions tagged [swift1-2]

Swift 1.2 specific questions

5 questions
3
votes
4 answers

Swift Pattern match on Array

Swift 1.2 I'm trying to pattern match in a switch case in a function that take a type Any as it's parameter, in order to dispatch to a private more specialize init. Here is a Playground extrapolation : import Foundation struct myStruct { } func…
Vincent Bernier
  • 8,674
  • 4
  • 35
  • 40
0
votes
2 answers

Left side of nil coalescing operator '??' has non-optional type 'Int', so the right side is Never used Warning after Conversion from swift 1.2 to 4

i've converted a line from swift 1.2 to swift 4 but it still gives warning suggestion. if i remove that warning it was deleting one value in the addition. Can someone suggest am i doing anything wrong conversion to swift 4 Swift 1.2-----> let…
user9364391
0
votes
2 answers

If Let vs Guard Let for UIImage in Swift 1.2

I am working my way through the iOS Apple Developer Tutorial, but am having a bit of an issue since my computer's version of Swift is 1.2 and Xcode is 6.4 instead of Swift 3.0. I've been able to work along-side downgrading the code as need, but…
user282041
  • 37
  • 8
0
votes
1 answer

String.Index does not have a member named advancedBy - swift

I need to validate medicare number and I'm following this thread: How do I validate an Australian Medicare number? I'm getting error as Code is : String.Index does not have a member named advancedBy let matches =…
Zusee Weekin
  • 1,348
  • 2
  • 18
  • 41
0
votes
0 answers

Why does filter always return an Array?

I'm using swift 1.2. When I invoke let filtered = filter(mySet, ) , I would think that filtered would have the same collection type as mySet but it is always an array. I'm wondering what the logic is since a Set, for instance,…
Tylerc230
  • 2,883
  • 1
  • 27
  • 31