Questions tagged swift

Explore the latest questions and answers asked by our top developers.

keyboard notification not called with small keyboard

In my code the notifications, that the keyboard will open/close are called normally when the keyboard is big. But as soon as is make it small, squishing the keyboard between to fingers, those notifications are not called anymore. Anybody having similar issues? let notificationCenter = NotificationCenter.default notificationCenter.addObserver(self, selector: #selector(self.keyboardWillBeShown(_:)), name: NSNotification.Name.UIKeyboardWillShow, object: nil) notificationCenter.addObserver(self, selector: […]

By Adarkas2302
Categorised as ios, keyboard, notifications, swift Tagged , , ,

PKPassLibrary not removing pass

I am implementing apple in-app provisioning and I am able to add a credit card to apple wallet via my app for iPhone and Watch. and I am able to get all these passes and work with them … but when I want to delete one of them nothing happened this is how I playing […]

By Luk lek
Categorised as apple-wallet, ios, ios-provisioning, passbook, swift Tagged , , , ,

How to Not fetch screenshots from Photos library iOS

I am trying to fetch Photos from Photo library and I want to show only images from the Photo Library. I do not want to show videos. I am using PHFetchOptions to fetch PHAssets from Photos library. Also I have provided a predicate to fetch only the photos. Below is my code: let allPhotosOptions = […]

By FE Tech
Categorised as ios, nspredicate, photokit, swift Tagged , , ,

Does creating an INImage from a URL work?

I would like to use INImage.init(url:) for displaying a user profile image in a notification. This initializer is documented with: A URL that specifies an image file on a remote server. The image file can be in any format supported by the system, but it is recommended that you use PNG images. However, as far […]

By Wil Gieseler
Categorised as ios, sirikit, swift Tagged , ,

In iOS 15, Soft hyphen is not working properly when using unicode character in UILabel

In iOS 15 soft hyphens (u{00AD}) are not considered when setting text on UILabel. for example: The following code does render the text with the soft hyphen correctly in iOS 13 & 14, but not in iOS 15. import UIKit class ViewController: UIViewController { @IBOutlet weak var label: UILabel! override func viewDidLoad() { super.viewDidLoad() label.text […]

By Renato Stauffer
Categorised as ios, ios15, soft-hyphen, swift, uilabel Tagged , , , , client automatically disconnecting in long Node.js function

I am using to communicate the swift client of my app with the server. Essentially, the client joins a socket connection upon opening the app and a job is instantly added to a Redis queue (it’s a job that takes anywhere from a few seconds to like 15ish seconds). There’s a response from the […]

By nickcoding2
Categorised as javascript, node.js, redis,, swift Tagged , , , ,

Why local notification is not firing for UNCalendarNotificationTrigger

The local notification is supposed to fire at 25-9-2021. Here is the print object of fire time ▿ year: 2021 month: 9 day: 26 isLeapMonth: false year : 2021 month : 9 day : 25 isLeapMonth : false let content = UNMutableNotificationContent() content.title = "Test title" content.body = "sample test body" var trigger:UNCalendarNotificationTrigger let n […]

Unexpected Combine Publisher Behavior

I’m building a mortgage calculator as an exercise to learn Combine. Everything has been going swimmingly until I encountered a situation where I’m not getting deterministic published output from one of my Publishers when I unit test it. I’m not making any asynchronous calls. This is the problematic AnyPublisher: public lazy var monthlyPayment: AnyPublisher<Double, Never> […]

By Adrian
Categorised as combine, publisher, swift Tagged , ,

MessageKit Collection View doesn’t display any cells after adding support for a custom cell`

I’ve read through the guide for creating a custom cell in MessageKit here, and SO questions like this I’m trying to create a custom cell; here’s my code for a cell that inherits from a UICollectionViewCell: import UIKit import MessageKit open class ChatReferenceCell: UICollectionViewCell { @IBOutlet weak var authorLabel: UILabel! @IBOutlet weak var referenceText: UITextView! […]

(Swift) upload Image to backend (Django Rest Framework) not working and Worked in (Postman) & (Admin Page)

Trying to Upload Image From Swift APP to Django backend with (DRF and Pillow ) class Profile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) bio = models.CharField(max_length=300, blank=True) user_img = models.ImageField(upload_to=’images/’, blank=True, null= True) def __str__(self): return self.user.username from django.urls import path from . import views urlpatterns = [ path(‘user’, views.PUser.as_view()), ] class PUser(APIView): def […]

1 26

Still Have Questions?

Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us