Post

Replies

Boosts

Views

Activity

Reply to Implement vibrancy on NSTextField
What is it that you can't make work ? Is it for MacOS ? Here is for iOS (and objC), but adaptation should be easy: https://stackoverflow.com/questions/26265936/uitextfield-placeholder-with-vibrancy But consider this note from NSVisualEffectView doc in Xcode: Note AppKit views and controls automatically add vibrancy where appropriate. For example, NSTextField enables vibrancy to increase the contrast between the text and background. Don't change the vibrancy settings of standard AppKit views and controls.
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’21
Reply to Does Apple allow an app that has a log-in feature without a sign-up feature on App Store?
My understanding is that you don't need Apple sign-in in this case. Here are what guidelines say: 4.8 Sign in with Apple Apps that use a third-party or social login service (such as Facebook Login, Google Sign-In, Sign in with Twitter, Sign In with LinkedIn, Login with Amazon, or WeChat Login) to set up or authenticate the user’s primary account with the app must also offer Sign in with Apple as an equivalent option. A user’s primary account is the account they establish with your app for the purposes of identifying themselves, signing in, and accessing your features and associated services. Sign in with Apple is not required if: Your app exclusively uses your company’s own account setup and sign-in systems. Your app is an education, enterprise, or business app that requires the user to sign in with an existing education or enterprise account. Your app uses a government or industry-backed citizen identification system or electronic ID to authenticate users. Your app is a client for a specific third-party service and users are required to sign in to their mail, social media, or other third-party account directly to access their content. Looks like you're in the first or fourth case
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’21
Reply to Image Classification Data
Not sure I understand your question. Could these tutorials help you? https://developer.apple.com/documentation/createml/creating_an_image_classifier_model or h t t p s : / / w w w .raywenderlich.com/7960296-core-ml-and-vision-tutorial-on-device-training-on-ios Otrherwise, please explain more what is your problem.
Aug ’21
Reply to Hi I am getting a blank screen when I run the following code in my Xcode project
Is it the real code ? It cannot compile. This is not correct syntax:    @State private var articles = [ Article () It misses closing bracket    @State private var articles = [Article] () And there is an extra quote and probably backslash here:       print ("Error: `(error?.localizedDescription` ?? "Unknown Error") ") Should be             print ("Error: \(error?.localizedDescription ?? "Unknown Error") ") I modified the code as follows import SwiftUI struct Result: Codable { var articles: [Article] } struct Article: Codable, Hashable { // Hashable to be able to use \.self in List var url: String var title: String var description: String? var urlToImage: String? } struct ContentView: View { private let url = "https://newsapi.org/v2/top-headlines?country=us&category=business&apiKey=49d5bfa113c34ec0af781fab38395996" @State private var articles : [Article] = [] // Just for the forum editor func fetchData() { guard let url = URL(string: url) else { print("URL is not valid") return } let request = URLRequest(url: url) URLSession.shared.dataTask(with: request) { data, response, error in if let data = data { if let decodedResult = try? JSONDecoder().decode( Result.self, from: data) { DispatchQueue.main.async { self.articles = decodedResult.articles print("Articles", articles) } return } } print ("Error: \(error?.localizedDescription ?? "Unknown Error") ") }.resume() } var body: some View { VStack { // Just to get something on screen List(articles, id: \.self) { item in HStack(alignment: .top) { VStack(alignment: .leading) { Text(item.title) .font(.headline) Text(item.description ?? "") .font(.footnote) } }.onAppear(perform: fetchData) } Text("Count articles \(articles.count)") } } } You get 0 article: which means Article and JSON may not match (I did not inspect the JSON file). I tested with an explicit int(), removing onAppear. Same issue: init() {     self.fetchData() }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’21
Reply to How can I divide the small number by the large number?
It is logical: you get an Int64, hence A/B is 0. But if you compute: print(1000*aNumber/bNumber) Then you get 424 And now divide (as Float) by 1000 let cNumber = 1000*aNumber/bNumber // Int64 print(Float(cNumber) / 1000) and get 0.424 You can also go to Double: let aNumber : Int64 = 106581282816 // -> Int64 (freeDiskSpaceInBytes) let bNumber : Int64 = 250790436864 // -> Int64 (totalDiskSpaceInBytes) let c = Double(aNumber) / Double(bNumber) print(c) yields 0.42498144725429654
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’21
Reply to Outlook Crashing
so please fix this issue at earliest. Developers here can't do anything about it. Remember that this forum is not an official Apple reporting channel. You'd better either or both: contact Microsoft: thay may need to updtae Outlook file a bug report.
Topic: App & System Services SubTopic: Core OS Tags:
Aug ’21
Reply to How to draw UIBezierPath with different colors?
Do you want to change within the same BezierPath ? I thought it was not possible: https://stackoverflow.com/questions/33108315/how-to-create-two-strokes-of-different-color-using-one-uibezierpath?rq=1     Or with multiple paths : https://stackoverflow.com/questions/6431005/how-to-draw-multiple-uibezierpath-with-different-colors-in-a-uiview
Topic: UI Frameworks SubTopic: UIKit Tags:
Aug ’21
Reply to Required iOS version in Appstore is lower than my Xcode iOS Deployment Target
The target also says: Deployment Info: iOS: 13.0, like the project Do you mean in your case you have already set it to 13.0 ? And Project is also at 13.0 Did you test your app on iOS 11 or 12 ? Does it work (may be not with all features but without crash) ? I'm not sure, but the info on Appstore may be computed after code analysis (by XCode), to check that it is compatible with 11.0. In that case, you cannot influence it, unless to have some API in code that do not exist before 11.0. See older threads https://developer.apple.com/forums/thread/68220 https://developer.apple.com/forums/thread/678691 What I do is to explicitly say in the app Description (on Appstore submission) that it best run (or even should run) on iOS 13 or above: Works on iOS 13 and above.
Aug ’21