Post

Replies

Boosts

Views

Activity

How to Simulate Subscription Cancellation with Products.storekit in Simulator?
Hi, Currently, instead of using a real device and test account for in-app purchase testing, we are using Products.storekit with the Simulator. Our app offers a subscription plan with a 3-day free trial. We would like to simulate the following test scenarios: User cancels the subscription within the 3-day free trial period. User cancels the subscription after the 3-day free trial period. However, in Xcode, under Debug > StoreKit > Manage Transactions..., we couldn’t find an option to simulate a subscription cancellation. There is an option to refund the purchase, but we believe this is not the same as a cancellation. Do you have any idea how we can simulate these two cases using Products.storekit and the Simulator? Thanks in advance!
0
0
19
1w
UIKit or SwiftUI First? Exploring the Best Hybrid Approach
UIKit and SwiftUI each have their own strengths and weaknesses: UIKit: More performant (e.g., UICollectionView). SwiftUI: Easier to create shiny UI and animations. My usual approach is to base my project on UIKit and use UIHostingController whenever I need to showcase visually rich UI or animations (such as in an onboarding presentation). So far, this approach has worked well for me—it keeps the project clean while solving performance concerns effectively. However, I was wondering: Has anyone tried the opposite approach? Creating a project primarily in SwiftUI, then embedding UIKit when performance is critical. If so, what has your experience been like? Would you recommend this approach? I'm considering this for my next project but am unsure how well it would work in practice.
1
0
47
Mar ’25
Issue with Empty Reporting in Apple Search Ads (Basic)
Hi, I am using Apple Search Ads (Basic), and I’ve noticed that my bank account has been debited weekly. However, when I recently tried to access the reports, they appear empty. Please see the attached screenshots for reference. Is there a customer support representative from Apple Search Ads who can assist me with this issue? Thank you.
0
0
307
Jan ’25
Official document for CONSUMPTION_REQUEST - What kind of data we are receiving?
This documentation describes what kind of data we should be sending to Apple server, once we are receiving CONSUMPTION_REQUEST https://developer.apple.com/documentation/appstoreserverapi/consumptionrequest But, it doesn't describe what kind of data we are receiving, when we are receiving CONSUMPTION_REQUEST? May I know, is such a document available? Thank you.
0
0
453
Dec ’24
How to animate substring in a Text?
Currently, I am using multiple Texts in a horizontal stackview, to achieve animation of substring. As you can see in the above animation, the text - conversation - meeting - lecture are animated. However, there shortcoming of such an approach. Text size is not consistent among different Text block. The following Text block are having different text size. - Transform - conversation/ meeting/ lecture - to Quick Note Any idea how we can achieve, so that all text blocks have same text size so that they appear like 1 sentence? Or, how we can make the text blocks having constant text size, but able to perform line wrapping to next line, so that they appear like 1 sentence? Currently, this is the code snippet I am using. import SwiftUI struct ContentView: View { var array = ["lecture", "conversation", "meeting"] @State var currentIndex : Int = 0 @State var firstString : String = "" var body: some View { VStack { HStack { Text("Transform") .lineLimit(1) .minimumScaleFactor(0.5) .font(.title) Text(firstString) .lineLimit(1) .minimumScaleFactor(0.5) .font(.title) .transition(AnyTransition.opacity.animation(.easeInOut(duration:1.0))) .background(.yellow) Text("to Quick Note") .lineLimit(1) .minimumScaleFactor(0.5) .font(.title) }.padding() } .animation(.default) .onAppear { firstString = array[0] let timer = Timer.scheduledTimer(withTimeInterval: 2.0, repeats: true) { _ in if currentIndex == array.count - 1 { self.firstString = array[0] currentIndex = 0 } else { self.firstString = array[currentIndex+1] currentIndex += 1 } } } } } #Preview { ContentView() }
2
0
273
Dec ’24
Resolving 2nd Repeated "Guideline 4.3(a) - Design - Spam" Rejection Within Six Months
We are reaching out for guidance after encountering 2nd repeated "Guideline 4.3(a) - Design - Spam" rejections for our WeNote app. Here’s a brief timeline of our journey: 2018: We launched the WeNote Android app on Google Play Store. 2019: We started promoting WeNote on YouTube and began development of the WeNote iOS app. Our progress was publicly visible on our Trello board and discussed on the Apple Developer forum. August 17, 2021: We filed an official complaint with Apple regarding a *** company infringing on our app logo, title, and description. The issue was resolved when *** agreed to update their app’s branding. 2022 Year: *** company is terminated from App Store. June 2022: WeNote for iOS was officially released on the Apple App Store. June 17, 2024: We received a rejection from the Apple Review team citing Guideline 4.3(a) - Design - Spam: “We noticed your app shares a similar binary, metadata, and/or concept as apps previously submitted by a terminated Apple Developer Program account. Submitting similar or repackaged apps is a form of spam that creates clutter and makes it difficult for users to discover new apps.” We successfully resolved this issue by providing documentation about the previous incident on August 17, 2021. November 22, 2024: Unfortunately, we received the same rejection message again, despite having already informed Apple of the previous case. Request for Assistance: We are now seeking guidance from the community or anyone with experience in navigating similar issues. We’ve provided Apple with all the necessary evidence and explanations regarding the previous incident, but our appeal was rejected. How can we resolve this issue, and prevent future rejections? Some Background on WeNote: To help provide context, I’d like to highlight what makes WeNote stand out compared to other apps in the same category: WeNote is an all-in-one solution: While most apps in the market focus on one function—whether it’s note-taking, to-do lists, or calendar management—WeNote uniquely combines all three into a single app. This integration offers users a seamless experience to manage tasks, notes, and schedules in one place. Proven user satisfaction: We are proud to have over 7,000 user reviews, with an average rating of 4.8 stars. This high rating reflects our users' satisfaction with the app’s features and functionality, as well as its ability to meet their needs in a way that other apps do not. We believe these features make WeNote a valuable and unique tool for users, and we continue to prioritize quality and user experience in our development.
2
0
529
Nov ’24
trailingSwipeActionsConfigurationProvider causes shadow effect on UICollectionViewListCell gone
Currently, I have achieve shadow and corner effect for UICollectionViewListCell, using the following code. UICollectionViewListCell class NoteCell: UICollectionViewListCell { override func awakeFromNib() { super.awakeFromNib() initShadow() initCorner() } private func updateShadowColor() { // Determine the shadow color based on the current interface style let shadowUIColor = UIColor.label self.layer.shadowColor = shadowUIColor.cgColor } private func initShadow() { // https://www.hackingwithswift.com/example-code/uikit/how-to-add-a-shadow-to-a-uiview self.layer.shadowOpacity = 0.3 self.layer.shadowOffset = CGSize(width: 0.5, height: 0.5) self.layer.shadowRadius = 2 self.layer.masksToBounds = false self.updateShadowColor() // Remove the following two lines if you experience any issues with shadow rendering: self.layer.shouldRasterize = true self.layer.rasterizationScale = UIScreen.main.scale } private func initCorner() { var backgroundConfig = UIBackgroundConfiguration.listPlainCell() backgroundConfig.backgroundColor = .systemBackground backgroundConfig.cornerRadius = 16 self.backgroundConfiguration = backgroundConfig } layout private func layoutConfig() -> UICollectionViewCompositionalLayout { let layout = UICollectionViewCompositionalLayout { section, layoutEnvironment in var config = UICollectionLayoutListConfiguration(appearance: .plain) config.headerMode = .none config.footerMode = .none config.showsSeparators = false config.headerTopPadding = 0 config.backgroundColor = nil config.trailingSwipeActionsConfigurationProvider = { [weak self] indexPath in guard let self = self else { return nil } // Knowing what we are tapping at. var snapshot = dataSource.snapshot() let sectionIdentifier = snapshot.sectionIdentifiers[indexPath.section] let itemIdentifiers = snapshot.itemIdentifiers(inSection: sectionIdentifier) let itemIdentifier: NoteWrapper = itemIdentifiers[indexPath.item] let deleteHandler: UIContextualAction.Handler = { action, view, completion in completion(true) // TODO: //snapshot.reloadItems([itemIdentifier]) } let deleteAction = UIContextualAction(style: .normal, title: "Trash", handler: deleteHandler) var swipeActionsConfiguration = UISwipeActionsConfiguration(actions: [ deleteAction, ]) deleteAction.image = UIImage(systemName: "trash") deleteAction.backgroundColor = UIColor.systemRed swipeActionsConfiguration.performsFirstActionWithFullSwipe = false return swipeActionsConfiguration } // https://developer.apple.com/forums/thread/759987 let layoutSection = NSCollectionLayoutSection.list(using: config, layoutEnvironment: layoutEnvironment) layoutSection.interGroupSpacing = 16 // Distance between item. layoutSection.contentInsets = NSDirectionalEdgeInsets( top: 16, // Distance between 1st item and its own header. leading: 16, bottom: 16, // Distance of last item and other header/ bottom edge. trailing: 16 ) return layoutSection } return layout } This is the outcome. However, when I perform swipe action, the shadow effect is gone. Do you have any idea how I can resolve such? Thanks.
0
0
335
Oct ’24
UILabel Attributed Text Anomaly: Unexpected Strikethrough When Setting Text Property in Swift
The following code, will create a red color text, without strike-through. class ViewController: UIViewController { @IBOutlet weak var label: UILabel! override func viewDidLoad() { super.viewDidLoad() let text = "Hello World" let textCount = text.count let fullRange = NSRange(location: 0, length: textCount) var attributedText = NSMutableAttributedString(string: text) attributedText.addAttribute(.foregroundColor, value: UIColor.green, range: fullRange) attributedText.addAttribute(.strikethroughStyle, value: NSUnderlineStyle.single.rawValue, range: fullRange) label.attributedText = attributedText attributedText = NSMutableAttributedString(string: text) attributedText.addAttribute(.foregroundColor, value: UIColor.red, range: fullRange) attributedText.removeAttribute(NSAttributedString.Key.strikethroughStyle, range: fullRange) label.attributedText = attributedText } } However, if I trigger label.text in between, it will cause the following strange behavior : A red color text, with strike-through created at the end of function. class ViewController: UIViewController { @IBOutlet weak var label: UILabel! override func viewDidLoad() { super.viewDidLoad() let text = "Hello World" let textCount = text.count let fullRange = NSRange(location: 0, length: textCount) var attributedText = NSMutableAttributedString(string: text) attributedText.addAttribute(.foregroundColor, value: UIColor.green, range: fullRange) attributedText.addAttribute(.strikethroughStyle, value: NSUnderlineStyle.single.rawValue, range: fullRange) label.attributedText = attributedText // Why this will cause a red color text, with strike-through created at the end of function? label.text = text attributedText = NSMutableAttributedString(string: text) attributedText.addAttribute(.foregroundColor, value: UIColor.red, range: fullRange) attributedText.removeAttribute(NSAttributedString.Key.strikethroughStyle, range: fullRange) label.attributedText = attributedText } } Does anyone what is the reason behind this behavior, and how I can avoid such? Thank you.
Topic: UI Frameworks SubTopic: UIKit
0
0
348
Aug ’24
Understanding Policies on Account Associations: Google vs. Apple
Google has a very strict policy regarding "associated previously terminated accounts." This means that if you are associated with another previously banned developer, you will be banned too. For instance : https://www.reddit.com/r/androiddev/comments/9mpyyi/google_play_developer_account_terminated_due_to/ Does Apple have a similar policy? Recently, I was considering providing read-only access to an external party on App Store Connect. However, I am concerned that it might trigger the same risk. Therefore, I am wondering if Apple has such a policy. Thanks.
0
0
440
Jul ’24
Optimizing Sorting and Order Management in CoreData
Sorting is an important feature in my app. I am using integers to represent the ordering sequence. Items: A, B, D, E, H Order number: 0, 1, 2, 3, 4 When I insert a new item "C", here's the outcome: Items: A, B, C, D, E, H Order number: 0, 1, 2, 3, 4, 5 Here's the write operation required on existing order numbers: D: 2 -> 3 E: 3 -> 4 H: 4 -> 5 I wish to reduce the number of write operations because CoreData is pretty slow at writing. The problem becomes more significant when my users start to have a few thousand items in CoreData. Here's my current workaround: leaving gaps between each order number. For instance: Items: A, B, D, E, H Order number: 0, 10, 20, 30, 40 When I insert a new item "C", here's the outcome: Items: A, B, C, D, E, H Order number: 0, 10, 11, 20, 30, 40 No write operations are required on existing order numbers. Every 1 or 2 weeks, when my users close the app, I run background tasks to re-arrange the gaps between order numbers so that when users insert new items, fewer existing order numbers will be affected. Items: A, B, C, D, E, H Order number: 0, 10, 20, 30, 40, 50 Since sorting is pretty common, I was thinking some of you might have a better idea on how to reduce write operations on existing order numbers. If you have a better idea, do you mind to share it with us? Thanks.
1
0
467
Jul ’24
When using NSCollectionLayoutSection.list, how to specific header height and cell item height?
I am using NSCollectionLayoutSection.list as follow. private func layoutConfig() -> UICollectionViewCompositionalLayout { let layout = UICollectionViewCompositionalLayout { section, layoutEnvironment in var config = UICollectionLayoutListConfiguration(appearance: .plain) config.headerMode = .supplementary config.footerMode = .none config.showsSeparators = false config.headerTopPadding = 0 // https://developer.apple.com/forums/thread/759987 let layoutSection = NSCollectionLayoutSection.list(using: config, layoutEnvironment: layoutEnvironment) layoutSection.interGroupSpacing = 0 layoutSection.contentInsets = NSDirectionalEdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 0) if let header = layoutSection.boundarySupplementaryItems.first(where: { $0.elementKind == UICollectionView.elementKindSectionHeader }) { header.contentInsets = NSDirectionalEdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 0) } return layoutSection } return layout } We provide our own custom header view and cell item view. Header View class HideShowHeader: UICollectionViewListCell { override func awakeFromNib() { super.awakeFromNib() // Initialization code } override func systemLayoutSizeFitting(_ targetSize: CGSize) -> CGSize { // Ensure the cell fills the width of the collection view let size = CGSize( width: targetSize.width, height: 80 ) print(">>>> size \(size)") return size } } Cell Item View class TodoCell: UICollectionViewListCell { override func awakeFromNib() { super.awakeFromNib() // Initialization code } override func systemLayoutSizeFitting(_ targetSize: CGSize) -> CGSize { // Ensure the cell fills the width of the collection view let size = CGSize( width: targetSize.width, height: 80 ) return size } } We would like to fine-tune the height of header and cell item. However, override systemLayoutSizeFitting doesn't work. May I know, when using NSCollectionLayoutSection.list, how to specific header height and cell item height? Thanks.
Topic: UI Frameworks SubTopic: UIKit Tags:
0
1
328
Jul ’24
Specifying Item Spacing in UICollectionLayoutListConfiguration
Currently, I am using UICollectionViewCompositionalLayout to achieve the following list layout with spacing: We were thinking of trying out UICollectionLayoutListConfiguration due to its ability to support swipe actions. We would like to specify the spacing between each item. However, I do not find a way to specify item spacing in UICollectionLayoutListConfiguration. Does UICollectionLayoutListConfiguration not support item spacing, or have I missed something? Thanks.
Topic: UI Frameworks SubTopic: UIKit Tags:
1
0
772
Jul ’24
Customizing Drop Location View in UICollectionView Drag and Drop
Currently, this is how I implement the drag and move operation: collectionView.beginInteractiveMovementForItem collectionView.updateInteractiveMovementTargetPosition collectionView.endInteractiveMovement The outcome looks like the following: However, what I would like to achieve is the ability to customize the view of the "drop" location. For instance, in the following example, a red line is drawn at the target drop location: In this example, a transparent rectangle is drawn at the target drop location: May I know how these apps achieve such an effect? Thanks.
Topic: UI Frameworks SubTopic: UIKit Tags:
0
0
369
Jul ’24