Questions tagged [swift4]

Use this tag only for questions directly related to changes in version 4 of Apple's Swift programming language. Use the tag [swift] for more general language questions, or the tags [ios], [cocoa], [apple-watch] etc. for questions about developing on Apple platforms.

Swift 4 is the fourth version of the Swift language developed by Apple that was released in 2017. The language is open source and available on Github (see ).

The development of Swift 4 and its goals can be viewed on the Swift Programming Language Evolution repository on GitHub.

5684 questions
1
vote
0 answers

How to get a specific value in firebase-realtime-database with where clause swift 4.0

How can I retrieve a result from the data where toid is equal to "-LzC6VYgURUZMHy_waYx" i used this func but it return nil func getpagechat(toid:String){ let mydatabase = FIRDatabase.database().reference().child("message") let query =…
1
vote
1 answer

Why does UILabel TapGesture only work after label initialization?

I have the following code to initialize a label: let forgotPasswordLabel: UILabel = { let label = UILabel() label.text = "Forgot password?" label.font = ApplicationScheme.instance.containerScheme.typographyScheme.subtitle1 …
uioporqwerty
  • 1,068
  • 3
  • 12
  • 30
1
vote
0 answers

Create PDF of whole UITableView for iOS version above 13.x

I am trying to create PDF from UITableView for sharing data to outside. Problem is what the code I have used is working great on device version below iOS 13 but on version above 13 it only render data which is on screen. Now I am expecting to render…
1
vote
1 answer

Why does array indexing in Swift not return an optional value?

When accessing a dictionary, such as [String:Any], the result type is Optional(Any). When indexing an array of [Any], the result type is Any, and the call can throw a fatal error. Is there any reason for this difference? It would be so nice to…
Rolf Locher
  • 163
  • 1
  • 13
1
vote
1 answer

Trying to make a wrapper for a property that should adjust a string

I have this code that I need to make reusable by other apps. This code shows messages where the localized app's name is present. So, I have localized strings like this: "DoYou" = "Do you really want to close $$$?"; "Quit" = "Quit $$$"; "Keep…
Duck
  • 34,902
  • 47
  • 248
  • 470
1
vote
0 answers

Stripe - PaymentOptionsViewController not loading

I currently have a working Stripe set up where the AddCardViewController is opened first and everything works. However, when I try to implement the PaymentSettingsViewController first and let user Add/Edit their cards, it won't load. I am using the…
Wolfgang
  • 132
  • 11
1
vote
1 answer

Google Maps different marker images for tapped and unselected state

is there a way to add an ID, a case or something similar, in order to set custom marker images for selected and unselected state? I have multiple markers with different names/title, and i need that a specific type of marker has another image for…
1
vote
0 answers

How can I make Alamofire requests progressively?

I have to send a POST request to a server with Alamofire but need to change the "id" in the body parameters every time that the previous api call has been completed. Here is what I did so far, but Alamofire makes 3 request, based on the number of…
1
vote
0 answers

Swift - register and re-register push notifications

Im trying to find a way to de-authorise users for push notifications when they log out from an app Ive found this function UIApplication.shared.unregisterForRemoteNotifications() which aparently works however I never see notifications being…
Kravitz
  • 2,769
  • 6
  • 26
  • 53
1
vote
1 answer

Swift Setting subclass UIButton ButtonType

I have a simple subclass of UIButton class IconButton: UIButton { init(type: FontAwesomeStyle, icon: FontAwesome, color: UIColor = .black, size: CGFloat = 20) { super.init(frame: CGRect.zero) let iconAsText =…
Ross Sullivan
  • 396
  • 1
  • 3
  • 13
1
vote
1 answer

Swift 5 How to get JSON multilayer data to append?

Please Help me, I am trying to get an array inside an array. Apply it to custom table view with headers and sections, headers is the first array, sections is the second. I added a comment in the line: print(subData.name), couldn't figure this out,…
1
vote
1 answer

Is it possible to change status bar height / y position?

I've seen an app wherein they can dynamically adjust their status bar height/y-position based on scroll-position. Here is a sample gif: https://gyazo.com/ec8e3fa336098305e6a5aedc68118789 Here is what I got override var prefersStatusBarHidden: Bool…
JohnG
  • 75
  • 10
1
vote
3 answers

Swift4: Delay for...loop results

I have an app that draws names randomly and then displays them in groups of 3 or 4. All is fine, but I would like to delay the output (increase suspense) We currently get "Group 1 consists of Fred, Dave, Steve, John" We want to see "Group 1 consists…
Lynxbci
  • 71
  • 7
1
vote
0 answers

How do I track GPS signal from a GPS Module

It might be a stupid question, but I have no idea where to start. I have a GPS device and I want to build an app in swift that will be able to track this particular device. I've seen so many small trackers that have apps for iOS but I want to build…
Marian Petrisor
  • 262
  • 2
  • 19
1
vote
1 answer

expandable drop down inside tableview in swift4

I tried, expandable drop down inside tableview in swift4 but not worked my below code. if i changed custom model class to String it is working. my requirement use below custom model class. please check my below code. class ExpandViewController:…
Ajay
  • 23
  • 3
1 2 3
99
100