I have created a macOS catalyst App from iPadOS in Xcode.But there is no way to enter or edit a custom bundle identifier for macOS Catalyst app in Xcode.How to do that?
Post
Replies
Boosts
Views
Activity
Hi All,Can anybody help me out with how to implement UIPointerInteraction (Which available with iPadOS 13.4) for UICollectionView Cell?I have referred this link: developer.apple.com/documentation/uikit/pointer_interactionsI want to highlight or lift UICollectionViewCell when I mouse over it on iPad...Thanks Again...
I am developing an app for iPad for iPadOS 13.There are two UICollectionViewController one navigates from one cell to another UICollectionViewController. I am using the following code:I have declared keyWindow at UICollectionView Controller as:let keyWindow = UIApplication.shared.connectedScenes
.filter({$0.activationState == .foregroundActive})
.map({$0 as? UIWindowScene})
.compactMap({$0})
.first?.windows
.filter({$0.isKeyWindow}).firstBut on first UICollectionViewController 'keyWindow?.bounds.size' gets printed as nil but on second UICollectionViewController same iPad Simulator 'keyWindow?.bounds.size' it gets printed as 'Optional((768.0, 1024.0))'. I am using the exact same code everywhere.func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
var sizeArea = CGSize()
print("UIScreen.main.bounds.size \(UIScreen.main.bounds.size)")
print(keyWindow?.bounds.size)
if UIScreen.main.bounds.size == keyWindow?.bounds.size {
print("UIScreen.main.bounds.size == keyWindow?.bounds.size")
let spacing = self.view.frame.size.width - 25
let itemWidth = spacing / 4
sizeArea = CGSize(width: itemWidth, height: itemWidth)
} else {
print("else")
let spacing = self.view.frame.size.width - 20
let itemWidth = spacing / 3
sizeArea = CGSize(width: itemWidth, height: itemWidth)
}
}What I am doing wrong here?
I have implemented UICollectionView for iOS / iPadOS and now macOSBut how efficiently I can code collection view for various mac screen/display sizes?Is there any definite threshold that I can code about? Because there are no compact or regular screen sizes...Do help me with this...
I am using following code to have a minimum size for my app, It looks something like this:#if targetEnvironment(macCatalyst)
func addWindowSizeHandlerForMacOS() {
UIApplication.shared.connectedScenes.compactMap { $0 as? UIWindowScene }.forEach { windowScene in
print("addWindowSizeHandlerForMacOS()")
windowScene.sizeRestrictions?.minimumSize = CGSize(width: 800, height: 800)
// windowScene.sizeRestrictions?.maximumSize = CGSize(width: 801, height: 1101)
}
}
#endifI want to have same minimum size as the default size for every time my mac catalyst apps opens.Every instance my app relaunch it should open in its minimum size width and height i.e. 800 by 800.
I am using the following code to set the light colour for StatusBarStyle: But this code has suddenly stopped working in iOS 13 and iPadOS 13extension UINavigationController {
override open var preferredStatusBarStyle: UIStatusBarStyle {
get {
return .lightContent
}
}
}I have implemented UINavigationBarController with Large Titles for iOS 13 and iPadOS 13. I am using Xcode 11.4.1
I am Converting numerical string to Int numbers in my Swift Playground in Xcode.
My calculation is getting more than 26 Digits...
e.g. "4444423533331235525555555"
I am getting error nil...
How to fix this?
My code look something like this:
let ageString = "4444423533331235525555555"
let ageInt = Int(ageString)
print(ageInt ?? 0)
I am Converting numerical string to Int numbers in my Swift Playground in Xcode.
My calculation is getting more than 26 Digits...
e.g. "4444423533331235525555555"
I am getting error nil...
How to fix this?
My code look something like this:
let ageString = "4444423533331235525555555"
let ageInt = Int(ageString)
print(ageInt ?? 0)
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 {
}
}
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...
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?
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...
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?
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.
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?