The internet's most comprehensive Swift resource.




by Jon Hoffman     masteringswift.blogspot.com
Swift Version: 3.0
In our last post  we showed how to create REST based web services using Swift and IBM’s Kitura framework.   In this post we will show how...

by Jon Hoffman     masteringswift.blogspot.com
Swift Version: 3.0
The Kitura framework, developed by IBM, is a light-weight, high-performance, web framework and server written in the Swift language.  This framework allows us to very quickly develop complex web services using the Swift language and Swift’s standard Foundation APIs.  This allows us to use our existing Swift knowledge to very easily create server-side services.  We can run our Kitura based services as stand-alone applications, deploy them to IBM’s Bluemix cloud or use IBM’s pre-build Docker image. This post will introduce Kitura and show how you can begin using it for your projects.

by Jon Hoffman     masteringswift.blogspot.com
Swift Version: 2.1
I have had numerous conversations about what exactly is Protocol Oriented Programming since my Protocol Oriented Programming with Swift book was released.   Everyone I spoke to seemed to have his or her own opinion about what POP is.  Out of all of those conversations I think this is the best explanation that I heard “Programming with an orientation toward the use of protocols for abstraction”. 

by Jon Hoffman     masteringswift.blogspot.com
Swift Version: 2.1
Have you wanted to use the Swift programming language to write applications on your BeagleBone Black? How about programming robotics with Swift? This blog post will show how I setup my BeagleBone Black to use Swift and also shows how we can use the SwiftyGPIO package to interact with the digital GPIO ports on the BeagleBone Black.

by Jon Hoffman     masteringswift.blogspot.com
Swift Version: 2.1
Generic programming can be defined as "programming with concepts”. In this post we will look at the idea of Concepts in the Generic Programming paradigm and how this relates to Protocol Oriented Programming in Swift.

by Jon Hoffman     masteringswift.blogspot.com
Swift Version: 2.0
In this post I would like to look at the The Law of Useful Return. The Law of Useful Return says: If you have already done the work to get some useful result, don’t throw it away. Return it to the caller because they may be able to use it.

by Jon Hoffman     masteringswift.blogspot.com
Swift Version: 2.0
In this post we will look at the iterative approach to programming where we should be constantly looking to improve our code. Keep in mind that no one writes good code the first time' it takes many iterations to find the most efficient or general way to do something. No programmer should have a single pass mindset.

by Jon Hoffman     masteringswift.blogspot.com
Swift Version: 2.0
POP vs OOP Numerous tutorials that I have seen take a very Object-Oriented approach to the protocol-oriented programming (POP) paradigm. By this statement I mean that they tell us that with POP we should begin our design with the protocol rather than with the superclass as we did with OOP however the protocol design tends to mirror the superclass design of OOP. They also tell us that we should use extensions to add common functionality to types that conform to a protocol as we did with superclasses in OOP. While protocols and protocol extensions are arguably two of the most important concepts of POP these tutorials seem to be missing some other very important concepts. In this post I would like to compare Protocol-Oriented design to Object-Oriented design to highlight some of the conceptual differences.

by Jon Hoffman     masteringswift.blogspot.com
Swift Version: 1.2
This post will show how we can create a good data access layer using sqlite.swift and Swift 2

by Jon Hoffman     masteringswift.blogspot.com
Swift Version: 1.1
One of the many new features with Xcode 7 and Swift 2 is the @testable attribute. While we have been able to do unit testing in previous versions of Xcode and Swift the big drawback has always been that any routine we wanted to test had to have an access level of public. This was a pretty big drawback especially with frameworks where we need to test routines without making them public. This has changed in Xcode 7 and Swift 2. In this post we will demonstrate how to use the new @testable attribute in our test source code to make all public and internal routines usable by our test code but not usable by other frameworks and app targets.

by Jon Hoffman     masteringswift.blogspot.com
Swift Version: 1.1
In this post I will explain how we could use tuples to model our data and then I will show how I would replace the data model classes from my previous "Create a Data Access Layer using SQLite.swift" post with tuples. When we replace data modeling classes or structures with tuples our code can become much more compact and in some ways easier to understand however we do lose the ability to add functionality to our data model types, but is that a bad thing?

by Jon Hoffman     masteringswift.blogspot.com
Swift Version: 1.1
It is important, when designing an application, to design a good data access layer between our application and its backend data storage. While some may argue that is what Core Data is for, I am just not a big fan of it especially if we are planning on porting our applications to other platforms. In this blog post, I will show how we can use the SQLite.swift framework to design a good data access layer for our applications written in Swift.

by Jon Hoffman     masteringswift.blogspot.com
Swift Version: 1.1
The Observer pattern is one of the design patterns that I tend to use the most. The basic principle behind this pattern is a listener registers with a broadcaster and then at some later point in time the broadcaster notifies the listener when some predefined event happens. This pattern can be used to facilitate the communication between decoupled objects and also to implement a one-to-many relationship. The Observer pattern falls into the behavior pattern category.

by Jon Hoffman     masteringswift.blogspot.com
Swift Version: 1.1
When the 1.0 version of Swift was initially released it contains native String, Array and Dictionary types that were bridged with the NSString, NSArray and NSDictionary types. The one noticeable omission was Swift did not contain a native set type. With the 1.2 version of Swift, Apple corrected this omission and added the Set type.

by Jon Hoffman     masteringswift.blogspot.com
Swift Version: 1.1
For developers that have used the Java or C# programming languages, Generics in Swift should look pretty familiar because Swift’s implementation is very similar to those languages. For other developers Generics may seem a bit foreign at first. In this tutorial we will show how to use Generics in Swift to create generic functions.



© 2015 SoSoSwift. Blog · About · Contact · Privacy policy · Terms of service · RSS