I'm trying to push a SwiftUI view from UIKit using UIHostingController. In the new view there is a button in the right side of the navigation bar, but it pops after the push animation. I can't make it appear with an animation like in a normal UIViewController.
I tried adding the button in the navigationItem of the hosting controller and in the toolbar of the SwiftUI but none gives a smooth animation.
I've made a small test and this are the results.
This is the code:
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
title = "Home"
}
@IBAction func buttonNavPressed(_ sender: Any) {
let vc = UIHostingController(rootView: ContentView())
vc.navigationItem.title = "NavItem Button"
vc.navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .action, target: self, action: #selector(sayHello))
navigationController?.pushViewController(vc, animated: true)
}
@IBAction func buttonSwiftUIPressed(_ sender: Any) {
let vc = UIHostingController(rootView: ContentViewWithButton())
navigationController?.pushViewController(vc, animated: true)
}
@objc func sayHello() {
print("Hello")
}
}
struct ContentView: View {
var body: some View {
Text("No button")
}
}
struct ContentViewWithButton: View {
var body: some View {
Text("With button")
.navigationTitle("SwuitUI W Button")
.toolbar {
ToolbarItem(placement: .topBarTrailing) {
Button(action: { print("Hello") },
label: { Image(systemName: "camera") }
)
}
}
}
}
There is any workaround to this problem?
UIKit
RSS for tagConstruct and manage graphical, event-driven user interfaces for iOS or tvOS apps using UIKit.
Posts under UIKit tag
200 Posts
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
My app's top crash is a mysterious one and I can't seem to figure it out. It always crashes on
_objc_fatalv(unsigned long long, unsigned long long, char const*, char*)
But the stack traces include a few different possible culprits like
NavigationBridge_PhoneTV.pushTarget(isDetail:)
UIKitNavigationBridge.update(environment:)
ViewRendererHost.updateGraph()
UIScrollView(SwiftUI) _swiftui_adjustsContentInsetWhenScrollDisabled
Crash reports here:
2024-12-02_21-37-21.7864_-0600-1e78918e5586309b96a1c2986ff722778dec8a77.crash
2024-12-02_19-18-29.1251_-0500-a2fc5513683cd647b4adbbe03cc59e4a09237b5f.crash
2024-12-01_11-59-09.8888_-0500-9eb224ab3d37e76d0b966ea83473f584ac3bbe18.crash
2024-11-28_17-17-38.4808_+0100-46208989f016fbefd16c30873a88c2ef61dd91a1.crash
Hopefully someone here can shed some light. For context we use a lot of UIHostingController's to bridge our SwiftUI views.
My xamarin application running fine in iOS 17 and below versions. but in iOS 18 and above when I open application and then when I use it for few min it gets crashed automatically and does not even show any crash report in mobile. When I checked the console logs in XCode then I found out that One error is logging more than 700 times in a sec. that is why the application is crashing. I will attach the error below.
Modifying properties of a view's layer off the main thread is not allowed: view <Xamarin_Forms_Platform_iOS_FrameRenderer: 0x7f9605e5e7a0> with nearest ancestor view controller <Xamarin_Forms_Platform_iOS_GroupableItemsViewController_1: 0x7f9605f96dc0>; backtrace:
(
0 UIKitCore 0x0000000152d29c00 -[UIView(UIKitManual) _raiseExceptionForBackgroundThreadLayerPropertyModification] + 453
1 UIKitCore 0x0000000152d2a188 -[UIView(UIKitManual) actionForLayer:forKey:] + 609
2 QuartzCore 0x0000000126f731da -[CALayer actionForKey:] + 151
3 QuartzCore 0x0000000126f7a425 ZN2CA5Layer12begin_changeEPNS_11TransactionEjP11objc_objectRS4 + 199
4 QuartzCore 0x0000000126f7ead8 _ZN2CA5Layer6setterEj12_CAValueTypePKv + 974
5 QuartzCore 0x0000000126f727e9 -[CALayer setOpacity:] + 49
6 Leadrat.Mobile.Forms.iOS 0x0000000101122fc9 xamarin_dyn_objc_msgSend + 217
7 ??? 0x00000001a315f176 0x0 + 7031091574
8 ??? 0x00000001b312d0bb 0x0 + 7299322043
9 ??? 0x000000019d76712b 0x0 + 6936752427
10 Mono 0x000000010b9b70b5 mono_jit_runtime_invoke + 1621
11 Mono 0x000000010bbac1e8 mono_runtime_invoke_checked + 136
12 Mono 0x000000010bbb1c9d mono_runtime_delegate_try_invoke + 157
13 Mono 0x000000010bbd0957 start_wrapper_internal + 647
14 Mono 0x000000010bbd06ae start_wrapper + 62
15 libsystem_pthread.dylib 0x000000012a21018b _pthread_start + 99
16 libsystem_pthread.dylib 0x000000012a20bae3 thread_start + 15
Hi community.
I am trying to adopt my first person shooter iOS game for running on MacOS environment.
I need to lock the pointer when I enter battle mode, and unlock in lobby.
On iOS all works fine (with mouse and keyboard) - pointer locks and unlocks according to my commands.
However, on MacOS I faced the following behavior:
after switching the pointer lock state and setNeedsUpdateOfPrefersPointerLocked invocation, the pointer does not locked immediately. To enable pointer lock, the user must click in the window.
I checked the criteria listed in documentation: I do have fullscreen mode, I monitor UISceneActivationState and can confirm it is UISceneActivationStateForegroundActive, I do not use MacCatalyst (it is disabled in app's capabilities). However pointer locks only after click on window, which is weird.
Can someone confirm that this is the exact behaviour as designed by Apple developers, or am I doing anything wrong.
I have read the note:
"Bringing an app built with Mac Catalyst to the foreground doesn’t immediately enable pointer lock. To enable pointer lock, the user must click in the window. To exit pointer lock, users can use Command-tab to switch to another app, or using Command-tilde.", but again, I don't use MacCatalyst.
Any hints are highly appreciated!
Best regards.
refs:
https://developer.apple.com/documentation/apple-silicon/running-your-ios-apps-in-macos
https://developer.apple.com/documentation/uikit/uiviewcontroller/3601235-preferspointerlocked?language=objc
Hello,
I’ve encountered a warning while working with UITableViewDiffableDataSource. Here’s the exact message:
Warning: applying updates in a non-thread confined manner is dangerous and can lead to deadlocks. Please always submit updates either always on the main queue or always off the main queue - view=<UITableView: 0x7fd79192e200; frame = (0 0; 375 667); clipsToBounds = YES; autoresize = W+H; gestureRecognizers = <NSArray: 0x600003f3c9f0>; backgroundColor = <UIDynamicProviderColor: 0x60000319bf80; provider = <NSMallocBlock: 0x600003f0ce70>>; layer = <CALayer: 0x6000036e8fa0>; contentOffset: {0, -116}; contentSize: {375, 20}; adjustedContentInset: {116, 0, 49, 0}; dataSource: <TtGC5UIKit29UITableViewDiffableDataSourceOC17ArticleManagement21DiscardItemsViewModel17SectionIdentifierSS: 0x600003228270>>
OS: iOS Version: iOS 17+,
Xcode Version: 16.0,
Frameworks: UIKit, Diffable Data Source,
View: UITableView used with a UITableViewDiffableDataSource.
Steps to Reproduce:
Using a diffable data source with a table view.
Applying snapshot updates in the data source from a main thread.
Warning occurs intermittently during snapshot application.
Expected Behavior:
The snapshot should apply without warnings, provided the updates are on a main thread.
Actual Behavior:
The warning suggests thread safety issues when applying updates on non-thread-confined queues.
Questions:
Is there a recommended best practice to handle apply calls in diffable data sources with thread safety in mind?
Could this lead to potential deadlocks if not addressed?
Note :- I confirm I am always reloading / reconfiguring data source on main thread. Please find the attached screenshots for the reference.
Any guidance or clarification would be greatly appreciated!
[[PHPhotoLibrary sharedPhotoLibrary] presentLimitedLibraryPickerFromViewController:self];弹出照片选择器时,导航栏背景颜色和导航栏字体颜色均为白色,导致无法辨认。
使用
[[UINavigationBar appearanceWhenContainedInInstancesOfClasses:@[UIImagePickerController.class]] setTintColor:[UIColor blackColor]];没有作用
Hi,
I am trying out the new UITabBar stuff in iOS18, and I don't think it'll be a good fit for my app. Is there a way to revert to the old iPad UITabBar look and placement that we've been using before? I don't want to make such a big change like this just yet, but I would need to make other changes to the app as well and I don't want to use the new UITabBar just yet. Is there a way to achieve this?
I belong to an EC shop application developers' team, and we got a crame from a small part of our customers about our application.
"Search Bar does not work on iOS 18."
This bug doesn't appear on most of our devices updated to iOS 18.0.
In some cases, it disappeared by turning [Settings > Accessibility > Touch > Reachability] off.
But it is not the same for all customers found the bug.
I'm looking for how to fix this bug, and why it happens.
I'm not sure but I doubt that this may be a bug of iOS18, UIKit, RxCocoa, RxSwift, or something else.
Any information would be welcome.
import UIKit
import RxSwift
import RxCocoa
@IBDesignable
public final class SearchBar: UISearchBar {
var textField: UITextField {
if #available(iOS 13.0, *) {
return searchTextField
} else {
return value(forKey: "_searchField") as! UITextField
}
}
private let disposeBag = DisposeBag()
private func bind() {
textField.rx.isFirstResponder
.bind(to: Binder(self) { me, isFirstResponder in
// This doesn't work in some iOS 18 devices.
me.textField.attributedPlaceholder = placeholderAttributedString(isFirstResponder: isFirstResponder)
me.textField.backgroundColor = isFirstResponder ? Asset.Colors.whiteTwo.color : .white
if me.useCancelButton {
me.showsCancelButton = isFirstResponder
}
if me.useBookmarkButton {
me.showsBookmarkButton = !isFirstResponder
}
})
.disposed(by: disposeBag)
}
public override init(frame: CGRect) {
super.init(frame: frame)
commonInit()
}
public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
public override func awakeFromNib() {
super.awakeFromNib()
commonInit()
}
public override func prepareForInterfaceBuilder() {
super.prepareForInterfaceBuilder()
commonInit()
}
private func commonInit() {
bind()
}
}
extension Reactive where Base: SearchBar {}
import UIKit
import RxSwift
import RxCocoa
@IBDesignable
public final class SearchHeaderView: UIView {
@IBOutlet private weak var searchBar: SearchBar!
@IBOutlet private weak var cartContainerView: UIView!
private let disposeBag = DisposeBag()
public override init(frame: CGRect) {
super.init(frame: frame)
loadFromNib()
commonInit()
}
public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
public override func awakeFromNib() {
super.awakeFromNib()
loadFromNib()
commonInit()
}
public override func prepareForInterfaceBuilder() {
super.prepareForInterfaceBuilder()
loadFromNib()
commonInit()
}
private func commonInit() {
bind()
}
private func bind() {
// ↓ This doesn't work in some iOS 18 devices.
searchBar.textField.rx.isFirstResponder
.bind(to: cartContainerView.rx.isHidden)
.disposed(by: disposeBag)
}
}
extension SearchAndCartHeaderView: NibOwnerLoadable {}
I am working on a sticker app and I am building a custom sticker app in SwiftUI. I have created a custom UIViewRepresentable to allow a MSStickerView to be displayed in SwiftUI. I have local *.gif files in my project and I am loading them into the MSStickerView successfully, however when they are loaded in my iMessage sticker extension the stickers are not animating by default. When I tap on the MSStickerView the gif begins to animate, I'm not sure what else I can do to get this working properly in my app. Some sample code below:
public struct CustomStickerView: UIViewRepresentable {
var sticker: CustomSticker
public init(sticker: CustomSticker) {
self.sticker = sticker
}
public func makeUIView(context: Context) -> MSStickerView {
let v = MSStickerView()
if sticker.fileType == .gif {
v.startAnimating()
}
return v
}
public func updateUIView(_ uiView: MSStickerView, context: Context) {
uiView.sticker = sticker.sticker
}
}
// CustomSticker
public var sticker: MSSticker? {
guard let imagePath = Bundle.main.path(forResource: name, ofType: ".\(fileType.rawValue)") else {
print("Failed to get sticker - \(name).\(fileType.rawValue)")
return nil
}
let path = URL(fileURLWithPath: imagePath)
return try? MSSticker(contentsOfFileURL: path, localizedDescription: name)
}
(Also have a case ID, 9879068)
We have an app that user use to check in/out from work for example. We have a button in-app do do this. Now I'm trying to add buttons to our widgets and our new live activity so that users don't have to open the app.
It's crucial that the live activity and widgets always show the exact same state.
Otherwise it'll look pretty bad if a user has both a live activity and a widget showin at the same time.
However, we have noticed that sometimes, pressing the button in the live activity, running the app intent, will not always make the widget update (we call reloadAllTimelines()). The other way around, i.e. press the button on widget to update live activity always works. (they both call the same app intent)
When running it in debug mode on a phone from Xcode, it always works, but when running it just on the phone it's unreliable.
My first thought was, of course, that's related to the widget "budget", but according to the docs HERE, it should not be applied when interacting with a widget, calling an app intent.
My question: HOW can I make my widget reliably refresh using an app intent invoked from a live activity??
I have a ready small project with simple buttons and trace labels that display this issue that I'm happy to supply to someone.
I'm building a custom camera screen that displays the camera image on a preview layer and then captures an image, using AVCaptureSession. When the picture is captured, I immediately load it into a UIImageView in order to display it to the user for approval.
I've actually done this many times before, but this is the first time I've tried to do it in an app that supports interface rotation. If I hold the phone in Portrait mode and capture a picture, everything works as expected.
When the user rotates the phone into Landscape orientation, I detect this and I replace the preview layer (AVCaptureVideoPreviewLayer) with a new one, specifying connection.videoRotationAngle in order to make the image appear in the right orientation. I'm a little surprised that this is necessary, and it's not a smooth transition, but that doesn't matter.
What does matter is that when I capture the image, it is in the wrong orientation. I tried rotating it myself, but this doesn't seem to make any difference. What am I doing wrong?
Hi all,
I’ve been facing a behavior issue with shouldAutomaticallyForwardAppearanceMethods in UITabBarController. According to Apple’s documentation, this property should default to YES, which means that the appearance lifecycle methods (like viewWillAppear and viewDidAppear) should be automatically forwarded to child view controllers.
However, in my current development environment, I’ve noticed that shouldAutomaticallyForwardAppearanceMethods returns NO by default in UITabBarController, and this is causing some issues with lifecycle management in my app. I even tested this behavior in several projects, both in Swift and Objective-C, and the result is consistent.
Here are some details about my setup:
I’m using Xcode 16.0 with iOS 16.4 Simulator.
I’ve tested the behavior in both a new UIKit project and a simple SwiftUI project that uses a UITabBarController.
Even with a clean new project, the value of shouldAutomaticallyForwardAppearanceMethods is NO by default.
This behavior contradicts the official documentation, which states that it should be YES by default. Could someone clarify if this is expected behavior in newer versions of iOS or if there is a known issue regarding this?
Any help or clarification would be greatly appreciated!
Thanks in advance!
I am trying to get my head around how to implement a MapKit view using UIViewRepresentable (I want the map to rotate to align with heading, which Map() can't handle yet to my knowledge). I am also playing with making my LocationManager an Actor and setting up a listener. But when combined with UIViewRepresentable this seems to create a rather convoluted data flow since the @State var of the vm needs to then be passed and bound in the UIViewRepresentable. And the listener having this for await location in await lm.$lastLocation.values seems at least like a code smell. That double await just feels wrong. But I am also new to Swift so perhaps what I have here actually is a good approach?
struct MapScreen: View {
@State private var vm = ViewModel()
var body: some View {
VStack {
MapView(vm: $vm)
}
.task {
vm.startWalk()
}
}
}
extension MapScreen {
@Observable
final class ViewModel {
private var lm = LocationManager()
private var listenerTask: Task<Void, Never>?
var course: Double = 0.0
var location: CLLocation?
func startWalk() {
Task {
await lm.startLocationUpdates()
}
listenerTask = Task {
for await location in await lm.$lastLocation.values {
await MainActor.run {
if let location {
withAnimation {
self.location = location
self.course = location.course
}
}
}
}
}
Logger.map.info("started Walk")
}
}
struct MapView: UIViewRepresentable {
@Binding var vm: ViewModel
func makeCoordinator() -> Coordinator {
Coordinator(parent: self)
}
func makeUIView(context: Context) -> MKMapView {
let view = MKMapView()
view.delegate = context.coordinator
view.preferredConfiguration = MKHybridMapConfiguration()
return view
}
func updateUIView(_ view: MKMapView, context: Context) {
context.coordinator.parent = self
if let coordinate = vm.location?.coordinate {
if view.centerCoordinate != coordinate {
view.centerCoordinate = coordinate
}
}
}
}
class Coordinator: NSObject, MKMapViewDelegate {
var parent: MapView
init(parent: MapView) {
self.parent = parent
}
}
}
actor LocationManager{
private let clManager = CLLocationManager()
private(set) var isAuthorized: Bool = false
private var backgroundActivity: CLBackgroundActivitySession?
private var updateTask: Task<Void, Never>?
@Published var lastLocation: CLLocation?
func startLocationUpdates() {
updateTask = Task {
do {
backgroundActivity = CLBackgroundActivitySession()
let updates = CLLocationUpdate.liveUpdates()
for try await update in updates {
if let location = update.location {
lastLocation = location
}
}
} catch {
Logger.location.error("\(error.localizedDescription)")
}
}
}
func stopLocationUpdates() {
updateTask?.cancel()
updateTask = nil
}
func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) {
switch clManager.authorizationStatus {
case .authorizedAlways, .authorizedWhenInUse:
isAuthorized = true
// clManager.requestLocation() // ??
case .notDetermined:
isAuthorized = false
clManager.requestWhenInUseAuthorization()
case .denied:
isAuthorized = false
Logger.location.error("Access Denied")
case .restricted:
Logger.location.error("Access Restricted")
@unknown default:
let statusString = clManager.authorizationStatus.rawValue
Logger.location.warning("Unknown Access status not handled: \(statusString)")
}
}
func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) {
Logger.location.error("\(error.localizedDescription)")
}
}
Some crashes were found, not many, but we could not locate the specific code because the error stack is a systematic method.
Error:
NSInternalInconsistencyException
Failed to create remote render context
Stack:
0 CoreFoundation 0x000000018a879d78 ___exceptionPreprocess + 220
1 libobjc.A.dylib 0x00000001a34de734 _objc_exception_throw + 60
2 Foundation 0x000000018c0ff358 -[NSMutableDictionary(NSMutableDictionary) initWithContentsOfFile:] + 0
3 UIKitCore 0x000000018d475f8c ___UIKIT_DID_NOT_RECEIVE_A_REMOTE_CACONTEXT_FROM_COREANIMATION_INDICATING_A_POSSIBLE_BACKBOARDD_CRASH + 572
4 UIKitCore 0x000000018d232484 ___UIKIT_IS_REQUESTING_A_CACONTEXT_FROM_COREANIMATION + 80
5 UIKitCore 0x000000018d1fc32c +[_UIContextBinder createContextForBindable:withSubstrate:] + 708
6 UIKitCore 0x000000018d13bdec -[_UIContextBinder _contextForBindable:] + 148
7 UIKitCore 0x000000018cf5bd20 -[_UIContextBinder updateBindableOrderWithTest:force:] + 480
8 UIKitCore 0x000000018d2e1200 -[_UIContextBinder createContextsWithTest:creationAction:] + 92
9 UIKitCore 0x000000018ccd64c0 -[UIWindowScene _prepareForResume] + 156
10 UIKitCore 0x000000018ce2ef80 -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 876
11 UIKitCore 0x000000018ce72528 -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 288
12 UIKitCore 0x000000018cdfc8c8 -[UIApplicationSceneClientAgent scene:handleEvent:withCompletion:] + 476
13 FrontBoardServices 0x000000019c9dbe18 -[FBSScene updater:didUpdateSettings:withDiff:transitionContext:completion:] + 528
14 FrontBoardServices 0x000000019c9f413c ___94-[FBSWorkspaceScenesClient _queue_updateScene:withSettings:diff:transitionContext:completion:]_block_invoke_2 + 152
15 FrontBoardServices 0x000000019c9d9308 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 240
16 FrontBoardServices 0x000000019c9df824 ___94-[FBSWorkspaceScenesClient _queue_updateScene:withSettings:diff:transitionContext:completion:]_block_invoke + 396
17 libdispatch.dylib 0x000000018a4e0a2c __dispatch_client_callout + 20
18 libdispatch.dylib 0x000000018a4e44e0 __dispatch_block_invoke_direct + 264
19 FrontBoardServices 0x000000019c9dac70 ___FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 48
20 FrontBoardServices 0x000000019c9da040 -[FBSSerialQueue _targetQueue_performNextIfPossible] + 220
21 FrontBoardServices 0x000000019c9de700 -[FBSSerialQueue _performNextFromRunLoopSource] + 28
22 CoreFoundation 0x000000018a89bf04 ___CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
23 CoreFoundation 0x000000018a8acc90 ___CFRunLoopDoSource0 + 208
24 CoreFoundation 0x000000018a7e6184 ___CFRunLoopDoSources0 + 268
25 CoreFoundation 0x000000018a7ebb4c ___CFRunLoopRun + 828
26 CoreFoundation 0x000000018a7ff6b8 _CFRunLoopRunSpecific + 600
27 GraphicsServices 0x00000001a6899374 _GSEventRunModal + 164
28 UIKitCore 0x000000018d164e88 -[UIApplication _run] + 1100
29 UIKitCore 0x000000018cee65ec _UIApplicationMain + 364
30 ??? 0x00000001059b9ce4 0x00000001059b9ce4 + 0
These crashes occurred when the App was about to enter the foreground.
(UIApplicationWillEnterForegroundNotification)
These crashes occurred on systems from 15 to 18.
crash.log
We have been trying to migrate screens that were developed using UITool Kit to SwiftUI. In the process we have some screens that have SwiftUI embedded inside the UITool kit view. Our developers have defined accessibility ids for all elements in these views and these are inspectable using the native iOS xcode inspector. However when i try inspecting it with the appium inspector i get an empty list with no elements in the hierarchy tree. Attaching a screenshot of the element when inspecting through the native xcode accessibility inspector,
Attaching a screenshot of the same screen when inspected through the appium inspector,
Also tried printing the XCTest UI dump using appium method,
`driver().executeScript("mobile:source", Map.ofEntries(Map.entry("format","description")))
The UI tree i get is the same that i get when inspecting through the appium inspector.
Requesting support from the Apple team based on this ticket, [https://github.com/appium/appium/issues/20759)
Problem
Our app use UIPasteControl for people taps to place pasteboard contents in UITextView.
It worked fine at first, but recently received a lot of user feedback and the button suddenly disappeared
This problem usually occurs when an App switches between the front and back
More Information
When the button disappears, we find that the child view of the UIPasteControl control which name _UISlotView has a size of zero.
we use UIKit and AutoLayout,limit button size (100, 36)
let config = UIPasteControl.Configuration()
config.displayMode = .labelOnly
config.cornerStyle = .fixed
config.baseForegroundColor = .white
config.baseBackgroundColor = .black
config.cornerRadius = 18
let btn = UIPasteControl(configuration: config)
pasteBtn = btn
addSubview(pasteBtn)
pasteBtn.snp.makeConstraints { make in
make.trailing.equalTo(-20)
make.bottom.equalTo(-10)
make.size.equalTo(CGSize(width: 100, height: 36))
}
UI view information
<UIPasteControl: 0x107dda810; frame = (0 0; 100 36); layer = <CALayer: 0x3010ff000>>
(lldb) po [0x107dda810 subviews]
<__NSSingleObjectArrayI 0x30152ff00>(
<_UISlotView: 0x107dea630; frame = (0 0; 100 36); userInteractionEnabled = NO; layer = <CALayer: 0x3010eb460>>
)
anyone meet before? is there a workaround?
I want to support Genmoji input in my SwiftUI TextField or TextEditor, but looking around, it seems there's no SwiftUI only way to do it?
If none, it's kind of disappointing that they're saying SwiftUI is the path forward, but not updating it with support for new technologies.
Going back, does this mean we can only support Genmoji through UITextField and UIViewRepresentable? or there more direct options?
Btw, I'm also using SwiftData for storage.
I have an iOS App which looks great on iPhone, portrait only, which makes a lot of use of UITableViews.
On iPad those tables look stretched out in Landscape.
On MacOS with Apple Silicon the app can be resized to any size and the table views look very stretched. There are views in the App which users want to resize so limiting app size not an option.
I've been modifying the app's table views to limit their width and centre them using constraints.
This isn't easy, it's a lot of work as UITableViewController doesn't allow for constraining the table width. Or does it?
So I've changed them to UIViewControllers with UITableView imbedded in the root UIView with constraints. Looks really nice.
Now I've just run into the limitation that static tables, which I have a number of, aren't allowed to be embedded. So how can I limit the width of them?
I really don't want to add a lot of dynamic code.
Please tell me there's an simpler, more elegant method to what really makes a much more aesthetically pleasing UI on iOS App running on iPad and MacOS?
TIA!
Does anyone know how battery state notification (UIDevice.batteryStateDidChangeNotification) is supposed to work regarding app foreground/background state?
Assume there is no other reason why the app is running in the background. I have enabled UIDevice.current.isBatteryMonitoringEnabled when the app was in the foreground. What should happen if the external power is later connected or removed when the app is in the background? The docs don't mention this.
Possibilities include
I don't get a notification, so I should check the state myself when the app next comes to the foreground.
I'll get a notification when the app next comes to the foreground, if the state changed while it was in the background.
The app will be woken up in the background to receive the notification.
The app will be kept running in the background while isBatteryMonitoringEnabled is true.
It looks as if it's doing either 3 or 4, which I find a bit surprising. But is this influenced by the fact that it's connected (wirelessly) to the debugger?
I have an iPad app, written in objective-c and distributed through Enterprise developer, as it is not for public use but specific to some large companies.
The app has a local database and works offline
For some functions of the app I need to display images (not edit or cut them, just display them)
Right now there is integrated MWPhotoBrowser viewer, which has not been maintained for almost 10 years, so in addition to warnings in compilation I have to fight with some historical bugs especially on high resolution images. https://github.com/mwaterfall/MWPhotoBrowser
Do you know of a modern and maintained OFFLINE photo viewer? I evaluate both free and paid (maybe an SDK). My needs are very basic
I have found this one https://github.com/TimOliver/TOCropViewController, but I need to disable the photos edit features and especially I would lose the useful feature of displaying multiple images (mwphoto for multiple images showed a gallery)