In brief and in blunt, I would say:
- typically, don't present it
- don't try to convince a potential employer if they've not asked for a portfolio
- definitely don't ignore an employer simply because they won't view your portfolio.
If I were interviewing you as a programmer, I wouldn't want to see your portfolio either.
(Offtopic but related note: I would prefer an employer that asks you to write code as part of the interview process.)
In much more detail...
Firstly, what does your portfolio prove? Very little, to an interviewer. A portfolio of code is not like a portfolio of artwork: it will not have much subjective beauty; it will not be significantly different to the portfolio that a hundred other similarly-skilled developers would produce. Unless your code is presented as a series of 10-line working snippets, the interviewer isn't going to be able to comprehend your portfolio meaningfully during the interview anyway - code takes time to understand, and all but the most trivial example will take too long to convey. Finally, there is no indication in a portfolio of how or where you wrote this content, and so any skill you may or may not have isn't conveyed: was it a 10-minute exercise for you, or 6 week's tortured work? Or did you actually just scrape it from the results of a Google search? An interviewer cannot know, and so the portfolio is useless.
Secondly, when I want to see your code, I want to have defined the problem you're solving. When I interview, I do ask people to solve a simple coding problem in a reasonably short timescale (typically under an hour). By doing that, I as an interviewer already have a good understanding of what output I expect - which makes my job of analysing the result less complex. It means I have a set of pre-prepared discussion points to follow up with that will allow me to more deeply question the candidate's skills ("what if we need to make this method thread-safe?" or "what if I ask you to scale up to a million users?"). This also makes comparing candidates easier because there is a common challenge that everyone has completed under known conditions.
Thirdly, consider what the interviewer is looking for. Most often, in a forward-looking company, they are not looking for evidence that you can write a perfect MVC structure, use a certain library, or reduce a complex algorithm to three obtuse lines of syntax. An interviewer wants to understand whether you are smart. When I interview people, I want to know that they can have a meaningful and intelligent conversation about design/architectural choices, that they have a good understanding of the fundamentals of computer programming, and that they have an active interest in furthering their understanding. I don't care what their code looks like because, nine times out of ten, they will (to a greater or lesser extent) be required to change what their code looks like to suit the requirements of the team and the codebase they're being hired into. Further, if a developer can have those intelligent conversations, I know that they are capable of learning the patterns or libraries or languages that are relevant to the project they're joining. Most times, they won't know it all already.
Fourthly, consider what I know. Am I even technical? Many times, at least one of your interviewers will not be. If I am, I may not know the libraries you've used, or even the language you've used, or the platform your code runs on. I may not understand the problem you're trying to solve. The problem you're trying to solve might be interesting, but it might not be relevant to the codebase you're applying to work on. You can't see that - but the interviewer can, and they will structure the interview to suit.
As an interviewer, my time with you is limited, and I want to have a conversation that draws out your intelligence, understanding, ability to learn, and experience. It's my responsibility as an interviewer to get that information from you and I might - if it's useful or warranted - choose to ask for a sample of your work to help with that process. Most times, though, I'd choose for a candidate to demonstrate that through verbal and some hands-on problem solving, not through a pre-written project of their own choosing.
As a candidate, you need to trust that the interviewer knows their own requirements, and how best to get those from you. Pushing a portfolio under their nose and insisting that they understand your pet project really only demonstrates that you don't respect their requirements, and won't do you any favours in the interview.
code
itself, but rather what you can do with it.