Post

Replies

Boosts

Views

Activity

Reply to Develop in Swift Open Restaurant program has issues
Did you install the provided server as described on page 447 ? Run the Server The Restaurant folder included with this project contains the binary file for the server, OpenRestaurant.app. Right-click OpenRestaurant and click Open in the dropdown. Depending on your Mac's security configuration, you may see a warning dialog. Click Open to indicate that you trust the app. Check also if port is 8080 or 8090 (as written at top of page 448). I understand it should be 8080.
Topic: Programming Languages SubTopic: Swift Tags:
May ’21
Reply to iphone 6
If you wait for any developer here to do something for this, you'll wait for long… For such request, you should contact Apple support directly, but with probably zero chance to be heard. Only 6s and 6Plus can have iOS 13 or even 14. So, keep with iOS 12 and enjoy…
Topic: App & System Services SubTopic: Core OS Tags:
May ’21
Reply to UITableView display first 5 rows of an array
Just to get (slightly) more compact code: func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) - UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! CustomTableViewCell cell.cellLbl?.text = array[indexPath.row] cell.blurView.isHidden = indexPath.row 5 return cell }
Topic: Programming Languages SubTopic: Swift Tags:
May ’21
Reply to MeasurementFormatter preferred unit
Use .providedUnit : measurement = Measurement(value: 0.31, unit: UnitLength.centimeters) // Or measurement.convert(to: UnitLength.centimeters) formatter.unitOptions = [.providedUnit] print(formatter.string(from: measurement)) I tested the following: var formatter = MeasurementFormatter() formatter.locale = Locale(identifier: "fr-fr") var measurement = Measurement(value: 0.31, unit: UnitLength.meters) formatter.unitOptions = [.naturalScale] print(formatter.string(from: measurement)) measurement.convert(to: UnitLength.centimeters) formatter.unitOptions = [.providedUnit] print(formatter.string(from: measurement)) and got: 0,31 m 31 cm
Topic: App & System Services SubTopic: General Tags:
May ’21
Reply to Sort is swift doubles the number of entries in array
Please format the code with tool: class InventoryModel: ObservableObject { @Published var fileData = [inventoryEntry]() var fileData2 = [inventoryEntry]() // for debug viewing fileData var fileData3 = [inventoryEntry]() // for debug viewing fileData // ..... } struct inventoryEntry { var id: UUID = UUID() var name: String = "" var catagory: String = "" var subcatagory: String = "" var location: String = "" } Could you show more code ? inventoryModel.fileData.sort{$0.name $1.name}
Topic: Programming Languages SubTopic: Swift Tags:
May ’21
Reply to Develop in Swift Open Restaurant program has issues
Am I doing something wrong? Yes, you are doing something wrong. You do not give useful information about your code ! Your post is really useless. So please, provide the code that retrieves the url.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to Develop in Swift Open Restaurant program has issues
OK, that's the exact same code as in book. But there are a lot of other stuff that could be wrong. Are you sure you followed exactly all the steps ? Impossible to say with our seeing code.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to Develop in Swift Open Restaurant program has issues
Did you install the provided server as described on page 447 ? Run the Server The Restaurant folder included with this project contains the binary file for the server, OpenRestaurant.app. Right-click OpenRestaurant and click Open in the dropdown. Depending on your Mac's security configuration, you may see a warning dialog. Click Open to indicate that you trust the app. Check also if port is 8080 or 8090 (as written at top of page 448). I understand it should be 8080.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to Develop in Swift Open Restaurant program has issues
Have you looked at the images directory ? Are they effectively .png images ? Have you checked also menuItems ? add somewhere print("menuItems", menuItems)
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to Develop in Swift Open Restaurant program has issues
The url is a url to the server on your Mac. http://localhost:8080/images/*.png have you configured your web server correctly ? I do not see in their doc where they set the 8080 port on the web server. This should direct to Library/WebServer/Documents/ Directory
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to I can't show QR in Image View
What is idQr ? How is it set ? Could you test with a print on line 2 of VerQR that it is not nil ? What doesn't work ? Is it compartirBtn or VerQR ?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to ⏰Is it possible if I want my app to upload data to firebase by itself even though the app's closing?
You can do a lot when app is in background or when app resumes: https://developer.apple.com/documentation/foundation/url_loading_system/downloading_files_in_the_background
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to iphone 6
If you wait for any developer here to do something for this, you'll wait for long… For such request, you should contact Apple support directly, but with probably zero chance to be heard. Only 6s and 6Plus can have iOS 13 or even 14. So, keep with iOS 12 and enjoy…
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to Adding border colour to page control applies background colour to page control
So that we can reproduce, can you post the exact code where you call customPageControl ? And explain where you call it.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to Develop a Mac based browser tool
What is your question ? I hope you are not expecting someone to develop for you ! That's not the purpose of the forum. As a developer, you should start doing it yourself and ask specific question if you have problem.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to Enable Stack Canary Flags
For my understanding, what do you call "Stack Canary flags" ?
Replies
Boosts
Views
Activity
May ’21
Reply to Xcode ColorPicker / StackView / IB broken since months
Which version of Xcode ? I'm working with Xcode 12.4. Just added a vertical stackView in IB. And added 2 ImageViews without problem…
Replies
Boosts
Views
Activity
May ’21
Reply to UITableView display first 5 rows of an array
Just to get (slightly) more compact code: func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) - UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! CustomTableViewCell cell.cellLbl?.text = array[indexPath.row] cell.blurView.isHidden = indexPath.row 5 return cell }
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to MeasurementFormatter preferred unit
Use .providedUnit : measurement = Measurement(value: 0.31, unit: UnitLength.centimeters) // Or measurement.convert(to: UnitLength.centimeters) formatter.unitOptions = [.providedUnit] print(formatter.string(from: measurement)) I tested the following: var formatter = MeasurementFormatter() formatter.locale = Locale(identifier: "fr-fr") var measurement = Measurement(value: 0.31, unit: UnitLength.meters) formatter.unitOptions = [.naturalScale] print(formatter.string(from: measurement)) measurement.convert(to: UnitLength.centimeters) formatter.unitOptions = [.providedUnit] print(formatter.string(from: measurement)) and got: 0,31 m 31 cm
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to Sort is swift doubles the number of entries in array
Please format the code with tool: class InventoryModel: ObservableObject { @Published var fileData = [inventoryEntry]() var fileData2 = [inventoryEntry]() // for debug viewing fileData var fileData3 = [inventoryEntry]() // for debug viewing fileData // ..... } struct inventoryEntry { var id: UUID = UUID() var name: String = "" var catagory: String = "" var subcatagory: String = "" var location: String = "" } Could you show more code ? inventoryModel.fileData.sort{$0.name $1.name}
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
May ’21