Post

Replies

Boosts

Views

Activity

Reply to Axie Infinity
Contact to the author of the app. This is not a place to request a invitation code of some specific app.
Oct ’21
Reply to Redirect to settings app from within an app.
I know openSettingsURLString redirects to app-settings and we can press back to go to general settings. Is it possible to go to settings page directly? As already noted, the answer is NO. One thing you need to care is that you can find many sites showing some urls to go to settings directly without any cautions or notes. Using such urls may be considered as using private APIs, and can be a reason to be rejected in reviewing for the App Store.
Topic: App & System Services SubTopic: Core OS Tags:
Oct ’21
Reply to Missing Fundamental something
It seems the min and max functions abort the sieve if the first pass doesn't yield a value. The closure passed min or max needs to be consistent in comparing orders. In a consistent ordering, one (and only one) of the following gets true: a < b a == b a > b Your closure {$0 != 0...0 && $1 != 0...0 && $0.lowerBound < $1.lowerBound} may return false, for both yourClosure(a,b) and yourClosure(b,a) even when a != b. Don't you think it is strange for a comparison function? In the header doc of min or max, you can find this description: The predicate must be a strict weak ordering over the elements. That is, for any elements a, b, and c, the following conditions must hold: areInIncreasingOrder(a, a) is always false. (Irreflexivity) If areInIncreasingOrder(a, b) and areInIncreasingOrder(b, c) are both true, then areInIncreasingOrder(a, c) is also true. (Transitive comparability) Two elements are incomparable if neither is ordered before the other according to the predicate. If a and b are incomparable, and b and c are incomparable, then a and c are also incomparable. (Transitive incomparability) It is not clear enough, but I guess you want to do something like this: import UIKit /* let ranges = [ //1...4, 0...0, 0...1, 3...5, 0...0, 2...4, 3...7, ] */ let ranges = [ 1...4, 0...0, 1...6, 3...5, 0...0, 2...4, 3...7, ] let defaultMinValue = 0 let ordinateMinimum = CGFloat( ranges .filter{$0 != 0...0} .min(by: {$0.lowerBound < $1.lowerBound})? .lowerBound ?? defaultMinValue ) let defaultMaxValue = Int.max let ordinateMaximum = CGFloat( ranges .filter{$0 != 0...0} .max(by: {$0.upperBound < $1.upperBound})? .upperBound ?? defaultMaxValue ) print("ordinateMinimum: \(ordinateMinimum)\nordinateMaximum: \(ordinateMaximum)") One more. You should not include two or more topics in a single thread. For example, if you made a separate thread for this min, max issue, more readers who were suffering from the same issue would be able to find the thread more easily.
Topic: Media Technologies SubTopic: Audio Tags:
Oct ’21
Reply to Why isn't a new room created in the Rooms project? SwiftUI, WWDC19-204
Thanks for showing your code. Unfortunately, the session video was made while SwiftUI was in beta, and you need to make the code updated in many, many points. And BindableObject having didChange does not work in the released version of SwiftUI. Please try this: class RoomStore: ObservableObject { // Instead of BindableObject @Published var rooms: [Room] //Use `@Published` here, no need to use `didChange` init(rooms: [Room] = []) { self.rooms = rooms } } There are many good tutorials and sample codes written for the released version of SwiftUI. You should better find a good one unless you want to study how the beta version of SwiftUI was.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’21
Reply to Approval rejected: The review of your app is taking longer than expected
that they need more time to review it. It usually is not a notification of rejection, just telling that the review for your app will need more time. (It represents that in the pre-review process, your app has some suspicious points. This can be caused by some third party libraries which is not properly using APIs.) Does the notification really contain the terms that your app is rejected? almost two weeks have passed Once your app is marked as need more time, more than two weeks is not a rare case. Sending sort of claims might reset the reviewing process, and another more than two weeks may be needed. Just wait for a few weeks till you get the actual review result: approval or rejection.
Oct ’21
Reply to Format Decimal as string in Swift?
You may use a NumberFormatter: import Foundation let values = [ "25.1", "25", "25.4575", ].map{Decimal(string:$0)!} let formatter = NumberFormatter() formatter.maximumFractionDigits = 2 formatter.minimumFractionDigits = 0 formatter.currencyCode = "USD" formatter.numberStyle = .currency for value in values { let string = formatter.string(for: value) ?? "?" print(string) } Output: $25.1 $25 $25.46
Topic: Programming Languages SubTopic: Swift Tags:
Oct ’21
Reply to Missing Fundamental something
Your code contains something unclear: loadFromJSON, someFunction and the type having the method someFunction. And there is no sample data. So, we readers cannot test it and hard to say something sure. But some parts of your code are clearly bad to use CAShapeLayer. You create only one CAShapeLayer with this line let shapeLayer = CAShapeLayer(), but shapeLayer is not added as sublayer to any other layer in your code. And, if you want multiple shape layers having different color each, you need to create multiple shape layers. As already written, your code has many missing parts, so I have written a simplified example. Please try this: import AppKit class AnalysisViewController: NSViewController { @IBOutlet var analysisView: NSView! func genrateGraph() { for bar: (CGFloat, CGFloat, CGFloat, ClosedRange<CGFloat>) in [ (1.0, 0.0, 0.0, 0...100), (0.0, 1.0, 0.0, 100...200), (1.0, 1.0, 0.0, 200...300), (0.0, 0.0, 1.0, 300...400), (1.0, 0.0, 1.0, 400...500), (0.0, 1.0, 1.0, 500...600), (1.0, 1.0, 1.0, 600...700), ] { let color = CGColor(srgbRed: bar.0, green: bar.1, blue: bar.2, alpha: 1.0) let x = bar.3.lowerBound let width = bar.3.upperBound - bar.3.lowerBound // //Create `CAShapeLayer` for each color let layer = CAShapeLayer() analysisView.layer?.addSublayer(layer) let height: CGFloat = 320 let rect = CGRect(x: x, y: 0, width: width, height: height) print(rect) let path = CGMutablePath() path.addRect(rect) layer.path = path layer.fillColor = color } } override func viewDidLoad() { super.viewDidLoad() view.frame = CGRect(x: 0, y: 0, width: 840, height: 640) analysisView.wantsLayer = true analysisView.frame = CGRect(x: 0, y: 0, width: 840, height: 640) genrateGraph() } } If this code does show you a grey window, you need to check if you properly setup AnalysisViewController on your storyboard. By the way, To work with CAShapeLayer, using CGPath (including CGMutablePath) is the simpler way. CGPath (or CGMutablePath) does not have a method stroke() and you have no need to call it. (In fact, you cannot!)
Topic: Media Technologies SubTopic: Audio Tags:
Oct ’21
Reply to Debug Menu Grayed Out
I'm running High Sierra 10.13.6 (that's the highest OS my computer will go to b/c it's a late 2011 pro). When I looked up what version of Xcode to get, I saw I needed to get Version 9.4.1 (9F2000) so that's what version of Xcode I have. As far as I checked, you can run Xcode 10 or Xcode 10.1 on a Mac running 10.13.6 . But if Xcode 9.4.1 is doing well with your C++ class, it would not make a big difference. I'm wondering if there's anything I can do to make it work ? What sort of debugging feature do you want to use? If you want to use some feature which are runtime-only, run your code. And you may need to learn that some of the features in the Debug menu are only for apps and you would not make them use in C++ code. So, again, what in the Debug menu do you want to use?
Oct ’21