11# Detect the platform
22import platform
33
4- system = platform .system ()
4+ system : str = platform .system ()
55
66
77class PlatformNotDetectedError (Exception ):
@@ -16,27 +16,27 @@ class PlatformNotDetectedError(Exception):
1616 class Button :
1717 native_class = ObjCClass ("UIButton" )
1818
19- def __init__ (self , title = "" ):
19+ def __init__ (self , title : str = "" ) -> None :
2020 self .native_instance = self .native_class .alloc ().init ()
2121 self .set_title (title )
2222
23- def set_title (self , title ) :
23+ def set_title (self , title : str ) -> None :
2424 self .native_instance .setTitle_forState_ (title , 0 )
2525
26- def get_title (self ):
26+ def get_title (self ) -> str :
2727 return self .native_instance .titleForState_ (0 )
2828
2929 class Label :
3030 native_class = ObjCClass ("UILabel" )
3131
32- def __init__ (self , text = "" ):
32+ def __init__ (self , text : str = "" ) -> None :
3333 self .native_instance = self .native_class .alloc ().init ()
3434 self .set_text (text )
3535
36- def set_text (self , text ) :
36+ def set_text (self , text : str ) -> None :
3737 self .native_instance .setText_ (text )
3838
39- def get_text (self ):
39+ def get_text (self ) -> str :
4040 return self .native_instance .text ()
4141
4242elif system == "Android" :
@@ -46,27 +46,27 @@ def get_text(self):
4646 class Button :
4747 native_class = jclass ("android.widget.Button" )
4848
49- def __init__ (self , title = "" ):
49+ def __init__ (self , title : str = "" ) -> None :
5050 self .native_instance = self .native_class ()
5151 self .set_title (title )
5252
53- def set_title (self , title ) :
53+ def set_title (self , title : str ) -> None :
5454 self .native_instance .setText (title )
5555
56- def get_title (self ):
56+ def get_title (self ) -> str :
5757 return self .native_instance .getText ().toString ()
5858
5959 class Label :
6060 native_class = jclass ("android.widget.TextView" )
6161
62- def __init__ (self , text = "" ):
62+ def __init__ (self , text : str = "" ) -> None :
6363 self .native_instance = self .native_class ()
6464 self .set_text (text )
6565
66- def set_text (self , text ) :
66+ def set_text (self , text : str ) -> None :
6767 self .native_instance .setText (text )
6868
69- def get_text (self ):
69+ def get_text (self ) -> str :
7070 return self .native_instance .getText ().toString ()
7171
7272else :
0 commit comments