Ekhoo / Device

Light weight tool for detecting the current device and screen size written in swift.
MIT License
1.7k stars 202 forks source link

Implement Comparable protocol for Size #39

Closed Ben305 closed 7 years ago

Ben305 commented 7 years ago

Makes Size enum comparable:


if Device.size() > Size.screen4_7Inch {
    print("Greater than 4.7 inch")
}

if Device.size() == Size.screen4_7Inch {
    print("Screen has 4.7 inch")
}

Previously existing functions are still there, but marked as deprecated
Ekhoo commented 7 years ago

👍