Skip to content

Commit

Permalink
Pass style in iOS build
Browse files Browse the repository at this point in the history
  • Loading branch information
jp928 committed Oct 7, 2020
1 parent 31d65f5 commit e72d8b2
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 9 deletions.
6 changes: 3 additions & 3 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ PODS:
- React-cxxreact (= 0.62.2)
- React-jsi (= 0.62.2)
- React-jsinspector (0.62.2)
- react-native-draggable-fab (0.1.0):
- react-native-draggable-fab (0.1.1):
- Floaty (~> 4.2.0)
- React
- React-RCTActionSheet (0.62.2):
Expand Down Expand Up @@ -438,7 +438,7 @@ SPEC CHECKSUMS:
React-jsi: b6dc94a6a12ff98e8877287a0b7620d365201161
React-jsiexecutor: 1540d1c01bb493ae3124ed83351b1b6a155db7da
React-jsinspector: 512e560d0e985d0e8c479a54a4e5c147a9c83493
react-native-draggable-fab: b1b06ad9115a0ad403aff1a67e253c9c86709ee6
react-native-draggable-fab: 1ebd0b63b592abc8c9e64df8b35ea6efc7d05a33
React-RCTActionSheet: f41ea8a811aac770e0cc6e0ad6b270c644ea8b7c
React-RCTAnimation: 49ab98b1c1ff4445148b72a3d61554138565bad0
React-RCTBlob: a332773f0ebc413a0ce85942a55b064471587a71
Expand All @@ -453,6 +453,6 @@ SPEC CHECKSUMS:
Yoga: 3ebccbdd559724312790e7742142d062476b698e
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

PODFILE CHECKSUM: e56ce38809e483139e4df0b873b19b53e3b24643
PODFILE CHECKSUM: 048095e3ca3baa2fdda0778e3bd0c61919d1cf1e

COCOAPODS: 1.9.1
5 changes: 2 additions & 3 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
} from 'react-native-draggable-fab';

import IconMDI from 'react-native-vector-icons/MaterialIcons';

export default function App() {
const [tappedItem, setTappedItem] = React.useState(0);

Expand All @@ -31,13 +30,13 @@ export default function App() {
<IconMDI name="add" size={42} color="#000" />
<Fab
animateType={LabelAnimation.SlideLeft}
itemLabels={['']}
itemLabels={['test1', 'test2', 'test3']}
onItemTap={onTapItem}
icon="atm"
onPress={onPress}
iconProvider={IconMDI}
iconColor="#fff"
backgroundColor="#10395e"
backgroundColor="#000000"
/>
</View>
</CoordinatorLayout>
Expand Down
30 changes: 29 additions & 1 deletion ios/DragableFabView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,36 @@
import Foundation
import Floaty

@objc(DraggableFabView)
class DraggableFabView: Floaty, FloatyDelegate {

@objc var onOpen: RCTDirectEventBlock?

override init() {
super.init()
handleFirstItemDirectly = true
fabDelegate = self
//
// self.isDraggable = true
// self.friendlyTap = true
}

override init(frame: CGRect) {
super.init(frame: frame)
fabDelegate = self
//
// self.isDraggable = true
// self.friendlyTap = true
}

required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

// override func layoutSubviews() {
// super.layoutSubviews()
// self.frame = self.bounds
// }

func floatyWillOpen(_ floaty: Floaty) {
onOpen!([:])
}
Expand Down Expand Up @@ -138,3 +154,15 @@ extension UIColor {
}
}

extension UIView {
var parentViewController: UIViewController? {
var parentResponder: UIResponder? = self
while parentResponder != nil {
parentResponder = parentResponder!.next
if let viewController = parentResponder as? UIViewController {
return viewController
}
}
return nil
}
}
4 changes: 2 additions & 2 deletions ios/DraggableFab.swift
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
@objc(DraggableFab)
class DraggableFab: RCTViewManager {
var floaty = DraggableFabView()
lazy var floaty = DraggableFabView()


override func view() -> UIView! {
floaty.isDraggable = true
floaty.friendlyTap = true

return floaty
}

Expand Down

0 comments on commit e72d8b2

Please sign in to comment.