Create a custom line chart to display historical price data | SwiftUI Crypto App #21

Поділитися
Вставка
  • Опубліковано 22 сер 2024
  • This line chart is going to be one of the highlights of our app. The end product looks awesome (especially in dark mode) and gives the user a visual representation of the coin's price over the last 7 days!
    This is one of the more challenging videos in this course because it involves a bit of math and you need to understand the coordinate system of the iPhone. As always, I will try to explain each step we take in detail but don't hesitate to leave a comment if you get confused.
    Admittedly, I have not yet covered creating custom shapes and paths in an individual bootcamp video yet! I am planning on doing that soon, but I didn't want that to hold up releasing this entire course.
    *** LINKS:
    - Downloadable Resources: www.swiftful-t...
    - CoinGecko API: www.coingecko....
    - CoinModel API: api.coingecko....
    - Market Data API: api.coingecko....
    - Coin Detail API: api.coingecko....
    - Buy Me A Coffee: www.buymeacoff...
    Next video: • Build an expandable / ...
    Last video: • Display downloaded dat...
    🤙 WELCOME BACK 🤙
    WEBSITE: www.swiftful-t...
    DISCORD: / discord
    GITHUB: github.com/Swi...
    SAY THANKS: www.buymeacoff...

КОМЕНТАРІ • 67

  • @-_--px7em
    @-_--px7em Місяць тому

    This guy never stop's helping me . greatest tutor on this platform fr

  • @alibatkanocal1620
    @alibatkanocal1620 8 днів тому

    I can't find a word to describe this video just waaow. this charts section is my favorite part in this app

  • @TheSpiralnotizblock
    @TheSpiralnotizblock 2 роки тому +4

    This chartview looks absolutly amazing. Thank you so much for creating this course and the other courses. If I have money left, I will definitely buy you some coffees!

  • @irfanrizvi161
    @irfanrizvi161 3 роки тому +2

    Super cool, I would've never thought of this logic to convert numbers into graph. Thank you bro.

  • @sols.2525
    @sols.2525 3 роки тому +5

    This was amazing and it looks freaking incredible in dark mode

  • @KimbrellBrad
    @KimbrellBrad 3 роки тому +7

    This one is really nice Nick! Had to wrestle with my animation a bit then found that I failed to change the 1.0 to "percentage" in the .trim(from 0.0, to: 1.0) statement (just in case others are having trouble). My oversight!
    But all of the math here was well-explained and will be useful in making other charts in our projects. Thanks again Nick!

    • @SwiftfulThinking
      @SwiftfulThinking  3 роки тому

      I've made the same mistake in the past haha

    • @mathewcrovitz7867
      @mathewcrovitz7867 2 роки тому +2

      @@SwiftfulThinking This was driving me nuts - couldn't get animation working. On the "Trim" statement, autocompletion had made it "Trimmed" - I didn't catch it until I read this comment... Thanks guys! Getting close to buying another coffee!

  • @samtree99
    @samtree99 2 роки тому

    Best stock chart I ever seen on mobile device. Thanks for the tutorial!

  • @omaraltali1195
    @omaraltali1195 2 місяці тому

    Thanks Nick, i really appreciate your efforts and you are really amazing man

  • @user-yb7uc2nx9p
    @user-yb7uc2nx9p Рік тому

    This was amazing and it looks very cool

  • @dev_jeongdaeri
    @dev_jeongdaeri 2 роки тому +1

    super cool!

  • @Collins01
    @Collins01 2 роки тому

    Dark mode😘. Awesome tutorial 👌

  • @baadrqaaba9529
    @baadrqaaba9529 Місяць тому

    good job !!

  • @JohnStrandt
    @JohnStrandt Рік тому

    Pretty cool, Nick

  • @Benbbr
    @Benbbr 3 роки тому +1

    Don't beat yourself up on the math. I guess a 10 year old should be able to do the math inside this lesson. The app is getting nicer each lesson. Time to wrap things up if you ask me. ;-) Thanks again!

  • @user-eg7ep8db8j
    @user-eg7ep8db8j 2 роки тому

    That's looks great~~~ I love it.

  • @azhmanzare848
    @azhmanzare848 2 роки тому

    Your tuts are appreciated

  • @wheezyair
    @wheezyair Рік тому +1

    Line drawing animation starts at 33:50

  • @AZMerf
    @AZMerf 3 роки тому +1

    Just amazing.

  • @era_i_ser7967
    @era_i_ser7967 3 роки тому +1

    Amazing!

  • @singingHo
    @singingHo 2 роки тому +1

    Hi, Nick. I'm really grateful to you for making a crypto app. I have a question. Preview is well drawn. but, run it as a simulator, chart is not drawn.. Where should I look? Is it related to three value points that are displayed as 0 in the chart, although the date is displayed?

  • @andayismayilzade1897
    @andayismayilzade1897 3 роки тому

    Awesome. Thank you!

  • @yitong6054
    @yitong6054 Рік тому +1

    Hi Nick, there is a new Charts library introduced to Swift in WWDC 2022, is there any chance you create a course of using that library to make a chart like this one?

  • @gregohb
    @gregohb 3 роки тому +1

    great video.

  • @andresraigoza2082
    @andresraigoza2082 2 роки тому

    Amazing!!! Thank you so much 😀

  • @yoreneu1294
    @yoreneu1294 2 роки тому

    Great work

  • @valerasworld
    @valerasworld 7 місяців тому +1

    Nick, thanks for the great lesson!
    I have a problem with the shadows. When the path is animating I have the only one shadow. And when the animation is finished all the others appear. Did anyone face the same problem and maybe find out how to fix it?

    • @user-oj5pm1wu8j
      @user-oj5pm1wu8j 7 місяців тому

      i got the same problem. do you figure out the reason of this problem

    • @user-oj5pm1wu8j
      @user-oj5pm1wu8j 7 місяців тому +1

      bro, i found a solution of this problem, just add .clipped() before all shadows

    • @vladyslavsushko1967
      @vladyslavsushko1967 7 місяців тому

      it's not a fix like crutch but it's work
      .shadow(color: lineColor.opacity(0), radius: 10, x: 0.0, y: 10)
      .shadow(color: lineColor.opacity(1), radius: 10, x: 0.0, y: 10)
      .shadow(color: lineColor.opacity(0.5), radius: 10, x: 0.0, y: 10)
      .shadow(color: lineColor.opacity(0.2), radius: 10, x: 0.0, y: 20)
      .shadow(color: lineColor.opacity(0.1), radius: 10, x: 0.0, y: 30)
      1 line ignore the animation for some reason, but 2 the same line working. If you just make the first line transparent, the behavior of the second line will change. If some body know the reason of this behavior, please tell me.

    • @skatelivi111
      @skatelivi111 6 місяців тому

      @@vladyslavsushko1967 Your fix works fine for me! Thanks :)

  • @mke579
    @mke579 3 роки тому +1

    @Nick Mate you're a beast! Plane beast! I've watched your whole series and I can say, this is an impressing teaching right here! I'll like to know, of course if you're willing to do it and explain how you can do a "update scenario from v1.0 to v1.5" for an app and if it's the same for macOS Apps and iOS Apps. I'm new to programming and I'm not shame to say it xD. Thanks alot and god bless you.

    • @mke579
      @mke579 3 роки тому +1

      And yea, forgot to say, of the app is not present in the App Store but it's a legit one and needs an update system, like a update button or some any other stylish way of pushing the latest version to a client.

    • @SwiftfulThinking
      @SwiftfulThinking  3 роки тому +3

      This is a bit hard to explain over comments haha. You basically need to update the version/build number and then push it. I'm planning to do a playlist to cover this, along with Git practices, but it wont be for a little while!

    • @mke579
      @mke579 3 роки тому

      @@SwiftfulThinking Awesome! Don't worry, at least from my part I'm just at my first interaction with code what so ever hehe. I never coded but somehow I find swift/swiftui very very pleasing and your channel is amazing! Love to way you present, teach and really trying to keep everything as professional as possible! You're simply a freaking beast!

  • @KimbrellBrad
    @KimbrellBrad 3 роки тому

    One suggestion: where we determine lineColor I suggest >= so we do not color a zero movement in red. Small issue likely never comes up over 7 days unless the crypto is dormant.

    • @SwiftfulThinking
      @SwiftfulThinking  3 роки тому

      Yea haha that makes a lot of sense lol I think the red might look cooler though?

  • @gopiraj5
    @gopiraj5 2 роки тому

    This is awesome

  • @TF242
    @TF242 2 роки тому +4

    Love it!
    When Nick is changing variables up top to private at the end you can use multiline edit: CONTROL + SHIFT arrow keys up or down, then type private. Magic.

  • @Nunny25
    @Nunny25 2 роки тому

    Hi Nick, thaks a lot.
    One questions to fully understand - for example ETH is -4,51(minus), but graph is green - end is higher then start. What exactly mean -4,51% (what period is calculated for that result?)

  • @kingfranchiz1991
    @kingfranchiz1991 2 роки тому

    your a beast!

  • @radimvorisek5810
    @radimvorisek5810 2 роки тому

    respect!

  • @kalpeshpipaliya9974
    @kalpeshpipaliya9974 2 роки тому

    it's a great technique. How can I achieve interactive part and show line while draging?

  • @MohdKashif-ls7wc
    @MohdKashif-ls7wc Рік тому

    how can i you show respective value in graph when someone hover over it?

  • @user-tg5fu3gf6t
    @user-tg5fu3gf6t Рік тому

    what is the recommend way if my app is not code by swiftUI can use only the chart section as different module

  • @TuanAnhLe-ef9yk
    @TuanAnhLe-ef9yk 3 роки тому +1

    Sir, this is crypto app so what's your favorite cryptocurrency? Where is your coin address :D ? Maybe one day one of us will sent you some coins to thank you for your big teaching. I hope I can apply iOS position for the next two months. Btw thank you again.

    • @SwiftfulThinking
      @SwiftfulThinking  3 роки тому

      Hahaha I love all the coins! I have a whole bunch in my portfolio, recently doing a lot of research on AMP and SOL. I haven't posted my address, but I accept tips on my Buy Me A Coffee :) I think they will start accepting crypto soon! What's your favorite? www.buymeacoffee.com/nicksarno

    • @TuanAnhLe-ef9yk
      @TuanAnhLe-ef9yk 3 роки тому

      @@SwiftfulThinking
      yup I believe that crypto is the next chapter of digital asset and monetary freedom. I'm holding BTT.

    • @azhmanzare848
      @azhmanzare848 2 роки тому

      @@SwiftfulThinking SOL did surge during this last 7 month a couple of time and huge increase, I hope you were on board!

    • @azhmanzare848
      @azhmanzare848 2 роки тому

      @@TuanAnhLe-ef9yk BTT Holding it for a long time but it makes me depressed when I look at its chart :)))

  • @user-lb9qn4bj5h
    @user-lb9qn4bj5h 3 місяці тому

    the chart don't seem to work for me

  • @LENANOERHOLM
    @LENANOERHOLM 2 роки тому

    Preview is running correct, but in the simulator I don't get the chart. What are I do'ing wrong?????

    • @SwiftfulThinking
      @SwiftfulThinking  2 роки тому

      Hey Stefan, sorry to hear this. Did you figure it out?

    • @LENANOERHOLM
      @LENANOERHOLM 2 роки тому

      @@SwiftfulThinking yes found a misspelling in the API, everything working now.

  • @ScholarshipWinner
    @ScholarshipWinner Рік тому

    A VStack appeared at 21.24