The Stanford iOS course is now a Swift course. Its best suited if you have xcode and iTunesU.
http://web.stanford.edu/class/cs193p/cgi-bin/drupal/
http://web.stanford.edu/class/cs193p/cgi-bin/drupal/
That is pretty sweet. Seems like all the big names are trying to get devs to use their programming stack but making them cross platform!
I've been wanting to learn swift for some time now but am too caught up with my C# and JS. Busy learning to build some Universal Windows Apps.
The thing that caught my eye is being able to create cross platform apps using swift via http://www.elementscompiler.com/elements/silver/. Perhaps mid-2016!
Use Xamarin![]()
I am a poor man so I have to use cordova :erm:
Xamarin's ok if you are a single language programmer who thinks everything can only be done in C#, or Java, ...Use Xamarin![]()
That is pretty sweet. Seems like all the big names are trying to get devs to use their programming stack but making them cross platform!
I've been wanting to learn swift for some time now but am too caught up with my C# and JS. Busy learning to build some Universal Windows Apps.
The thing that caught my eye is being able to create cross platform apps using swift via http://www.elementscompiler.com/elements/silver/. Perhaps mid-2016!
That is pretty sweet. Seems like all the big names are trying to get devs to use their programming stack but making them cross platform!
I've been wanting to learn swift for some time now but am too caught up with my C# and JS. Busy learning to build some Universal Windows Apps.
The thing that caught my eye is being able to create cross platform apps using swift via http://www.elementscompiler.com/elements/silver/. Perhaps mid-2016!
[)roi(];16777195 said:The other thing that might surprise you is that the Swift team are seriously considering making final the default state for all classes.
/snip
You've officially piqued my interest!
public abstract class Vehicle
{
public abstract void Drive();
public abstract void Reverse();
public abstract void Honk();
}
public class Bicycle: Vehicle
{
public override void Drive()
{
// Drive the bicycle forward with pedal power
}
}
protocol Driveable {
func drive()
}
protocol Reversible {
func reverse()
}
protocol Honkable {
func honk()
}
extension Drivable {
func drive() {
// drive with average speed
}
}
extension Reversible {
func reverse() {
// reverse with average speed
}
}
extension Honkable {
func honk() {
// emit standard horn sound
}
}
struct Porsche: Drivable, Reversible, Honkable {
func drive() {
// drive with lightning speed
}
// fall back to protocol extension's average reverse speed
// fall back to protocol extension's average honk sound
}
struct Bicycle: Drivable {
fun drive() {
// Speed is dependant on the athlete behind the pedals, and the category of Bicycle (maybe that's another protocol type)
}
}
[)roi(];16782399 said:One of the key differentiations between Swift and strict OOP languages like C# and Java is it's unique approach to the use of Protocols (Swift name for interfaces / abstract classes).
/snip
public struct Person {
public let name: String
public let surname: String
}
public protocol Equatable {
public func ==(lhs: Self, rhs: Self) -> Bool
}
extension Person: Equatable { }
public func ==(lhs: Person, rhs: Person) -> Bool {
return lhs.name == rhs.name && lhs.surname == rhs.surname
}
if person1 == person2 { }
public extension Array {
public func mapWithIndex<T>(f: (Int, Element) -> T) -> [T] {
return zip((self.startIndex ..< self.endIndex), self).map(f)
}
}
let result = splitInput.mapWithIndex {
(index, tag) -> Token in
if index == 0 && !input.hasPrefix(separator) {
return self.tokenize(tag: tag, separator: separator)
}
return Ansi.tokenize(tag: separator + tag, separator: separator)
}
let myArray = [4, 5, 2, 8, 10, 9, 3]
let reverseMyArray = myArray.sort({
(number1: Int, number2: Int) -> Bool in
return number1 > number2
})
let reverseMyArray = myArray.sort(>)
Thanks for the overview. Swift looks like a very nice compiled version of Java. BTW, Java 8 has the same kind of interface now.