Post

Replies

Boosts

Views

Activity

Comment on [Swift] How to properly subclass UITextfield and work with its delegate
@Claude31 I fixed the init() stuff, it's working now. It wasn't working before because I had the ViewController code which uses MyTextField to also have a UITextFieldDelegate: class ViewController: UIViewController, UITextFieldDelegate { override func viewDidLoad() { let myTF = MyTextField( .... ) myTF.delegate = self }    func textFieldDidBeginEditing(_ textField: UITextField) {     print("XXXXX"). // This is printed instead of "Inside subclassed textfield" within the subclass.   }  ``` So, if the subclassed textfield's delegate is set to self within the calling code (ViewController in this case), the textFieldDidBeginEditing() inside the subclass is never called. In general, is there a way to trigger textFieldDidBeginEditing() in both the calling code as well as the one inside the subclass?
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’21
Comment on Color Literal behaves inconsistently in Xcode 13.2.1
That works, but it is still not possible to insert a color literal as an argument in a function. Example: setGradientBackground(topColor: QQQ, bottomColor: YYY) You can't put a color literal in place of QQQ and YYY. It forces it to: setGradientBackground(topColor: colorLiteral(red: 0.4745098054, green: 0.8392156959, blue: 0.9764705896, alpha: 1), bottomColor: colorLiteral(red: 0.5546397567, green: 0.3071874082, blue: 0.007406672928, alpha: 1))
Dec ’21
Comment on In the Platforms window, difference between iOS and iOS Simulator
OK, good to know. But the fact that there was an error during "Verifying iOS 17.2 simruntime" and yet iOS 17.2 appears in the Platforms list is a bit puzzling. Yes, I can run the code in the iPhone 15 Pro simulator. Let's see if it runs in the Preview window. I have not succeeded in seeing the app display in the Previews canvas ever since I upgraded to Xcode 15.
Dec ’23
Comment on [Swift] How to properly subclass UITextfield and work with its delegate
@Claude31 I fixed the init() stuff, it's working now. It wasn't working before because I had the ViewController code which uses MyTextField to also have a UITextFieldDelegate: class ViewController: UIViewController, UITextFieldDelegate { override func viewDidLoad() { let myTF = MyTextField( .... ) myTF.delegate = self }    func textFieldDidBeginEditing(_ textField: UITextField) {     print("XXXXX"). // This is printed instead of "Inside subclassed textfield" within the subclass.   }  ``` So, if the subclassed textfield's delegate is set to self within the calling code (ViewController in this case), the textFieldDidBeginEditing() inside the subclass is never called. In general, is there a way to trigger textFieldDidBeginEditing() in both the calling code as well as the one inside the subclass?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’21
Comment on [Swift] How to properly subclass UITextfield and work with its delegate
Oops, sorry, I didn't know formatting is off inside a comment!
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’21
Comment on [Swift] How to properly subclass UITextfield and work with its delegate
@Claude31 Thanks for your explanation. It seems to me that, in general, when a subclass makes use of the delegate, it runs the risk of having the calling code hijack the functionality of the subclass either deliberately or unintentionally by also using the delegate. Something to be mindful of.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’21
Comment on How to link an App project to a Framework project so that changes made to the Framework code are "seen" in the App code without explicitly building the Framework code in Terminal?
@edford Thank you. Took me a while to zero in on the right section of that article, but I got it to work.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’21
Comment on How to link an App project to a Framework project so that changes made to the Framework code are "seen" in the App code without explicitly building the Framework code in Terminal?
@edford Can you answer my other question: [https://developer.apple.com/forums/thread/688469)
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’21
Comment on Xcode 12.5 very slow launch time for app in simulator
@ajisaputrars I just updated to Big Sur 11.5.2. Problem remains the same.
Replies
Boosts
Views
Activity
Aug ’21
Comment on Xcode 12.5 very slow launch time for app in simulator
I skipped Big Sur 11.3 or 11.4 and updated directly to 11.5.2 last night. I then updated my Xcode to 12.5.1. The simulator (I chose iPhone 11) for an existing small project then took more than 10 minutes (!!!) to launch and run! (I have a 2017 iMac 27".) When will Apple fix this?!
Replies
Boosts
Views
Activity
Aug ’21
Comment on Xcode 12.5 very slow launch time for app in simulator
@tramsdell Your post was 3 months ago. I just updated to Big Sur 11.5.2 and Xcode 12.5.1 and the problem remains the same! :-(
Replies
Boosts
Views
Activity
Aug ’21
Comment on Xcode 12.5 very slow launch time for app in simulator
@ajisaputrars I just updated to Big Sur 11.5.2 and Xcode 12.5.1 last night. The slowness issue remains unfixed.
Replies
Boosts
Views
Activity
Aug ’21
Comment on Is there anyway to delete unused icloud containers?
@BrianA You posted that answer 6 years ago, and today in 2021, the iCloud container STILL cannot be renamed or deleted. I am stuck with a container name from a tutorial at https://www.hackingwithswift.com/read/33/overview called Project-33. So my iCloud container is cursed with that name forever. UGH!!!
Replies
Boosts
Views
Activity
Sep ’21
Comment on Is there anyway to delete unused icloud containers?
@h725 How were you even able to create test containerS (plural) since you can't have more than one for a particular bundleID (com.yourCompanyName), and you can't rename or delete it? How was it possible to have more than one container?
Replies
Boosts
Views
Activity
Sep ’21
Comment on Xcode 13.2 - Internal error : Missing Package Description Module
If they have fixed it, why isn't it available as an update via the usual Software Update in System Preferences?
Replies
Boosts
Views
Activity
Dec ’21
Comment on Color Literal behaves inconsistently in Xcode 13.2.1
That works, but it is still not possible to insert a color literal as an argument in a function. Example: setGradientBackground(topColor: QQQ, bottomColor: YYY) You can't put a color literal in place of QQQ and YYY. It forces it to: setGradientBackground(topColor: colorLiteral(red: 0.4745098054, green: 0.8392156959, blue: 0.9764705896, alpha: 1), bottomColor: colorLiteral(red: 0.5546397567, green: 0.3071874082, blue: 0.007406672928, alpha: 1))
Replies
Boosts
Views
Activity
Dec ’21
Comment on Unable to Verify "iOS 17.0.simruntime" after iOS 17.0.1 Attempted Download
I am having the same issue when installing iOS 17.2 simruntime. Waiting it out ended with "iOS 17.2 Simulator (21C62) Failed — CoreSiimulator failed to respond." Any suggestions?
Replies
Boosts
Views
Activity
Dec ’23
Comment on In the Platforms window, difference between iOS and iOS Simulator
OK, good to know. But the fact that there was an error during "Verifying iOS 17.2 simruntime" and yet iOS 17.2 appears in the Platforms list is a bit puzzling. Yes, I can run the code in the iPhone 15 Pro simulator. Let's see if it runs in the Preview window. I have not succeeded in seeing the app display in the Previews canvas ever since I upgraded to Xcode 15.
Replies
Boosts
Views
Activity
Dec ’23