@applicaster/quick-brick-native-apple 5.21.1 → 5.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apple/QuickBrickApple.podspec.json +2 -2
- package/apple/universal/ReactNative/AirplayButton/AirPlayButton.swift +52 -0
- package/apple/universal/ReactNative/AirplayButton/AirPlayButtonModule.swift +25 -0
- package/apple/universal/ReactNative/ReactNativeModulesExports.m +8 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "QuickBrickApple",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.22.0",
|
|
4
4
|
"platforms": {
|
|
5
5
|
"ios": "14.0",
|
|
6
6
|
"tvos": "14.0"
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"authors": "Applicaster LTD.",
|
|
17
17
|
"source": {
|
|
18
18
|
"git": "https://github.com/applicaster/Zapp-Frameworks.git",
|
|
19
|
-
"tag": "@@applicaster/quick-brick-native-apple/5.
|
|
19
|
+
"tag": "@@applicaster/quick-brick-native-apple/5.22.0"
|
|
20
20
|
},
|
|
21
21
|
"requires_arc": true,
|
|
22
22
|
"source_files": "universal/**/*.{m,swift}",
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
//
|
|
2
|
+
// AirPlayButton.swift
|
|
3
|
+
// DefaultPlayer
|
|
4
|
+
//
|
|
5
|
+
// Created by Anna Bauza on 22/06/2020.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import AVKit
|
|
9
|
+
import Foundation
|
|
10
|
+
|
|
11
|
+
@objc public class AirPlayButton: UIView {
|
|
12
|
+
override init(frame: CGRect) {
|
|
13
|
+
super.init(frame: frame)
|
|
14
|
+
setupView(frame)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
required init?(coder aDecoder: NSCoder) {
|
|
18
|
+
super.init(coder: aDecoder)
|
|
19
|
+
setupView(nil)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
var airplayButton: AVRoutePickerView?
|
|
23
|
+
|
|
24
|
+
// in here you can configure your view
|
|
25
|
+
private func setupView(_ frame: CGRect?) {
|
|
26
|
+
let buttonFrame = frame ?? self.frame
|
|
27
|
+
airplayButton = AVRoutePickerView(frame: buttonFrame)
|
|
28
|
+
airplayButton?.activeTintColor = UIColor.blue
|
|
29
|
+
|
|
30
|
+
if let buttonView = airplayButton {
|
|
31
|
+
addSubview(buttonView)
|
|
32
|
+
buttonView.translatesAutoresizingMaskIntoConstraints = false
|
|
33
|
+
let horizontalConstraint = NSLayoutConstraint(item: buttonView, attribute: .centerX, relatedBy: .equal, toItem: self, attribute: .centerX, multiplier: 1, constant: 0)
|
|
34
|
+
let verticalConstraint = NSLayoutConstraint(item: buttonView, attribute: .centerY, relatedBy: .equal, toItem: self, attribute: .centerY, multiplier: 1, constant: 0)
|
|
35
|
+
let widthConstraint = NSLayoutConstraint(item: buttonView, attribute: .width, relatedBy: .equal, toItem: self, attribute: .width, multiplier: 1, constant: 0)
|
|
36
|
+
let heightConstraint = NSLayoutConstraint(item: buttonView, attribute: .height, relatedBy: .equal, toItem: self, attribute: .height, multiplier: 1, constant: 0)
|
|
37
|
+
addConstraints([horizontalConstraint, verticalConstraint, widthConstraint, heightConstraint])
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@objc override public var tintColor: UIColor? {
|
|
42
|
+
didSet {
|
|
43
|
+
airplayButton?.tintColor = tintColor
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@objc public var activeTintColor: UIColor? {
|
|
48
|
+
didSet {
|
|
49
|
+
airplayButton?.activeTintColor = activeTintColor
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//
|
|
2
|
+
// RCTMyCustomViewManager.swift
|
|
3
|
+
// DefaultPlayer
|
|
4
|
+
//
|
|
5
|
+
// Created by Anna Bauza on 22/06/2020.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import AVFoundation
|
|
9
|
+
import Foundation
|
|
10
|
+
import React
|
|
11
|
+
|
|
12
|
+
@objc(AirPlayButtonModule)
|
|
13
|
+
public class AirPlayButtonModule: RCTViewManager {
|
|
14
|
+
override public static func moduleName() -> String? {
|
|
15
|
+
"AirPlayButtonModule"
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
override public static func requiresMainQueueSetup() -> Bool {
|
|
19
|
+
true
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
override public func view() -> UIView! {
|
|
23
|
+
AirPlayButton()
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
//
|
|
8
8
|
|
|
9
9
|
@import React;
|
|
10
|
+
#import <AVFoundation/AVFoundation.h>
|
|
11
|
+
#import <React/RCTViewManager.h>
|
|
10
12
|
|
|
11
13
|
@interface RCT_EXTERN_MODULE (QuickBrickCommunicationModule, NSObject)
|
|
12
14
|
|
|
@@ -146,3 +148,9 @@ RCT_EXTERN_METHOD(getCurrentLayoutId:(RCTPromiseResolveBlock)resolve
|
|
|
146
148
|
RCT_EXTERN_METHOD(getDefaultLayoutId:(RCTPromiseResolveBlock)resolve
|
|
147
149
|
rejecter:(RCTPromiseRejectBlock)reject);
|
|
148
150
|
@end
|
|
151
|
+
|
|
152
|
+
@interface RCT_EXTERN_MODULE(AirPlayButtonModule, RCTViewManager)
|
|
153
|
+
RCT_EXPORT_VIEW_PROPERTY(tintColor, UIColor);
|
|
154
|
+
RCT_EXPORT_VIEW_PROPERTY(activeTintColor, UIColor);
|
|
155
|
+
|
|
156
|
+
@end
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/quick-brick-native-apple",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.22.0",
|
|
4
4
|
"description": "iOS and tvOS native code for QuickBrick applications. This package is used to provide native logic for QuickBrick",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1"
|