September 2018
Intermediate to advanced
434 pages
8h 47m
English
We will now create some UI-like buttons for hosting and joining a session and a Map button to send the map once we have connected to a peer. We will also create a couple of text labels to tell us what the app is doing currently.
For sending the map, we will create a custom class so that the button lights up when the map is ready to be sent.
Create a new Swift file called RoundedButton. In it, create a new class of the same name and inherit from UIButton:
import UIKit
@IBDesignable
class RoundedButton: UIButton {
}In this class, we will add the init function, which will, in turn, call the setup() function in which we will set the button parameters.
Also, override the isEnabled function, which, when set, will change backgroundColor ...
Read now
Unlock full access