Posts

Post not yet marked as solved
0 Replies
252 Views
I have a LookAroundPrewiew in a frame which itself is already small. On top of that is the LookAroundPreview automatically appended onto the preview. In fact it doesn’t really bother me per se, but it’s that my view doesn’t have much space. So is it possible customize the view by removing the text ? And the Apple Maps text at the bottom of the image which is fairly small isn’t a problem for me.
Posted
by Kwiky.
Last updated
.
Post not yet marked as solved
2 Replies
265 Views
I'm trying to set up a git repository from Xcode so that me and a friend can work on a project. When he clones the repository in Xcode, he gets the "no editor" error message. On my side, in the source control panel, I see the untracked icon, with a question mark in a blue box, and uncommitted changes. Despite pushing it 20 times, it's still showing the uncommitted message. Also, I have the no editor message too in a rectangle. How can I track these files and fix it ?
Posted
by Kwiky.
Last updated
.
Post not yet marked as solved
0 Replies
519 Views
Hi. I'm writing the following code for a navigation with images and I have an issue: the images don't fit with the automatic rectangle that is created by the NavigationStack view. Here is the code and I'm attaching an image too for you to understand : import SwiftUI struct LycéesListe: View { var body: some View { NavigationStack { List(lycées) { lycée in NavigationLink { LycéeDétail(lycée: lycée) } label: { LycéesRow(lycée: lycée) } } .navigationTitle("Lycées") } } struct LycéesListe_Previews: PreviewProvider { static var previews: some View { ForEach(["iPhone 13", "iPhone 12"], id: \.self) { deviceName in LycéesListe() .previewDevice(PreviewDevice(rawValue: deviceName)) .previewDisplayName(deviceName) } } } } Anyone knows how I could make the images fit with the rectangle border so I just have images with clean rectangles and not these green lines ? I tried to do padding but it didn't help. Any answer appreciated.
Posted
by Kwiky.
Last updated
.
Post not yet marked as solved
3 Replies
1.6k Views
Hi. I'm getting an error on the index 1 of my code : Binary operator '+' cannot be applied to operands of type '()' and 'String'. The code block is the following func addDance (_ sentence: String) {     return addDance(sentence: String) + " and then we dance" } The instruction of the exercise I'm doing is the following : «Create a function addDance that takes a string, appends a phrase about dancing (like "and then we dance!" or "but no dancing", according to your taste), and returns the new string.  Call the addDance function passing in myPlans, and assign the result to friendPlans. »
Posted
by Kwiky.
Last updated
.
Post not yet marked as solved
1 Replies
1.6k Views
Hi, I’ve been watching quite some stuff about Object Capture months afar from now and how it works, and I’m wondering how I am supposed to interpret the ideal overlaps between sequential photos. Apple says it should be at least 70% between each photo, but since the ideal overlap isn’t a tangible concept, how am I supposed to take it into account when I take photos. Any help appreciated. By the way, here’s the article mentioning the overlap, near the end of the latter. https://developer.apple.com/documentation/realitykit/capturing-photographs-for-realitykit-object-capture
Posted
by Kwiky.
Last updated
.
Post marked as solved
1 Replies
1.6k Views
Apple recently introduced and presented Web Push, a new Web Kit tool permitting to send notifications to users on your websites and web apps. However, push notifications have been a thing on macOS since Mavericks. Therefore, what is the difference between these two things ?(https://developer.apple.com/notifications/safari-push-notifications/ ) and that new thing (https://developer.apple.com/videos/play/wwdc2022/10098/)
Posted
by Kwiky.
Last updated
.
Post marked as solved
3 Replies
679 Views
I'm trying to do the last questions. However, I'm having much difficulty with the last question and I'm unsure of my answers on the previous questions. Structure is actually a new concept for me. let songTitles = ["Ooh yeah", "Maybe", "No, no, no", "Makin' up your mind"] let artists = ["Brenda and the Del-chords", "Brenda and the Del-chords", "Fizz", "Boom!"] let durations = [90, 200, 150, 440] func songInformation(songTitles: String, artists: String, durations: Int) -> String {    return "\(songTitles) by \(artists), duration \(durations)" } for i in 0 ... songTitles.count - 1 {     print(songInformation(songTitles: songTitles[i], artists: artists[i], durations: durations[i])) } /*:  The code above is prone to all sorts of errors. What would happen if your song catalog expanded but you forgot to update one of the three arrays? What if you added star rating data with a new array but forgot to modify the `songInformation` function?    This kind of code is also hard to maintain and read. What if you were tracking thirty properties about songs, instead of just a handful? What would the parameter list of the `songInformation` function look like?    Next you'll perform the same task using a data abstraction: the `Song` struct from the previous page.  */ struct Song {     let title: String     let artist: String     let duration: Int } //:- callout(Exercise): Below, use the `Song` struct from the previous page to simplify your code. /* Create the array of songs here */ let song = [songTitles] /* Declare the songInformation function here */ func songInformation2(songTitles: String, artists: String, durations: Int) -> String {    return "\(songTitles) by \(artists), duration \(durations)" } /* Write a for...in loop here */ for song in songTitles {     songInformation2(songTitles: song.title, artists: song.artist, durations: song.duration) }
Posted
by Kwiky.
Last updated
.
Post not yet marked as solved
4 Replies
892 Views
Hi. I'm getting the «Expected expression» for some reason but don't understand why. let index = 3 if index <= devices.count {     print(devices[index])     else {         return "the array is out of range"     } } Any answer appreciated.
Posted
by Kwiky.
Last updated
.
Post marked as solved
2 Replies
3.1k Views
Hi. I would like to definitely remove comments appearing in the header of a new Xcode project. How can I do so for my future projects, cause that would be annoying to select the header every time a new project is created and delete it. Thanks.
Posted
by Kwiky.
Last updated
.
Post marked as solved
3 Replies
869 Views
Hi. I am currently following Apple's swift course. However, I get an error saying "Expected '}' at end of brace statement" and I don't really understand why ? Can someone explain why and eventually correct the code ? Thanks ! var question2 = question let lowerQuestion2 = question.lowercased() "hello" == "Hello" func responseTo(question: String) -> String {     if question.hasPrefix("hello") {         if lowerQuestion2.hasPrefix("hello") {             return "Hello there"         } else {             return "That really depends"     } }
Posted
by Kwiky.
Last updated
.
Post not yet marked as solved
2 Replies
1.1k Views
Hi, I am doing the first question of the last exercise on the following screenshot. However, I don't really understand the two questions. How is it possible to store a result in a constant, if the result itself is declared with 'let', making it a constant? I sure am not understanding correctly the question, understandable with the fact I just started learning code. Here's the block of code.     let total = pigsFlying + frogsBecomingPrinces + multipleLightningStrikes     return total } /*:  - callout(Exercise): Update the `impossibleBeliefsCount` function so that instead of printing the value, it returns it as an `Int`. `impossibleThingsPhrase` creates a phrase using string interpolation:  */ func impossibleThingsPhrase(numberOfImpossibleThings: Int, meal: String) -> String {     return "Why, I've believed as many as \(numberOfImpossibleThings) before \(meal)" } impossibleThingsPhrase(numberOfImpossibleThings: 712, meal: "chicken") /*:  - callout(Exercise): Update the `impossibleThingsPhrase` function so that, instead of using its two internal constants, it takes two arguments: `numberOfImpossibleThings` as an `Int` and `meal` as a `String`. Now you have two functions that take parameters and return values.  - callout(Exercise): Call `impossibleBeliefsCount` and store the result in a constant.\ Call `impossibleThingsPhrase`, passing in the result of `impossibleBeliefsCount` as one of the arguments.  */ func impossibleBeliefsCount(pigsFlying: Int, frogsBecomingPrinces: Int, multipleLightningStrikes: Int) {     let total = pigsFlying + frogsBecomingPrinces + multipleLightningStrikes     return total }
Posted
by Kwiky.
Last updated
.
Post not yet marked as solved
0 Replies
1.2k Views
What’s the point of Lost Mode for AirPods ? Unlike AirTags where once lost mode is activated and these cannot be paired even if resetted, AirPods’ full panel of features can be enabled once they are resetted. We can’t even change the message appearing, and Apple says a message with the phone number appears when the lost AirPods are paired, but it’s false. I really don’t see where Apple is trying to go.
Posted
by Kwiky.
Last updated
.
Post not yet marked as solved
0 Replies
527 Views
If someone gives a review about an app without commenting about it with text, will the review be private ? What I'm wondering is if the owner of the app will be able to see who gave a review, even a just a stars rating without text. Is there no feature such as «Hide my email» like with Sign In with Apple where the user's email is replaced by another one ? If anybody knows, thanks for the answers.
Posted
by Kwiky.
Last updated
.
Post not yet marked as solved
0 Replies
1.4k Views
From what I know, the iPhone can read NFC tags since 2017 (Core NFC) only on the iPhone 7, 7 Plus, and later. I also know that iPhone XR and later can read tags in the background. My question is the following : what is the difference between reading an NFC and being able to use the phone to scan a NFC ? Technically, paying with Apple Pay on an iPhone 6s, being the first to support Apple Pay is possible, but why is that phone model unable to read NFCS ? Thanks for the answers.
Posted
by Kwiky.
Last updated
.