To anybody that needs it, here is the correct and updated Pythonista 3 Template:
https://www.dropbox.com/h?preview=Pythonista3AppTemplate+Updated+.zip
Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
To anybody that needs it, here is the correct and updated Pythonista 3 Template:
https://www.dropbox.com/h?preview=Pythonista3AppTemplate+Updated+.zip
@Ichicoro lol I hate myself. This should work, let me know if it doesn’t.
https://www.dropbox.com/s/nq899u5gv54o5t8/Pythonista3AppTemplate Updated .zip?dl=0
@JonB I’m glad you mentioned that. I forgot to inform that to get past signing errors I used @RomSpy ’s last template he posted from this forum link:
https://forum.omz-software.com/topic/5837/xcode-template
After getting past the signing errors is when I started getting the UIWebView deprecated rejections from Apple. That is when I stumbled upon this forum post and tried out your idea of downloading the hex editor, etc. I first tried replacing UIWebView with WKWebView like Apple suggested, but it ended up crashing my app after launch. Replacing it with UIBarItem had no effect.
Here is my latest version of the Pythonista 3 App Template that I used for my game I’m currently publishing to the App Store as we speak.
https://www.dropbox.com/s/442v3cp90oyk8rd/Pythonista3AppTemplate Updated .zip?dl=0
@ruohola sorry this is a little late and I hope this information is still relevant for you. I took @JonB 's advice and went into the P3kit framework and edited the P3kit file. For me it popped up as a unix executable, so I needed to download a hex editor to go in and modify it.
All I did was command-F and find all the instances of UIWebView and replace them all with UIBarItem. This is an API with the same character length and the API isn't deprecated. Save the file and make sure it is still in your project directory.
I archived and uploaded my build last night and the App Store did not reject the build. so this is a good working solution. My app is a 2D shooting game called Flyboy Adventure Game and it is currently under beta review as we speak. I've tested my game on Testflight and it works great, so hopefully there is no long term repercussions from using this workaround.
@momorprods That’s definitely a fair assessment. I’ve tried Codea and want to get behind Lua and all the awesome features the app has, but Pythonista is just an amazing IDE and what you can do on it is endless. I end up missing it too much whenever I am toying around with Codea.
Going to try and get some thoughts from you all here in the forums.
I was thinking about creating a game in Pythonista.
Would there be anybody that we like me to record tutorials on creation of the game, but also the process of uploading the game to the App Store using the Xcode Template?
I’ve been wanting to get a YouTube channel started for fun on the side, and I believe this would be a good way to kick it off.
@cvp it’s all good. Your code gave me a good starting place and led me to the code I got so thank you!
For anybody following this thread I figured how to present SFSafariViewController
from an already presented view:
#######################################################################
# Necessary imports.
from objc_util import *
#######################################################################
class WebView():
@on_main_thread
def __init__(self,url,uiview,bar_tint_color,control_tint_color):
self.safari_view_controller = ObjCClass("SFSafariViewController").alloc().initWithURL_(nsurl(url))
self.safari_view_controller.preferredBarTintColor = bar_tint_color
self.safari_view_controller.preferredControlTintColor = control_tint_color
self.view_controller = ObjCClass('UIViewController').viewControllerForView_(ObjCInstance(uiview))
@on_main_thread
def present(self):
self.view_controller.presentViewController_animated_completion_(self.safari_view_controller,True,None)
Also to add, I added the code above to a blank main.py
file in a blank Xcode project and it worked just fine. I think it has something to do with the App ui.View
that I am presenting.
@cvp to clarify I am attempting to run this is the most current Xcode Template. Your code is good starting place but when I tried it was just a blank white screen. The code I am trying to incorporate is:
from objc_util import *
SFSafariViewController = ObjCClass('SFSafariViewController')
@on_main_thread
def open_in_safari_vc(url, tint_color=None):
vc = SFSafariViewController.alloc().initWithURL_(nsurl(url))
if tint_color is not None:
vc.view().tintColor = tint_color
app = UIApplication.sharedApplication()
root_vc = app.keyWindow().rootViewController()
root_vc.presentViewController_animated_completion_(vc, True, None)
vc.release()
open_in_safari_vc('http://apple.com', UIColor.orangeColor())
Basically I have an ui.View
called App that is presented from the point of where the iOS app starts. When clicking on a button view on this App class I want it to open a SFSafariViewController with the designated url given to the open_in_safari_vc
function.
When I attempt this in the Xcode Template I get this error:
[Presentation] Attempt to present <SFSafariViewController: 0x7fbfa7a98000> on <PYAViewController: 0x7fbfa4408e80> (from <PYAViewController: 0x7fbfa4408e80>) whose view is not in the window hierarchy.
I hope this clarifies what I'm trying to do.
I was wondering if any of you that are good with objc_util
could help me out.
I would like to present a SFSafariViewController
as a ui.View
from a ui.View
that is already presented.
Or be able to add SFSafariViewController
as a subview for the already presented view.
Thx in advance.
Sooo update on this issue. I moved all my external code for google sheet & Twilio messaging into the script file thinking that would solve the issue.
And it didn’t, same error with the same naming convention. All the modules that I need have a lot of init.py files so I wonder if Apple doesn’t allow files with that name specifically or what.
So as a test I took out those files and just tried to upload my Pythonista code and it worked flawlessly. At least I pinpointed exactly what files are causing this error, but it’s sad because those modules are important for the functionality of my app.
@JonB this might be some of my own doing. I wanted to add google sheet api and Twilio messaging support in my app.
I added those files into the site packages and performed the ‘import Pythonista’ trick to all files so that no singing issues would occur.
Since these files were apart of the original template, these files my need to exist in the Script folder of the template.
I’m pretty sure when I make this switch everything should be fine.
Hello all,
A few months ago I got a Pythonista 3 App Template to work and uploaded my game to the App Store successfully. Since then I've tried to post another app to the App Store. I get past the validation stage and upload stage just fine but then a few minutes later apple hits me with this error:
ITMS-90048: This bundle is invalid - Your archive contains paths that are not allowed: ('init.py')
Has anybody that has downloaded my app template had this problem? Any help would awesome. Thx