That's not a question for other developers.
You'd better post a feedback in Feedback assistant.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Please avoid duplicating posts.
Topic:
Accessibility & Inclusion
SubTopic:
General
Tags:
The delegate is of type TapLabelCollectionViewCellDelegate
So cell.delegate is of type TapLabelCollectionViewCellDelegate
So unless I miss something in your code, self (which is TapGridViewController) must conform as well.
Another point:
Why don't you put
cell.delegate = self
cell.index = indexPath.row
in CellRegistration handler ?
Topic:
UI Frameworks
SubTopic:
UIKit
Tags:
In TapGridViewController, you have:
cell.delegate = self
delegate is a TapGridViewController
In TapLabelCollectionViewCell
you declare
var delegate: TapLabelCollectionViewCellDelegate?
But TapLabelCollectionViewCell does not conform to TapLabelCollectionViewCellDelegate
Topic:
UI Frameworks
SubTopic:
UIKit
Tags:
@SaurabhSaini
Is it just a question of terminology and documentation ?
[..<2] of One Sided Range as it is already included in Half Open Range?
Could you explain what you mean precisely ?
Topic:
Programming Languages
SubTopic:
Swift
Tags:
The anti spam is crazy. At the end, it will even more discourage developers to post on the forum.
I had a similar problem with word f r e e: https://developer.apple.com/forums/thread/779778
You should file a yet another bug report.
Topic:
Community
SubTopic:
Apple Developers
true and false are not 1 and 0 as in other languages.
But of course, this works
let myTuple = ("blue", 0)
let otherTuple = ("blue", 1)
if myTuple < otherTuple { print("yes it evaluates") }
and this as well:
let myTuple2 = ("blue", false)
let otherTuple2 = ("blue", true)
if myTuple2 == otherTuple2 {
print("yes it evaluates")
} else {
print("Not equal")
}
You may be interested in reading this discussion in Swift forum: https://forums.swift.org/t/why-bool-doesnt-conform-to-comparable/10698/6
Topic:
Programming Languages
SubTopic:
Swift
Tags:
I have created the tap gesture in storyboard and added it to the view controller hierarchy by dragging the tap gesture onto the view controller.
You drag in the viewController, and try to apply to multiple objects (each cell's label: that's what "repeating content" means here). That cannot work as a gesture is attached to a unique object. So you need as many tapGestures as there are cells.
The simplest in your case would be to create the tap gesture in code, in the init of collectionCell.
Or try to declare the tapGesture in storyboard in the cell.
Topic:
UI Frameworks
SubTopic:
UIKit
Tags:
You do not provide enough information about you proceeded.
Did you do those steps ?
create a tapGesture in storyboard by dragging the object in the viewController structure ?
-> Could you show the attributes inspector of the tapGesture ?
you control dragged in storyboard from the tapGesture to the label object in the viewController structure (in storyboard)?
-> Do you see the tapGesture listed Connections inspector of the label?
You say:
When I connect the outlet to the gesture recogniser I get this error:
How exactly do you try to connect ? Is it the label in storyboard or IBOutlet in code (you should not do it) ? Please clarify
How can I connect the tap gesture recogniser in storyboard to my code?
What do you want to connect exactly in code ? You don't have to connect the tapGesture to the label IBOutlet in code. The connection is made in storybaord as explained before.
If you want to declare an action for the tapGesture, then
create the IBAction
@IBAction func tapped(_ sender: UITapGestureRecognizer) {
}
select the tapGesture in stroryboard
corntrol-drag from the tapgesture to the IBAction
-> You should now see "tapped" in the connections inspector of the tapGesture in the sent actions section.
It seems you have tried to connect the incrementNumberOfTaps action to the cell and not to the tapGesture.
Topic:
UI Frameworks
SubTopic:
UIKit
Tags:
Could you post your info.plist ?
Open it as Source code and post the compete file.
Topic:
App Store Distribution & Marketing
SubTopic:
TestFlight
Where is configureDataSource called ?
Topic:
UI Frameworks
SubTopic:
UIKit
When looking at code in documentation, registration is done differently, by creating a default content configuration and then adjusting:
let cellRegistration = UICollectionView.CellRegistration<UICollectionViewListCell, Int> { cell, indexPath, item in
var contentConfiguration = cell.defaultContentConfiguration()
contentConfiguration.text = "\(item)"
contentConfiguration.textProperties.color = .lightGray
cell.contentConfiguration = contentConfiguration
}
Could you also test with a log:
let mainCellRegistration = UICollectionView.CellRegistration<EmotionExplorerCell, Item> { cell, indexPath, item in
print("cell", cell, indexPath, item) // <<-- ADD THIS
switch item {
case .main(emotion: let emotion, icon: let iconName, red: let red, green: let green, blue: let blue) :
cell.configure(iconName: iconName, title: emotion, red: red, green: green, blue: blue)
cell.index = indexPath.row
cell.delegate = self
case .title(title: -, buttonTitle:
Topic:
UI Frameworks
SubTopic:
UIKit
However, calling the cell delegate method from the cell is not calling the method in the view controller.
It's not very clear.
calling the cell delegate method from the cell
Which method is it ? repromptLLMForIconName ?
is not calling the method in the view controller.
Which method is it ?
Have you checked that delegate is not nil ?
print("delegate", delegate)
delegate?.repromptLLMForIconName(iconName, index: index, emotion: emotion, red: red, green: green, blue: blue)
Topic:
UI Frameworks
SubTopic:
UIKit
Why would a third party have to know and the right to know ? IMHO that would be a privacy (and possibly security) breach, isn't it ?
Topic:
Privacy & Security
SubTopic:
General
Tags:
Just a personal opinion.
Unless you have really imperative reason to refactor your project, and if your app works correctly, I would not undertake such a work. You will spend huge amount of time with the risk to create a lot of bugs.
In any case, make sure you have a complete project back up (not only Time Machine).
Topic:
Developer Tools & Services
SubTopic:
Xcode