How to Use Userdefaults Suites With Swift
This page has been moved to programmingwithswift.com What are UserDefaults suites UserDefaults contains different suites that are identified by their suiteName. This can allow you to create different UserDefaults for different sections of your app, but it also allows you to share content between multiple apps and extensions that use the same App Group. Your suiteName cannot be the same as your apps bundle identifier. Using the global domain is also not allowed as it is not writeable by apps.
Add MKPointAnnotation on Map View With Swift
This page has been moved to programmingwithswift.com Adding a MKPointAnnotation on a map with Swift is quite simple and in this tutorial I will show you how to add a annotaiton to a MKMapView with Swift. For this tutorial I will assume that you have already setup your map view. If you haven’t I have another tutorial, Getting started with MKMapView, that will help you to get started with MKMapView.
Difference Between Methods and Functions in Swift
This page has moved from programmingwithswift.com I never really thought that there was a difference between a method and a function, and this probably does not deserve its own post, but in this post I will explain the difference between a method and a function in Swift. Functions A function is just some code that will do a specific task. These functions must not be associated with a particular type.
How to Separate UITableView Datasource and Delegate
This page has moved to programmingwithswift.com Today I will show you how to the put a UITableViewDelegate and UITableViewDatasource into different files. One of the main reasons for doing this is to get the all the code out of the view controller. This cleans up the view controller as the view controller does not need to know about the datasource and delegate methods. You could take this further by allowing multiple UITableViews to make use of this datasource and delegate, but we will not be getting into that in this tutorial.
Simulate custom location iOS simulator(Simulator, GPX)
This page has moved to programmingwithswift.com In this post I will show you a couple of methods on how you can simulate custom/different locations on the iOS simulator. Being able to add custom locations means that you can easily test to see if your app is working correctly when using you are using Core Location. By default Xcode has a few locations that you can use, which is great, but custom locations will allow you to potentially test more complex situations in your applications.
Easily fix "Failed to set plugin placeholders" in Xcode
This page has moved to programmingwithswift.com I was setting up rich notifications the other using a library and I was required to create a few extra targets. I followed all the steps correctly but Xcode was not liking what I had done. Xcode would build successfully but it would prompt me saying that it failed to set plugin placeholders. Personally I had never seen this message before so I started googling, turns out it was a really simple fix.
Easily fix "build only device cannot be used to run this target"
This page has moved to programmingwithswift.com This is an issue that I got recently. I have to be honest, I don’t often write unit tests which is something that I am starting to change, hence me getting stuck with this little issue. Turns out I was missing something really obvious. I was using the “Generic iOS Device” from the simulator/device drop down list. In order to fix this issue all one needs to do is to switch to a proper simulator or device and this error will go away.
Add Core Data to Existing iOS Project
This page has been moved to programmingwithswift.com If you have ever struggled to add Core Data to an existing iOS project, I feel your pain. Years ago when I tried to do it I failed and decided to recreated the project from scratch. But recently I decided that I should try and add Core Data into an existing project. It turns out that it is actually quite a simple task.