mirror of
https://github.com/zhigang1992/ProMotion.git
synced 2026-04-29 12:45:28 +08:00
Fixed issue when testing ProMotion apps where the on_load never fires.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
class AppDelegate
|
||||
def application(application, didFinishLaunchingWithOptions:launchOptions)
|
||||
return true if RUBYMOTION_ENV == 'test'
|
||||
def on_load(app, options)
|
||||
open BasicScreen
|
||||
end
|
||||
end
|
||||
|
||||
27
app/screens/basic_screen.rb
Normal file
27
app/screens/basic_screen.rb
Normal file
@@ -0,0 +1,27 @@
|
||||
class BasicScreen < PM::Screen
|
||||
title "Basic"
|
||||
|
||||
def on_init
|
||||
# Fires right after the screen is initialized
|
||||
end
|
||||
|
||||
def on_load
|
||||
# Fires just before a screen is opened for the first time.
|
||||
end
|
||||
|
||||
def will_appear
|
||||
# Fires every time the screen will appear
|
||||
end
|
||||
|
||||
def on_appear
|
||||
# Fires just after the screen appears somewhere (after animations are complete)
|
||||
end
|
||||
|
||||
def will_disappear
|
||||
# Fires just before the screen will disappear
|
||||
end
|
||||
|
||||
def on_disappear
|
||||
# Fires after the screen is fully hidden
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user