Today we are going to take it to the next level. By adding some simple pieces of code, we can make the user catch the important information on your chart at once.
Since this article focuses on how to add a custom marker to the iOS Chart, I assume you already the prerequisite knowledge of building an iOS Chart and creating a custom view from xib. I will skip chart view…
I recently use iOS-Charts at work. It’s a very flexible, easy-to-use third-party library, allowing you to highly customise your chart.
This library is around 95% similar to its Android counterpart, making developing apps for both platforms much easier.
Here I use some high-income countries' birth rate data to demonstrate how to set up a basic bar chart using iOS-Charts.
Finally, I finished this eight-week course. As an iOS developer, naturally I chose iOS track.
Add searching function.
Add a button to keep track of which Pokémon have been caught and save the state in UserDefaults.
Create structs with types that match the keys and types returned by the API. Parse the JSON data and display Pokemons’ image and description
Some structs are added to help parse the JSON data. I have done some practices of this skill in Music App, so it didn’t take me much time to finish the parts of displaying pokemon image and description.
Write a programme that imports data from a CSV spreadsheet. For each student in the CSV file, insert the student into the
studentstable in the
While the CSV file provided to you has just a
namecolumn, the database has separate columns for
lastnames. You’ll thus want to first parse each name and separate it into first, middle, and last names. …
To create a Date object with a specific date, let’s say October 10 2020, we can create from
var dateComps = DateComponents()
dateComps.calendar = Calendar.init(identifier: .gregorian)
dateComps.day = 10
dateComps.month = 10
dateComps.year = 2020let date = dateComps.date
//Oct 10, 2020 at 12:00 AM
The time will automatically set to 12:00 AM if not specified.
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "MMM/dd/yyyy"
let dateStr = "Jan/20/2020"let date = dateFormatter.date(from: dateStr)
// Jan 20, 2020 at 12:00 AM
This part demonstrates how to parse string-based and integer-based values we get back from API to Date objects.
I broke down this programme into a few small functions, dealing with the DNA database, the input DNA sequences, and the computation of DNA results respectively.
At the beginning of this programme, it checks the number of command-line arguments first. If the user does not pass 3 arguments on the command line, this programme exits.
If 3 command-line arguments are passed, this programme reads the database by calling function
read_db(). The second command-line argument, supposed to be the file name of a…
Date is a specific point in time, independent of any calendar or time zone.
To create a date object initialised to the current date and time, simply write like this:
let date = Date()
If you run it on Playground, the Date object shown on live view might look a bit different from what it is printed out. That’s because the Date object shown on live view shows the current date and time of your system. When you print it out, it shows the date information in ISO 8601 format UTC time. …
Implement functions that spell-check a file after loading a dictionary of words from disk into memory. Use a hash table to keep track of the words in dictionary
One day I just wanted to make a collection view able to be infinitely scrolled both forward and backward, so I started to think about how to make it. Then I was inspired by those infinite rotating ads commonly seen on e-commerce apps.
valgrind: check memory leak
blurthat apply filters to BMPs.
sepia simply iterate through each pixel and recalculate its RBG values. Function
reflect swaps the RGB values of each pixel with the pixel on the mirror side of it. These 3 functions are quite easy, so I don’t show them here.