Raindas’ NBA Stats App Journal

I’m jumping on the NBA stats app challenge, and for like a couple of mins to about an hour now, I’ve been looking at APIs to consume. I think I’ll go with the recommended SportsData.io

1 Like

Being someone who Isn’t familiar with basketball games, I’ve been doing a little homework on it. For example, standings are very similar to premier league table I football. Fascinating. This enabled me sketch out what my app is gonna look like based on the example project Chris showed us in his video.

1 Like

2 Likes

When you post images from your Mac, use the built in screenshot app rather than take a photograph.

With the Mac ScreenShot App, you can capture the entire window, the entire screen or a section of the screen.

If you just want a small section, press Shift + Command + 4 which will change your mouse pointer into a set of crosshairs. Click and drag diagonally across the screen to capture the section you want. When you let go of the mouse button, the image will be saved to your Desktop and will be named something like “Screen Shot YYYY-MM-DD at HH.MM.SS am/pm”.

Other screen selection options are available by pressing Shift + Command + 5. An options bar will appear near the bottom of the screen. You can even video record your screen.

Thank you for this, will do that next time.

Been busy all day, was able to squeeze in a little time to work on the project. Realised that the API’s times and dates are in Eastern Standard Time. I created methods to convert from West African Time to Eastern Standard Time and also from the 24 hours format to 12 hours format.

1 Like

Was stuck for a long time trying to figure out how to load SVG image files from a remote URL. SVGKit came to the rescue. I learned how to install cocoa pods and install frameworks with it. I learned how to use frameworks and libraries in iOS development. I Got stuck again trying to resize the SVG view, after several hours surfing the web, I discovered the framework doesn’t have a defined way to do this. After a long time of trial and error, I figured out how to resize the view, and reducing the original scale of the SVG view worked.

2 Likes

Looking good! What is that SVGLogo struct, could you share that with us? :smiley:

It’s from SVGKit and is available from GitHub here: GitHub - SVGKit/SVGKit: Display and interact with SVG Images on iOS / OS X, using native rendering (CoreAnimation)
It includes instructions on how it include it (either drag and drop the framework into your project or install through cocoapods).

1 Like

Yes, you need to add the SVGKit framework first. But to specifically show where and how I defined my

SVGLogo(SVGUrl: “url”)

struct, see this screenshot attached.

Nice work! Looks like a legit app :slight_smile: cool how you converted it from the West African timezone to Eastern as well. Thanks for sharing and for the screenshots!

2 Likes

It’s my pleasure @RedFox1

1 Like

So, I completed the App Challenge today. Been busy for the past few days but I managed to finish on time. Honestly, I came across a lot of challenges while building this app, but I’m glad I was able to overcome all. I am more confident now as an iOS developer than I was weeks ago.

Screenshots


Video
NBAStats App Video (without audio)
NBAStats App Video (with audio)

***Source Code ***
GitHub link

4 Likes

Hey it looks great! Seems like a professional, fully fledged app, I would find in the App Store. What was the most challenging aspect to this build? Any big aha moments?

Also, how far have you gone in the courses in order to get to this stage? I just finished the 14-day challenge, and started the SwiftUI Foundations course :slight_smile:

1 Like

Hi @RedFox1, I’m glad you think it looks great and professional, it means a lot to me.

The most challenging aspect of this build was when I had to work with different timezones. The API I was using has its time in Eastern Standard Time, and mine is West African Time.
Another major challenge I faced was when I had to load the logo images which was in an SVG file format remotely, not just that, resizing the images had me doing a lot of trial and error.

My big aha moment was when I realized there’s a native way of comparing dates and getting the time from the DateTime value. I was already writing an algorithm to do that (you know, the manual way of creating your method to do that).

Honestly, I just learned the basics of swift and SwiftUI from a couple of tutorial videos. I had prior programming knowledge in other languages, catching up with swift didn’t take much time. Knowing that the best way to learn is when you start working on projects, I have been gaining more confidence with every project I’ve worked on and I’ve been learning way more things.

Getting practical will help speed up your learning process, and not let you get stuck on watching tutorials.

1 Like