Julia Hartley-Brewer has 'hit the nail', so to speak. Whatever views people have on 'the Union' the fact remains the UK overall voted Leave and overall it should carry that through. Of course there were differences, in places Remain had the biggest share, but overall as a United Kingdom its was leave that won out. The problem is the party ruling Scotland wants to Remain in the EU, but not in the UK and if that is the majority view of the populace in Scotland then it should be able to do just that.
In NI it seems to be the other way around, the majority (it seems)want to stay in both 'Unions', the UK and the EU, this is not that easy to sort out because of Brexit and ultimately the people in NI will have to choose one or the other.