xcode

SwiftUI Index out of range in ForEach

怎甘沉沦 提交于 2021-01-02 03:58:48
问题 After hours of debugging I figured out the error is inside the foreach loop in MenuItemView in the folder ContentViews . The app crashes and the error is: Fatal error: Index out of range: file Swift/ContiguousArrayBuffer.swift, line 444 . Information: I have got an ObservableObject with an Array of Structs inside as data storage. The problem: The ForEach goes between 0 and the array count + 1. This is so I can have an extra item for adding new elements. In the ForEach is a check if the index

SwiftUI Index out of range in ForEach

让人想犯罪 __ 提交于 2021-01-02 03:58:32
问题 After hours of debugging I figured out the error is inside the foreach loop in MenuItemView in the folder ContentViews . The app crashes and the error is: Fatal error: Index out of range: file Swift/ContiguousArrayBuffer.swift, line 444 . Information: I have got an ObservableObject with an Array of Structs inside as data storage. The problem: The ForEach goes between 0 and the array count + 1. This is so I can have an extra item for adding new elements. In the ForEach is a check if the index

Xcode 11.2 not updating

帅比萌擦擦* 提交于 2021-01-01 09:01:28
问题 show disk space not enough I’m using macOS Mojave 10.14.5 I have 11.69GB free disk space when I click the install it's always show alert message "We could not complete your update, there is not enough disk space available to install the product". How to fix the problem ? please help 回答1: I have more free space than you and couldn't update my already installed Xcode 11.1 to 11.2. What I did was to manually download the file. You search for the version you want by going here: https://developer

The “git” command requires the command line developer tools. Would you like to install?

主宰稳场 提交于 2021-01-01 08:33:13
问题 I'm super new to coding (actually trying to teach myself some Python), but there's a thing bugging me that I cannot seem to find any info online about my particular case: When I run git on the terminal, there is: The "git" command requires the command line developer tools. Would you like to install.." Now, since I have a very basic Macbook 12, I try to keep it as lightweight and uncluttered as possible, so I don't want to install any IDE or anything, I'm practising coding with vim 7.3, but in

Swift3 different font in the All of the UIView with Localization each

笑着哭i 提交于 2021-01-01 04:55:33
问题 I want to use different fonts up to Languages each. for example, roboto in English, openSans in French. Localization arrayOfTitle = [NSLocalizedString("comment", comment: "0"), NSLocalizedString("profile", comment: "1"), NSLocalizedString("Like", comment: "2")] patterns using String 1. let username: String? = (rList[indexPath.row].userInfo?.name)! let attrString = NSMutableAttributedString(string: username!, attributes: [NSFontAttributeName: UIFont(name: "Roboto-Bold", size: 12.0)!])

XCBUtil.PropertyListConversionError in Xcode

穿精又带淫゛_ 提交于 2021-01-01 02:59:29
问题 When I try to run my project, I get this error, pointing to my localized .strings file: read failed: The operation couldn’t be completed. ( XCBUtil.PropertyListConversionError error 1.) What can I do to fix this issue? 回答1: There is a formatting error inside the .string file that the error is pointing at. Localizable .strings files should contain strings in quotes (if they contain more than one word and/or special characters) and semicolons at the end of lines, like such: string = translation

Looping through JSON object in Swift

给你一囗甜甜゛ 提交于 2020-12-31 15:00:54
问题 I got this JSON object which I sent from my server to my Swift application. { "625289": { "id": 1, "subject": "Hello World" }, "625277": { "id": 2, "subject":"Bye World!" } } So i tried to get the subject for each result ("625289" and "625277") by doing as below in my Swift class: struct Resultat : Decodable { let subject: String } var result = [Resultat]() let urlll = URL(string:"http://localhost:8888/api/pouet.php") URLSession.shared.dataTask(with: urlll!) { (data, response, error) in do {

Looping through JSON object in Swift

孤者浪人 提交于 2020-12-31 14:56:40
问题 I got this JSON object which I sent from my server to my Swift application. { "625289": { "id": 1, "subject": "Hello World" }, "625277": { "id": 2, "subject":"Bye World!" } } So i tried to get the subject for each result ("625289" and "625277") by doing as below in my Swift class: struct Resultat : Decodable { let subject: String } var result = [Resultat]() let urlll = URL(string:"http://localhost:8888/api/pouet.php") URLSession.shared.dataTask(with: urlll!) { (data, response, error) in do {

How to integrate sign in with apple in iOS 12 or earlier? [duplicate]

谁说我不能喝 提交于 2020-12-31 02:51:33
问题 This question already has answers here : Will “Sign in With Apple” allow apps to be backward compatible with iOS 12 and lower? (2 answers) Closed 3 months ago . My app was rejected due to a third-party login service. So I've implemented Sign in with Apple for iOS 13. Problem is how to provide backward compatibility for iOS 12 or earlier. 回答1: In my case, it only works (for iOS12 and below) if I avoid importing CryptoKit for the sha256 encryption. Instead of using the sha256 function provided

How to integrate sign in with apple in iOS 12 or earlier? [duplicate]

主宰稳场 提交于 2020-12-31 02:40:26
问题 This question already has answers here : Will “Sign in With Apple” allow apps to be backward compatible with iOS 12 and lower? (2 answers) Closed 3 months ago . My app was rejected due to a third-party login service. So I've implemented Sign in with Apple for iOS 13. Problem is how to provide backward compatibility for iOS 12 or earlier. 回答1: In my case, it only works (for iOS12 and below) if I avoid importing CryptoKit for the sha256 encryption. Instead of using the sha256 function provided