Post

Replies

Boosts

Views

Activity

Reply to Disable Dark Mode for iOS, iPadOS and macOS Catalyst App using Swift Programming Language
If you are sure you set Light there and it causes error on archiving, or it has no effect for LaunchScreen.storyboard, please share your experience. I used 'Light' as value for 'Appearance' key... I was able to validate archive successfully Setting value 'Light' doesn't affected LaunchScreen... Launch Screen was changing appearance and status bar style with dark mode...
May ’21
Reply to Refreshing / Reloading Data of Supplementary View (Header & Footer) for Collection View
Hi, I create UILabel by Adding it as a subview to header... Here is my code for Header at '0'... override func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) - UICollectionReusableView { let reusableview = UICollectionReusableView() if (kind == UICollectionView.elementKindSectionHeader) { print("section \(indexPath.section)") if indexPath.section == 0 { let headerView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: collectionViewFirstHeaderFooterReuseIdentifier, for: indexPath) headerView.backgroundColor = .clear let headerUILabelText = UILabel() headerUILabelText.textAlignment = .left headerUILabelText.font = UIFont.systemFont(ofSize: 20, weight: .bold) headerUILabelText.numberOfLines = 0 headerUILabelText.text = "Your Roll Number is \(NumberInteger). Your Exam Numbers are \(examNumbers(number: "\(NumberInteger)"))" headerUILabelText.textColor = .darkGray headerUILabelText.lineBreakMode = .byTruncatingTail headerView.addSubview(headerUILabelText) headerUILabelText.setMargins() headerUILabelText.isHidden = false headerUILabelText.translatesAutoresizingMaskIntoConstraints = false NSLayoutConstraint.activate([ headerUILabelText.leadingAnchor.constraint(equalTo: headerView.leadingAnchor), headerUILabelText.trailingAnchor.constraint(equalTo: headerView.trailingAnchor), headerUILabelText.centerXAnchor.constraint(equalTo: headerView.centerXAnchor), headerUILabelText.centerYAnchor.constraint(equalTo: headerView.centerYAnchor), headerUILabelText.topAnchor.constraint(equalTo: headerView.topAnchor), headerUILabelText.rightAnchor.constraint(equalTo: headerView.rightAnchor), headerUILabelText.bottomAnchor.constraint(equalTo: headerView.bottomAnchor), headerUILabelText.leftAnchor.constraint(equalTo: headerView.leftAnchor), headerUILabelText.widthAnchor.constraint(equalToConstant: headerView.frame.width), headerUILabelText.heightAnchor.constraint(equalToConstant: headerView.frame.height) ]) return headerView } else if indexPath.section == 1 { let headerView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: collectionViewSecondHeaderFooterReuseIdentifier, for: indexPath) return headerView } else { return reusableview } }
Apr ’21
Reply to Rearrange collection view cells within it's section
I used your suggestion of 'if (sourceSection == destSection)' but user is able to still drag from section 1 to 0... Also used your code for else statement but it never gets called. I think answer should be Collection View 'Section' Specific. As per requirement user should be able to only move cells within sections i.e. Section 1 cells should be rearranged within section 1 only..
Apr ’21