GithubHelp home page GithubHelp logo

Comments (6)

rjcollingham avatar rjcollingham commented on August 14, 2024

I have this in my AppDelegate.cs and it works great on iOS 10 iPhone 7

[Register("AppDelegate")]
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate {
public static Type dummyt = typeof(SignaturePad.Forms.iOS.SignaturePadRenderer); //<<-------

from signaturepad.

voydz avatar voydz commented on August 14, 2024

Hi @rjcollingham ,

thank you for your advice. I also tried this already (did not mention it in my initial post, though). Changing nothing in the result stated above. :(

from signaturepad.

gtbuchanan avatar gtbuchanan commented on August 14, 2024

It's due to linker settings in the build configuration. I actually had to create an instance of the renderer in AppDelegate to get it to work (pulled from this comment, but I found only the renderer is necessary). Just referencing the type as mentioned above didn't work for me.

var _ = new SignaturePad.Forms.iOS.SignaturePadRenderer();

I have confirmed this works in release mode with "Link SDK Assemblies" set. Hopefully, we won't have to resort to stupid hacks like this in the future.

from signaturepad.

matthieugd avatar matthieugd commented on August 14, 2024

@voydz did you find a solution ? I have the same problem and I also added the dummy code but still no luck. It's a Xamarin Forms project 2.3.3.175 with SignaturePad 1.4.0.

from signaturepad.

balaameex avatar balaameex commented on August 14, 2024

HI,

I also faced the same problem, after adding the below code in App Delegate it solved the problem.
public static Type dummyt = typeof(SignaturePad.Forms.iOS.SignaturePadRenderer);

Thanks

from signaturepad.

mattleibow avatar mattleibow commented on August 14, 2024

Sometimes the linker links too much - and the linker is getting better.

One way that may be better is to use this type of "preserve":

static bool falseflag = false;
static AppDelegate ()
{
    if (falseflag) {
        var ignore = new SignaturePad.Forms.iOS.SignaturePadRenderer ();
    }
}

This code will never get executed, but the linker will never know that.

But some good news! This is no longer necessary in v2.0 (as yet unreleased). This is avoided since we are using the same assembly via bait-and-switch. Also, we are directly indicating to the linker that the particular view is using a particular renderer. So there is now a "hard" link between the view and the platform render.

from signaturepad.

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.