UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

Bucket List SwiftUI Tutorial: Downloading data from Wikipedia - How to download the text from the Wikipedia article?

Forums > Articles

Hi all, I want to make an app in which text from a Wikipedia article should be shown. In the 'Downloading data from Wikipedia' tutorial, only the titles of the articles are being shown. So my question is: Is there a way to also download and show the other text from the article, rather than only the title?

Link to article: https://www.hackingwithswift.com/books/ios-swiftui/downloading-data-from-wikipedia

4      

In the acticle, it state

Each page has a lot of information, including its coordinates, title, terms, and MORE.

So you need to find the field(s) and add that to the struct Page

4      

Thanks for your help! I am able to download the text from the article now.

However, I ran into another problem. In my project, I want to show an article about power functions. I use this link: https://en.wikipedia.org/w/api.php?action=query&titles=cubic_function&prop=extracts&format=json&exchars=500&explaintext&exsectionformat=plain.

Now the problem is: the extract I get is a string (open the link to see it) that contains a formula, which looks weird in a swift string.

Is there a way to solve this problem with swift?

4      

Hacking with Swift is sponsored by RevenueCat

SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.

Learn more here

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.