Post

Replies

Boosts

Views

Activity

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
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
Changing UITabBar item image on selected and unselected state for Three Tabs but getting error
I have implemented three tab bar view controllers for my app. Each tab has collection views, And I have implemented following code in my ViewController to change tab bar image icon from stroke to fill on respective tab bar selection. I am using System Icons (SF Symbols). My Code: self.tabBarController?.tabBar.items?[0] = UITabBarItem(title: "Myanmar", image: UIImage(systemName: "m.square.fill"), selectedImage: UIImage(systemName: "m.square")) self.tabBarController?.tabBar.items?[1] = UITabBarItem(title: "Singapore", image: UIImage(systemName: "s.square"), selectedImage: UIImage(systemName: "s.square.fill")) self.tabBarController?.tabBar.items?[2] = UITabBarItem(title: "Hyderabad", image: UIImage(systemName: "h.square"), selectedImage: UIImage(systemName: "h.square.fill")) Error that I am getting at AppDelegate is: "Directly modifying a tab bar managed by a tab bar controller is not allowed." How to solve this?
4
0
9.2k
Apr ’21
Refreshing / Reloading Data of Supplementary View (Header & Footer) for Collection View
I have deployed 2 Supplementary Views for Header and Footer views for my collection view. Header '0' has UILabel text which dynamically sets data dynamically after transitioning to push secondary view controller. But I am having problem that when UILabel in header loads again after returning and taking data from secondary view controller collection view get updated but Header and Footer Supplementary views has overlapping of old and new data...!!! How to fix overlapping of data and 'Reload Supplementary Views' for Header and Footer?
3
1
3.8k
Apr ’21
Implementing Free Trials for My Paid App
I have few questions about implementing free trials for my UIKit Swift App. Currently my app is paid i.e. One time purchase. I have good amount of user who have purchased my app as an Paid app previously. Now I want to introduce Trial period for my app I am also exploring RevenueCat framework for this... My Questions: If I implement Trial period then can I offer free app as my previous user have already bought my app when it was paid. And new user can use my app for free for 14 days then one time payment will start. Is there any good documentation for this kind of logic / programming? with source code examples... Thanks in advance...
0
0
1k
Apr ’21
UIVisualEffectView Not working in macOS Catalyst
I am using UIVisualEffectView for my Popup View Controller view for my app. Code is successfully working in iOS and iPadOS to blure view background. But view for macOS Catalyst app is white without transperency and blur. How to solve this? I am using following code... self.view.backgroundColor = UIColor(red: 255/255, green: 255/255, blue: 255/255, alpha: 0.3) let blurEffect = UIBlurEffect(style: .light) let blurEffectView = UIVisualEffectView(effect: blurEffect) blurEffectView.frame = self.view.bounds blurEffectView.autoresizingMask = [.flexibleWidth, .flexibleHeight] self.view.insertSubview(blurEffectView, at: 0)
0
1
1.1k
Aug ’21
Lay outing Issues While Using SplitViewController over CollectionViewController
I was using CollectionViewController all along without any lay outing issues. After implementing SplitViewController for CollectionViewController... I noticed when I toggle switch for SplitViewController gap between two cells breaks or layouting of Cell i.e. sizeForItemAt I have implemented multitasking - view for my app. i.e. if traitCollection.verticalSizeClass == .regular && traitCollection.horizontalSizeClass == .regular etc. How to fix this?
0
0
691
May ’22
Converting ViewController Module to External Swift Package
I used the Local Folder UIKit-Based ViewController Module to select three Xcode projects that may work differently with string values stored in each Xcode Project Helper File. However, I have Successfully converted that Module to an Independent Swift Package And was able to deploy it on GitHub for easy use with different projects without having to update each file everywhere. But Now the string value that the Package depended on is not taking that value from the Xcode project it has been added to. So, How do we get value from the Xcode project for an independently added Swift Package to make it work?
0
0
645
Sep ’23
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 { } }
Replies
7
Boosts
0
Views
2k
Activity
Apr ’21
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.
Replies
6
Boosts
0
Views
4.6k
Activity
May ’21
How know previously released app updates's build numbers?
I have almost updated my app 10 times or more. But I did not documented my app's build numbers. I have even deleted old archives from Xcode organiser. I checked App Store Connect's version history but it only shows App Versions and not Build Numbers. Is there any way to know build version for all my app updates and releases?
Replies
5
Boosts
0
Views
5.9k
Activity
Dec ’22
Changing UITabBar item image on selected and unselected state for Three Tabs but getting error
I have implemented three tab bar view controllers for my app. Each tab has collection views, And I have implemented following code in my ViewController to change tab bar image icon from stroke to fill on respective tab bar selection. I am using System Icons (SF Symbols). My Code: self.tabBarController?.tabBar.items?[0] = UITabBarItem(title: "Myanmar", image: UIImage(systemName: "m.square.fill"), selectedImage: UIImage(systemName: "m.square")) self.tabBarController?.tabBar.items?[1] = UITabBarItem(title: "Singapore", image: UIImage(systemName: "s.square"), selectedImage: UIImage(systemName: "s.square.fill")) self.tabBarController?.tabBar.items?[2] = UITabBarItem(title: "Hyderabad", image: UIImage(systemName: "h.square"), selectedImage: UIImage(systemName: "h.square.fill")) Error that I am getting at AppDelegate is: "Directly modifying a tab bar managed by a tab bar controller is not allowed." How to solve this?
Replies
4
Boosts
0
Views
9.2k
Activity
Apr ’21
Refreshing / Reloading Data of Supplementary View (Header & Footer) for Collection View
I have deployed 2 Supplementary Views for Header and Footer views for my collection view. Header '0' has UILabel text which dynamically sets data dynamically after transitioning to push secondary view controller. But I am having problem that when UILabel in header loads again after returning and taking data from secondary view controller collection view get updated but Header and Footer Supplementary views has overlapping of old and new data...!!! How to fix overlapping of data and 'Reload Supplementary Views' for Header and Footer?
Replies
3
Boosts
1
Views
3.8k
Activity
Apr ’21
Programmatically Setting Constraints for CollectionViewCell Elements
Is there any possibility to update constraints for elements inside CollectionViewCell with button tap? And where to put the code inside CellForItem or Inside CollectionViewCell Class File?
Replies
2
Boosts
0
Views
88
Activity
May ’25
Applying Porperty to Every UIButton in current app
Hello, Is there any way to iterate all views and subviews in current xcode app and taget to particular properties to every UIButton. I tried using folllowing code but it is not working. for views in self.view.subviews { if views == UIButton { button.isPointerInteractionEnabled = true } else { } }
Replies
1
Boosts
0
Views
564
Activity
Apr ’24
Integrating iCloud for Universal App
Is there any good framework that can ease process of syncing strings, structs, bools across devices using icloud. Currently app doesn't use any cloud functionality. Any help will be greatly appreciated.
Replies
1
Boosts
0
Views
999
Activity
Jun ’24
Disable External Keyboard Input for UIDatePicker
I have used UITextField to get date input using UIDatePicker. If user has attached external Bluetooth keyboard to his iPad or Mac (Catalyst) I want to block user input from keyboard and force user to use UIDatePicker instead to get in put in valid date format e.g. dd/MM/YYYY How to do it in Swift app? Do help...
Replies
0
Boosts
1
Views
1.1k
Activity
Apr ’21
Implementing Free Trials for My Paid App
I have few questions about implementing free trials for my UIKit Swift App. Currently my app is paid i.e. One time purchase. I have good amount of user who have purchased my app as an Paid app previously. Now I want to introduce Trial period for my app I am also exploring RevenueCat framework for this... My Questions: If I implement Trial period then can I offer free app as my previous user have already bought my app when it was paid. And new user can use my app for free for 14 days then one time payment will start. Is there any good documentation for this kind of logic / programming? with source code examples... Thanks in advance...
Replies
0
Boosts
0
Views
1k
Activity
Apr ’21
UIVisualEffectView Not working in macOS Catalyst
I am using UIVisualEffectView for my Popup View Controller view for my app. Code is successfully working in iOS and iPadOS to blure view background. But view for macOS Catalyst app is white without transperency and blur. How to solve this? I am using following code... self.view.backgroundColor = UIColor(red: 255/255, green: 255/255, blue: 255/255, alpha: 0.3) let blurEffect = UIBlurEffect(style: .light) let blurEffectView = UIVisualEffectView(effect: blurEffect) blurEffectView.frame = self.view.bounds blurEffectView.autoresizingMask = [.flexibleWidth, .flexibleHeight] self.view.insertSubview(blurEffectView, at: 0)
Replies
0
Boosts
1
Views
1.1k
Activity
Aug ’21
Lay outing Issues While Using SplitViewController over CollectionViewController
I was using CollectionViewController all along without any lay outing issues. After implementing SplitViewController for CollectionViewController... I noticed when I toggle switch for SplitViewController gap between two cells breaks or layouting of Cell i.e. sizeForItemAt I have implemented multitasking - view for my app. i.e. if traitCollection.verticalSizeClass == .regular && traitCollection.horizontalSizeClass == .regular etc. How to fix this?
Replies
0
Boosts
0
Views
691
Activity
May ’22
Replacing Chevron (< Root View Controller) with Display Mode Icon in Split View Controller
Hi, I am using Split View Controller. Can somebody help me with how to show Display Mode Icon in iPad Portrait Mode instead of just < Root View Controller
Replies
0
Boosts
0
Views
635
Activity
May ’22
Converting ViewController Module to External Swift Package
I used the Local Folder UIKit-Based ViewController Module to select three Xcode projects that may work differently with string values stored in each Xcode Project Helper File. However, I have Successfully converted that Module to an Independent Swift Package And was able to deploy it on GitHub for easy use with different projects without having to update each file everywhere. But Now the string value that the Package depended on is not taking that value from the Xcode project it has been added to. So, How do we get value from the Xcode project for an independently added Swift Package to make it work?
Replies
0
Boosts
0
Views
645
Activity
Sep ’23
Appearance Support Without Asset Catalog in Swift
I have created enum and UI Color Extension which returns Semantic UIColors created in Assets Catalog in iOS app. But is there any way that I can create UIColor Programatically that supports Dark and Light Mode using RGBA etc? Ans avoid using Asset Catalog.
Replies
0
Boosts
0
Views
847
Activity
Oct ’23