File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ " tauri-runtime " : minor:feat
3+ ---
4+
5+ ` Runtime::run_return ` now must also be implemented on mobile targets.
Original file line number Diff line number Diff line change @@ -2836,14 +2836,20 @@ impl<T: UserEvent> Runtime<T> for Wry<T> {
28362836 self . event_loop . run ( event_handler)
28372837 }
28382838
2839- #[ cfg( desktop ) ]
2839+ #[ cfg( not ( target_os = "ios" ) ) ]
28402840 fn run_return < F : FnMut ( RunEvent < T > ) + ' static > ( mut self , callback : F ) -> i32 {
28412841 use tao:: platform:: run_return:: EventLoopExtRunReturn ;
28422842
28432843 let event_handler = make_event_handler ( & self , callback) ;
28442844
28452845 self . event_loop . run_return ( event_handler)
28462846 }
2847+
2848+ #[ cfg( target_os = "ios" ) ]
2849+ fn run_return < F : FnMut ( RunEvent < T > ) + ' static > ( mut self , callback : F ) -> i32 {
2850+ self . run ( callback) ;
2851+ 0
2852+ }
28472853}
28482854
28492855fn make_event_handler < T , F > (
Original file line number Diff line number Diff line change @@ -438,7 +438,6 @@ pub trait Runtime<T: UserEvent>: Debug + Sized + 'static {
438438 fn run_iteration < F : FnMut ( RunEvent < T > ) + ' static > ( & mut self , callback : F ) ;
439439
440440 /// Equivalent to [`Runtime::run`] but returns the exit code instead of exiting the process.
441- #[ cfg( desktop) ]
442441 fn run_return < F : FnMut ( RunEvent < T > ) + ' static > ( self , callback : F ) -> i32 ;
443442
444443 /// Run the webview runtime.
Original file line number Diff line number Diff line change @@ -1103,7 +1103,7 @@ impl<R: Runtime> App<R> {
11031103 ///
11041104 /// ## Platform-specific
11051105 ///
1106- /// - **iOS / Android **: Unsupported.
1106+ /// - **iOS**: Unsupported. The application will fallback to [`run`](Self::run) .
11071107 ///
11081108 /// # Panics
11091109 ///
@@ -1125,7 +1125,6 @@ impl<R: Runtime> App<R> {
11251125 ///
11261126 /// std::process::exit(exit_code);
11271127 /// ```
1128- #[ cfg( desktop) ]
11291128 pub fn run_return < F : FnMut ( & AppHandle < R > , RunEvent ) + ' static > ( mut self , mut callback : F ) -> i32 {
11301129 let manager = self . manager . clone ( ) ;
11311130 let app_handle = self . handle ( ) . clone ( ) ;
Original file line number Diff line number Diff line change @@ -1188,7 +1188,6 @@ impl<T: UserEvent> Runtime<T> for MockRuntime {
11881188 ) ) ]
11891189 fn run_iteration < F : FnMut ( RunEvent < T > ) > ( & mut self , callback : F ) { }
11901190
1191- #[ cfg( desktop) ]
11921191 fn run_return < F : FnMut ( RunEvent < T > ) + ' static > ( self , callback : F ) -> i32 {
11931192 self . run ( callback) ;
11941193
You can’t perform that action at this time.
0 commit comments