Post

Replies

Boosts

Views

Activity

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 Adding border colour to page control applies background colour to page control
slideControl.customPageControl(dotFillColor: UIColor(named: "Primary-Color")!, dotBorderColor: UIColor(named: "Primary-Color")!, dotBorderWidth: CGFloat(2)) Which color do you expect, as you call for the same UIColor(named: "Primary-Color") Did you try with something like: slideControl.customPageControl(dotFillColor: UIColor.blue, dotBorderColor: UIColor.red, dotBorderWidth: CGFloat(2))
Topic: UI Frameworks SubTopic: UIKit Tags:
May ’21
Reply to Adding border colour to page control applies background colour to page control
I would like to check a few points in this func : func customPageControl(dotFillColor:UIColor, dotBorderColor:UIColor, dotBorderWidth:CGFloat) { for (pageIndex, dotView) in self.subviews.enumerated() { if self.currentPage == pageIndex { dotView.backgroundColor = dotFillColor dotView.layer.cornerRadius = dotView.frame.size.height / 2 }else{ dotView.backgroundColor = .white dotView.layer.cornerRadius = dotView.frame.size.height / 2 dotView.layer.borderColor = dotBorderColor.cgColor dotView.layer.borderWidth = dotBorderWidth } } } You do not reset colors when it's not the current page. Why ? you set corner radius in all cases, that could be outside the if. More critical, pageControl has only one subview (each dot is not a subview). So what do you expect with: for (pageIndex, dotView) in self.subviews.enumerated() { } I would try the following: func customPageControl(dotFillColor:UIColor, dotBorderColor:UIColor, dotBorderWidth:CGFloat) { for (pageIndex, dotView) in self.subviews.enumerated() { print("pageIndex", pageIndex) // You should get only 0 dotView.layer.cornerRadius = dotView.frame.size.height / 2 dotView.layer.borderWidth = dotBorderWidth if self.currentPage == pageIndex { dotView.backgroundColor = dotFillColor.cgColor // in case you need cgColor dotView.layer.borderColor = // any color you need } else { dotView.backgroundColor = .white dotView.layer.borderColor = dotBorderColor.cgColor } } } To get what you want, you may need to create your custom pageControl or use those 2 func: The first would be the filled dot, the other the empty dot. var preferredIndicatorImage: UIImage? The preferred image for indicators. func setIndicatorImage(UIImage?, forPage: Int) Sets the indicator image for the specified page.
Topic: UI Frameworks SubTopic: UIKit Tags:
May ’21