Post

Replies

Boosts

Views

Activity

Reply to Date constant from year, month, day
Did you try this: func makeDate(year: Int, month: Int, day: Int, hr: Int = 0, min: Int = 0, sec: Int = 0) -> Date { var calendar = Calendar(identifier: .gregorian) calendar.timeZone = TimeZone(identifier: "GMT")! let components = DateComponents(year: year, month: month, day: day) //, hour: hr, minute: min, second: sec) return calendar.date(from: components)! } let myDate = makeDate(year: 2025, month: 02, day: 10) print(myDate)
Topic: App & System Services SubTopic: General Tags:
Feb ’25
Reply to Is it possible to get selected text from a Text field?
I tried with onChange, but could not extract the string: var body: some View { TextField("Placehodler", text: $myText, selection: $textSelection) .onChange(of: textSelection) { print("change of selection: \(textSelection)") } } I get change of selection: Optional(SwiftUI.TextSelection(indices: SwiftUI.TextSelection.Indices.selection(Range(Swift.String.Index(_rawBits: 131080)..<Swift.String.Index(_rawBits: 393224))), affinity: SwiftUI.TextSelectionAffinity.upstream)) But that leads nowhere. However, TextSelection doc hints at a way to extract strings, but does not show how to retrieve substrings: struct SuggestionTextEditor: View { @State var text: String = "" @State var selection: TextSelection? = nil var body: some View { VStack { TextEditor(text: $text, selection: $selection) // A helper view that offers live suggestions based on selection. SuggestionsView( substrings: getSubstrings(text: text, indices: selection?.indices)) } } private func getSubstrings( text: String, indices: TextSelection.Indices? ) -> [Substring] { // Resolve substrings representing the current selection... } } That let me hope there is a solution…
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Feb ’25
Reply to Swift Form on iOS
Welcome to the forum. Before one can answer, please: post complete code so that we can reproduce (not only the editSource func) format thee code with code formatter tool. As you can see, your present code is just unreadable.
Topic: Community SubTopic: Apple Developers Tags:
Feb ’25
Reply to Extremely offended by Inconsistent Review
Welcome to the forum. You wrote: I got case 4.3 resolved previously, Do you mean you once got a rejection that was finally solved ? If so, I do advise you, when you submit a new release, to mention this past rejection and its resolution and give details (incl the dates of this former rejection/resolution) in the notes for reviewer. That should avoid this type of new rejection.
Feb ’25
Reply to My application has been under review for a very long time, more than 17 days, there is a critical fix in it, how can I speed up the review process?
Welcome to the forum.   I provided the necessary document in response to your request What was the request ? What category of app is it ? It could be a reason beyond the app itself (as it seems it is an update of an existing app on the AppStore), but a verification of your account. Note: the forum is not the right place to address review issues. You have to contact support or continue exchanging with review team (and provide them complete and transparent information).
Feb ’25
Reply to Date constant from year, month, day
Did you try this: func makeDate(year: Int, month: Int, day: Int, hr: Int = 0, min: Int = 0, sec: Int = 0) -> Date { var calendar = Calendar(identifier: .gregorian) calendar.timeZone = TimeZone(identifier: "GMT")! let components = DateComponents(year: year, month: month, day: day) //, hour: hr, minute: min, second: sec) return calendar.date(from: components)! } let myDate = makeDate(year: 2025, month: 02, day: 10) print(myDate)
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Feb ’25
Reply to How to solve "Extra trailing closure passed in call" in a section?
Welcome to the forum. Hard to say with the code you show. Please post complete code of the View. The error may be elsewhere, like a missing or misplaced closing curly brace. Maybe there's a false note in the music. 😉
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Feb ’25
Reply to Guideline 4.3(a) - Design - Spam
Could you explain more clearly. Impossible to understand what you mean and what you want. is your app published already ? what was rejected as spam ? if you want a new version, just change the version release to version 2 or rename the app (it is possible) and then upload the new code.
Replies
Boosts
Views
Activity
Feb ’25
Reply to Swift Challenge
Welcome to the forum.   to join to developer programs you need to be under 18 years old Where did you read this ? That's absolutely not the case.
Replies
Boosts
Views
Activity
Feb ’25
Reply to Is it possible to get selected text from a Text field?
I tried with onChange, but could not extract the string: var body: some View { TextField("Placehodler", text: $myText, selection: $textSelection) .onChange(of: textSelection) { print("change of selection: \(textSelection)") } } I get change of selection: Optional(SwiftUI.TextSelection(indices: SwiftUI.TextSelection.Indices.selection(Range(Swift.String.Index(_rawBits: 131080)..<Swift.String.Index(_rawBits: 393224))), affinity: SwiftUI.TextSelectionAffinity.upstream)) But that leads nowhere. However, TextSelection doc hints at a way to extract strings, but does not show how to retrieve substrings: struct SuggestionTextEditor: View { @State var text: String = "" @State var selection: TextSelection? = nil var body: some View { VStack { TextEditor(text: $text, selection: $selection) // A helper view that offers live suggestions based on selection. SuggestionsView( substrings: getSubstrings(text: text, indices: selection?.indices)) } } private func getSubstrings( text: String, indices: TextSelection.Indices? ) -> [Substring] { // Resolve substrings representing the current selection... } } That let me hope there is a solution…
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Feb ’25
Reply to New to the Apple Developer Program
Start what ? To properly use the forum, start reading this: https://developer.apple.com/forums/thread/706527 To start programming ? You'll find a lot of material here in beginners' pathway: https://developer.apple.com/pathways/?cid=ht-pathways Wish you good start.
Replies
Boosts
Views
Activity
Feb ’25
Reply to WOW, These forums have improved a lot!
Welcome.to the forum. Great you like it. That's your first post ? How do you compare so to see the improvement ?
Replies
Boosts
Views
Activity
Feb ’25
Reply to User content required to college usage data?
You have to declare in App tracking transparency
Topic: Business & Education SubTopic: General Tags:
Replies
Boosts
Views
Activity
Feb ’25
Reply to copyright complaint
Are they more specific about copyright infringement reported by reviewer. It could be an image, a text, a music. What is your trademark about ? It is probably just a name of app or company, but reviewer may have detected something else.
Replies
Boosts
Views
Activity
Feb ’25
Reply to Swift Form on iOS
Welcome to the forum. Before one can answer, please: post complete code so that we can reproduce (not only the editSource func) format thee code with code formatter tool. As you can see, your present code is just unreadable.
Topic: Community SubTopic: Apple Developers Tags:
Replies
Boosts
Views
Activity
Feb ’25
Reply to labels appear as dimmed in UIView
OK, found the obvious answer: Label behaviour must be enabled ! But what does it really mean for a label to be enabled (user interaction being disabled…)
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Feb ’25
Reply to Is there a way to change the username on the developer forum ?
AFAIK, no way to change the user name. Unless by deleting the account and recreating. But that's too much extreme solution.
Replies
Boosts
Views
Activity
Feb ’25
Reply to Extremely offended by Inconsistent Review
Welcome to the forum. You wrote: I got case 4.3 resolved previously, Do you mean you once got a rejection that was finally solved ? If so, I do advise you, when you submit a new release, to mention this past rejection and its resolution and give details (incl the dates of this former rejection/resolution) in the notes for reviewer. That should avoid this type of new rejection.
Replies
Boosts
Views
Activity
Feb ’25
Reply to Rejected because of 4.3 (a) spam
xray-core (https://github.com/XTLS/Xray-core) framework Is it open source ? Or can you prove you have the right to reuse this framework. If so, try to explain to reviewer.
Replies
Boosts
Views
Activity
Feb ’25
Reply to My application has been under review for a very long time, more than 17 days, there is a critical fix in it, how can I speed up the review process?
Welcome to the forum.   I provided the necessary document in response to your request What was the request ? What category of app is it ? It could be a reason beyond the app itself (as it seems it is an update of an existing app on the AppStore), but a verification of your account. Note: the forum is not the right place to address review issues. You have to contact support or continue exchanging with review team (and provide them complete and transparent information).
Replies
Boosts
Views
Activity
Feb ’25