Post

Replies

Boosts

Views

Activity

Reply to Does SKLabelNode have a method to "automatically" adjust font size?
AFAIK, you have to adjust yourself. I could not find the property 'Automatically adjust Font size' as for UILabel. See this if that may help https://stackoverflow.com/questions/32144666/resize-a-sklabelnode-font-size-to-fit and a follow up here https://stackoverflow.com/questions/41315657/adjust-text-size-to-fit-sklabelnode-with-fixed-width And this one is not precisely on your question, but you may find interesting ideas. https ://www.informit. com/articles/article.aspx?p=2234247
Topic: Programming Languages SubTopic: Swift Tags:
May ’21
Reply to How to code a screen tap to increment/decrement a value?
Implement tapGesture on the label: one with numberOfTapsRequired set to 1 another with numberOfTapsRequired set to 2 You can add them via the storyboard by dragging tap gestures on the label. Connect each gesture to an IBAction, by control-drag from the IBAction to the corresponding gesture. @IBAction func handleLabelTap(recognizer:UITapGestureRecognizer) { print("Label Tapped") // Decrement the value value = label.text ?? 0 value += 1 label.text = String(value) var value = Int(label.text ?? "0") ?? 0 value -= 2 // Because singletap will be fired first, need to compensate for the +1 label.text = String(value) } @IBAction func handleLabelDoubleTap(recognizer:UITapGestureRecognizer) { print("Label Double Tapped") // Increment the value var value = Int(label.text ?? "0") ?? 0 value += 1 label.text = String(value) } Very important: enable user interaction for the label
Topic: Programming Languages SubTopic: Swift Tags:
May ’21
Reply to property of UIContentConfiguration cannot be called
Looks as if content was optional ('UIContentConfiguration?'), which is surprising, but. Could you test: let registration = UICollectionView.CellRegistrationUICollectionViewListCell, Article { cell, _, item in if var content = cell.defaultContentConfiguration() { content.text = "title" cell.contentConfiguration = content } }
Topic: UI Frameworks SubTopic: UIKit Tags:
May ’21
Reply to What is the "1 << 5" meaning in the EventFlags of ANCS
In following doc: https://developer.apple.com/library/archive/documentation/CoreBluetooth/Reference/AppleNotificationCenterServiceSpecification/Appendix/Appendix.html#//apple_ref/doc/uid/TP40013460-CH3-SW4 eventflag 0x20 is reserved: EventFlags Table 3-3   EventFlagsEventFlagSilent = (1 0), EventFlagImportant = (1 1), EventFlagPreExisting = (1 2), EventFlagPositiveAction = (1 3), EventFlagNegativeAction = (1 4), Reserved EventFlags = (1 5)–(1 7) But spec has not been updated in this document since 2014. So the flag may now be used. Note: found an old document (not dated, in chinese), where flags over 0x02 were reserved: https ://www.programmersought. com/article/51571699993/ https ://www.cnblogs. com/alexcai/p/4321514.html#_EventFlags which illustrates how reserved flags are progressively used.  
May ’21
Reply to IOS App UI Design Best practices
Top Bar, do you mean status bar ? or Navigation bar ? What do you mean by bottom bar ? Is it the TabBar ? Status bar are not required. There is even an API to hide status bar: override var prefersStatusBarHidden: Bool { return true } And navigation bar are needed only if you have a navigation view. I'm not even sure it is a best practice. Where did you read this ? So, don't worry about this. And only use top or bottom bar if that allows for better use of your app. And read this carefully, you'll learn a lot on user interface design. https://developer.apple.com/design/human-interface-guidelines/ios/overview/themes/
Topic: App & System Services SubTopic: Core OS Tags:
May ’21
Reply to property of UIContentConfiguration cannot be called
Something strange on this forum. The abstract of your question is: private func setupCollectionView() {    let registration = UICollectionView.CellRegistrationUICollectionViewListCell, Article { cell, _, item in      var content = cell.defaultContentConfiguration()      content.text = "title"  And the first line private func setupCollectionView() { doesn't show in the post itself ! Now back to your question. I tested your code (which is exactly what is proposed in documentation), and initially I got content type as UIContentConfiguration (which is a protocol) not UIListContentConfiguration (which is a struct with text property). Could you check the type of content ? Error message seems to show it is UIContentConfiguration So you could also test let registration = UICollectionView.CellRegistrationUICollectionViewListCell, Article { cell, _, item in if var content = cell.defaultContentConfiguration() as? UIListContentConfiguration { content.text = "title" cell.contentConfiguration = content } } Note: I tested the following let registration = UICollectionView.CellRegistrationUICollectionViewListCell, Int { cell, _, item in var content = cell.defaultContentConfiguration() as? UIContentConfiguration content.text = "title" cell.contentConfiguration = content } and got the exact same error message as yours : Value of type 'UIContentConfiguration?' has no member 'text'. That seems to confirm the problem.
Topic: UI Frameworks SubTopic: UIKit Tags:
May ’21
Reply to Xcode 12.3 on 2012 MacBook Air
@imtiger  Last version on 10.15.2 is Xcode 11.7 But you may upgrade to a more recent version of Catalina to support latest Xcode. However 4GB RAM is not enough to run Xcode. You would need a minimum of 8GB and that could be a bit slow. Better is 16 GB. How much disk space available ? Need at least 40 GB to install.
May ’21
Reply to Activate capabilities
In Xcode, select the project (blue icon at the top of file browser) Select Project section Select Signing and Capability tab click on plus (+) sign next to Capability tab in the list of capabilities, select Sign With Apple (at the end of the list) These tutorials may help you https ://www.raywenderlich. com/4875322-sign-in-with-apple-using-swiftui https ://www.iosapptemplates. com/blog/ios-development/sign-in-with-apple-swift Don't forget to close the thread if you're OK. Good continuation in your project.
May ’21