Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Mia Pivirotto
5,557 PointsHow can I code in a pathway that I want to appear step by step on my screen with Swift iOS?
Hello, so this is not related to any course challenges or anything. Say I want to construct an app that displays a pathway that involves a lot of steps, but I want to use the app to learn the pathway. So I only want to show one or two steps on my screen at a time. And when I touch the screen I would want something new to pop up (either a question mark marking where the next step is happening, or the actual next step), how can I go about coding this? What code should I use? Or what keywords should I be using to look stuff up in the documentation?
Thanks for any help!! I really appreciate it!
2 Answers
Unsubscribed User
11,496 PointsHi Mia,
I would start by looking at the UITouch class documentation.
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UITouch_Class/
You can add a UITouch object to any UIView (or UIView subclass) and then create an @IBAction on the view controller to handle events like changing a view/label from hidden to visible.
The locationInView or locationInNode methods can be used to get the coordinates of a touch if you're wanting to target specific coordinates that the user touches.
Hopefully that helps you get started at least!
Jens Hagfeldt
16,548 PointsI think it sounds like MapKit and the Core Location Framework is what you want to dive into if by displaying a pathway you mean showing locations in coordinates or with a pin on a map.
You can find all the information you want about using maps and locations while building an app on Apples developer site here: https://developer.apple.com/maps/
I hope you find the documentation there useful for the app you want to build!
Mia Pivirotto
5,557 PointsMia Pivirotto
5,557 PointsAwesome, thanks Grant..that seems to be what I am looking for. I do seem to have some troubles really connecting the documentation to knowing what they are saying to make my code, or doing something like looking at a sample code and having any idea what they are talking about. I'm very new to this, but I really want to start to get better and really make the intuitive leaps that seem to be needed, but I'm getting stuck on how to do that..any help/advice?
Unsubscribed User
11,496 PointsUnsubscribed User
11,496 PointsI would recommend checking out Treehouse's Python track if you're very new to programming. Python was the first language I learned and I found it very readable and friendly. I like Swift quite a bit but, Python doesn't force you to deal with all of the data types and UI methods like Swift/iOS.
Coding in Python is much closer to how you would give instructions to a human and I think that makes each step a bit easier to understand. The core concepts of variables, functions, classes, etc... are all the same and a second run through in a new language will really help solidify them in your mind.
Good Luck!