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
1 answer

tableview last section is scrambled when setting row height to 0 swift

I added an arrow to fold the section when clicked, when I fold the last section (e.g. setting the row height to 0 in cellForRow, all the rows in the last section get mixed up, as can be seen in the image below: Can anyone suggest any reason why…
1
vote
2 answers

from Objective-C to Swift 4 perform selector

I am new to both Swing and Objective-C and I was trying to work with AVCaptureDevice. I tried to implement the following code that gives me back a private member of an AVCaptureDevice instance in Objective-C. But I am no able to transfer the same…
Ivan_nn2
  • 469
  • 7
  • 20
1
vote
4 answers

Push new view controller when button is pressed

I'm building a game in Swift 5 programmatically and want to navigate from the main menu to the game screen. Here is my code: func handleButtonsTapped() { playButton.addTarget(self, action: #selector(pushGameViewController), for:…
c0ded_truth
  • 37
  • 1
  • 2
  • 8
1
vote
1 answer

Pass storyboard outlet to base controller class

I have a base class: class BaseViewController: UIViewController, UITableViewDelegate, UITableViewDataSource, UITableViewDataSourcePrefetching { var posts = [Post]() func tableView(_ tableView: UITableView, numberOfRowsInSection section:…
user2343632
  • 167
  • 7
1
vote
2 answers

Xcode - toolbar or views not showing near top

I got a new MacBook and I downloaded a newer copy of Xcode. Newer than what I was previously using on my old Mac. I copied over my app from an older version Mac and Xcode. Now, all the screens are acting weird. The toolbars have round corners and…
user7367398
1
vote
4 answers

How to check whether String only consists of letters and spaces in Swift 5?

I am currently trying to validate a name input field. For that purpose I would like to check the input. The input is a string and should only consist of letters and spaces. Is there any simple way to implement it. For example I have the Input of…
user9874788
1
vote
1 answer

Swift find the end index of a word within a string

I have a string. I have a word inside that string I want to basically get rid of everything in the string and the word. But everything after the word in the string I want to keep. This word and string can be dynamic. Here is what I got so far and I…
Peter
  • 68
  • 9
1
vote
3 answers

how to change keyboard style programmatically in iOS?

I would like to change the keyboard style. I have attached two pictures one the current situation and the second one is the desired situation.
Pathak Ayush
  • 726
  • 12
  • 24
1
vote
3 answers

Merge Dictionaries With Values As Arrays in Swift4

I have three dictionaries, and I want to merge these. Please Help! Dictionary 1: "Abc": { "Def": { "Jkl": "xxx", } } Dictionary 2: "Abc": { "Ghi": { "Mno": "yyy", } } Dictionary 3: "Abc": { "Ghi": { …
Deepanshu
  • 29
  • 1
  • 8
1
vote
1 answer

Swift 4 - while loops and UI elements

-- Edit -- I cannot answer my own question, but I will leave my solution here in this edit. Thanks everyone for your time in looking at my problem. I am creating 1 new variable var timer = 1 I am using this in my Async dispatch timer for the…
user5175896
1
vote
2 answers

Adding multiple shadows hides the background colour and text UIButton

I was trying to add multiple shadows to my UIButton. The two shadows were added as you can see in the image. However, they hide the title and background colour of UIButton. Why is this happening? So, has the order of the layers become bottomLayer,…
Kyaw Siesein
  • 705
  • 8
  • 14
1
vote
1 answer

Swift 5, iOS 13.3.1 FBSDKCoreKit error (Derived Data deletion doesn't help)

Have updated sudo gem install cocoapods --pre, iOS 13.3.1 on my iPhone 7, and Podfile. After that FBSDKCoreKit error has appeared. Thread 1 (0 __abort_with_payload): dyld`__abort_with_payload: 0x10251f5dc <+0>: mov x16, #0x209 …
J A S K I E R
  • 1,976
  • 3
  • 24
  • 42
1
vote
4 answers

How to add white space at the last position of a string?

I am trying to add 2 white space at the last position of a string but when I set this in a label I found no space. But if I added 2 white space with another character, it works ok. Then I tried to add 2 white space with some extra character and then…
spectre_d2
  • 193
  • 15
1
vote
3 answers

How to use pagination in table view

Basically i have a table view and get 5 item in every time when i call the api. So how to use/ reload more data white scrolling table view. array.count-1 not for me at cell for row indexpath because when device size bigger all data shown at a time…
IOS Lerner
  • 11
  • 3
1
vote
2 answers

Collection View reusable cell issue while scrolling

I am using the collection view to show the gif's on the list. Now facing the cell reusable issue while scrolling the cells up or down of collection view. Like itemA is on first place in the list and itemB is on the second place in the list. but when…
manoj kashyap
  • 143
  • 2
  • 9
1 2 3
99
100