Posts

Post not yet marked as solved
5 Replies
1.8k Views
I have some code which currently assumes that UICollectionViewDelegate - collectionView(_: UICollectionView, willDisplay _: UICollectionViewCell, forItemAt indexPath: IndexPath) will be called as the user scrolls through the collection view and cells are about to be displayed on-screen. However on refactoring this screen to use the UICollectionViewDiffableDataSource APIs I noticed that willDisplay is called for every indexPath in the collection view's data as a result of calling UICollectionViewDiffableDataSource apply`. This is reproducible in Apple's sample app Updating Collection Views Using Diffable Data Sources running on iOS 15. Is this behaviour intentional? Is there another reliable way to be informed of when a cell is about to be displayed as the user is scrolling through the collection view? As a workaround I am using a boolean flag to indicate when the data source is updating and setting that to false in the completion of UICollectionViewDiffableDataSource apply. Many thanks!
Posted Last updated
.
Post not yet marked as solved
2 Replies
1.9k Views
An iOS application of ours we develop for a client was recently rejected as it was claimed we violate Guideline 5.1.2. The App Review team's justification was: We noticed your app accesses web content you own where you collect cookies. Cookies may be used to track users, but you do not use App Tracking Transparency to request the user's permission before collecting data used to track. The App Review team included a screenshot of our client's website which they had navigated to via a button found in our client's SSO login flow. Their main website has a cookie policy which seems to be the cause of the rejection. Clearly our client's main website should not be accessible via their SSO login flow but this opens a wider question and concerns from our client. We open the SSO login flow within an ephemeral ASWebAuthenticationSession. The documentation of which states: Set prefersEphemeralWebBrowserSession to true to request that the browser doesn’t share cookies or other browsing data between the authentication session and the user’s normal browser session. https://developer.apple.com/documentation/authenticationservices/aswebauthenticationsession/3237231-prefersephemeralwebbrowsersessio We interpret that and the fact that there is no API on ASWebAuthentication to extract cookies from it into the hosting iOS app to mean that we do not store cookies in our iOS app and are therefore not in violation of Guideline 5.1.2. We also assume the same thing applies to SFSafariViewController (which we also use to sometimes display pages from our client's website which, to reiterate, has a cookie policy). It's documentation states: The user's activity and interaction with SFSafariViewController are not visible to your app, which cannot access AutoFill data, browsing history, or website data https://developer.apple.com/documentation/safariservices/sfsafariviewcontroller After having read the documentation we see no reason why accessing a website with a cookie policy within either an ephemeral ASWebAuthenticationSession or an SFSafariViewController would warrant the hosting app to include App Tracking Transparency. I am assuming that due to the nature of these APIs (as they do not give cookie access to the hosting app) that they are exempt. Could someone please either: Provide documentation that states if an ephemeral ASWebAuthenticationSession or an SFSafariViewController accesses a website with a cookie policy App Tracking Transparency is required. or Confirm that we are not in violation of of Guideline 5.1.2 and we should appeal the rejection. Many thanks
Posted Last updated
.
Post not yet marked as solved
1 Replies
883 Views
Hello, At RunTime I'm being suggested an Optimization Opportunity for some code I've written. The layer is using a simple layer with background color set as a mask. Instead, use a container layer of the same "frame" and "cornerRadius" as the mask, but with "masksToBounds" set to YES I'm afraid I don't know what is meant here by a "container layer". This is the code that threw up the optimization opportunity      let maskView = UIView(frame: CGRect(x: 0, y: 0, width: 45, height: 90))     maskView.backgroundColor = .black     filledImage.mask = maskView The code above masks half of a 90x90 UIImageView filledImage. Any ideas how this could be refactoring to use a "container layer". Many thanks
Posted Last updated
.