Yup, not much else to add. Here it is: let randomColor = NSColor(red: CGFloat(drand48()), green: CGFloat(drand48()), blue: CGFloat(drand48()), alpha: 1.0) For iOS developers out there just change NSColor to UIColor. Marc PS: Drand48 will create a random number between 0 and 1.
Category Archives: development
Get NSDate Day, Month or Year in Swift 2.0
Looking for Swift 3.0 version? -> Click here Well, having recharged batteries after vacation I’m back into coding! And yet again I was faced with another simple problem: how to get the day, month or year from a date. This is the simpler solution I’ve found in Swift 2: //Here I’m creating the calendar …
Continue reading “Get NSDate Day, Month or Year in Swift 2.0”
Dates & Components in Swift 2.0
Another topic that has been changed in Swift 2.0 is how to work with dates. I’m digging into this topic for my upcoming app and I’ve found that most documentation on the web refers to Swift 1.2. So here are some snippets to create dates using components: //CreateDateFromComponents (1st January 2016) var …
Evaluate string width and return CGFloat (Swift, OSX)
This morning I’ve been working in a Swift function to detect the width of a given text and return a CGFloat. I’ve not found that many examples on the web for OSX, so here you have what I’ve done in all of its glory: func evaluateStringWidth (textToEvaluate: String) -> CGFloat{ letfont = NSFont.userFontOfSize(NSFont.systemFontSize()) …
Continue reading “Evaluate string width and return CGFloat (Swift, OSX)”
CSV Parser Swift 2
One of the features I’m adding to an upcoming app is the ability to import CSV files. For that purpose I looked around for code already available (and found several options, see below), however none of them compelled me enough so I decided to create my own. The main objective was to make it as …
Compatibility updates
Today both Excelling and Notio have been received a compatibility update to ensure they work great under iOS9. Provided that Apple approves them both should be available for users in about a week. And now back to focusing on the new app. Marc
Starting working on a new app
Late last week I was posting to announce that Notio would be discontinued. Today it’s time to announce some more positive news. After much research and discussions with trusted friends, today I’m kicking off the design phase of my new app. And, for me, this is one of the most fun phases. I love spending …
Discontinuing app Notio
After WWDC15, having thought long and hard, I’ve taken the decision to discontinue one of my Products: Notio. It’s an app I started with the idea of giving a new spin on notes, treating them like ideas, so that you could add multiple information to them. Although I had high hopes, initial reception of the …
Tweetbot 2 for Mac released
New version of Tweetbot for Mac finally released, oh boy, this is so good. The UI is gorgeous, fits right in Yosemite and the fit and finish is amazing. Strongly suggest you to check it out.
Brent on quitting Q Branch and focusing on what matters
“I realized how very important it is for me to work on the software that I think about every day. I kept putting it off, but every day that I put it off hurt more than the previous day. I realized that I couldn’t continue — I have to do the work that I need …
Continue reading “Brent on quitting Q Branch and focusing on what matters”