In Xcode 11.1, I created a 'README.md' markdown file, but it always renders as its raw text (yet font size changes depending on header level). For example, in Xcode's editor I see:# AppName
## Version
1.0Where the first line is in a larger font size than the lines 3 and 4.Anyhow, if I open up a project from Apple (e.g. BuildingCustomViewsInSwiftUI), it's README renders correctly.If I paste my project's contents into Apple's sample project README, it then renders a-ok. The reverse though (taking the contents from Apple's sample and pasting into my project; even dragging in the original project) won't render it (I then see all the markup symbols such as #.I've checked every possible setting between the two projects and cannot figure out why this is happening. The type of file (markdown), encoding, etc. are identical.However, one item I have noticed is that in Apple's sample project, when I view the README.md file, the Editor | Minimap menu choice is disabled and unchecked. Whereas in my project, the menu choice is enabled. Toggling that on/off though has no effect in my project.Thus, there must be some reason why Apple's sample has the Minimap option disabled. And my guess is this is the reason why Apple's sample in then rendering the markdown file correctliy in the editor.Anyone know how to fix this?Note: I also viewed the contents of the various files under the .xcodeproj package and couldn't find anything useful (i.e.. I was hoping to find some settings difference regarding the readme file, but couldn't find any).
Post
Replies
Boosts
Views
Activity
I'm beginning to wonder just how viable SwiftUI is for apps. Keep running into serious issues.
For example, I have several existing UIKit apps. All have the same exact about screen. I created a storyboard with the UI along with a view controller .swift file that can be added to all my projects via simple file reference.
In trying to do the same with SwiftUI, I created an AboutView.swift file that lives outside the project's folder hierarchy:
Common Views AboutView.swift
MyApp MyApp.xcodeproj Views (folder/file reference here for Common items)
...
In my app project, I just dragged in the dependent AboutView.swift file.
Xcode (12.4) refuses to generate a preview though for AboutView. Giving me "Cannot preview in this file - active scheme does not build this file". That is false, when adding AboutView to the project, I included it in the app and UITest targets.
If I copy AboutView into the project (now just another local source file specific to that project), previews work again. I refuse to have twelve copies of these shared files; one per project!
I also tried folder references (e.g. dragging in that Common folder above). Same issue.
Tried a workspace that contained my app project and a simple project with my common views. Same issue.
Didn't even try local packages due to those failing miserably for me (separate thread on this forum with all those issues).
Side note: Building and running the app works great, it shows my about screen.
How is one supposed to be able to create a SwiftUI view and shared it across two or more projects? Why can't these be previewed? Each of my apps Assets.xcassets contains a Logo asset that is used in the about screen, so would be nice to see it in a preview and not have to rely on running the app in the simulator or on a device.
Finally, I'm thinking that Xcode can only generate previews of SwiftUI views in a project IFF their files are direct decendents on the project file's main folder on disk. Is that true? If so, why?
I'm trying to rebasline my app to iOS 14. My app's main entry point for the UI is a tab view controller. Three of its four children are then split view controllers. I configured those to 'all visible'. On iPad, this shows both master/detail at all times and on iPhone, you get the collapsed behavior. Just like the Settings app.
Anyhow, I've removed the deprecations and migrated the split view controllers to use the new properties: Style of "Double Column", Display Mode of "One Column Beside", and Behavior of "Tile".
On iPad, the split view controllers will always be collapsed as if they are running on a compact device.
If I make a sample project with the same exact split view controller (along with its configuration as above), but make this SVC the main entry point of the app, all is well on both iPad and iPhone. Collapsed interface only happens on iPhone (compact).
But when I change the sample project to have the SVC now a child of a tab view controller, it breaks (always collapsed on all devices).
Why? Hoping this is a bug and not Apple changing the requirements of what a SVC can be placed inside of. No mention of that in the documentation; just states not to put a SVC inside a navigation controller which I'm not. If I can no longer do this, the entire UI and flow of my app is ruined.
A few days ago I used Xcode 14 Beta to gather some build timings for three of my projects. That went well. I then went back to using Xcode 13.4.1, but found that two of those three projects would immediately crash Xcode when I opened them.
Also started to have crashes in other projects when debugging (single clicks into the debugging panel or even trying to resize Xcode windows would crash it).
Deleting Xcode 14 and 13.4.1 and re-installing just 13.4.1 didn't fix the issue. Even after reboots and purging all Derived Data.
I'm now deleting anything developer related (e.g. /Library/Developer), going to reboot, install Xcode 13.4.1 fresh and hope for the best.
Earlier I also tried re-installing 13.4, but the same issues were experienced with that. Actually, after scrubbing my system, I may just go back to Xcode 13.3 and should that prove stable, then perhaps move to 13.4.x. I'm assuming that running Xcode 14 is what hosed my system and that it's not a fault of 13.x which I've used without issue prior.
Curious as to what others have done regarding iOS 16 developer mode where you need to, for now, keep on using Xcode 13.x I'm specifically speaking to the final release version of iOS 16.
Did you install Xcode 14 just to enable developer mode on those iOS 16 devices, then switch back to using Xcode 13? Can Xcode 13 install apps onto iOS 16 devices in this scenario?
Or, are we ultimately forced to use Xcode 14 once our devices are on iOS 16?
Thank you.
I'm rebaselining my apps to require iOS 14. As such, I'm moving completely to SwiftUI to include no longer using UIKit for the application delegate logic.
Previously, in my app delegate, I would use the appearance proxy APIs to set up tint colors for various bars, switches, etc. as well as to set the tint color on my main window. So all the app's UI to include buttons on alerts and action sheets, would be using my custom color.
In my SwiftUI app, I have filled in the color swatches for the AccentColor item in my xcassets file. I have all four swatches filled: light vs. dark, normal vs. high contrast.
This works perfectly for any view controller in my app. Navigation and tab bar elements, etc. all have my accent color. However, when presenting an alert or action sheet, they are using the default system blue colors.
I don't see any way to assign accent/tint colors directly to the alerts/action-sheets. Is this not possible?
Anyone successful in creating custom SF Symbols with Adobe Illustrator?
I've been starting with a variable template, and moving margins mostly works, but if I then attempt to center artwork, it leads the resultant SVG as not being usable by SF Symbols app.
Specifics... I want one of my apps that uses icons for table view cells, to switch over to SF symbols. For most, I could take advtange of an Apple-supplied one. However, due to each symbol having a different margins, this leads to textual content in the cells not all being aligned.
So I thought I would copy the symbols as all being custom, exporting as a variable template, and adjusting the margins in Illustrator such that all margins were the same.
I also just tried a trial of Sketch. And while that didn't mess up the SVG, the feature set is too limited for my needs.
One other thing I just tried in Illustrator was starting with a variable template, deleting all three symbols, adjusting the margins to be on integral pixel boundaries, and then centering a simple square path in each area. Importing back into SF symbols though shows my square non-centered.
It shouldn't be this difficult.
Logged in today to iTunes Connect and am greeted with a 'Get Started with iTunes Connect' page. Several icons (e.g. Apps). Clicking on Apps does nothing.
Opening a browser tab to developer.apple.com, then going into the Account section does bring up my account (already logged in). So the login above worked.
Anyone else seeing this?
I like SwiftUI overall and my minimum OS is now iOS 14 / iPadOS 14. Thus, I can use all of what SwiftUI currently has to offer.
However, I'm finding some missing pieces that are beginning to pile up. e.g. flashing the scroll indicators is not happening automatically, and I see no way to do so with any scrollable content (e.g. list). No way to specify the size of sheets (e.g. formSheet). And other issues.
Thus, before I invest too much time with SwiftUI rewrites, have others been successful with SwiftUI (say for small to medium sized apps)? Or are you sticking with UIKit, AppKit for now?
Are you finding similar missing items? Are those trivial though in your eyes, and you chose to just press forward with SwiftUI?
Re-doing my apps and using iOS/iPadOS 14 as the deployment.
I have not figured out how to get sheets to be of size formSheet. Seems that all sheets in SwiftUI are pageSheet which is too big for my apps.
Couldn't find any modifiers on sheet to change the presentation mode.
I've been trying all morning to get a trivial Swift package (local) working. I'm using macOS 11.2 with Xcode 12.4 on an iMac Pro.
In all cases, I'm left with a compile error of Module 'MyPackage' has no member named 'some symbol'.
Setup:
Simple iOS single view app.
Swift package with a simple Utility class with a static func named doWork that just prints a message.
I've of course imported my package in the app's file where I need to use the utility function.
What I've tried...
Created a standalone Swift Package first. Then, the app project and dragged the Swift Package into it.
As above but with a workspace instead of a project.
Started with just an app project. Created my Utility.swift file in that project. Then, created the Swift package and dragged that Utility.swift file into the package's main source folder. This is basically what is demoed in "Creating Swift Packages" (WWDC 2019). During the first part showing how to create a local package.
As with #3, but started with a workspace first.
Other issues I'm seeing...
For the cases where I start first with a package, then create a project and drag that project into it (always at the top-level), the package contents are hidden (no disclosure triangle). Closing the Xcode app project and re-opening now lets you view the package contents.
After adding the package as well as setting up a dependency to it in my app target settings, when compiling, it first errors on my import MyPackage line. A clean build resoves that issue, but even though the app source can definitely "see" the module now, all symbols within that module error (no member named).
Even fully resolving things fails. e.g. MyPackage.Utility.doWork()
At my day job, we have an app no longer in the store. But in iTunes Connect (App Connect), we still have an entry for it. For the sake of discussion, the name is "Foo" and has a bundle ID of a.b.cWe are creating a brand new app (so different bundle ID d.e.f) and want to re-use this "Foo" app name. Can we delete the original app in iTunes Connect, then add a new one with the same name?We don't want to simply re-use the existing app/bundleID since this new app is totally different and want to start anew with version 1.0.Anyone do something similar?I don't want to delete the original app only to find out we cannot re-use that name.Thank you.
I cannot rely upon the Mac App store for Xcode. All throughout the 11.x releases, those releases were added to the More section within 24 hours.
For 12.x, they don't show up; sometimes for several days. For 12.1 (released to Mac App Store on Oct 20th), it's still not available for download directly.
I've raised a ticket with Apple for 12.0 and now 12.1. 12.0 did get resolved, but I never heard back any response to my ticket.
So adding a note here just in case any Apple engineers can see about getting this download squared-away.
For reference: https://developer.apple.com/download/more/
With Xcode 11.x, I started to write code that taps into Apple's state restoration features. My apps don't yet use scene delegates and need to work on iOS 12, so just opted to use the iOS 12 set of APIs such as 'application(_:shouldSaveApplicationState:)'.I started out with a simple test by just implementing the shouldSave and shouldRestore functions in my app delegate. Both return 'true'. Then, for a learning exercise, I instrumented all the app delegate lifecycle APIs (e.g. willEnterForeground) as well as my view controller APIs (viewDidLoad, etc.). Also added the viewController APIs 'encode' and 'decode' functions that just called super and did some logging. Finally, in this simple tab view controller app with two tabs, I set restoration IDs in IB for all three view controllers (tab controller itself and its two children).When running the app in debug or release mode in the Simulator (iOS 13 runtime), all is well. If I suspend the app, it's definitely calling encode. Stopping the app and relaunching via Xcode then preserves which child view controller I had previously selected.When running the app on a device with iOS 13.2.2 via Xcode, things worked identically up to the point where I suspended the app (encode called). I force-quit the app on the device, but relaunching it didn't restore its state. The log output revealed that it never called the app delegate's shouldRestoreApplicationState. I also lauched the app directly on the device, but no matter what, it will not restore the last state if lauching it fresh.On top of this, In some other more advanced samples I wrote, I'm not happy with the NSCoder instance you're given in these callbacks. Their behavior is to trap (crashing your app) instead of generating errors to allow you to gracefully deal with corrupt data. And you cannot set the behavior at this point since that also traps (once a decoder object starts decoding the data, which Apple is obviously doing before calling your delegate API), you cannot switch to the 'generate errors' behavior. To remedy this, one should avoid using APIs such as encodeInteger since if you then call decodeInteger, that will trap if you have bad data. I ended up wrapping Int, Double, Bool in NSNumber and using the encode/decodeObject APIs will thankfully return nil if it cannot find an object for a certain key.Finally, even if the above simple scenario even worked, it seems to be a decent amount of work to code up both an iOS 12.x and 13.x solution. Thus, I'm going to roll my own solution. Just curious if others have had any success with Apple's APIs. Searching the forums brought up some old posts; some going unanswered.
I never rely upon the Mac app store and always want to grab the actual .xip files from the More downloads section.
The entire family of Xcode 11.x showed up there (11.0 through 11.7), but so far Xcode 12 (release) isn't there.