Created
December 3, 2019 19:07
-
-
Save digitallysavvy/dd68724f3c8abd690371289cf1d0cb94 to your computer and use it in GitHub Desktop.
Snippet for setColor within the ARSupportAudienceViewController
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@IBAction func setColor(_ sender: UIButton) { | |
guard let colorSelectionBtn = self.colorSelectionBtn else { return } | |
colorSelectionBtn.tintColor = sender.backgroundColor | |
self.lineColor = colorSelectionBtn.tintColor | |
toggleColorSelection() | |
// send data message with color components | |
if self.streamIsEnabled == 0 { | |
guard let colorComponents = sender.backgroundColor?.cgColor.components else { return } | |
self.agoraKit.sendStreamMessage(self.dataStreamId, data: "color: \(colorComponents)".data(using: String.Encoding.ascii)!) | |
if debug { | |
print("color: \(colorComponents)") | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment