diff --git a/ControlCenter_iOS.xcodeproj/project.pbxproj b/ControlCenter_iOS.xcodeproj/project.pbxproj index ed85872..5f03ce0 100644 --- a/ControlCenter_iOS.xcodeproj/project.pbxproj +++ b/ControlCenter_iOS.xcodeproj/project.pbxproj @@ -44,6 +44,7 @@ 7BBC6A6A24A5AD7300306BD5 /* NowPlayingControl.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NowPlayingControl.swift; sourceTree = ""; }; 7BBC6A6C24A5AD8100306BD5 /* BatteryControl.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BatteryControl.swift; sourceTree = ""; }; 7BBC6A6E24A5AE4400306BD5 /* LightAndDarkPreviews.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LightAndDarkPreviews.swift; sourceTree = ""; }; + 7BBC6A7024A5B99C00306BD5 /* Readme.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = Readme.md; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -60,6 +61,7 @@ 7BBC6A1C24A4EF3400306BD5 = { isa = PBXGroup; children = ( + 7BBC6A7024A5B99C00306BD5 /* Readme.md */, 7BBC6A4424A5ABBF00306BD5 /* Sources */, 7BBC6A4324A5AB7200306BD5 /* Resources */, 7BBC6A2624A4EF3400306BD5 /* Products */, diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..d916bde --- /dev/null +++ b/Readme.md @@ -0,0 +1,25 @@ +# Control Center in SwiftUI + +An exercise in trying to recreate macOS 11's new Control Center using SwiftUI. Created as an iOS project for no particular reason, could probably be ported to macOS easily enough as well. + +This is not even close to pixel perfect and there's a lot of room for improvement. It doesn't use any visual effects to get the right blur and translucency and a lot of the fonts and colours don't match. I didn't bother tackling the sliders either as this was just for fun to learn about laying things out with SwiftUI. + +The trickiest part was probably making the AirPlay and keyboard brightness controls have the correct widths, and generally trying to get the tiled controls at the top to have the correct widths and heights. I don't think it's easy to do in a general way that scales to any size, hence the [limit on the total width in ContentView](Sources/ContentView.swift). Also it's kind of obvious that I phoned in the Now Playing control and didn't even bother to see what it looks like when actually playing something. If you want to recreate it down to the fine details then there's still plenty of work left for you. + +# Screenshots + +Yeah sure but what's it look like? + +Light mode: + +[](Readme/light.png) + +Dark mode: + +[](Readme/dark.png) + +# License + +Copyright © 2020 Sami Samhuri + +Licensed under the terms of the [MIT license](https://sjs.mit-license.org). diff --git a/Readme/dark.png b/Readme/dark.png new file mode 100644 index 0000000..c712d02 Binary files /dev/null and b/Readme/dark.png differ diff --git a/Readme/light.png b/Readme/light.png new file mode 100644 index 0000000..df466bd Binary files /dev/null and b/Readme/light.png differ