It is a new language, ok. But why people can complex simple things? For years we used:

int newvar = (int)oldfloat;

and it was ok. Not only in ObjectiveC but in many other. Now you have to:

var newintvar:Int = Int(oldfloatvar)

BUT – keep in mind that float will be always ROUNDED DOWN – so for 1.9 you will get 1 not 2. To make it rounded as it should be use:

var newintvar:Int = Int(round(oldfloatvar))

 

There is no advantages of using this in Swift, but in case you have Objective-C you can do it using:

class Singleton {
    class var sharedInstance : Singleton {
        struct Static {
            static var onceToken : dispatch_once_t = 0
            static var instance : Singleton? = nil
        }
        dispatch_once(&Static.onceToken) {
            Static.instance = Singleton()
        }
        return Static.instance!
    }
}

 

One week after seeding the last OS X 10.9.4 Mavericks beta, Apple on Thursday issued to developers a new build of the upcoming maintenance update, with the latest version coming with minor bug fixes and minor tweaks.
The latest OS X 10.9.4 Mavericks build 13E25 continues Apple’s usual one-week release interval and follows build 13E19 seeded last week.
Thursday’s release focuses on the same areas, including Graphics Drivers, Safari, Bluetooth, Audio Drivers, Finder and the App Store.
The initial seed was issued at the end of May following the public release of OS X 10.9.3. Along with developers, Apple announced a limited number of consumers can also take part in testing out betas seeds.

The latest OS X 10.9.4 Mavericks build 13E19 marks the return to Apple’s usual one-week build release interval, coming eight days after the second beta was issued earlier in June. The initial seed was issued at the end of May following the public release of OS X 10.9.3

As with the previous OS X 10.9.3 betas, Apple is asking developers to focus on Graphics Drivers and Safari. The new OS X 10.9.4 releases tack on extra areas of interest including Bluetooth, Audio Drivers, Finder and the App Store.

This can be really painfull – you made you translation and at compiling time you see such error:

Localizable.strings:0: error: validation failed: The data couldn’t be read because it has been corrupted.

Don’t worry, you dont need to manually check it line by line, just open Terminal, go to folder with your Localizable.strings and enter:

plutil -lint Localizable.strings

you will see output like this:

2014-06-14 15:28:03.516 plutil[855:507] CFPropertyListCreateFromXMLData(): Old-style plist parser: missing semicolon in dictionary on line 68. Parsing will be abandoned. Break on _CFPropertyListMissingSemicolon to debug.
 Localizable.strings: Unexpected character / at line 1

which gives you exact line number and reason.

Named after the California national park, Yosemite will be available later this fall, and end users will be able to sign up for a public beta program in the summer. As with Mavericks, the Yosemite update will be free.
Apple software chief Craig Federighi showcased new “translucent materials” in the redesigned operating system, which also features bright colors and new icons. The translucent material extends to many areas of the operating system, with a demonstration showing it reacting to the background image in the sidebar of Messages and Finder. The effect is similar to the translucency introduced in iOS 7.
Apple also focused on “precise and consistent” fonts throughout the OS, eschewing their traditional Lucida Grande typeface in favor of a new sans-serif that appears to be a Helvetica variant.
Yosemite also comes with a new “dark mode,” which turns the normally-light gray menu bars and dock to a darker gray, while Notification Center has been updated with a new Today View that can be extended with widgets and apps from the Mac App Store.
It’s not yet known whether the appearance of widgets in Notification Center spells the end of the Dashboard. One of the widgets shown during a demonstration was ESPN SportsCenter, long a popular Dashboard widget.
Safari also gains HTML5 Premium Video, which supports services like Netflix without plugins, adding up to 2 hours of additional battery life during playback.
Additionally, new Continuity features in OS X add greater integration between iOS and OS X. Macs can now automatically configure hotspots from connected iPhones, for instance, and both operating systems give users the ability to automatically continue working across devices in first-party apps like Numbers and Safari.
Continuity also extends to phone functionality. SMS messages can now be sent and received in Messages on the Mac, while OS X also allows users to make and receive phone calls from their laptop or desktop.