Post not yet marked as solved
Some context from the Human Interface Guidelines. It says that the AppIcon should be square in shape with no rounded edges. But when I build my app with the same image specs using Image Asset Catalog, it does not seems to be rounding the corners automagically. I know it does in iOS and iPadOS, but does it work macOS 11.
And what about Icon shapes in older macOS Catalina? Will this change affect them.
Square without rounded corners looks kinda ugly.
Post not yet marked as solved
Hi,
I have a little issue with this new API PHPPickerViewController:
var configuration = PHPickerConfiguration()
configuration.filter = .any(of: [.images])
configuration.selectionLimit = 10
configuration.preferredAssetRepresentationMode = .compatible
let picker = PHPickerViewController(configuration: configuration)
picker.delegate = self
present(picker, animated: true, completion: nil)
func picker(_ picker: PHPickerViewController, didFinishPicking results: [PHPickerResult]) {
var selectedPhotosData : [Data] = []
for (index,result) in results.enumerated() {
				 result.itemProvider.loadFileRepresentation(forTypeIdentifier: "public.jpeg") { (url, error) in
guard let fileUrl = url else {return }
print(fileUrl)
}
}
This code above doesn't work, I don't get the URL at all. I tried on Simulator and real device but the same problem. I tried loadObject function but I can't the UIImages...
I saw some workarounds here but they don't work in my case it seems...
Post not yet marked as solved
I have a multi-window app. Additional scenes can be properly created from the dock, although I'm not able to create a new scene programmatically via requestSceneSessionActivation.
I get the following error: Open window errror: The operation couldn’t be completed. the host declined to create a scene.
Any thoughts?
Post not yet marked as solved
Hi!
I am working on the UI/UX project for Apple apps(iPhone/watchOS etc.) using FIGMA.
I don't have any Apple device from where I could use 'SF Font' family natively. I have tried the alternative fonts but none of them appealed to me and my client too.
I also downloaded their resources but still it changes the file after I edit the text.
Thanks in Advance.
Post not yet marked as solved
How can I create a List that starts on the bottom?
All Lists start on top, but in a chat, the desired content scroll direction is up (inverted).
There are workarounds that rely on flipping the list with rotation effects, but these don’t work well, and make the logic very hard to understand.
Scrolling to bottom after some delay on list appear has side effects (loads rows on top).
Ideally there would be List { … }.scrollDirection(.inverted) api, that automatically loads the list from its last item, not first.
Post not yet marked as solved
When using conditionals in view bodies, can I preserve identity between the true and false sides of the conditional by adding an explicit id?
struct DogTreat: Identifiable {
var expirationDate: Date
var serialID: String
var id: String { serialID }
}
...
struct WrapperView: View {
...
var treat: DogTreat
var isExpired: Bool { treat.expirationDate < .now }
var body: some View {
if isExpired {
DogTreatView(treat)
.id(treat.id)
.opacity(0.75)
else {
DogTreatView(treat)
.id(treat.id)
}
}
...
}
Does this perform / behave the same as
struct WrapperView: View {
...
var treat: DogTreat
var isExpired: Bool { treat.expirationDate < .now }
var body: some View {
DogTreatView(treat)
.opacity(isExpired ? 0.75 : 1.0)
}
...
}
Post not yet marked as solved
In the "old" TextKit, page-based layout is accomplished by providing an array of NSTextContainers to NSLayoutManager, each with its own NSTextView.
TextKit 2, NSTextLayoutManager allows only a single text container. Additionally, NSTextParagraph seems to be the only concrete NSTextElement class. Paragraphs often need to break across page boundaries.
How would one implement page-based layout in TextKit 2?
The sessions talks about a new subtitle ability for UIMenus (“These buttons also benefit from improvements in menus like the ability for menu items to have subtitles for greater clarity.”) but I cannot find documentation on how to enable said subtitle.
Even using the example code with the new .singleSelection option does not display any subtitle..
Anyone did succeed in doing so?
Post not yet marked as solved
In a SwiftUI lab, I was asking about setting the focus state down a view hierarchy. The answer I got was to pass the focus state down the views as a binding. Conceptually, that made sense, so I moved on to other questions. But now that I am trying to implement it, I am having problems.
In the parent view, I have something like this:
@FocusState private var focusElement: UUID?
Then I am setting a property like this in the child view:
@Binding var focusedId: UUID?
When I try to create the detail view, I'm trying this:
DetailView(focusedId: $focusElement)
But this doesn't work. The error I get is:
Cannot convert value of type 'FocusState<UUID?>.Binding' to expected argument type 'Binding<UUID?>'
What is the right way to pass down the focus state to a child view so that it can update back up to the parent view?
I am trying to update from one child view, and have a TextField in a sibling view get focus.
Post not yet marked as solved
I don't understand the changes made to the tab bar in iOS 15.
In my app, I have a collection view that goes all the way down to the bottom of the screen.
When the tab bar appears, it covers some of that collection view, which is fine.
However, in iOS15, the tab bar has no background (and no blur effect), thus making the tab bar item text hard to see over the collection view.
In interface builder, I tried turning on the "Scroll Edge" option. This gives a translucent background to the tab bar similar to what I had in iOS 14.
Unfortunately, the menu tab bar item text size is affected by this option. For some reason, it doesn't use the font size I set, but something smaller.
Why is this happening? How do I get it to use the correct font size?
P.S. I'm only using text for the tab bar items. There are no images.
Post not yet marked as solved
If you try to change the bar item text color programmatically like in iOS 14, it doesn't work in iOS 15.
For example:
// https://stackoverflow.com/questions/2576592/changing-font-size-of-tabbaritem/
UITabBarItem.appearance().setTitleTextAttributes(
[NSAttributedString.Key.foregroundColor: UIColor.red],
for: .normal)
This correctly changes the color when the tab bar is on top of a scroll view.
However, when the tab bar background becomes clear, all tab bar item text is red and not just the text for the currently selected tab.
Is this a bug in iOS 15? Or is this code wrong for iOS 15?
Post not yet marked as solved
While not a major problem, selecting table rows seems to be noticeably more sluggish compared to other apps that make heavy use of table views (such as Finder).
In other words, the time between clicking and the table row visibly highlighting feels longer than in other apps.
I assume this is due to some details in SwiftUI that have yet to be sorted out, or is it the fault of the Garden App sample code? Perhaps both?
Post not yet marked as solved
Hi,
I'm trying to use Table in an app sort of similar to the garden example but imagine if there was a third view in the NavigationView for a third column.
And then imagine that if you selected a single plant in the middle table, a sort of detail inspector would appear in the third position with the data from your selection, updating as the selection in the middle table changed.
I'm struggling a bit to get this working. I've tried:
Wrapping the table column content closure's contents in a NavigationLink. This sort of works but it styles things oddly in the table column and as I scroll around, it seems to trigger on it's own, I'm guessing as cells are re-used or something behind the scenes. This feels wrong.
Moving row creation into the rows: parameter with TableRow but the only modifier there is for drag and drop, there's no onTapGesture or similar.
Watching for changes to the selected item via the binding and then acting on it then - this fires when I select stuff and I can get the related model object but I can't put a NavigationLink in there as it's outside of the view hierarchy so I'm not sure how to act on it.
I'm guessing there's some other way to handle this that I'm simply not thinking of but if anyone has any pointers, much appreciated!
Post not yet marked as solved
I receive an error when using the .listStyle(.carousel) function in Xcode 12.5, that error being Cannot infer contextual base in reference to member 'carousel' What should I do?
Post not yet marked as solved
I'm trying to adopt Quick Note in a document-based app. Has anyone got the "Add Link" button to show up for documents located in iCloud?
For local documents, the button works but then userInfo dictionary is missing from the continued NSUserActivity...
I have prepared an Xcode project that demonstrates the issue, available here on GitHub with a README describing what I have tried and what's not working in more detail:
https://github.com/tomaskraina/feedbackassistant.apple.com/tree/master/QuickNote-UIDocumentVsUserActivity
Post not yet marked as solved
e.g. via a keyboard shortcut? That would be really helpful when debugging.
Or is it possible to show the Quick Note window only on iPad with Pencil by swiping from the bottom right corner of the screen?
Post not yet marked as solved
What is the recommended approach to rendering text with line numbers in TextKit 2?
Post not yet marked as solved
Hey all,
I've just taken Xcode 13 Beta 2, and I still can't get the sample code from the "Sharing-Data" code to work properly, and nor does the boilerplate code from creating a new project that incorporates CodeData and CloudKit work.
Fo far my feedback items have not been identified as having other similar issues - based on the posts I'm seeing I'm not the only one experiencing the same problem.
Has anyone got this code built and working yet? Mine breaks when you try to copy the sharing link.
Post not yet marked as solved
In the current version of the Garden app, when you add a new Plant, the variety is 'New Plant' and the days to maturity is zero.
How can we change the code (and replacing the Text by TextField) to make these two fields for instance editable.
My question comes from the fact that in the table, we use plants computed property that take all the plants from the garden, and the filter using the search text and sort them.
How can we change that to have binding to plants and then use that in the table?
Regards
Vincent
Post not yet marked as solved
I want to take a screenshot with WKWebView contains a playing video. I tried many ways, it works well in Simulator, but on device the video's content is not captured.
Simulator:
Device:
I tried the following ways:
CALayer#render
let window = UIApplication.shared.windows.first { $0.isKeyWindow }
if window == nil { return }
let layer = window!.layer
let screenRect = window!.screen.bounds
UIGraphicsBeginImageContext(screenRect.size)
let ctx:CGContext = UIGraphicsGetCurrentContext()!
layer.render(in: ctx)
self.screenShotImage = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
and
UIView#drawHierarchy
let window = UIApplication.shared.windows.first { $0.isKeyWindow }
if window == nil { return }
UIGraphicsBeginImageContextWithOptions(window!.frame.size, false, 0)
window!.drawHierarchy(in: window!.frame, afterScreenUpdates: true)
self.screenShotImage = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
and
WKWebView#takeSnapshot
let config = WKSnapshotConfiguration()
config.rect = WKWebViewHolder.webView!.frame
config.afterScreenUpdates = false
webView.takeSnapshot(with: config, completionHandler: { (image: UIImage?, error: Error?) in
if error != nil {
return
}
self.screenShotImage = image
})
What should I do? 🤔