Skip to main content
Filter by
Sorted by
Tagged with
-3 votes
0 answers
121 views

I have this code: func drawCount() { Task { await _drawCount() } } func _drawCount() async { let k = await Task.detached(priority: .low) { return gfed.filter{$0.blah}....
Fattie's user avatar
  • 9,780
-1 votes
2 answers
104 views

I have a Swift model using Codable, and my backend is inconsistent with date formats: Sometimes a date comes as ISO8601 string ("2025-09-30T04:00:00Z") Sometimes as a Unix timestamp (...
Muaaz Ahmed's user avatar
-3 votes
1 answer
66 views

We have a UX where the "paradigm" of a button is similar to this: so I want to exactly duplicate the look. Is this something standard available in UIKit, or is it just a UIButton that Apple ...
Fattie's user avatar
  • 9,780
-5 votes
1 answer
77 views

I had a custom UIView V which adds a stack view S with three labels L. It draws some CAShapeLayer lines. class CustomView: UIView { ///Consumers supply some texts and other info var input: [ ...
Fattie's user avatar
  • 9,780
-1 votes
1 answer
94 views

I just did this, 1, 5, 100, 2, 7 becomes 5, 100, 7 1, 2, 18, 19, 5, 4 becomes 2, 19, 5 extension Array where Element: Comparable { ///Simply return the bigger of each pair of (say) integers ...
Fattie's user avatar
  • 9,780
-1 votes
2 answers
74 views

Say you have a vertical collection view, you can add typical "springy" physics by incorporating UIDynamicAnimator in the UICollectionViewLayout. Simple example below. Now imagine just a ...
Fattie's user avatar
  • 9,780
-1 votes
2 answers
65 views

An extension ... fileprivate extension Optional { ///Do an upsert for one item - works on all groups mutating func upsert<T: MyProtocol>(item: T) where Wrapped == [T] { } } which ...
Fattie's user avatar
  • 9,780
0 votes
1 answer
64 views

When I have private lazy var aLine: RepairedCAShapeLayer { let v = RepairedCAShapeLayer() v.contentsScale = UIScreen.main.scale v.strokeColor = cfp.color.cgColor v.fillColor = nil ...
Fattie's user avatar
  • 9,780
0 votes
1 answer
99 views

Say struct Teste: Codable { let a: Int lazy var x: Int = { print("I just changed this Teste item") return a + 1000 }() } and you var hugeData: [Teste] // 750 ...
Fattie's user avatar
  • 9,780
0 votes
1 answer
80 views

I have a typical ... "user selects one row, all other rows go away, there is now only one row in the data source, the row's new position is (obviously) now the top and only row: row X slides up ...
Fattie's user avatar
  • 9,780
0 votes
1 answer
89 views

I have an iOS project with some async await functions. I update Swift Language Version setting in Xcode Build Settings to 4.2 and the project still able to compile. How Swift 4.2 knows how to compile ...
Igor Sorokin's user avatar
0 votes
1 answer
68 views

I am trying to implement a custom UISlider on an iOS device. First, the ThumbSlider is positioned on both ends, and the desired behavior is as follows: When the ThumbSlider moves left or right, the ...
정석영's user avatar
5 votes
0 answers
425 views

I have been using SecPKCS12Import to retrieve the kSecImportItemIdentity from a .p12 certificate. While this method works well on iOS 18.0, it returns an error code -25293 on iOS 17.5 or lower. I use ...
Xuân Tùng's user avatar
2 votes
1 answer
87 views

I often have something like .. enum DotNetType: String, CaseIterable { case guid = "Guid" case int = "Int32" case float = "Single" case dateTime = "...
Fattie's user avatar
  • 9,780
0 votes
2 answers
225 views

I have a situation where I have to return a typed nil. The only way I know of to "make" a typed nil is .. // need to return String nil var x: String? = nil return x .. // need to return ...
Fattie's user avatar
  • 9,780
0 votes
1 answer
45 views

This is my code, processingFormat is always <AVAudioFormat 0x3016b46e0: 1 ch, 16000 Hz, Float32>, how to make it to be Int16? `let documentDirectory = FileManager.default.urls(for: ....
trip xp's user avatar
  • 21
0 votes
2 answers
57 views

I have a single storyboard with 4 screens (segue to each ViewControllers). An Open Url sequence WILL NOT WORK on any of the additional 3 screen ViewControllers. It only works on the main View ...
user26546618's user avatar
0 votes
1 answer
72 views

I've always wanted to do something like class URLSessionDataTask_Plus: URLSessionDataTask { var obs: NSKeyValueObservation? = nil // store the progress observer there } which would be ...
Fattie's user avatar
  • 9,780
-1 votes
1 answer
249 views

Say you have extension APISingleton { func items ( _ blah: Blah?, completionOnMain: ( (_ status: Int, _ found: Blahs) -> ())? = nil ) { let t = URLSession.shared....
Fattie's user avatar
  • 9,780
0 votes
0 answers
82 views

I'm developing a macOS application using Swift and a camera extension. I'm utilizing the Vision framework's VNGeneratePersonSegmentationRequest to apply a background blur effect. However, I'm ...
Yogeshwar Shelke's user avatar
0 votes
0 answers
57 views

I'm customizing the navbar and their bar buttons with a custom font using this code let textAttributes = [NSAttributedString.Key.font: AppTheme.ptsansMedium(withSize: 17.0), NSAttributedString.Key....
Felipe Peña's user avatar
  • 2,848
-1 votes
1 answer
661 views

I have a UIKit app (it perfectly handles and does APNS), I add an ActivityAttributes and thus launch an activity. So that's TestAttributes; notice that is used in the Widget TestWidg; and is used as ...
Fattie's user avatar
  • 9,780
0 votes
1 answer
52 views

I have a view controller that shows two tableViews side by side. I have also a class (ButtonHeaderFooterView) that extends from UITableViewHeaderFooterView. I want to show different titles for the ...
Felipe Peña's user avatar
  • 2,848
0 votes
1 answer
81 views

var annoying: [String: Any?] To get the 'height' value, the best I could come up with is this, let found: String = (annoying["height"] as? String? ?? "?") ?? "?" That ...
Fattie's user avatar
  • 9,780
0 votes
0 answers
110 views

req = ["a":nil, "b":3, "c":["d":3.3, "e":"e", "f":[]], "g":[]] Traditionally ("if js can do it we can do it too!&...
Fattie's user avatar
  • 9,780
1 vote
1 answer
41 views

I am facing issues while using init(from decoder: Decoder) in Model extension in different module. I have model in Module 1 as below public struct LabelModel { public var value: String? } And I ...
Asif Raza's user avatar
  • 1,040
-2 votes
2 answers
118 views

Say you have some large complex custom view, lazy var pinkThing: .. lazy var greenThing: .. And you want to ///For upstream views to use as they wish var pinkCenterY: NSLayoutYAxisAnchor { return ...
Fattie's user avatar
  • 9,780
1 vote
1 answer
102 views

I am trying to get result by using a for loop inside nested response by not getting the required result. I have tried but not getting the desired response. Required result is as below. [ [["P-1 ...
Abhishek kumar's user avatar
0 votes
2 answers
139 views

I was stunned to learn there is no? immediate way to get the mantissa/exponent of a CGFloat in Swift. (Note that I want the two values, NOT a string representation in scientific notation format.) ...
Fattie's user avatar
  • 9,780
0 votes
1 answer
50 views

Say you're drawing a line in draw#rect in some view, override func draw(_ rect: CGRect) { guard let c = UIGraphicsGetCurrentContext() else { return } c.move(to: CGPoint(x: 13, y: 13 ) ) c....
Fattie's user avatar
  • 9,780
4 votes
1 answer
825 views

I'm trying to replace DispatchGroup with a TaskGroup because I can cancel a TaskGroup... however I can't store a reference to a TaskGroup.. The methods withTaskGroup(...) and withDiscardingTaskGroup(.....
TheJeff's user avatar
  • 4,227
2 votes
0 answers
118 views

On my end showing same option "iPhone" and "iPhone". While this should be "iPhone" and "Speaker". Reply please, if found solution for this. This comes only when ...
Kamal Kumar's user avatar
0 votes
1 answer
230 views

Here is what I am trying to do: The screenshot is taken from Iphone: Code:- import UIKit import MSCircularSlider class HomeViewController: UIViewController { @IBOutlet weak var lbl_Clock: UILabel! ...
Sham Dhiman's user avatar
  • 1,596
1 vote
2 answers
74 views

You have typealias Stringish = String var x: Stringish func examp() { x = "yo" print(x) } and you have a zillion Stringish in your code base. You suddenly realize you need something ...
Fattie's user avatar
  • 9,780
2 votes
2 answers
1k views

Some code, typealias Brio = (String, String, String) extension Brio { static var divider: Brio { return ("_", "_", "_") } static var isDivider: Bool {...
Fattie's user avatar
  • 9,780
-2 votes
1 answer
287 views

I am trying to create a data model for an experiment project. However, I am unable to import SwiftData. I am using Swift 5. import Foundation import SwiftData @Model class WeatherDataModel{ var ...
WasimSafdar's user avatar
  • 1,152
0 votes
1 answer
78 views

Have a data source singleton with class hugestuff ..{ var dataSources: [String: ThingWithIncrediblyLargeArrays] .. var currentThing: String } ThingWithIncrediblyLargeArrays is indeed a ...
Fattie's user avatar
  • 9,780
0 votes
1 answer
105 views

typealias Stuff = [[String]] // typically zillions of items var stuff: [String: Stuff] = [:] // tens of these When I deep copy† a Stuff, spare: Stuff = original{ let line = $0.map{ $0 } ...
Fattie's user avatar
  • 9,780
1 vote
0 answers
174 views

can’t figure out why a NavigationStack with a .searchable modifier isn’t showing a search bar when embedded into a NavigationSplitView. Here’s how I’m showing the Navigation on the homescreen for ...
Ronni's user avatar
  • 75
0 votes
1 answer
317 views

I'm trying to get the height of a popup view that I added in my main content view. I tried using geometry reader, but it seems to be returning full height of the view. Am I doing something wrong here? ...
Francis F's user avatar
  • 3,325
0 votes
0 answers
234 views

We are updating our code to work with DGCharts v.4.0 (previously Charts) and our previously working solution (see below) for adding titles for the x and y axis is now no longer working, as "...
user9062458's user avatar
0 votes
1 answer
36 views

This is my code. I checked IBOulets connection, Identifier, class names. and find some question and answer which on same boat. but didn't words. what did I missed? Thank you for reading. :) ...
KEATON's user avatar
  • 45
0 votes
1 answer
329 views

We did update macos and Xcode to the latest releases (macos Sonoma, and Xcode 15). After deploying our app to TestFlight we see strange issue that all custom fonts in application was changed from ...
Sergey Krasiuk's user avatar
1 vote
0 answers
65 views

I am new in using swift5. I am going to integrate Apple Pay with my app, however the datatask seems not working cannot see any log from the console. Can anyone tell me what I am done wrong? also how ...
invu's user avatar
  • 41
6 votes
2 answers
649 views

I'm working on a company project that requires me to log to a specific server, but I want to log to the console simultaneously. I use a custom logging class that I can feed a log message, a log level, ...
Benno Kress's user avatar
  • 2,809
0 votes
1 answer
75 views

Im' new in swift and I want to understand why I got this error from my struct. I want to offer to my customer the possibility to show the file after the download. Here is my class witch used for : ...
Windows Frame's user avatar
2 votes
1 answer
638 views

CoreData doesn't import the data when using dictionaries in a transformable core data attribute. I'll attach screenshots of the setup and the project. Using a custom NSSecureUnarchiveFromData like [...
NilsBerni's user avatar
1 vote
1 answer
2k views

I would like to generate notification to specific moment in my swift application but I got this message witch indicate me that apns token is not specified. however I generate the certificate from ...
Windows Frame's user avatar
0 votes
0 answers
382 views

I would like to understand what this error come from : This the error from text : 2023-09-07 12:16:50.304646+0200 ML2V_IOS[4697:148814] [DocumentManager] Failed to associate thumbnails for picked ...
Windows Frame's user avatar
0 votes
0 answers
94 views

So firstly, when I present the image picker I get this error: 2023-08-03 16:47:45.979280-0700 MyAppName[7794:1889375] [AXRuntimeCommon] Unknown client: MyAppName Then when I choose an image I get this ...
Mr. Man's user avatar
  • 38

1
2 3 4 5
63