From f1aedb13d2d3b572e7783a9b527553905eed76e8 Mon Sep 17 00:00:00 2001 From: philbrisco Date: Thu, 5 Mar 2015 08:55:09 -0700 Subject: [PATCH] Create README.md --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..51d75da --- /dev/null +++ b/README.md @@ -0,0 +1,24 @@ +# MTPopupWindow +Swift port of Marin Todorov's Objective-C class library + +This allows the use of Marin Todorov's excellent library in Swift projects without having to resort to bridging headers. +MTPopup easily creates popup windows for use in a program. The implementation can be as simple as creating an instance of the +class, giving it the name of the HTML file to be displayed in the popup window and telling the instance to display the page, +thusly: + + var winPop = MTPopupWindow() + winPop.fileName = "about.html" + winPop.showInView(self.view) + +As can be seen above, an instantiation of the class is assigned to the variable 'winPop', the instance property 'fileName' is +assigned the name of an HTML file that is stored in the application's bundle and the instance method 'showInView' is called to +display the file referenced by the 'fileName'. As an added enhancment, the ability to add a sound when the window's close +button is touched has been added. The method 'clickBtnSound' is called with the name of a sound file and its type. This should +be placed before the 'showInView' method is called: + + var winPop = MTPopupWindow() + winPop.clickBtnSound("Click", fileType: "wav") + winPop.fileName = "about.html" + winPop.showInView(self.view) + +Setting up MTPopupWindow for use in a project simply requires dropping the MTPopupWindow.Swift file into the desired project.