Category "uikit"

Can't reset UILabel attributedText when a UITableViewCell is reused

The problem I'm using a UITableView to show the list of transactions of a credit card. If the transaction is a chargeback, I'm adding a strikethrough style to

How to generate a dynamic light/dark mode UIImage from Core Graphics?

iOS 13 introduced UIImage instances that auto-adopt to the current UIUserInterfaceStyle (aka light or dark mode). However, there seem to be only methods to cons

NSUnknownKeyException for a UIButton. Correctly added referencing outlets and corresponding function

I am facing an NSUnknownKeyException for a back button present on a Storyboard, i.e. FastGazeExtension. I have correctly connected the back button to the UIButt

Deleting and inserting a row in a table?

I am following some swift tutorials and I have been noticing that sometimes it's enough to use the array and append/remove but sometimes you have to also add in

Any way to keep gradient attached at top when scrolling?

I have a scroll view attached to superview(not safe area) and inside it there is a gradient filled view at top. However when i swipe up, the gradient gets pulle

UITextView cutting off last line of text

I am trying to render out a UITextView within a UITableViewCell. For some reason the last line of my text is being cut off. I have followed numerous posts on h

How to change icon color in UIAction inside UIMenu? [duplicate]

Trying to change icon color in UIAction but changing tint does not seem to work at all. Any idea? let imageView = UIImage(systemName: "eye")!

Keyboard's globe button (🌐) was disappeared, iOS 15

when updated to iOS 15 , my app got this issue. Keyboard's globe button (🌐 at left bottom corner) was disappeared, but we could click it. Does anyone ha

my app crash in uikit ,only happen on IPhone X and above exception name NSInternalInconsistencyException

Failed to load bounding path bitmap data from the asset manager for asset name: BoundingPathBitmap-1125x2436-375x812-3.00x The crash happen on the viewcontroll

Open UIDatePicker programmatically in iOS 14

I have this normal UIDatePicker (sorry that it's not in English, please ignore that): But the problem is that it only appears when I'm pressing the Date Picker

UIStepper - start counting from 1

I have successfully implemented core data and UISteppers. Every time I try to edit a saved record the UI Stepper starts over from 0. Please help me to figure pu

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: {