In this post, I will demonstrate one particular way of creating singletons in Swift. But, before starting, let me just say: Swift is a very powerful programming language that allows developers to construct the same functionality in multiple ways. Therefore, the following example is just one way of building a singleton in Swift.
Generally, I discourage the use of singletons, as instantiating an object that will last forever is not good design. Instead, I prefer letting ARC do the memory management and letting ARC decide when to release an object or keep it alive. Additionally, there’s always an alternative way to build what you are trying to do with a singleton.
I was building new exercises in Swift—Apple’s new development language—for our upcoming iOS training class in San Francisco, and when combining Swift and Cocoa Touch, I discovered something really interesting.
In particular, for this tutorial, I will examine methods that require a selector as the argument, such as: performSelector:, respondsToSelector: or performSelector:withObject:afterDelay:.
This year, the WWDC was amazing. The shear amount of new stuff is overwhelming, and I still can’t believe that most of my wish list is now covered.
This year’s biggest surprise, however, which I was not really expecting (I guess nobody was), was Apple’s introduction of a new programming language—Swift. But now, Swift is here, and we have to deal with it.
Every year, before WWDC, there’s a lot of buzz. Transforming technologies are on our minds, and everyone is asking—what’s going to be the next big thing, as technology and change are seemingly synonymous.
UIKit Dynamics, Core Animation Layers and Autolayout Constraints
Recently, we have been busy with interesting consulting work, and have not had a lot of time to write new blog posts. We appreciate the many emails, asking for more, but we have been fighting time and finalizing projects. Now, however, one of our projects is nearly finished. So, I found a couple of hours to write this post about combining UIKit Dynamics and other UIKit APIs.
Biometrics: identity theft or individual security?
The iPhone 5s Touch ID™ has changed the standard for smartphone security. Apple’s innovative technology, which was initiated by the purchase of AuthenTech in 2012, enables instant access and personalized security, suddenly making it feel antiquated and overly involved to remember and enter a password into our smartphone.
At iNVASIVECODE we aren’t doing generic business. We strive to offer the most innovative iOS solutions to our clients. This requires contemporary thinking. This requires constantly asking: What do people need now? Therefore we have intentionally based our headquarters at Runway in downtown San Francisco. Runway is a brand new co-working space that is redefining the optimal environment for innovative business. At Runway openness creates community. We constantly collaborate with other businesses, exchange information, and troubleshoot complicated problems. We don’t operate in a box. Instead, we fuse our extensive experience with vital contemporary knowledge, creating the most relevant solutions possible.
iOS 7 has brought a fresh new look to the entire UI, affecting also the Maps and the Map view. Let’s see what those changes are and how to take advantage of them.
If you check the Maps app, you will notice a slight update in the cartography of the map and hybrid mode. This update aims to deliver clearer cartographic information, so some graphic elements (the roads, for example) are blended to the map and labeling stands our more. Pins, callouts and user location views have been updated to embrace the new iOS 7 UI too. There is also the new tintColor property, which applied to MKMapView will affect down all the elements to show callouts and location views with matching colors.