Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16552

Widget iOS 14 create the ui with react native using swift ui

$
0
0

Widget example in iOS:

enter image description here

Example of the react-native(js) code written below:

enter image description here

import React from 'react';import { Text, View, NativeModules } from 'react-native';var Widget = NativeModules.Widget;const App = () => {  return (<Widget><View        style={{          justifyContent: 'center',          alignItems: 'center',          backgroundColor: '#dee1e3',          borderRadius: 4,        }}><Text>San Francisco</Text><Text style={{ fontSize: 30 }}>62°F</Text></View></Widget>  );};export default App;

There is still not much documentation on creating widgets with Swift ui for iOS 14.

It wouldn't seem that difficult to create a widget using Swift ui, but there isn't much information.

So I thought it would be interesting to develop the ui using react-native and use swift ui just to create the widget for iOS.

Idea is this, everything inside the tag (let's call it that) <Widget> (hence its child) should be the content of the Widget.

I did not find anything in the documentation, I was wondering exists in Swift ui or something for iOS, to use child content as UI for app.

Surely such a thing will be impossible, but dreaming costs nothing.


Viewing all articles
Browse latest Browse all 16552

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>