Post

Replies

Boosts

Views

Activity

Reply to View Controller not visible in Identity Inspector
Your question is really unclear. But I guess in a moment you will provide the answer yourself… 😀 but it says no selection?  That's because you have not selected anything in the storyboard. You have to select the viewController in storyboard (click on the white bar with 3 icons at the top of the viewController in IB) and then open Identity inspector. Give it RestaurantListViewController as custom class.
Topic: Programming Languages SubTopic: Swift Tags:
May ’21
Reply to Tab bar item localization
So you do this in the "child" VC (LevelsViewController for instance). Which is loaded only when you access to it. If you don't want to do it the simple way, you should: subclass UITabBarController: MyTabBarController create IBOutlet for the tabBar in viewDidLoad, change the titles of the tabBarItems with localiee() set the class of the TabBarController to MyTabBarController in Identity Inspector.
Topic: UI Frameworks SubTopic: UIKit Tags:
May ’21
Reply to Swift - How to Call and Show XIB/StoryBoard inside from XIB?
Could you explain. I am having issues with presenting the nib cell Cell is defined in a nib, PodcastViewCell, exact ? What issue exactly ? You just display the cell in the tableView. So, you should have registered the cell, in viewDidLoad (where the table view is): override func viewDidLoad() { super.viewDidLoad() let nib = UINib(nibName: "PodcastViewCell", bundle: nil)  tableView.register(nib, forCellReuseIdentifier: "PodcastViewCell") Assuming you have defined an IBOutlet (tableView) for the UITableView or that your class is a UITableViewController Does this part work OK ? If so, could you show how you call now the player ?
Topic: UI Frameworks SubTopic: UIKit Tags:
May ’21
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