I found a great article on option sets in Swift. The article is signed by Ole Begemann. I’m not entirely sure if I like them or not. I’m working on a hybrid project, combining Swift with Objective C. So my Swift structs aren’t available in ObjC. I’m afraid of code duplication. Here’s the entire article.
Here’s the list of Swift 3.0 and 2.3 changes. The list was made by Hesham Salman, and covers almost everything. Enjoy.
Here is a nice implementation of undo functionality in swift by Chris Eidhof: http://chris.eidhof.nl/post/undo-history-in-swift/
The current implementation has a few limitations (supports only structs, stores the whole object, not just the change). But it is only a demo for an idea. Use it accordingly.
Excellent article on app performance and what you can do about it: https://medium.com/@mandrigin/ios-app-performance-instruments-beyond-48fe7b7cdf2#.dkuyz02mr
Measuring the startup time is really easy and can have a great impact on the user experience. I wouldn’t release an app with an extra thread to detect responsiveness issues on the main thread, but it is definitely a good idea in testing environment. It can point out some issues at an early stage. Collecting performance metrics from your users also seems a good idea to me.
Note: I didn’t mention anything about Instruments, because it is obvious you should use it regularly.
I found an interesting article signed by Ryan Olson. More precisely it is a research: he wanted to find out the percentage of Swift code in iOS, and apps developed by Apple. The results are surprising I’d say. I was expecting to a much higher adoption rate. Here’s the article: https://medium.com/@ryanolsonk/is-apple-using-swift-4a6c80f74599
I finally finished reading the book Functional Programming in Swift. I have to say it is a pretty good book. I wouldn’t recommend it for a beginner in Swift, but after you familiarize yourself a bit with the language, it is definitely worth reading.
After this I am seriously considering learning Haskell. I think it would make my functional programming skill much better.
I found an interesting Swift tutorial for beginners. It focuses on the way of thinking you should have when programming in Swift. To learn a new syntax isn’t a big deal after all. So this is the hardest part to do. Here is the first post of the series: http://alisoftware.github.io/swift/2015/09/06/thinking-in-swift-1/. If you’re interested you’ll probably find the rest of the articles from there. Enjoy.
I few days ago I found a podcast about protocols in swift. Finally I had time to listen to it. It is a great one, produced by Ray Wenderlich. I recommend to listen it to everyone who wants to know more about the topic. You can find it here: http://www.raywenderlich.com/120655/protocols-in-swift-unity Enjoy.
Recently I ran into a weird issue: I had to create an ad-hoc build, but the archive landed in the “Other Items” section in the Xcode’s organizer instead of iOS Apps. Therefore I couldn’t distribute the build.
The issue was that in the Info.plist of the archive the ‘ApplicationProperties’ key is missing. This contains some info about the app. And if it is not present, then the Xcode can’t interpret it as an iOS app.
I had searched for the issue and found several solutions. I tried everything I could: setting skip install to NO for the main project target and skip install to YES for the sub-project targets; making sure sub-projects have Copy Headers in Project, not Public etc. Nothing worked.
Finally I found out that the issue is only reproducible in Xcode 7 and using Cocoapods version 0.38.2. This was a good starting point. Everybody suggests that downgrading Cocoapods resolve the issue. However, these suggestions were made before launching version 0.39.0 as a stable version. So I recommend upgrading it to the newest version. I re-installed the pods, just to be sure I have nothing from the old version left.
Recently I read about socket.io. Basically it enables event-based communication between a server and a client. The server side is written in node.js, and they have a lot of client libraries in different languages. The server is open source, under MIT license. You can download it from Github: https://github.com/socketio/socket.io. The concept is really interesting, so I started looking for a solution in iOS.
You can find a few socket.io client libraries out there written in objective-c. But as it turned out, socket.io had released their own client library for iOS. So you should definitely use that. I was more than happy to see, that the library is written is Swift. They also provide objective-c interface. So I fired up Xcode and started a test project. In this article I will show you how to use the library.