Giter VIP home page Giter VIP logo

Comments (9)

fboulegue avatar fboulegue commented on July 30, 2024

@HarryKnowsTech did you find any solution for this i m stuck on the same point

from panorama.

fboulegue avatar fboulegue commented on July 30, 2024

Here is a example for swift:

class MainView: GLKViewController {

    var panoramaView = PanoramaView()

    override func viewDidLoad() {
        panoramaView.setImage("eicccbbc.jpg")
        panoramaView.touchToPan = true          // Use touch input to pan
        panoramaView.orientToDevice = false     // Use motion sensors to pan
        panoramaView.pinchToZoom = true         // Use pinch gesture to zoom
        panoramaView.showTouches = true         // Show touches
        self.view = panoramaView
    }

    override func glkView(view: GLKView, drawInRect rect: CGRect) {
        panoramaView.draw()
    }
}

from panorama.

fboulegue avatar fboulegue commented on July 30, 2024

#40 Updated readme with Swift example so might be closed by @robbykraft

from panorama.

buiminhtu93 avatar buiminhtu93 commented on July 30, 2024

HI, can you share Demo Project by Swift or Demo Detail Code? I write code like this but It don't run. It failt when start app. :( :( I don't know why???

This error at : "class AppDelegate: UIResponder, UIApplicationDelegate " of App Delegate
Help Me

from panorama.

tscholze avatar tscholze commented on July 30, 2024

@buiminhtu93 do you get an error like reason: '-[GLKViewController loadView] loaded the "xxx" nib but didn't get a GLKView.'?

from panorama.

smilesm2 avatar smilesm2 commented on July 30, 2024

@tscholze I got this error too. I haven't find out any solution.
It crash at var panoramaView = PanoramaView()

from panorama.

tscholze avatar tscholze commented on July 30, 2024

@smilesm2 what's your view controller type in your storyboard? You have to use GLKViewController.

from panorama.

smilesm2 avatar smilesm2 commented on July 30, 2024

@tscholze yes, finally I solved the problem.
The problem is it can't use normal view and put a GLKView even I connect all object and make sure all is ready.
I need to add a GLKViewController and everything is all right.

from panorama.

mayakraft avatar mayakraft commented on July 30, 2024

Thanks for all your help everyone! I want to update the documentation for swift integration. here's what I have.

  1. make sure you are using a GLKViewController instead of UIViewController
  2. contents of the GLKViewController:
import PanoramaView

class ViewController: GLKViewController {

	let panoramaView:PanoramaView

	required init?(coder aDecoder: NSCoder) {
		panoramaView = PanoramaView()
		super.init(coder: aDecoder)
	}

	override func viewDidLoad() {
		panoramaView.setImageWithName("park_2048.jpg")
		panoramaView.orientToDevice = true
//		panoramaView.touchToPan = false
//		... further customization
		self.view = panoramaView
	}

	override func glkView(_ view: GLKView, drawIn rect: CGRect) {
		panoramaView.draw()
	}
}

and that should be it, right, am I missing anything?

does anyone have best practices on creating the PanoaramaView as an optional and handling errors if it doesn't get created? I feel like it's better to declare let panoramaView:PanoramaView? instead of non-optional

from panorama.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.