Post

Replies

Boosts

Views

Activity

Reply to .fileExporter issue
yea I put it as high in the hierarchy as I can. for me that's generally on the content() view - makes it easy to know where it is, particularly if u want to call it from multiple different places var body: some View { content() .fileImporter {} .fileExporter {} } func content() -> some View { //all the other views }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’22
Reply to Do I need to establish LLC in the US when we launch an app in App store in the US
No, but from memory (I did it over 10 years ago) you will need to create a US tax file number or whatever they call it there. the iTunes connect process will take you through the process (or at least it used to). I think you also need one for Japan and one other country (Canada?) from memory if u want to avoid withholding taxes for sales in those locations. not sure if the process has changed now. feel free to correct me if it has.
Aug ’22
Reply to SwiftUI slowly adoption
what I do is write the apps in swiftui then its pretty easy to bridge to UIKit for a particular view or part of it to get all of the functionality u have listed. I believe there is a WWDC session on this specifically. SwiftUI and UIKit generally plays together pretty well. Tbh its way easier and faster to do it that way than write everything in UIKit. some of what you have listed have been implemented in native swiftui already. eg pull down to refresh - have a look at the "what's new in swiftui" from the past few years wwdc's. I believe its called .refreshable MapKit has been recently brought into swiftui. not sure about the specific functionality you need but I recently converted my UIKit maps components into the native swiftui version. For the custom controls on a Video view, I overlayed some custom swiftui controls over the top of a bridged AVKit video player using a ZStack. it'll be another decade before everything is in swiftui, if ever. they still haven't got everything in objective c implemented for swift (try catching a core data fetch thrown exception in swift) and there are still a few obscure functionality that u still need to fall back to C for. So it'll pay to learn how to bridge the UIKit controls into swiftui so u can move to swiftui more seamlessly.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’22
Reply to App Intent not Discoverable by Siri
just say "Show me my books". don't need your app name. Also it seems you don't need the AppShortcutsProvider. I was able to get it working with just the AppIntent struct struct ShowMeMyBooks: AppIntent {     static var title: LocalizedStringResource = "Show me my books"     @MainActor     func perform() async throws -> some IntentResult {         return .result(dialog: "These are your books")     }     static var openAppWhenRun: Bool = false } note: it seems the sample code in the WWDC session is wrong. its right in the video but not in the attached code.
Topic: App & System Services SubTopic: General Tags:
Jul ’22
Reply to Charts: customising chartYAxis values
a .stride solution based on Olivers suggestion: func myChart() -> some View {         var yAxisMaxValue = 23532 //get the min and max values from your data         var yAxisMinValue = -7633 //get the min and max values from your data         let roundedYAxisMaxValue = roundUp(yAxisMaxValue, to: 2)         let roundedYAxisMinValue = roundUp(yAxisMinValue, to: 2)         let strideValue = max(abs(roundedYAxisMaxValue), abs(roundedYAxisMinValue)) / 3.0 //max 3 axis marks above and max 3 below zero return Chart { //your chart layout code } .chartYAxis {             AxisMarks(values: .stride(by: strideValue)) {                 let value = $0.as(Double.self)!                 AxisGridLine()                 AxisTick()                 AxisValueLabel {                     Text("\(self.abbreviateAxisValue(string: "\(value)"))")                 }             }         } } func abbreviateAxisValue(string: String) -> String {         let decimal = Decimal(string: string)         if decimal == nil {             return string         } else {             if abs(decimal!) > 1000000000000.0 {                 return "\(decimal! / 1000000000000.0)t"             } else if abs(decimal!) > 1000000000.0 {                 return "\(decimal! / 1000000000.0)b"             } else if abs(decimal!) > 1000000.0 {                 return "\(decimal! / 1000000.0)m"             } else if abs(decimal!) > 1000.0 {                 return "\(decimal! / 1000.0)k"             } else {                 return "\(decimal!)"             }         } } //round up to x significant digits func roundUp(_ num: Double, to places: Int) -> Double {         let p = log10(abs(num))         let f = pow(10, p.rounded(.up) - Double(places) + 1)         let rnum = (num / f).rounded(.up) * f         return rnum     }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’22
Reply to Charts: customising chartYAxis values
just tried. using .stride works. have to calculate your own values but probably a better solution than parsing debug descriptions. would be nice if we could vary stride values for different ranges eg. below 0 and above 0 but I suppose that's a different problem.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’22
Reply to Macbook too old.
What I used to do when I was in your situation was to create a VMware image with a macOS install and Xcode and put it on a large thumbdrive. Then go to a public library with Macs and run the virtual machine and code using that. I did that until I could afford a macbook. I can't remember exactly how I got it to run but might be worth researching if u have access to a library or other public facility with newer Macs. not sure if u even need a Mac, maybe just a fast machine. also have a browse of eBay or whatever classified site u have where u live. you can probably pick up an old (but newer Mac than yours) for $50 or even free. though sounds like a **** move from whoever at apple you were talking to.
Jun ’22
Reply to iOS 16 beta 6
its your device, do what u want
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Sep ’22
Reply to .fileExporter issue
yea I put it as high in the hierarchy as I can. for me that's generally on the content() view - makes it easy to know where it is, particularly if u want to call it from multiple different places var body: some View { content() .fileImporter {} .fileExporter {} } func content() -> some View { //all the other views }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’22
Reply to Can not download any key!
Sorry not helpful but - "Wheres the any key!" ;-)
Replies
Boosts
Views
Activity
Aug ’22
Reply to Do I need to establish LLC in the US when we launch an app in App store in the US
No, but from memory (I did it over 10 years ago) you will need to create a US tax file number or whatever they call it there. the iTunes connect process will take you through the process (or at least it used to). I think you also need one for Japan and one other country (Canada?) from memory if u want to avoid withholding taxes for sales in those locations. not sure if the process has changed now. feel free to correct me if it has.
Replies
Boosts
Views
Activity
Aug ’22
Reply to NavigationStack with NavigationLink - back button only works correctly one deep
seems to be fixed in ios16 beta 4
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’22
Reply to SwiftUI slowly adoption
what I do is write the apps in swiftui then its pretty easy to bridge to UIKit for a particular view or part of it to get all of the functionality u have listed. I believe there is a WWDC session on this specifically. SwiftUI and UIKit generally plays together pretty well. Tbh its way easier and faster to do it that way than write everything in UIKit. some of what you have listed have been implemented in native swiftui already. eg pull down to refresh - have a look at the "what's new in swiftui" from the past few years wwdc's. I believe its called .refreshable MapKit has been recently brought into swiftui. not sure about the specific functionality you need but I recently converted my UIKit maps components into the native swiftui version. For the custom controls on a Video view, I overlayed some custom swiftui controls over the top of a bridged AVKit video player using a ZStack. it'll be another decade before everything is in swiftui, if ever. they still haven't got everything in objective c implemented for swift (try catching a core data fetch thrown exception in swift) and there are still a few obscure functionality that u still need to fall back to C for. So it'll pay to learn how to bridge the UIKit controls into swiftui so u can move to swiftui more seamlessly.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’22
Reply to AppIntents: pauses in siri's speech and hiding dialog text
I tried using a ";" instead of a "." in the dialog. gives a more acceptable pause between bullet points but it's not really the correct punctuation in the displayed dialog.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jul ’22
Reply to Parse data from natural language text using SiriKit
yes, but you have to write all the logic to do that... Siri can recognise a specified number of phrases for you but that's about it. The new App Intents framework will help. have a watch of the WWDC sessions on it.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jul ’22
Reply to App Intent not Discoverable by Siri
just say "Show me my books". don't need your app name. Also it seems you don't need the AppShortcutsProvider. I was able to get it working with just the AppIntent struct struct ShowMeMyBooks: AppIntent {     static var title: LocalizedStringResource = "Show me my books"     @MainActor     func perform() async throws -> some IntentResult {         return .result(dialog: "These are your books")     }     static var openAppWhenRun: Bool = false } note: it seems the sample code in the WWDC session is wrong. its right in the video but not in the attached code.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jul ’22
Reply to NavigationStack with NavigationLink - back button only works correctly one deep
still an issue in ios16b3
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’22
Reply to Charts: customising chartYAxis values
a .stride solution based on Olivers suggestion: func myChart() -> some View {         var yAxisMaxValue = 23532 //get the min and max values from your data         var yAxisMinValue = -7633 //get the min and max values from your data         let roundedYAxisMaxValue = roundUp(yAxisMaxValue, to: 2)         let roundedYAxisMinValue = roundUp(yAxisMinValue, to: 2)         let strideValue = max(abs(roundedYAxisMaxValue), abs(roundedYAxisMinValue)) / 3.0 //max 3 axis marks above and max 3 below zero return Chart { //your chart layout code } .chartYAxis {             AxisMarks(values: .stride(by: strideValue)) {                 let value = $0.as(Double.self)!                 AxisGridLine()                 AxisTick()                 AxisValueLabel {                     Text("\(self.abbreviateAxisValue(string: "\(value)"))")                 }             }         } } func abbreviateAxisValue(string: String) -> String {         let decimal = Decimal(string: string)         if decimal == nil {             return string         } else {             if abs(decimal!) > 1000000000000.0 {                 return "\(decimal! / 1000000000000.0)t"             } else if abs(decimal!) > 1000000000.0 {                 return "\(decimal! / 1000000000.0)b"             } else if abs(decimal!) > 1000000.0 {                 return "\(decimal! / 1000000.0)m"             } else if abs(decimal!) > 1000.0 {                 return "\(decimal! / 1000.0)k"             } else {                 return "\(decimal!)"             }         } } //round up to x significant digits func roundUp(_ num: Double, to places: Int) -> Double {         let p = log10(abs(num))         let f = pow(10, p.rounded(.up) - Double(places) + 1)         let rnum = (num / f).rounded(.up) * f         return rnum     }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to Charts: customising chartYAxis values
just tried. using .stride works. have to calculate your own values but probably a better solution than parsing debug descriptions. would be nice if we could vary stride values for different ranges eg. below 0 and above 0 but I suppose that's a different problem.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to Loading large number of records into the CloudKit public database
done - FB10392936 (Unable to load large number of records into the CloudKit public database.) probably not the best articulation for a bug report but I've attached code and schema. let me know if u need anything specific.
Replies
Boosts
Views
Activity
Jun ’22
Reply to NSPersistentCloudkitContainer Memory Leak -> Crash? (iOS 15 beta 4 & 5)
broken again in ios16b1. doesn't crash but same error message and doesn't sync
Replies
Boosts
Views
Activity
Jun ’22
Reply to Macbook too old.
What I used to do when I was in your situation was to create a VMware image with a macOS install and Xcode and put it on a large thumbdrive. Then go to a public library with Macs and run the virtual machine and code using that. I did that until I could afford a macbook. I can't remember exactly how I got it to run but might be worth researching if u have access to a library or other public facility with newer Macs. not sure if u even need a Mac, maybe just a fast machine. also have a browse of eBay or whatever classified site u have where u live. you can probably pick up an old (but newer Mac than yours) for $50 or even free. though sounds like a **** move from whoever at apple you were talking to.
Replies
Boosts
Views
Activity
Jun ’22