Category "uikit"

Google Places, Swift Package Manager & M1 Mac issues

I have students using Google Places AutoComplete with iOS UIKit and Swift. Students with M1 Macs still seem to not be able to use the simulator with this SDK an

Core Bluetooth. How can I check does peripheral already connect?

During development I got a problem witch related to the connection central and peripheral. When one of the central already connected with perepheral I have to d

How to add space and resize image for rightView of UITextField

I need to make this kind of text fields but I don't know how can I make spacing for rightView. Here is a code where I'm trying to set rightView image let i

UIKit automatically switch to another VC after launch screen appear

I'm trying to automatically switch from lauch screen to home screen after 3 sec. This is code in entry point view controller override func viewDidAppear

Animate a UILabel and UIButton within a single UIView.transition block?

I need to animate the change of the value of a UILabel and a UIButton's image property. I currently use two UIView.transition blocks which seem to work fine, bu

How to use a SwiftUI view in place of table view cell

How can I use a SwiftUI view struct in place of a traditional cell and xib in a UITableViewController? import UIKit import SwiftUI class MasterViewController:

iOS - Change UICollectionView layout to fill rows instead of columns

Is it possible to change the UICollectionView so that it fills the rows instead of the columns ? Here's an image explaining it : EDIT : It's an horizontal scro

How to detect current device using SwiftUI?

I am trying to determine whether the device being used is iPhone or iPad. Please see this question: Detect current device with UI_USER_INTERFACE_IDIOM() in Swi

Error Domain=SSZipArchiveErrorDomain Code=-1 "failed to open zip file" UserInfo={NSLocalizedDescription=failed to open zip file}

_ = try? SSZipArchive.unzipFile(atPath: filePath, toDestination: downloadPath.absoluteString!, overwrite: true, password: nil, progressHandler: {

Unable to hide the navigationBar when embedding SwiftUI in UIKit

I am trying to hide the navigationBar when putting some SwiftUI inside of a UIKit UIViewController: override func viewWillAppear(_ animated: Bool) { super.vi

Testing storyboard from within Swift Package

In the middle of factoring code from an app into a swift package and ran into a weird issue while adding test coverage. I reference the app's main storyboard in

Is there any way to swipe to delete/ Add actions into cell in UITableview Diffable datasource?

I am trying to add swipe actions into my tableview. when I used simple tableview datasource method it worked fine (trailingSwipeActionsConfigurationForRowAt). b

Can't select a folder with UIViewRepresentable & UIDocumentPicker

I'm trying to create a picker for a user to choose a folder in a SwiftUI app. However, there doesn't seem to be any SwiftUI document picker yet so I was attempt

How do you share a data model between a UIKit view controller and a SwiftUI view that it presents?

My data model property is declared in my table view controller, and the SwiftUI view is modally presented. I'd like the presented Form input to manipulate the d

UITextView.attributedText, How to set numberOflines and lineBreakMode?

In some condition I have to use UITextView instead of UILabel(To make link attributes clickable). Here is my code: let attributedString = NSMutableAttribut

Dismiss button in SwiftUI modal called from UIKit

I have got a SwiftUI modal view which I am calling from main UIKit view. I want to add a dismiss button to my modal view. As I can tell, there is no @State vari

UItextView delegate swift - textViewDidBeginEditing not called

I've seen the other topics dealing with UITextView delegate, but can't seem to find where my issue come from. Here is my code, but when I modify my UITextView,

I can't make extension convenience init for UIImage

I want to create UIImage(urlString: String?). There is no error when I run this code but it is not working. extension UIImage { convenience init?(urlString:

How can I apply a filters to ONE image?

I'm beginner in Swift and make an app "Photo Editor". I have a problem. I need to apply a some filters to ONE image. I have four sliders(sepia, contrast, bright

Self sizing collection view enters a recursive loop in iOS 15

I have a self sizing collection view and when I call super.layoutSubviews my app crashes since the collection view enters a recursive update loop. This was work