Posts

Post not yet marked as solved
0 Replies
205 Views
Hello, how should I perform two next two operations with UICompositionalLayout? Scroll To Specific offset Change layout of the item, I'm scrolling to. Whenever I try to call collectionView.collectionViewLayout.invalidateLayout(), I get reset: Content Offset of UICollectionView The layout change of the item is not updated Here is the example of the layout I try to use.    let itemSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0),                                           heightDimension: .estimated(100))     let item = NSCollectionLayoutItem(layoutSize: itemSize)     item.edgeSpacing = NSCollectionLayoutEdgeSpacing(leading: nil, top: .fixed(8), trailing: nil, bottom: .fixed(8))     let groupSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0),                                            heightDimension: .estimated(100))     let group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize, subitems: [item])     let section = NSCollectionLayoutSection(group: group)     return section And here is the example of cell class ReelTextCellView: UICollectionViewCell {   private var textView: UITextView!   private var infoHolderView: UIView!   private var copyButton: UIButton!   private var scrollView: UIScrollView!   private var heightConstraint: NSLayoutConstraint!   var isExpanded = false   override init(frame: CGRect) {     super.init(frame: .zero)     buildView()   }   required init?(coder: NSCoder) {     fatalError("init(coder:) has not been implemented")   }   override func preferredLayoutAttributesFitting(_ layoutAttributes: UICollectionViewLayoutAttributes) -> UICollectionViewLayoutAttributes {     let attributes = super.preferredLayoutAttributesFitting(layoutAttributes)     attributes.frame.size = .init(width: contentView.frame.width, height: isExpanded ? 300 : 100)     return attributes   } // Called with the cellWillAppear and manually for indexPathsForVisibleItems   func update(with appeareance: Appearance) {     isExpanded = appeareance.isExpanded     ///    heightConstraint.constant = appeareance.isExpanded ? 300 : 100   } private extension ReelTextCellView {   func buildView() {     infoHolderView = UIView()     contentView.addSubview(infoHolderView) {       contentView.bottomAnchor.constraint(equalTo: infoHolderView.bottomAnchor)       contentView.leadingAnchor.constraint(equalTo: infoHolderView.leadingAnchor)       contentView.trailingAnchor.constraint(equalTo: infoHolderView.trailingAnchor)       infoHolderView.heightAnchor.constraint(equalToConstant: 30)     }     let separatorView = UIView()     separatorView.backgroundColor = Assets.Colors.separator.color     infoHolderView.addSubview(separatorView) {       separatorView.topAnchor.constraint(equalTo: infoHolderView.topAnchor)       separatorView.leadingAnchor.constraint(equalTo: infoHolderView.leadingAnchor)       separatorView.trailingAnchor.constraint(equalTo: infoHolderView.trailingAnchor)       separatorView.heightAnchor.constraint(equalToConstant: 0.5)     }     textView = UITextView()     contentView.addSubview(textView) {       textView.topAnchor.constraint(equalTo: contentView.topAnchor)       textView.leadingAnchor.constraint(equalTo: contentView.leadingAnchor)       textView.trailingAnchor.constraint(equalTo: contentView.trailingAnchor)       textView.bottomAnchor.constraint(equalTo: infoHolderView.topAnchor)     }   } }
Posted
by hayeuyur.
Last updated
.
Post not yet marked as solved
0 Replies
639 Views
Hi! I have encountered the next problem during the creation of the .xcframework and building it for the simulator devices and couldn't find any solution for this problem. Could not find module ‘’ for target ‘x86_64-apple-ios-simulator’; Let's me describe the build process: First of all i build framework for the iOS simulator and for iOS device. xcodebuild BUILD_LIBRARY_FOR_DISTRIBUTION=YES \ 	-scheme $(FRAMEWORK_NAME) \ 	-derivedDataPath $(DERIVED_DATA) \ 	-arch x86_64 \ 	-sdk iphonesimulator \ 	-mios-simulator-version-min='11.0' \ build xcodebuild BUILD_LIBRARY_FOR_DISTRIBUTION=YES \ 	-scheme $(FRAMEWORK_NAME) \ 	-derivedDataPath $(DERIVED_DATA) \ 	-arch arm64 \ 	-sdk iphoneos \ 	-mios-version-min='11.0' \ build 2. Extract from derived data a build product and compose it in the xcframework xcodebuild -create-xcframework \																																																																															 -library $(BUILD_FOLDER)/simulators/lib$(FRAMEWORK_NAME).a \																																																																 library $(BUILD_FOLDER)/devices/lib$(FRAMEWORK_NAME).a \																																																																		 output $(BUILD_FOLDER)/$(FRAMEWORK_NAME).xcframework	 3. Then the framework is linked to the example project and the error occurs in the example project, when trying to build for the simulator. However, building for the arm64 works as should. The structure of the xcframework is the next: _ | _.DS_Store | _ios-x86_64-simulator | | _.DS_Store | | _libA.a | | _A.swiftmodule | | | _x86_64-apple-ios-simulator.swiftinterface | | | _x86_64-apple-ios-simulator.swiftdoc | | | _x86_64.swiftdoc | | | _Project | | | | _x86_64.swiftsourceinfo | | | | _x86_64-apple-ios-simulator.swiftsourceinfo | | | _x86_64.swiftinterface | _ios-arm64 | | _libA.a | | _A.swiftmodule | | | _arm64-apple-ios.swiftinterface | | | _arm64-apple-ios.swiftdoc | | | _arm64.swiftinterface | | | _Project | | | | _arm64-apple-ios.swiftsourceinfo | | | | _arm64.swiftsourceinfo | | | _arm64.swiftdoc | _Info.plist Could you please suggest, what is wrong in this approach of building .xcframework and how it can be fixed?
Posted
by hayeuyur.
Last updated
.