Post

Replies

Boosts

Views

Activity

Reply to How to set up XCode Server
This should help you set up the local web server on your Mac (it is not Xcode server, just a web server). https://discussions.apple.com/docs/DOC-250003138 This is older and maybe a bit outdated, but should help as well. https://websitebeaver.com/set-up-localhost-on-macos-high-sierra-apache-mysql-and-php-7-with-sslhttps
Aug ’21
Reply to Editor placeholder in source file
First point is to solve this: var textFields = var textFieldKeys = [ "benchPressPB", "squatPB", "deadliftPB", "ohpPB", "rackPullPB", "legPressPB", "pullUpsPB" ] var textFieldStrings = What is your intent ? Where did you copy it from (with errors) ? Do you mean : var textFields : [UITextField] = [] var textFieldKeys = [ "benchPressPB", "squatPB", "deadliftPB", "ohpPB", "rackPullPB", "legPressPB", "pullUpsPB" ] var textFieldStrings : [String] = [] If so, your code is now: class ViewController: UIViewController, UITextFieldDelegate { @IBOutlet weak var benchPressPB: UITextField! @IBOutlet weak var squatPB: UITextField! @IBOutlet weak var deadliftPB: UITextField! @IBOutlet weak var ohpPB: UITextField! @IBOutlet weak var rackPullPB: UITextField! @IBOutlet weak var legPressPB: UITextField! @IBOutlet weak var pullUpsPB: UITextField! var textFields : [UITextField] = [] var textFieldKeys = ["benchPressPB", "squatPB", "deadliftPB", "ohpPB", "rackPullPB", "legPressPB", "pullUpsPB"] var textFieldStrings : [String] = [] override func viewDidLoad() { super.viewDidLoad() self.benchPressPB.delegate = self self.squatPB.delegate = self self.deadliftPB.delegate = self self.ohpPB.delegate = self self.rackPullPB.delegate = self self.legPressPB.delegate = self self.pullUpsPB.delegate = self textFields = [benchPressPB, squatPB, deadliftPB, ohpPB, rackPullPB, legPressPB, pullUpsPB] for (index, key) in textFieldKeys.enumerated() { let aValue = UserDefaults.standard.string(forKey: key) textFields[index].text = aValue textFieldStrings.append(aValue ?? "") } } func textFieldShouldReturn(_ textField: UITextField) -> Bool { textField.resignFirstResponder() let newText = textField.text ?? "" // textField.text is an optional, but textFieldStrings[index] is String, not String? ; so ?? make it sure you get a String (maybe empty) and not String? if let index = textFields.firstIndex(of: textField) { textFieldStrings[index] = newText UserDefaults.standard.set(newText, forKey: textFieldKeys[index]) } return true } } Try with those changes and tell what you get.
Topic: UI Frameworks SubTopic: UIKit Tags:
Aug ’21
Reply to Editor placeholder in source file
You probably had written var TextFieldsStrings = [String] () // without the space and got the error: Please fix the following URL related errors. This domain "" is not a permitted domain on this forums. This is a forum bug ! I filed a bug report on it. So, does your code work now (or at least compile) ? If so, you should close the thread (just mark my previous answer as correct answer). As for learning Swift, I think I did like a lot of us: learn Xcode and iOS API (I used books that are now totally outdated) work from books to practice Swift (Apple Books are pretty good) used on line materials (Stanford course for iOS notably). and then start developing some app, making extensive use of this forum and other information on the web each time I had a problem. and most important, Kept continuing learning over the years… Wish you good learning and enjoy.
Topic: UI Frameworks SubTopic: UIKit Tags:
Aug ’21
Reply to I am having trouble with this question can anybody help me with the solution
First error: func displayArray expects to return an array [[[Int]]]. So, it tries to interpret print as a return value, which fails. So, add a return statement return someArray of type [[[Int]]] or more likely, declare func without return value func displayArray(array1: [[[Int]]] { print(array1) } Second error: you try to pass a second argument to displayArray which expects one only. Change as: outputobj.displayArray(array1: myArray)
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’21
Reply to Use - requestImageForAsset: targetSize: contentMode: options: resultHandler on iOS15 beta
Could you show how you call (objc code ?) requestImage(for:targetSize:contentMode:options:resultHandler:) The method is asynchronous, so maybe you look at result before completion ? You can force it to be synchronous (at least for testing purpose). Did you check permission keys in info.plist ? h t t p s : / / github.com/react-native-cameraroll/react-native-cameraroll/issues/157
Topic: App & System Services SubTopic: Core OS Tags:
Aug ’21
Reply to How to set up XCode Server
This should help you set up the local web server on your Mac (it is not Xcode server, just a web server). https://discussions.apple.com/docs/DOC-250003138 This is older and maybe a bit outdated, but should help as well. https://websitebeaver.com/set-up-localhost-on-macos-high-sierra-apache-mysql-and-php-7-with-sslhttps
Replies
Boosts
Views
Activity
Aug ’21
Reply to Editor placeholder in source file
First point is to solve this: var textFields = var textFieldKeys = [ "benchPressPB", "squatPB", "deadliftPB", "ohpPB", "rackPullPB", "legPressPB", "pullUpsPB" ] var textFieldStrings = What is your intent ? Where did you copy it from (with errors) ? Do you mean : var textFields : [UITextField] = [] var textFieldKeys = [ "benchPressPB", "squatPB", "deadliftPB", "ohpPB", "rackPullPB", "legPressPB", "pullUpsPB" ] var textFieldStrings : [String] = [] If so, your code is now: class ViewController: UIViewController, UITextFieldDelegate { @IBOutlet weak var benchPressPB: UITextField! @IBOutlet weak var squatPB: UITextField! @IBOutlet weak var deadliftPB: UITextField! @IBOutlet weak var ohpPB: UITextField! @IBOutlet weak var rackPullPB: UITextField! @IBOutlet weak var legPressPB: UITextField! @IBOutlet weak var pullUpsPB: UITextField! var textFields : [UITextField] = [] var textFieldKeys = ["benchPressPB", "squatPB", "deadliftPB", "ohpPB", "rackPullPB", "legPressPB", "pullUpsPB"] var textFieldStrings : [String] = [] override func viewDidLoad() { super.viewDidLoad() self.benchPressPB.delegate = self self.squatPB.delegate = self self.deadliftPB.delegate = self self.ohpPB.delegate = self self.rackPullPB.delegate = self self.legPressPB.delegate = self self.pullUpsPB.delegate = self textFields = [benchPressPB, squatPB, deadliftPB, ohpPB, rackPullPB, legPressPB, pullUpsPB] for (index, key) in textFieldKeys.enumerated() { let aValue = UserDefaults.standard.string(forKey: key) textFields[index].text = aValue textFieldStrings.append(aValue ?? "") } } func textFieldShouldReturn(_ textField: UITextField) -> Bool { textField.resignFirstResponder() let newText = textField.text ?? "" // textField.text is an optional, but textFieldStrings[index] is String, not String? ; so ?? make it sure you get a String (maybe empty) and not String? if let index = textFields.firstIndex(of: textField) { textFieldStrings[index] = newText UserDefaults.standard.set(newText, forKey: textFieldKeys[index]) } return true } } Try with those changes and tell what you get.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to Editor placeholder in source file
You probably had written var TextFieldsStrings = [String] () // without the space and got the error: Please fix the following URL related errors. This domain "" is not a permitted domain on this forums. This is a forum bug ! I filed a bug report on it. So, does your code work now (or at least compile) ? If so, you should close the thread (just mark my previous answer as correct answer). As for learning Swift, I think I did like a lot of us: learn Xcode and iOS API (I used books that are now totally outdated) work from books to practice Swift (Apple Books are pretty good) used on line materials (Stanford course for iOS notably). and then start developing some app, making extensive use of this forum and other information on the web each time I had a problem. and most important, Kept continuing learning over the years… Wish you good learning and enjoy.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to I am having trouble with this question can anybody help me with the solution
First error: func displayArray expects to return an array [[[Int]]]. So, it tries to interpret print as a return value, which fails. So, add a return statement return someArray of type [[[Int]]] or more likely, declare func without return value func displayArray(array1: [[[Int]]] { print(array1) } Second error: you try to pass a second argument to displayArray which expects one only. Change as: outputobj.displayArray(array1: myArray)
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to App is crashing with TCCAccessRequest
You still probably miss some permission. Could you look at the Apple crash report, it should tell which permission is missing. See similar problem here: https://developer.apple.com/forums/thread/676642
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to iOS 15 rotation button display does not switch.
Where exactly are those 2 buttons ? Are they specific to your app or system buttons ?
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to I am having trouble with this question can anybody help me with the solution
Of course, you need a closing parenthesis at the end of arguments list. Sorry for the typo. func displayArray(array1: [[[Int]]]) { A good practice here is to declare an alias type typealias tripleArray = [[[Int]]] func displayArray(array1: tripleArray) { }
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to 12.0 Beta Beta bluetooth state issue
Who is this question for ? If it is for Apple, the forum is not the right channel. If not, your message is not very specific (I personally don't know about 12.0 Beta Beta bluetooth state). Is it linked to a bug report ? If so, which.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to CALayer message while playing video (Xcode 12.5.1, Swift 5)
I do confirm. That's the type of verbose message from Xcode that you can safely ignore.
Replies
Boosts
Views
Activity
Aug ’21
Reply to No email notification for answers to own posts
@Nickkk I do confirm it works for me (experienced today). There was an answer posted to one of my own message for which I had activated the bell. I received a mail notification within minutes. Note however that my own answers to my post do not trigger a mail notification, which seems logical.
Replies
Boosts
Views
Activity
Aug ’21
Reply to I am having trouble with this question can anybody help me with the solution
If you want to return the flat array from the triple array, just use flatMap: func displayArray(array1: tripleArray) -> [Int] { print(array1) return array1.flatMap({ $0 }) } When you print the value returned, you will get [2, 4, 6, 4, 6, 7, 1, 9, 3]
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to Supporting Alternate App Icons
Did you check if your app supports alternate icons ? if UIApplication.shared.supportsAlternateIcons { } What are the exact size of our icons ? (@1x, @2x, @3x) ? Are the Alternate icons in app Bundle (they should) or in the asset catalog ?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to Running Storyboard on a simulator
Is it a SwiftUI app or an UIKit with storyboard ? You cannot create a SwiftUI app and use storyboard / UIKit anymore.
Replies
Boosts
Views
Activity
Aug ’21
Reply to iOS 15 rotation button display does not switch.
Found this tutorial. But I fear it is a bit too basic to solve your problem. h t t p s : / / w w w .guidingtech. com/top-ways-to-fix-auto-rotate-not-working-in-iphone/
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to Use - requestImageForAsset: targetSize: contentMode: options: resultHandler on iOS15 beta
Could you show how you call (objc code ?) requestImage(for:targetSize:contentMode:options:resultHandler:) The method is asynchronous, so maybe you look at result before completion ? You can force it to be synchronous (at least for testing purpose). Did you check permission keys in info.plist ? h t t p s : / / github.com/react-native-cameraroll/react-native-cameraroll/issues/157
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Aug ’21