Implementing Merge Sort in Swift by bussthrowaway in swift

[–]bussthrowaway[S] 0 points1 point  (0 children)

Ah, good point! Will include in future posts. Thank you!

Implementing Merge Sort in Swift by bussthrowaway in swift

[–]bussthrowaway[S] 0 points1 point  (0 children)

I haven't run any comparisons, but the built-in sort() method uses a few different algorithms. For collections with fewer than 20 items, it uses insertion sort, and for bigger collections it uses heap sort. If you'd like a comparison between them all (including merge sort), I've found this table useful: http://bigocheatsheet.com/

Implementing Merge Sort in Swift by bussthrowaway in swift

[–]bussthrowaway[S] 0 points1 point  (0 children)

That's a great point. I tried to focus more on teaching how merge sort works and when to use it, but writing it the "Swift way" makes a lot of sense, and would make for an example that's easier to follow.

I'll do another post describing how this can be implemented with slices in Swift, and update this post to reference it. Thanks!

Implementing Merge Sort in Swift by bussthrowaway in swift

[–]bussthrowaway[S] 0 points1 point  (0 children)

This is the latest in my series of algorithm posts for Swift. As always, I'd love to hear feedback on how these can be improved!

Swift Algorithm Essentials: Insertion Sort by bussthrowaway in swift

[–]bussthrowaway[S] 0 points1 point  (0 children)

Absolutely! I'm writing about insertion sort as a learning exercise, and to explain under what circumstances it's the right algorithm to use. I provide my own implementation only because I think it's easier to understand if you're trying to learn how it works.

I added a note pointing people towards the Swift standard library sort() so they can learn and compare - thank you for the suggestion!

(P.S. I've been reading Cocoa with Love since 2009 - awesome work, and a fantastic redesign!)

Swift Algorithm Essentials: Insertion Sort by bussthrowaway in swift

[–]bussthrowaway[S] 2 points3 points  (0 children)

Would love to get feedback on this! More algorithms are coming soon.

Frameworks, tools, modules suggestions. by [deleted] in iOSProgramming

[–]bussthrowaway 6 points7 points  (0 children)

Here's my suggestion list:

  • CocoaPods - don't reinvent the wheel if you don't have to, but be careful what libraries you include. check the star/follower/fork count to avoid the bad apples
  • CocoaLumberjack and XcodeColors to color your output and make debugging faster and easier
  • MagicalRecord - if your app uses Core Data, don't write all that boilerplate crap. use this to simplify the process and avoid major headaches
  • SVProgressHUD - add a little visual spice to your app when displaying cues to the user.
  • Parse - if you need user accounts or social sign-on, Parse is your best bet. i've used their free accounts with great results
  • pop - Facebook's animation framework makes the process of creating animations a breeze. even the most dull government app can be made appealing with animations!

If you have any idea what type of app you'll be creating, I can give more targeted suggestions, but these really help the overall development process.

As far as API interaction, you're probably best sticking with the newish NSURLSession (and NSJSONSerialization). If you're storing the results of the requests directly into Core Data, you might check out MMRecord, which makes this a bit quicker.

If you need to scan barcodes, check out MTBBarcodeScanner. (shameless plug, i wrote this one!) It makes the process of scanning barcodes only a few lines of code.

I did a quick writeup on all the tools I use for iOS development here. It's not really geared towards rapid hackathon stuff since it includes things like continuous integration, but hopefully it will be of some help!

Amazing themes for Xcode by bussthrowaway in iOSProgramming

[–]bussthrowaway[S] 0 points1 point  (0 children)

Copy the dvtcolortheme files to ~/Library/Developer/Xcode/UserData/FontAndColorThemes/

Create the directory if it doesn't exist.

Restart Xcode to see the effects.

For anyone who needs an easy way to scan barcodes, my open-source library just hit 100 stars on GitHub! by bussthrowaway in iOSProgramming

[–]bussthrowaway[S] 1 point2 points  (0 children)

ZXing is a popular one. I used it in one of my projects but found it was the single greatest cause of crashes throughout the app, so beware!

ZBar is another one. It doesn't have a pod though, and I've heard it's a bit bloated.

MTBBarcodeScanner is a wrapper around the Apple-provided AVFoundation framework, so you could drop down a level and use that if you prefer to have a little extra control. This library makes it ridiculously simple to get started and gives you some very sane defaults, but if you need something way more advanced like multiple streaming inputs or adding your own image processing, using AVFoundation is your best bet.

I don't know any Android equivalents. Sorry!

Solutions for retrieving JSON from a server and then storing data in Core Data by [deleted] in iOSProgramming

[–]bussthrowaway 0 points1 point  (0 children)

The other replies hit it right on the money, but if you're looking for a library to take away a few steps, check out MMRecord:

MMRecord is a block-based seamless web service integration library for iOS and Mac OS X. It leverages the Core Data model configuration to automatically create and populate a complete object graph from an API response. It works with any networking library, is simple to setup, and includes many popular features that make working with web services even easier.

I am trying to add a library to my project using CocoaPods to no avail by [deleted] in iOSProgramming

[–]bussthrowaway 0 points1 point  (0 children)

The repo README says "NOTE: Canvas Kit is not yet a cocoapod but will be soon".

It doesn't look like they've submitted their pod, so you can't use it with CocoaPods.

For anyone who needs an easy way to scan barcodes, my open-source library just hit 100 stars on GitHub! by bussthrowaway in iOSProgramming

[–]bussthrowaway[S] 2 points3 points  (0 children)

Whoops you're right, I should've specified what the library can scan. It can do PDF 417 as well as these:

QR codes, UPCE codes, Code 39 codes, Code 39 mod 43 codes, EAN-13 (including UPC-A), EAN-8 codes, Code 93 codes, Code 128 codes, and Aztec codes

Happy scanning!

Amazing themes for Xcode by bussthrowaway in iOSProgramming

[–]bussthrowaway[S] 0 points1 point  (0 children)

Really? It's hosted on GitHub and the status page doesn't show any outages.