Questions tagged [swift3]
Use this tag only for questions directly related to changes in version 3 of Apple's Swift programming language.
43 questions
3
votes
2
answers
1k
views
Tableview Subclass implementing delegate datasource
I have two view controllers which have same tableview. One is for Post and one is for Profile, which also contains a post by a user. I have decided to reuse the code, so I have created the class ...
1
vote
1
answer
145
views
Swift UITableViewCell class to show cameras, ratings for a car wash and other information
I have an UITableViewCell class that written in Swift. And it seems to me that I did it the wrong way. It works fine, but I want improve the code or refactor it somehow to make it look better.
Any ...
2
votes
0
answers
140
views
Log in user through json and display the application
I am currently learning swift 4 and would like to ask you to correct my code. (I would like to have a pattern for learning the "beautiful code").
My code gets data from the server in JSON format and ...
0
votes
1
answer
16k
views
Prevent a UITextField from being input with aphabetic characters
The goal is to disallow typing alphabetic characters as input in a UITextField.
Please tell me if this approach is convenient.
...
1
vote
2
answers
4k
views
Finding the number of perfect squares in an array
I am posting here for feedback about the code that I wrote to count the number of perfect squares in an array.
...
1
vote
1
answer
100
views
Notifying view controller of changes to any of five types of models
I have a swift 3 project with a code that's look like very generic, but I don't know if I can reduce a method like this one :
...
3
votes
1
answer
195
views
Project Euler problem #14 (longest Collatz chain) in Swift
This is my Swift code for finding the starting number, under one million, which produces the longest collatz chain.
...
4
votes
1
answer
4k
views
Basic Caesar Cipher in Swift 3.1
I have been learning Swift for the past day and thought I'd try a basic problem where I can do String manipulation. I am only on pg.100 of the Swift Programming Language on iBooks. Compared to python ...
1
vote
2
answers
243
views
Switching between queues in cellForIndexPath method
My tableView is scrolling very slowly because there is a fetch request done in every cellForIndexPath method. I have verified ...
2
votes
1
answer
443
views
Grouping models without dictionary
I want to group an array of structs only using arrays into an array of new structs. In this example I want to group the Person structs by ...
3
votes
0
answers
163
views
Load data from WebAPI to the ViewController
My current code working perfectly, it is for data load from web api to the UIViewController (UITableView).
But I am confused ...
14
votes
1
answer
1k
views
Interview coding challenge for iOS Part 2 - the application in Objective-C and Swift
I recently interviewed with a company that needed a C/C++ programmer to work on the iOS side of the products. The job description indicated they needed someone with 4 years of Objective-C and iOS ...
2
votes
0
answers
437
views
Find MIDI devices with certain names and make them usable
I'm working on a Swift app for macOS, where I take input from MIDI devices and transform that input. The MIDI devices being supported come in for flavors.
What my code does is scan for MIDI devices, ...
6
votes
2
answers
8k
views
Countdown timer in every table cell
I am making countdown app with multiple records, so I am using UITableView to show that records and countdown dates. What I do is just take one timer and reload cells on every second. Is this a best ...
6
votes
1
answer
5k
views
UIButton subclass with animated 'shimmer' effect
In earlier versions of iOS the lock screen had a 'slide to unlock' element which I'm referencing as a 'shimmer' effect.
The effect I'm looking for is simpler:
Button starts with single color (e.g. ...