With a .swiftpm-based project there is no Deployment Info option in the General tab. In the end, I edited the Package.swift file to add a entry like this:
supportedDeviceFamilies: [
.pad
],
But thanks for the help.
Post
Replies
Boosts
Views
Activity
I decided to have a crack at copying off the Get Started with Apps example and changed my targets section of the app package to look like this:
targets: [
.executableTarget(name: "App", dependencies: ["Guide"], path: "App"),
.target(
name: "Guide",
path: "Guide",
resources: [
.process("Guide.tutorial"),
.process("Resources/title.png"),
.process("Resources/titleBackground.png")
])
]
With both Xcode 13 and the 14 beta I get the following message now, for my project:
public headers ("include") directory path for 'Guide' is invalid or not contained in the target
There is a Guide folder and a Resources folder with those two pngs in it, so I don't think it's an issue with missing files... Any ideas at all would be appreciated.
Thanks for the quick response! So I'm planning on using Apache and having a setup that looks like, for example, this:
~/public_html/docs/question_bot
~/public_html/docs/slothcreator
But before I even get to serving up the two separate doc archives, when I navigate to question_bot, I have an issue loading the css and js folders at the root, because in my public_html folder I already have css and js files that drive other parts of this site. So this rewrite rule in the .htaccess file is a bit of an issue:
# Route files within the documentation archive.
RewriteRule ^(css|js|data|images|downloads|favicon\.ico|favicon\.svg|img|theme-settings\.json|videos)\/.*$ QuestionBot.doccarchive/$0 [L]
(This rewrite rule is in a .htaccess file in the ~/public_html/docs/question_bot directory.)
Is there an easy way to amend this to not stomp all over my existing content? I can go digging into rewrite rules and regexp, but if there's an obvious way to support the setup above (and avoid requests for my docs going to /css and /js) I'm missing I'd love to hear it.
Thanks!
You can get the teacher resources (which includes the solutions) here: https://education-static.apple.com/explorations/xcode11/teacher.zip
Depends what hardware you have available. If all you have is an iPad, you would start with Everyone Can Code Puzzles to get an intro to the Swift programming language.
If you have a Mac, needed for iOS development, you could start with either Develop in Swift Fundamentals (https://books.apple.com/us/book/id1511184145) or Develop in Swift Explorations (https://books.apple.com/us/book/id1511184149). These books came out this summer and replace the App Development with Swift books.
The Fundamentals book is all about app development and dives right in. It's suitable for beginners, but you really hit the ground running.
Explorations is for beginners who really haven't had much exposure to coding or the concepts of coding at all. Either one would be a really good start and they have some great resources for you to work through.
What version of Swift Playgrounds are you using? What OS?
I'm running it in Playgrounds on the Mac with Catalina 10.15.7 and it runs okay for me...
It depends if there is an Apple authorized training center near you, but you can get a certification from one of those in the Develop with Swift curriculum:
The Develop in Swift curriculum has been completely redesigned to help students explore app development on a Mac — and code just like the pros, for a semester or for certification. The curriculum is now accompanied by a free online professional learning course to help more educators give students an opportunity to make an impact with code.
(from this page, the Spotlight at the bottom: https://www.apple.com/education/k12/)
I gave an answer to this version of the question, here: https://developer.apple.com/forums/thread/658024
That's a great question!
Looking at your code it should work, but, for some reason that last tile with the stone blocking the path forward doesn't think it's being blocked forward, to the left or to the right.
(Try your code with an extra:
if isBlocked {
collectGem()
}
if isBlockedLeft {
collectGem()
}
if isBlockedRight {
collectGem()
}
for the craic and you'll see that Byte jumps to collect gems in lots of other places, but not on that last tile until Byte turns.)
In the hints they mention that there's a certain pattern to when you turn left and when you turn right... and in the solution, from the teacher's guide, the while loop is working until we see that Byte isOnOpenSwitch.
But you're right, I think your algorithm should work, but I'd need to do some more digging to see why it's not...
I hope that helps!
(The teacher's guide for all the solutions, even for comparing against your own solutions, is available here: https://education-static.apple.com/teaching-code/learn-to-code-solutions.pdf)
The text when you complete the Moving Further Forward page in Learn to Code 2 is trying to say that, now that you've learned about using parameters in your functions (like being able to specify how many steps forward you want Expert to take), you can use the move(distance:) function on any character. Like you folks were saying above, Expert and Character derive from the same base class, which, if you look into the sources for the playground (on your iPad, in the '...' menu under Advanced > View Auxilliary Source Files) you'll see that the Actor.swift file in the Book.playgroundmodule has a method defined called public func move(distance: Int)
This means that, even before you learned about this method by writing a function with the parameter for distance, there was a method you could call on your expert that would look like this:
expert.move(distance: 3)
It didn't show up in the autocompletions until the next page, but it was always there.
Does that make sense?
With Playground Books you can author more involved experiences... chapters, pages... I use them to teach kids how to code or to guide them through a particular concept. Same with the Learn to Code playground books, they're brilliant examples of using a series of lessons to teach kids a certain set of concepts.
But if you're writing code to ultimately live in a project in Xcode I think you're good with just the plain old playground...
To *not* have your Playgrounds sync (on your iPad) you can go to Settings and your iCloud account at the top of the settings list. In there, if you tap on the iCloud option you should see a list of app using iCloud... you can toggle the switch for Playgrounds and you should be good to go.
On the Mac, go to System Preferences and tap on the Apple ID preference in the top row. In the list of apps using iCloud on this Mac you should see an iCloud Drive row with an Options... button. Click on the Options button, find Playgrounds in the list that pops up, and uncheck it. That *should* do what you want...
I also chucked these playgrounds up in a temporary feed you can subscribe to: https://developer.apple.com/ul/sp0?url=https://www.thecodehub.ie/playgrounds/wwdcfeed.json
But the Files uncompressed tip works well, too!
For sure this is a deep(ish) end to jump into!
The absolute best place to start, in my mind, is with the free Everyone Can Code Puzzles book from Apple: https://books.apple.com/us/book/everyone-can-code-puzzles/id1481279769
I ran an online course for the last little while that I can't link in the forums, but it's up on YouTube as The Code Hub Everyone Can Code Puzzles. I walked through the material (it was aimed at kids ages 8-18 in Ireland, but a lot of their parents and folks outside Ireland followed along, too) in the book and in Swift Playgrounds. We just did a session on Swan's Quest, Chapter 1, and the background of Everyone Can Code Puzzles certainly helped them.
You don't need to edit any code in the shared code files (like Graphic.swift and all), just in the main swift file that you see when you navigate to the page. Like you mentioned, you just need to set the accessibilityLabel property on each of those torches to turn them all on.
I hope this helps!
To make it easier I created a playground feed you can subscribe to in Swift Playgrounds to add the first chapter to your iPad: https://developer.apple.com/ul/sp0?url=https://www.thecodehub.ie/playgrounds/wwdcfeed.json
This is just temporary until Apple finds it a permanent home...