Posts

Post marked as solved
3 Replies
Thanks to OOPer for the explanation and the solution!
Post marked as solved
5 Replies
Yes, NSSavePanel was all I needed.
Post marked as solved
5 Replies
Using NSSavePanel did the trick. Thanks!
Post marked as solved
12 Replies
P.S. This is the code accepted by Xcode 11, but rejected by Xcode 10.3:navigationItem.rightBarButtonItem?.tintColor = .systemRedThe 10.3 compiler says Type 'UIColor?' has no member 'systemRed'.
Post marked as solved
12 Replies
Now here's something that may be of interest. In my app, I set a UIButton's colour to UIColor.systemRed. I believe I added this code after I started using Xcode 11.0, though I can't remember for sure. When I tried to compile my code using Xcode 10.3, the compiler rejected that line (and only that line.) So I changed it to UIColor.red. It then compiled without complaint, and I was able to upload the archive with no trouble.Since the upload error consistently occurred when when Xcode was waiting for a response after sending API usage data, I wonder if that could have something to do with it? Even though my deployment target was set to iOS 12.4 when I was using Xcode 11.0, perhaps it was missing that line.I see that .systemRed has been around since iOS 7.0. So could it have been removed in later versions, and the Xcode 11 compiler failed to catch it?
Post marked as solved
12 Replies
Apple Help suggested I downgrade to Xcode 10.4. It wasn't available for download, so I got Xcode 10.3 instead. I have now uploaded the archive successfully, using Xcode 10.3.
Post marked as solved
12 Replies
It's been three days now, and I'm still unable to upload an archive that I've uploaded many times before. The only error I get is "App Store Connect Operation Error". How would I report this to Apple? Has anyone found a work-around? Has Apple itself said anything about this?
Post marked as solved
6 Replies
My plan is to have a small collection of texts that would come with the basic (free) app. (Those are the ones I had originally intended to place in the bundle.) Only an upgraded version of the app (available through a single in-app purchase) would be able to download additional texts. One purchase would be enough to gain access to all of the other texts.I'd also want to make more texts available for download from time to time. Another requirement is that the user have access to all of their texts when offline. Ideally, the user would have the free texts available immediately when they download the basic app, rather than having to go through an extra step to download them. I'm hoping that be can done automatically from the on-demand resources. I'll read through the information at the link you provided and see if I can come up with a solution.Thanks very much for that link. It looks like it will provide a much simpler solution than the one I originally had in mind. But no doubt I'll have further questions about it!
Post marked as solved
6 Replies
As I said to eskimo, my main concern is that the app be able to locate both types of file. At first I thought they'd have to be in the same directory. But upon reading the docs more carefully, it seems that's not the case.
Post marked as solved
6 Replies
My main concern is that the app be able to find both kinds of file. If I understand correctly how File Manager works (a big "if"), it should be able to locate them even if they're in different directories. So should I just leave the bundled ones alone, and put the downloaded ones into Resources? I should add that I want the user to be able to delete the files if they wish. Some of them are huge, and they may want to save space on their device.
Post marked as solved
16 Replies
No, I wanted to get rid of the citations entirely, and leave just the text behind. The citations represent chapter.section.line references that are embedded in the text.And yes, I need to have mString.length instead of mString.count. As you said, the latter doesn not compile. I've changed the code in my post accordingly.
Post marked as solved
16 Replies
The responses from Claude and Quinn inspired me to come up with this code (from a playground):var testString = "I want to get rid 1.2.3 of inline citations. But I don't want 1.2.4 to get rid of full stops." let pattern = #"\.[^\s]"# // Matches . before non-whitespace characters. let regex = try! NSRegularExpression(pattern: pattern, options: []) let mString = NSMutableString(string: testString) regex.replaceMatches(in: mString, options: [], range: NSMakeRange(0, mString.length), withTemplate: "") testString = String(mString) testString = testString.filter {CharacterSet.decimalDigits.inverted.contains($0.unicodeScalars.first!)} testString = testString.replacingOccurrences(of: " ", with: " ")This gives me what I want: I want to get rid of inline citations. But I don't want to get rid of full stops.Having to switch between String and NSMutableString is a bit of a nuisance, but perhaps that won't be necessary in future versions of Swift.I'll wait to see if you guys have any improvements before marking this as correct!
Post marked as solved
16 Replies
Yes, that is the expected result. But the texts I am dealing with contain no dates, or anything else of the form x.y.z except the inline citations.
Post marked as solved
16 Replies
The inline citations are always of the form x.y.z, so no leading dots to worry about. I'd take care of leading dots with the trimmingCharacters(in:) property of String.Sorry, I should have given my testString example string in my first post, to illustrate more clearly what I was dealing with.
Post marked as solved
3 Replies
Yes, you've given me the solution once again! Here's the code that works:var uc = URLComponents(string: "LogeionLookUp://")! uc.host = selectedText if let url = uc.url { UIApplication.shared.open(url, options: [:], completionHandler: {success in print(url, "\n", success)}) }I'm going to name my first-born child after you. (Harold gets mad when I change her name, but as long as I'm paying her college tuition, she'll have to put up with it.)