5,665 questions
0
votes
0
answers
64
views
Nested Tableview inside CollectionView not loading from first index
The problem is I have a Parent TableView and Inside Tableview I have a CollectionView and Inside collection I have another Tableview for each Cell.My Problem is I am not able to load first 0th item of ...
1
vote
0
answers
463
views
Face comparison of two images using Tensorflow Lite and Google ML Kit library
I am trying to compare 2 images , I cropped face from images now I want to compare them
But below codes have errors , unable to fix it, Please help,
Below is my code which I am trying to compare faces ...
1
vote
0
answers
237
views
Tried to implement the TLS/SSL connection from TCP connection in Swift 4 using Network library
Currently, We are developing a MacOS application and the app can connect successfully to a server "X.X.X.X:YYYY" with default TCP Option and none TLS by NWConnection.
Note: the host name ...
0
votes
1
answer
266
views
Is it possible to make 2 subviews with same z index?
I am looking to create a water fill effect into a shape and am using WaveViewAnimation project.
I want to allow the user to press on different buttons to create different colour waves to fill the ...
0
votes
1
answer
102
views
How to Make array of username clickable in UI Label each username should redirect to another page without using @, # , I want every username clickable
If I click on the first username "Kelly Kapoor" it should redirect to another page and when I click on the second username "Jim Halpert" it should redirect to another page.
I've ...
-1
votes
2
answers
515
views
How to check enum in same value using switch in swift
I'm kinda block for this scenario , I have a enum which have the same value now the question here is that they have different usecases how can I put a condition for this to case in switch:
supposed I ...
1
vote
0
answers
114
views
Swift 5 very random and hardly identifiable crashes
My crash log from firebase unfortunately doesnt really help me finding a solution to my issue.
Crashed: com.apple.main-thread
0 MyApp 0x94d30 PostsAPI.loadNewestPosts(...
0
votes
0
answers
181
views
Crash in custom cell when leaving and re entering app
I have a weird crash which I cannot solve. I have a tableview which displays data which works just fine. When I leave the app and re enter it (without killing it) it sometimes (really seldom, like in ...
1
vote
1
answer
1k
views
Swift migration: 'Notification' is ambiguous for type lookup in this context' in some places
I'm making a migration from Swift 2.3 to Swift 5 with a lot of pain and well, I'm ending the migration but I'm still getting an error in some places of the code:
Notification' is ambiguous for type ...
0
votes
1
answer
723
views
UIApplication.keywindow ,must be used from main thread only warning
DispatchQueue.main.async {
}
This cause error in my Extension
How I use it
let topController = UIApplication.shared.topMostViewController()
0
votes
1
answer
72
views
Replace Gradient colors with ThemeSwift library (Library used for App Theme management)
How to use this library for gradient colors as they haven't mentioned the usage of gradient with ThemeAnyPicker in their documentation.
I am using plist method which is much easier way than the other ...
5
votes
0
answers
595
views
iOS 15 - UICollectionView disappear while scrolling only in iOS 15
this is the second time I posted here about this issue and no one could help me
my project was good in iOS 14 and previous versions when I debug my app on simulator or real device that have iOS 15 the ...
1
vote
0
answers
144
views
Create Long length Haptic in iWatch swift
Hi i am aware that apple does not allow us to create core haptic in iWatch instead it make us to use the default haptic it has. But the default haptics are of short length. Can I get help to know how ...
0
votes
2
answers
271
views
How to allow only single UIViewController to rotate upside down with Xcode?
In my app all screens have portrait orientation. How to allow only single UIViewController be in two orientation mode: portrait and upside down? When user rotates an iPhone, the UIViewController ...
3
votes
0
answers
201
views
How can I use old binary library TinyCrayon on latest iOS project?
I tried to use TinyCrayon in my new iOS project.
The library consists of a binary library framework. The link of the framework is dead in the TinyCrayon readme but it can be found here.
When I add the ...
0
votes
2
answers
615
views
how to put default value in fetch request predicate in coredata ios?
im working in ios swift, here i have used core data to store values and written some function to find the data and return it.
public func insertdetails (id:String, data:String, createdAt:String){
do{
...
0
votes
1
answer
2k
views
Swift generics issue: generic parameter could not be inferred
With this code:
public protocol LoginInfoBase: Decodable {
var access_token: String? { get }
var notifications: [PushNotification] { get }
}
public class ExampleLoginInfo: LoginInfoBase {
...
-2
votes
1
answer
197
views
Why does the large title not work when I use the Turkish character "ç"? [closed]
Why does the banner not work when I use the Turkish "ç" character?
I've tried everything, everything seems fine. But I only get such an error in the "ç" character, has anyone ...
2
votes
1
answer
1k
views
Unable to download PKpass from server
I've been trying several links to download pkpass from server but whenever i download it it shows me the size of file "0 kb", due to this i cannot convert it to pkpass data.
is there any ...
0
votes
1
answer
112
views
Xcode 12.5 NSCoding issue with SpriteKit/GameplayKit
I'm working on application using SpriteKit and I'm having trouble with NSCoding on a particular object (a GKComponent object). I'm using Swift 4.0 and iOS 11 in Build Settings. The application always ...
0
votes
2
answers
306
views
call a method from another class with required init coder
I have a class with a required init coder that I have a method I would like to call from another class. Im unsure how to instantiate this class.
first class I want to call
import UIKit
import ...
1
vote
0
answers
491
views
Edit saved data in Core data using swift
I am building an app in swift which has takes user details like Name, age, gender, picture, About me. I am saving all the data in core data and and displaying it in tableView. It also has a swipe to ...
1
vote
2
answers
1k
views
Reload tableview without scroll
I am new to swift
I want to reload my tableview so I used tableviewName.reloadData()
After this the table view is reloaded and scrolled a bit upwards but I want to stay where it is
Here is the code
...
0
votes
1
answer
853
views
Refresh Bearer Token and resume current API
I need to resume my WebService if my bearer token expire by http code 401 ,
below is my code.
When a 401 error occurs that means the Access Token has expired and I need to send a Refresh Token over ...
-1
votes
1
answer
405
views
Programmatically emptying UIStackView
I have a fairly simple code which, upon clicking a button, adds a randomly colored UIView to a UIStackView, and upon a different button click, removes a random UIView from the UIStackView.
Here's the ...
1
vote
3
answers
1k
views
Array with multiple values per index?
I'm learning swift, and I do the sololearn course to get some knowledge, but I bumped into something that I don't understand.
It is about modifying an array's values. The questionable part states the ...
12
votes
1
answer
565
views
Tapping on a video in a table view cell to open it in a view controller
tl;dr I'm trying to recreate this in the Twitter app: https://i.imgur.com/173CVyM.mp4
As you can see, Twitter plays a video in the feed (table view cell) and when the video is tapped, the video ...
1
vote
1
answer
244
views
Text View placeholder being cut off
I have a custom UITextView that shows a placeholder, like so:
extension UITextView {
private class PlaceholderLabel: UILabel { }
private var placeholderLabel: PlaceholderLabel {
if ...
-1
votes
1
answer
112
views
Xcode Storyboard file displaying source control diff interface
When I click on my Storyboard file, I can't see the UI I made.
It's showing some code instead of my UI.
How can I see my Storyboard user interface?
0
votes
1
answer
177
views
Confused about async block inside loop
I want to print the data only after executing all loops inside the closure block, since I don't know how to use dispatch group exactly. I have tried in several ways.
What am I doing wrong here?
...
1
vote
1
answer
1k
views
Replace all line breaks with a space in a UITextView
I have a UITextView. I want to disable all line breaks in the text view, whether they're typed manually or if the user pastes text that contains line breaks, and replace each line break with a space (&...
0
votes
1
answer
134
views
Smaller button over a big button in swift
I am new to swift and iOS development. I have created a scroll view with table view cells and image views inside cells. Each Image view has a button with same constraints. I have a fixed button in the ...
5
votes
1
answer
2k
views
How to change UITextField size inside UIViewRepresentable in SwiftUI
I want to make a simple custom UITextField and I can't figure out how to set its height.
The problem is the UITextField expands to fill parent, and I realise I can set .frame() modifier on the ...
0
votes
0
answers
82
views
Click button to add additional text fields not working
I have a poll system where users are able to create polls. Each poll must have at least two options, with the ability to add up to four.
Right now, I have a collection view cell for each text field, ...
1
vote
2
answers
195
views
Deinit not calling - Cannot find why something is retaining (code provided)
I have discovered that my UIViewcontroller is not calling deinit() under the following scenario.
I am using this code extension to make my life easier by adding tap gesture recognizers.
https://gist....
0
votes
0
answers
90
views
Scheduled IOS local notifications repeat every minute
I have an IOS app that schedules a local notification on the day the app is opened, and every day at roughly the same time for the next 7 days. What happens is each notification is repeated the number ...
0
votes
2
answers
1k
views
Adding time from string into date object swift
I have a time coming from service in string form like so "12:30 PM".
I am able to get this time but I want to add this time in current date. like so
31/3/2021 12:30 PM
The current date is ...
0
votes
0
answers
738
views
Decoding Base64 in Swift Returns nil
I have been trying to implement Coinbase API in my application that is built using swift 5 and xcode. Whenever I try to convert this base64 encoded data to Normal string, it returns nil.
Here is the ...
-1
votes
1
answer
1k
views
SwiftUI simple Pop-Up Alert from a function in a class
I am a little confused, I try to display a pop-up in my View when my function is true otherwise continue but I do not understand how to do it I am lost between the different ways of doing. I tried ...
0
votes
0
answers
51
views
What is the safest way to create the coredata stack
In order to initiate the coredata stack in app delegate is not recommended as it will create issue in a multi threaded environment. Therefore, I created a separate class for coredata stack and then a ...
0
votes
0
answers
83
views
Change Button image from view controller inside custom header cell
I have a VC that is UICollectionView that has header. This header is a custom cell, and inside that cell there is an button with image which I need to change based on info from API or user tap.
In ...
2
votes
2
answers
3k
views
Swift base64 decode non alphabetic and non utf-8 strings
Is it possible to correctly decode using Swift language base64 encoded string which contains a string in non-utf8 encoding (ie. Windows-1252 or ISO-8859-1)?
Every snippet of code that can be found ...
0
votes
3
answers
754
views
How to give size to table view to XIB
I am new to iOS practicing XIB I have created an XIB for a cell
Now When I resize it from here I automatically change its behaviour in tableview I want to give this XIB with as 100% of tableview. I ...
0
votes
1
answer
751
views
Swift - Problem with scrollview (Need to print when dragging down)
I am testing the swiping controller/gesture from Jake Spracher with his SnapchatSwipeView (https://github.com/jakespracher/Snapchat-Swipe-View )
I have setup a topVC,leftVC,rightVC and middleVC(the ...
2
votes
1
answer
2k
views
Safe JSON Decoding. Still getting Key not found: No value associated with key'
IMGUR image search returns json:
{"data": [{
"title": "Family :)",
"images": [{
"title": null,
...
0
votes
2
answers
257
views
How to create model object for Imgur JSON | Swift
Imgur image search response has following structure (simplified) :
{ "data": [ {"title" : "Kittens",
"images" : [ { "title" : "&...
0
votes
1
answer
579
views
Beginner stuck with a problem with NSScreen.screens
I'm a beginner with swift and I'm learning as I go with a project for myself. Right now, I'm trying to make a "kiosk mode" window appear that maximizes to fill the entire screen while the ...
1
vote
0
answers
293
views
Navigation controller is nil after switching the rootviewcontroller
I have to change / switch rootviewcontroller to user home page when login is success.
But when I change rootviewcontroller here I can't navigate to another page from buttons inside home view ...
0
votes
1
answer
787
views
Can't initialize crashlytics in iOS
Followed all instructions showed in this video: https://www.youtube.com/watch?v=qFQLG1Hlzis
As well as all instructions that are shown here: https://firebase.google.com/docs/crashlytics/get-started
My ...
-2
votes
1
answer
75
views
Unable to Extract Data from the Dictionary<String, Any> in swift
I have a Dictionary<String, Any> Data in the following format. I need to extract the values from it.I am unable to extract the values, initially it looked to me as JSON but it's of type ...