We investigate the degrees of freedom (DoF) and secrecy DoF for a general framework of multiway relay networks named wireless MIMO switching, where a number of users exchange information via a common relay. Each round of data exchange consists of one uplink transmission from users to relay and one downlink transmission from relay back to users. The data exchange model is unicast, i.e., every user transmits one message and intends to receive one message from one other user. We categorize unicast patterns using the notion of orbit borrowed from abstract algebra. Roughly speaking, an orbit is a minimum subset of users such that data exchange is closed within this subset. We analyze the achievable DoF of wireless MIMO switching with various numbers of orbits. Particularly, the DoF capacity for unicast with one and two orbits are established. Furthermore, we study communication secrecy with an untrusted relay in wireless MIMO switching. We present an achievable secrecy sum rate and the corresponding achievable secrecy DoF by assuming a non-regenerative relay. Then, we focus on unicast patterns with one and two orbits, and show that this achievable lower bound is actually the secrecy DoF capacity based on a novel genie-aided technique. Our results build a bridge between the DoF and the secrecy DoF in multiway relaying. The methodology of the proof can be generally applied to analyze the secrecy DoF in other relay networks.