Post

Replies

Boosts

Views

Activity

Reply to Directions to annotation from current location in MapKit
Your initial question seemed to be about opening the maps app. Which the code I posted should allow you to do. Does it work ? I understand you have further need to help user navigate. What do you want to provide exactly ? Route planning inside the map ? Then passing the additional info should be OK. To find what to pass exactly in HTTP header, do the test in Maps: select an itinerary to search and look at the url ; it is like this (here to go from Paris-Orly airport to Toulouse city): https://www.google.fr/maps/dir/Paris-Orly,+Orly/Toulouse/@46.1636622,-0.0010695,7z/data=!3m1!4b1!4m14!4m13!1m5!1m1!1s0x47e675b1fa6a3b1d:0x9d78ded743db8422!2m2!1d2.3652422!2d48.7262321!1m5!1m1!1s0x12aebb6fec7552ff:0x406f69c2f411030!2m2!1d1.444209!2d43.604652!3e0 Something else ?
Topic: Programming Languages SubTopic: Swift Tags:
Oct ’21
Reply to Print location shared when user tap 'locate me' button
Is it normal that when user choose allow once, current location disappears in couple of seconds when app is in background?  I cannot tell for sure, but once means that when it's done, it is no more authorised. Backgrounding may fall in this case. What you could do is instruct your user via the message in info.plist For the rest, if it works, don't forget to close the thread. And ask another question if you have other points to solve.
Topic: Programming Languages SubTopic: Swift Tags:
Oct ’21
Reply to Panic full
Do you mean the underlined keywords ? Translate: I assume you want to get the meaning, not translate in another language ? Could you explain the context ? Have you connected sensors ? I also see your battery is nearly empty.
Topic: App & System Services SubTopic: Core OS Tags:
Oct ’21
Reply to iOS 15 crash at -collectionView:viewForSupplementaryElementOfKind:atIndexPath:
If anyone can, please share more clarity as to why when I return from collectionView:viewForSupplementaryElementOfKind:atIndexPath: that my return ends up nil despite returning a valid view? You have closed this thread. So please open a new one and post the complete code of this func. collectionView:viewForSupplementaryElementOfKind:atIndexPath:  You have a problem in your dequeue statement.
Topic: UI Frameworks SubTopic: UIKit Tags:
Oct ’21
Reply to [SwiftUI] Gray view with simple navigation
OK, I tested. Effectively problem occurs only when you are editing the TextField and hit the YellowView button. In fact the sequence is: You type in TextField: keyboard shows in its view You type the button : keyboard view still occupies screen keyboards hides in the same time yellow appears. But it has only a partial screen available, because of keyboard View when finished, keyboard view is freed and space becomes available for yellow view You should try to dismiss the keyboard before firing NavigationLink. https://stackoverflow.com/questions/57697827/swiftui-navigationlink-navigate-to-a-destination-view-after-running-account-cre
Topic: UI Frameworks SubTopic: UIKit Tags:
Oct ’21
Reply to [SwiftUI] Gray view with simple navigation
Here is something (can probably be simplified) that works. struct YellowView: View { var body: some View { Text("Yellow view") .frame(maxWidth: .infinity, maxHeight: .infinity) .background(Color.yellow) } } struct ContentView: View { private enum Field: Int, CaseIterable { case textCase } @State var isLinkActive = false // Will allow to delay @State var text: String = "" @FocusState private var focusedField: Field? var body: some View { NavigationView { VStack { TextField("TextField", text: $text) .focused($focusedField, equals: .textCase) // If $focusedField different, will hide keyboard NavigationLink(destination: YellowView(), isActive: $isLinkActive) { Button(action: { focusedField = nil let seconds = 0.5 // Give time for keyboard to completely hide DispatchQueue.main.asyncAfter(deadline: .now() + seconds) { self.isLinkActive = true } }) { Text("Go Yellow view") } } Spacer() } } Text("Bottom View") .frame(maxWidth: .infinity, maxHeight: 60) .background(Color.red) } } With the help of: https://stackoverflow.com/questions/56491386/how-to-hide-keyboard-when-using-swiftui and https://stackoverflow.com/questions/57799548/navigationview-and-navigationlink-on-button-click-in-swiftui/63367285
Topic: UI Frameworks SubTopic: UIKit Tags:
Oct ’21
Reply to [SwiftUI] Gray view with simple navigation
If you have a single textField, you can simplify a little bit. No need for enum. struct YellowView: View { var body: some View { Text("Yellow view") .frame(maxWidth: .infinity, maxHeight: .infinity) .background(Color.yellow) } } struct ContentView: View { let textCase = 1 @State var isLinkActive = false // Will allow to delay @State var text: String = "" @FocusState private var focusedField: Int? var body: some View { NavigationView { VStack { TextField("TextField", text: $text) .focused($focusedField, equals: textCase) // If $focusedField different, will hide keyboard NavigationLink(destination: YellowView(), isActive: $isLinkActive) { Button(action: { focusedField = nil let seconds = 0.4 // Give time for keyboard to hide DispatchQueue.main.asyncAfter(deadline: .now() + seconds) { self.isLinkActive = true } }) { Text("Go Yellow view") } } Spacer() } } Text("Bottom View") .frame(maxWidth: .infinity, maxHeight: 60) .background(Color.red) } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } }
Topic: UI Frameworks SubTopic: UIKit Tags:
Oct ’21
Reply to Xcode 13 doesn't stay paused on breakpoint
I tested with Xcode 13 (13A233). I set a breakpoint in this simple code at line 7. I waited for 3 minutes, and code was still stopped. Then it did continue normally. 1. struct ContentView: View { 2. @State var newText: String = "" 3. @State var newText2: String = "" 4. var body: some View { 5. List { 6. Text("Hello, World!") 7. Text("Hello, Again!") 8. TextField("New text", text: $newText).environment(\.isEnabled, true) 9. TextField("New text 2", text: $newText2).environment(\.isEnabled, true) 10. } 11. } 12. } Could you show your code and where you set the breakpoint ?
Oct ’21
Reply to Directions to annotation from current location in MapKit
Your initial question seemed to be about opening the maps app. Which the code I posted should allow you to do. Does it work ? I understand you have further need to help user navigate. What do you want to provide exactly ? Route planning inside the map ? Then passing the additional info should be OK. To find what to pass exactly in HTTP header, do the test in Maps: select an itinerary to search and look at the url ; it is like this (here to go from Paris-Orly airport to Toulouse city): https://www.google.fr/maps/dir/Paris-Orly,+Orly/Toulouse/@46.1636622,-0.0010695,7z/data=!3m1!4b1!4m14!4m13!1m5!1m1!1s0x47e675b1fa6a3b1d:0x9d78ded743db8422!2m2!1d2.3652422!2d48.7262321!1m5!1m1!1s0x12aebb6fec7552ff:0x406f69c2f411030!2m2!1d1.444209!2d43.604652!3e0 Something else ?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Print location shared when user tap 'locate me' button
Is it normal that when user choose allow once, current location disappears in couple of seconds when app is in background?  I cannot tell for sure, but once means that when it's done, it is no more authorised. Backgrounding may fall in this case. What you could do is instruct your user via the message in info.plist For the rest, if it works, don't forget to close the thread. And ask another question if you have other points to solve.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to How to get animation interpolation during animation?
I want invoke a method during animation,this method is in other framework not related with iOS SDK What do you mean "not related to iOS SDK" ? What are the parameters you want to animate between 100 and 200 ? A workaround would be to animate "manually". Or to call animate in a loop, from 100 to 200 ; then you can get the value as you need.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to How can I add my developer logo
@free_lancer55 I got the answer from Apple support. It is only for high volume apps. The logo you see is visible to some developers only, this is not a function intended by Apple, except for certain apps that generate a lot of volume. Feel free to send a Feedback to ask for enhancement.
Replies
Boosts
Views
Activity
Oct ’21
Reply to Panic full
Do you mean the underlined keywords ? Translate: I assume you want to get the meaning, not translate in another language ? Could you explain the context ? Have you connected sensors ? I also see your battery is nearly empty.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to [SwiftUI] Gray view with simple navigation
The individual frames provide more information: Try removing this spacer: .background(Color.yellow) Spacer()
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to iOS 15 crash at -collectionView:viewForSupplementaryElementOfKind:atIndexPath:
If anyone can, please share more clarity as to why when I return from collectionView:viewForSupplementaryElementOfKind:atIndexPath: that my return ends up nil despite returning a valid view? You have closed this thread. So please open a new one and post the complete code of this func. collectionView:viewForSupplementaryElementOfKind:atIndexPath:  You have a problem in your dequeue statement.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to [SwiftUI] Gray view with simple navigation
OK, I tested. Effectively problem occurs only when you are editing the TextField and hit the YellowView button. In fact the sequence is: You type in TextField: keyboard shows in its view You type the button : keyboard view still occupies screen keyboards hides in the same time yellow appears. But it has only a partial screen available, because of keyboard View when finished, keyboard view is freed and space becomes available for yellow view You should try to dismiss the keyboard before firing NavigationLink. https://stackoverflow.com/questions/57697827/swiftui-navigationlink-navigate-to-a-destination-view-after-running-account-cre
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Cant click on buttons after update to Xcode 13
Could you first post the code edited with formatter tool (<>) ? That will help analyzing it.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to [SwiftUI] Gray view with simple navigation
Here is something (can probably be simplified) that works. struct YellowView: View { var body: some View { Text("Yellow view") .frame(maxWidth: .infinity, maxHeight: .infinity) .background(Color.yellow) } } struct ContentView: View { private enum Field: Int, CaseIterable { case textCase } @State var isLinkActive = false // Will allow to delay @State var text: String = "" @FocusState private var focusedField: Field? var body: some View { NavigationView { VStack { TextField("TextField", text: $text) .focused($focusedField, equals: .textCase) // If $focusedField different, will hide keyboard NavigationLink(destination: YellowView(), isActive: $isLinkActive) { Button(action: { focusedField = nil let seconds = 0.5 // Give time for keyboard to completely hide DispatchQueue.main.asyncAfter(deadline: .now() + seconds) { self.isLinkActive = true } }) { Text("Go Yellow view") } } Spacer() } } Text("Bottom View") .frame(maxWidth: .infinity, maxHeight: 60) .background(Color.red) } } With the help of: https://stackoverflow.com/questions/56491386/how-to-hide-keyboard-when-using-swiftui and https://stackoverflow.com/questions/57799548/navigationview-and-navigationlink-on-button-click-in-swiftui/63367285
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to [SwiftUI] Gray view with simple navigation
If you have a single textField, you can simplify a little bit. No need for enum. struct YellowView: View { var body: some View { Text("Yellow view") .frame(maxWidth: .infinity, maxHeight: .infinity) .background(Color.yellow) } } struct ContentView: View { let textCase = 1 @State var isLinkActive = false // Will allow to delay @State var text: String = "" @FocusState private var focusedField: Int? var body: some View { NavigationView { VStack { TextField("TextField", text: $text) .focused($focusedField, equals: textCase) // If $focusedField different, will hide keyboard NavigationLink(destination: YellowView(), isActive: $isLinkActive) { Button(action: { focusedField = nil let seconds = 0.4 // Give time for keyboard to hide DispatchQueue.main.asyncAfter(deadline: .now() + seconds) { self.isLinkActive = true } }) { Text("Go Yellow view") } } Spacer() } } Text("Bottom View") .frame(maxWidth: .infinity, maxHeight: 60) .background(Color.red) } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } }
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to App Store Connect trends has incoherent data
I have noticed some problems for sales of the current day. For instance, they may show up when you display by month but not in the per day section. Retry a day later and check if everything OK.
Replies
Boosts
Views
Activity
Oct ’21
Reply to Manage hit test mask in SwiftUI for an Image with transparency
When you say transparent, do you mean color is .clear ?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Xcode 13 doesn't stay paused on breakpoint
I tested with Xcode 13 (13A233). I set a breakpoint in this simple code at line 7. I waited for 3 minutes, and code was still stopped. Then it did continue normally. 1. struct ContentView: View { 2. @State var newText: String = "" 3. @State var newText2: String = "" 4. var body: some View { 5. List { 6. Text("Hello, World!") 7. Text("Hello, Again!") 8. TextField("New text", text: $newText).environment(\.isEnabled, true) 9. TextField("New text 2", text: $newText2).environment(\.isEnabled, true) 10. } 11. } 12. } Could you show your code and where you set the breakpoint ?
Replies
Boosts
Views
Activity
Oct ’21
Reply to What to use for animating app for iOS
What type of animation do you look for ? Flash button, color change, size change, morphing effects ? All those are very easy to do with UIView.animate(withanimate(withDuration:animations:). Or are you looking for more sophisticated ones ?
Replies
Boosts
Views
Activity
Oct ’21