Post

Replies

Boosts

Views

Activity

Reply to extension of UISegmentedControl for touches events.
It is my first post and when I was editing, updating the post it happened like this So welcome to the forum. For editing properly, you have to: paste code with Paste and Match Style (avoid insertion of a lot of blank lines) remove useless blank lines Use the code formatter (<>) Here is the result @interface UISegmentedControl (CustomSegmentControl) @end @implementation UISegmentedControl (CustomSegmentControl) (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{ &#9;&#9;NSInteger current = self.selectedSegmentIndex; &#9;&#9;[super touchesBegan:touches withEvent:event]; &#9;&#9;if (current == self.selectedSegmentIndex) &#9;&#9;&#9;&#9;[self sendActionsForControlEvents:UIControlEventValueChanged]; &#9;&#9;[self.nextResponder touchesBegan:touches withEvent:event]; } (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{ &#9;&#9;[self setSelectedSegmentIndex:self.selectedSegmentIndex]; &#9;&#9;[super touchesEnded:touches withEvent:event]; &#9;&#9;[self.nextResponder touchesEnded:touches withEvent:event]; } @end extension of UISegmentedControl for touches events in iOS 12 is working but in iOS 13 and in iOS 14 is not working, Why?  * What did you expect ? What do you get ? One remark: in tutorials from Apple, super is called as the first statement of the override func // Implemented in your custom subclass (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { &#9;&#9;[super touchesBegan:touches withEvent:event]; if ([touches count] != 1) { &#9;&#9;&#9; self.state = UIGestureRecognizerStateFailed; &#9;&#9;&#9; return; &#9;&#9; } }
Topic: UI Frameworks SubTopic: UIKit Tags:
Dec ’20
Reply to Xcode 12.3 Release Simulators Dock Yellow / buggy
I have Xcode 12.3 on MacOS Catalina 10.15.7 on an iMac. I rebooted the Mac after installing Xcode and updated the project to the new settings proposed by Xcode. All tests on iPhone 12 Pro Max simulator iOS 14.3. I do no not experience the exact same problems, but some others: In a TabBarController, the tabBar has turned yellow (color of a view that covers the whole screen) => As TabBar is translucent that may be a normal behaviour, but different from Xcode 12.2 / iOS 14.2 In a view, I have an alert. The top left and right corners are now fuzzy: on about 30 pixels wide and 80 pixels high (but not uniformly on this whole rectangle), we don't see the alert background but the view that is behind; just as if those parts had ben snacked by some rodent… => I file a bug report : Dec 15, 2020 at 6:01 PM – FB8941139 When I delete the app from the iPhone, the top button "Edit home screen" is no more lisible (text black on black or transparent on black) => I file a bug report : Dec 15, 2020 at 6:10 PM – FB8941145 I tried the Prefer Integrated GPU option: no change. As a conclusion, I will stay with Xcode 12.2. for the time being.
Dec ’20
Reply to how to start making App
You will have 3 main topics to master: Xcode, the development environment a language, most likely Swift and, most tricky, get familiar with app architecture (choose between UIKit and SwiftUI) and API to use. But you can make it ! Start with simple things, but learn very carefully. I advise to start, in Apple Library, with: Intro to App development with Swift. Once completed: App development with Swift Then, go to learn Swift more in detail with: « The Swift Programming Language (Swift 5.3). » Apple Books. And don't forget, developers on this forum are ready to help when you get stuck. Just take time to explain clearly the problem, show the code you have tried… Good luck.
Dec ’20
Reply to What is going on with Xcode?
I downloaded and installed on iMac / Catalina without problem: 40 minutes to download, 40 minutes to unzip and install.. I downloaded from https://developer.apple.com/download/more/ and not from Appstore. I then installed manually. Maybe you just tried immediately after publication, when servers are really busy.
Dec ’20
Reply to UITextView only follows links once
Could you show the full code ? And show the rtf text in plain format. Maybe a problem with the embedded links themselves ? Did you set the text as attributedString ? Did you use shouldInteractWith ? optional func textView(_ textView: UITextView, &#9;&#9;shouldInteractWith textAttachment: NSTextAttachment, &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;in characterRange: NSRange, &#9;&#9;&#9;&#9;&#9; interaction: UITextItemInteraction) -> Bool Short tutorial here, to check you did all that's needed: https ://www.youtube .com/watch?v=qr1XJMIziBg
Topic: UI Frameworks SubTopic: UIKit Tags:
Dec ’20
Reply to UIColor Issues in Navigation Bar Settings? Xcode 12.1
Setting navigationBar.backgroundColor in each viewController in the navigation stack will do it &#9;&#9;override func viewDidLoad() { &#9;&#9;&#9;&#9;super.viewDidLoad() &#9;&#9;&#9;&#9;// Do any additional setup after loading the view. &#9;&#9;&#9;&#9;self.navigationController?.navigationBar.backgroundColor = UIColor(red: 1.0, green: 0.1, blue: 0.1, alpha: 1.0) &#9;&#9;} That changes the color of the navigation controller; so you may need to reset in each VC of the stack.
Topic: UI Frameworks SubTopic: UIKit Tags:
Dec ’20
Reply to Can someone help me diagnose an ios simulator crash?
Just a hint, hope that will start to help. Crash seems to be caused by simulatorTrampoline. This is a process that deals notably with microphone. https://stackoverflow.com/questions/55549319/simulatortrampoline-xpc-would-like-to-access-the-microphone Have you access to the microphone in your app ? Have you set the relevant entries in info.plist ?
Topic: App & System Services SubTopic: Core OS Tags:
Dec ’20
Reply to DatePicker (iOS14) flips date numbers
I have encountered a bug in which it flips the date numbers when showing modal date selector. * What did you expect ? What do you get (at which second in the video is it ?) You display 35:11:20:48 : is it a date ? an elapsed time ? Have you set the locale properly ? Note: to paste a link, it is enough to add a space after https and before .com https ://streamable .com/wn9q5l
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Dec ’20