Reputation: 399
I am trying to implement license agreement as shown in the attached image, I can create a new WindowController and design in the same way, but i want to know if we have any default screens in Xcode to do this kind of stuff, as i noticed that most of the apps have similar kind of design.
Upvotes: 2
Views: 731
Reputation: 22415
That's a disk mount license agreement. You can embed a license agreement into a DMG disk image, to be displayed with this screen when a user mounts the image.
If your application is in example/Example.app
, you can create example.dmg
, embedding EULA.txt
into it as follows:
hdiutil create -srcfolder example/ -volname "Example" "example.dmg"
./eula_into_dmg.sh "example.dmg" "EULA.txt"
# you should also codesign the dmg if you're going to distribute it:
codesign -s "$CODE_SIGN_IDENTITY" -v "$dmg"
This is eula_into_dmg.sh
:
#!/bin/bash -u
if [[ $# -ne 2 ]]; then
echo "Usage: $0 <dmg> <license>"
exit 1
fi
prefix=$(base64 -D <<<\
H4sIAJtVUFoCA4VWW2vbSBh9bn7Fh3ahbci6o9FcLPahJJIMBbcNjaH7qjpyYupaiyW3pGX/+55vpJF1\
ianBYmTjo/Ody4zv8zqnl6v3t8uX9CqU8ysKlrfbdfCafl28+DMII6XIaGPIhFaTSawiKVSCW5ORsfxZ\
aGxAvdebS5qlxSY/7mpa5vuHY/5Al28YzWgpSMWAVEpb0hIroVVEZsFAGcDVQkVjtILepennT+ksKY/7\
+mPSoqlM4+dKXpO8dhfQ0hE+U5G4IRvZGBcpxmgfVrNLvJZ3q2RWPVXkuSUmBAVjeb4YBMFNWy2xCjFp\
YhZkIhOO0XYY0NPbleu8Q8OkVhrtKDQzSyHnmJS1NBYza6smaHQoKsDRq3KzqYq6RZMCPwIaKKRAi3SE\
i8DlJGMoIjlGo82h/EZaCOHoSY+WGkk2tmws0E6DW80rC9LRQk24/fXlqS7cvDC0eJu2aK1GQnkXcFGJ\
jkiD3ABjgMaEWhsyRvrv74uLe5dFjh+yyLTbEGIlCG9JfjW6KLeahHD0Gj7mbvXpj/YxyHy2f9htq0f6\
cqzrcl8FpycbEqnSjUCQijNl5vDSyQcbrYrCZ57sAeuiqsNWKkSd9bWSG6VJzLlbMUchZPU5LUYLPUG7\
fjgUxSzdVrlbeOEFA8WooVUCKUA4yRpgyExmuFj4EBszRrs9bPf17C7/XoDlz3ebLmKoi6shwtZniS8s\
swTV+bRM9FQeydGiH9v60ZfJKmjk0oWV5tHSpggu/o14cxOP0erHAoIdvlVUbnCz9WhRE9OYG+j2CW6P\
TJhq1H1xM0araLddF/uquKI1Vl+7SSUC21Mctw2jBT8mZEg8ZjJp4GwIqC4pX6+LjhvI+IGcWlEzpFWs\
W+hklNmEW+WGrcpN/SM/dJ6Cm3Cu0cAPzy3DDmDVMy4QfGQn7kval3W3pfWHZLVstyc50qyDmrrg7Lyi\
f7EVVRSkJxeGucikPFPv4aRNaINz7ZOn9g1bZ6etGxbofOuaxvjWnakZDQs0PcJ835rG+NZNanbzjGGT\
HaHt26/Wp+6YOFMzGhZojHbqW9MY79CZmtGwQGO0U9+axnhuvZo9Exyv5RjN9a3NDttwOvoHNXOyR3wb\
GvybSNqZJ0e/69t2X9X5bgeK/T8SiMSCj1JF1rIpsjFFNAe4MdOe9AvHlfG6xdwrdxYqrOBfxk6q0VY4\
RusVLu/lTbpZXLbc+cDaSznJ4BitVziXu4Fu2W+bNtFtdNytsn9W0+PubnntSvc/iogHYQYKAAA= | gunzip -)
suffix=$(base64 -D <<<\
H4sIANNVUFoCA6u15uJKSSxJVFAvLqnMUVfQMDUwMNBRUHLNS8/JLM5QCPZxVNJUqObiVFECShgrAAkD\
OOEMIiyBhKEJQkJJAQnoaynowcAxCKWgpQ81zUABgzAyRzMXp2nqEBNhphliMw3JXEewuThNAwEtZLeh\
+wqNQDEIbtoxZONAZtVacwEAUriwzWEBAAA= | gunzip -)
temp=$(mktemp)
echo -n "$prefix" > "$temp"
cat "$2" | dd conv=swab | hexdump -v -e '8/2 "%04x " "\n"' | sed -e 's/ *$//' -e 's/^/ $"/' -e 's/$/"/' >> "$temp"
echo -n "$suffix" >> "$temp"
hdiutil unflatten "$1"
Rez -a "$temp" -o "$1"
hdiutil flatten "$1"
rm "$temp"
Upvotes: 2
Reputation: 14
There is no default UI Element for it, nor is there a well known community option. Best option is to design your own.
Upvotes: -1