Post

Replies

Boosts

Views

Activity

Disable Dark Mode for iOS, iPadOS and macOS Catalyst App using Swift Programming Language
I want to disable Dark Mode system wide. Apple Developer has mentioned that you can add 'UIUserInterfaceStyle' key to info.plist. But I checked there is no such key in list and it also gives error when you upload app to the App Store. I tried using below code in AppDelegate.swift file. window?.overrideUserInterfaceStyle = .light' But it seems above code doesn't apply to LaunchScreen.storyboard How to fix this? That is LaunchScreen should also obey command to disable dark mode system wide.
6
0
4.6k
May ’21
Rearrange collection view cells within it's section
I have used UICollectionView Cells for my app. It is populated by Arrays. I have two CollectionView Sections. Section '0' & Section '1' has it's own cells populated with arrays. There are multiple cells in section 1. I want to enable user to rearrange cells within section 1. User should not be able to move cell from section 1 to section 0. I am using following code but It is giving me errors... I tried searching on the web but I didn't got the answer so I am posting it here for help... override func collectionView(_ collectionView: UICollectionView, moveItemAt sourceIndexPath: IndexPath, to destinationIndexPath: IndexPath) { let sourceSection = sourceIndexPath.section let destSection = destinationIndexPath.section if (sourceSection destSection) { let tempInputDataArray = inputDataArray.remove(at: sourceIndexPath.item) inputDataArray.insert(tempInputDataArray, at: destinationIndexPath.item) UserDefaults.standard.set(inputDataArray, forKey: "KeyForInputDataArray") for element in inputDataArray { print(element) } } else { } }
7
0
2k
Apr ’21