Post

Replies

Boosts

Views

Activity

Reply to TipUIPopoverViewController disables all the views from presenting screen
Extra note: It's worth adding that this behaviour is the opposite from SwiftUI implementation. From Apple's TipKitExamples app: Image(systemName: "wand.and.stars") .imageScale(.large) // Add the popover to the feature you want to highlight. .popoverTip(tip) .onTapGesture { // Invalidate the tip when someone uses the feature. tip.invalidate(reason: .actionPerformed) } This piece of code does not disable the touch for underlaying views
Topic: UI Frameworks SubTopic: UIKit Tags:
Oct ’23
Reply to Swift, iOS15, UIKit, CollectionView header issue
Sorry I forgot to paste the solution I came up with. It should all work now. enum Section { case main } var dataSource: UICollectionViewDiffableDataSource<Section, Follower.ID>! // MARK: - Collection View configurations fileprivate lazy var collectionView: UICollectionView = { let collectionView = UICollectionView(frame: view.bounds, collectionViewLayout: UIHelper.createCompositionalLayout()) collectionView.delegate = self collectionView.backgroundColor = .systemBackground collectionView.register(FollowersCollectionHeaderView.self, forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: FollowersCollectionHeaderView.reuseId) view.addSubview(collectionView) return collectionView }() fileprivate lazy var snapshot: NSDiffableDataSourceSnapshot<Section, Follower.ID> = { var snapshot = NSDiffableDataSourceSnapshot<Section, Follower.ID>() snapshot.appendSections([.main]) let itemIdentifiers = followers.map { $0.id } snapshot.appendItems(itemIdentifiers, toSection: .main) dataSource.apply(snapshot, animatingDifferences: true) return snapshot }() fileprivate func updateData(with followers: [Follower]) { snapshot = NSDiffableDataSourceSnapshot<Section, Follower.ID>() snapshot.appendSections([.main]) let itemIdentifiers = followers.map { $0.id } snapshot.appendItems(itemIdentifiers, toSection: .main) dataSource.apply(snapshot, animatingDifferences: true) } fileprivate func configureDataSource() { let cellRegistration = UICollectionView.CellRegistration<FollowerCell, Follower.ID> { [weak self] cell, indexPath, followerID in guard let self = self else { return } let followerArray = self.followers.filter { $0.id == followerID } if let follower = followerArray.first { cell.set(on: follower) } } dataSource = UICollectionViewDiffableDataSource<Section, Follower.ID>(collectionView: collectionView) { collectionView, indexPath, itemIdentifier in return collectionView.dequeueConfiguredReusableCell(using: cellRegistration, for: indexPath, item: itemIdentifier) } let headerRegistration = createSectionHeaderRegistration() dataSource.supplementaryViewProvider = { collectionView, elementKind, indexPath in return collectionView.dequeueConfiguredReusableSupplementary(using: headerRegistration, for: indexPath) } } fileprivate func createSectionHeaderRegistration() -> UICollectionView.SupplementaryRegistration<FollowersCollectionHeaderView> { return UICollectionView.SupplementaryRegistration<FollowersCollectionHeaderView>( elementKind: FollowersCollectionHeaderView.reuseId) { [weak self] supplementaryView, elementKind, indexPath in guard let self = self else { return } supplementaryView.set(with: self.user) } }
Topic: Community SubTopic: Apple Developers Tags:
Sep ’21
Reply to Bug: Tip comes back as pending first, then available when reloading screen
Problem solved itself after multiple cache cleaning
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Oct ’23
Reply to TipUIPopoverViewController disables all the views from presenting screen
Extra note: It's worth adding that this behaviour is the opposite from SwiftUI implementation. From Apple's TipKitExamples app: Image(systemName: "wand.and.stars") .imageScale(.large) // Add the popover to the feature you want to highlight. .popoverTip(tip) .onTapGesture { // Invalidate the tip when someone uses the feature. tip.invalidate(reason: .actionPerformed) } This piece of code does not disable the touch for underlaying views
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Oct ’23
Reply to SwiftUI: Adding accessibility identifiers to VStack
Hey Sparta. Has the memory leak subject been resolved? Thanks for letting me know
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to Add a UIImage to a Plane in RealityKit
Hey Barrylium. Why don't you try it with the SceneKit? Using SceneKit for that purpose is easier.
Topic: Spatial Computing SubTopic: ARKit Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to RealityKit Skeleton Tracking: Hand positions were off quite a bit. Did I do something wrong?
Hi mate. Have you been able to resolve that issue? If so, could you please share some more code? Thanks.
Topic: Graphics & Games SubTopic: RealityKit Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Mesh Opacity in RealityKit
It worked for me, thanks!
Topic: Graphics & Games SubTopic: RealityKit Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Swift, iOS15, UIKit, CollectionView header issue
Sorry I forgot to paste the solution I came up with. It should all work now. enum Section { case main } var dataSource: UICollectionViewDiffableDataSource<Section, Follower.ID>! // MARK: - Collection View configurations fileprivate lazy var collectionView: UICollectionView = { let collectionView = UICollectionView(frame: view.bounds, collectionViewLayout: UIHelper.createCompositionalLayout()) collectionView.delegate = self collectionView.backgroundColor = .systemBackground collectionView.register(FollowersCollectionHeaderView.self, forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: FollowersCollectionHeaderView.reuseId) view.addSubview(collectionView) return collectionView }() fileprivate lazy var snapshot: NSDiffableDataSourceSnapshot<Section, Follower.ID> = { var snapshot = NSDiffableDataSourceSnapshot<Section, Follower.ID>() snapshot.appendSections([.main]) let itemIdentifiers = followers.map { $0.id } snapshot.appendItems(itemIdentifiers, toSection: .main) dataSource.apply(snapshot, animatingDifferences: true) return snapshot }() fileprivate func updateData(with followers: [Follower]) { snapshot = NSDiffableDataSourceSnapshot<Section, Follower.ID>() snapshot.appendSections([.main]) let itemIdentifiers = followers.map { $0.id } snapshot.appendItems(itemIdentifiers, toSection: .main) dataSource.apply(snapshot, animatingDifferences: true) } fileprivate func configureDataSource() { let cellRegistration = UICollectionView.CellRegistration<FollowerCell, Follower.ID> { [weak self] cell, indexPath, followerID in guard let self = self else { return } let followerArray = self.followers.filter { $0.id == followerID } if let follower = followerArray.first { cell.set(on: follower) } } dataSource = UICollectionViewDiffableDataSource<Section, Follower.ID>(collectionView: collectionView) { collectionView, indexPath, itemIdentifier in return collectionView.dequeueConfiguredReusableCell(using: cellRegistration, for: indexPath, item: itemIdentifier) } let headerRegistration = createSectionHeaderRegistration() dataSource.supplementaryViewProvider = { collectionView, elementKind, indexPath in return collectionView.dequeueConfiguredReusableSupplementary(using: headerRegistration, for: indexPath) } } fileprivate func createSectionHeaderRegistration() -> UICollectionView.SupplementaryRegistration<FollowersCollectionHeaderView> { return UICollectionView.SupplementaryRegistration<FollowersCollectionHeaderView>( elementKind: FollowersCollectionHeaderView.reuseId) { [weak self] supplementaryView, elementKind, indexPath in guard let self = self else { return } supplementaryView.set(with: self.user) } }
Topic: Community SubTopic: Apple Developers Tags:
Replies
Boosts
Views
Activity
Sep ’21
Reply to Using Objective-C Singleton in Swift file within Objective-C project
Fantastic. Thank You. Would you mind telling me why is not a good idea to use id with Swift?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
May ’21