All App Store Apps Required to Have a Privacy Policy: Starting October 3rd

Starting October 3, 2018, App Store Connect will require a privacy policy for all new apps and app updates in order to be submitted for distribution on the App Store or through TestFlight external testing. In addition, your app’s privacy policy link or text will only be editable when you submit a new version of your app. 

To add or edit your privacy policy for the App Store:

1. Go to My Apps in App Store Connect, and click on your app.
2. Under App Store, click on App Information.
3. In the top right corner, add your privacy policy link for iOS apps or macOS apps, or enter text directly for tvOS apps.
4. Click Save.

Source: All New and Updated App Store Apps Required to Have a Privacy Policy Starting October – Mac Rumors

Defer Statement: How to use it in Swift!

Here is a hidden gem in Swift called defer. Defer allows you to defer (no surprises there!) execution of a block of code until the end of the current scope is reached.

func updateImage() {
    defer { print("Did update image") }
    print("Will update image")
    imageView.image = updatedImage
Above code prints the folowing :
// Will update Image
// Did update image

The most common use case seen around is opening and closing a context, for example when handling access to files. A FileHandle requires to be closed once the access has been finished. You can benefit from the defer statement to ensure you don’t forget to do this.

Source: Defer usage in Swift – Swift Programming – Medium

Best Practices: Structuring Your Swift Code!

As your project grows in size, it’s essential that your code is structured well so that future maintenance doesn’t become a pain.

If there is one thing that you can to take from this article then it’s this quote below:

Whenever you touch a part of the code base, you should try to leave it better than how you found it

Check out the article below by John Sundell who provides some great tips to organize your code base which will pay big dividends down the road.

Source: Structuring Swift code — Swift by Sundell

Unit Tests: The complete guide to Network Unit Testing in Swift!

Networking is one of the most popular features in iOS development but is also the most unintuitive for developers to write unit tests against it. Check out the linked article below to find out how to write unit tests for your networking piece of your code.

Check out this insightful article linked below to find out how to write unit tests for your networking piece of your code.

Source: The complete guide to Network Unit Testing in Swift

App Store: Are app reviews worth reading?

App reviews are highly opinion based and not fact based and normally not a great way to gauge if an app is good or bad. They sure can be helpful (for a developer), but most reviews are composed of biased rants and half-legible reviews which are hard to sift through. Sadly, most people judge an app just by looking at the app’s review scores even though it does not actually reflect the quality of an app.

People want to be heard, and giving a 1-star or 5-star rating adds oomph to your opinion.

Check out this fantastic article by John Saito who has sifted through 1000’s of app reviews to provide his take on app store reviews. Quote from the article:

After crunching the numbers, I found that over 70% of our app reviews were either 5-star or 1-star reviews. Over two-thirds of reviewers either loved or hated our app.

Source: Are app reviews worth reading? – Dropbox Design – Medium

iOS 11: Location Permissions and avoiding the Blue Bar of Shame!

Apple has always been known to be a flag bearer for user privacy and the evidence for it is now even clearer with iOS 11. With iOS 11 if an app collects location data in the background, then a big ugly flashing blue bar shows up over the status bar.

If you have an app or planning to develop one that continuously scans user location, then check out the article linked below that details how to avoid it.


Source: Location Permissions in iOS 11 and avoiding the Blue Bar of Shame

Refactoring: How to deal with technical debt and save your sanity!

Refactoring code may not have any innate business value ( an exception being small performance optimization) and your business won’t immediately get better once refactoring is done. But refactoring is an essential part of software development and frequent refactoring is what keeps the code well oiled to prevent it from going obsolete.

Also, if you are working as part of a team and your team diligently conducts code reviews, then just the fact that your code will be assessed sends signals to the brain making you extra aware to maintain your code clean and keep it well optimized.

An ordered and clean environment, one that is maintained, sends the signal that the area is monitored and that criminal behavior is not tolerated. Conversely, a disordered environment, one that is not maintained (broken windows, graffiti, excessive litter), sends the signal that the area is not monitored and that criminal behavior has little risk of detection.

Check out this article linked below to find out how refactoring can greatly reduce your technical debt.

Source: How to deal with technical debt and save your sanity

NSObject: The Inheritance Curse!

Here is an article that provides a whimsical take on the evil that is NSObject. If you use classes that inherit from UIKit classes then you directly or indirectly inherit from NSObject.

There are ways to stop this inheritance madness in your classes by marking them as final so it cannot be subclassed. It allows some compiler optimizations, and also makes the code more consistent by removing features that can be achieved in a more Swifty way like code reuse with protocol extensions, generics or composition and polymorphism with protocols.

Read on at the link below to find out more tips:

Source: The Inheritance Curse – Swift Programming – Medium