Skip to content

Instantly share code, notes, and snippets.

@SunXiaoShan
Created December 14, 2018 09:20
Show Gist options
  • Save SunXiaoShan/0d706273669388e8ddeb127a1eb92f60 to your computer and use it in GitHub Desktop.
Save SunXiaoShan/0d706273669388e8ddeb127a1eb92f60 to your computer and use it in GitHub Desktop.
import ReplayKit
class ViewController: UIViewController {
@IBOutlet weak var mainView: UIView!
var broadcastPicker: RPSystemBroadcastPickerView?
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
DispatchTimer(timeInterval: 1) { [weak self] timer in
self?.mainView.backgroundColor = self?.randomColor()
}
broadcastPicker = RPSystemBroadcastPickerView(frame: CGRect.init(x: 20, y: 20, width: 50, height: 50))
view.addSubview(broadcastPicker!)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment