Compare commits
92 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 76ad9f1828 | |||
| e042cb52c6 | |||
| d239f5d3c8 | |||
| 57d64c3f48 | |||
| d88128933a | |||
| 2423fa9bbf | |||
| 1b029ff382 | |||
| 83e1a11bef | |||
| 8a62e44836 | |||
| c6445f9735 | |||
| ccb4aabee9 | |||
| ed6da6d0d8 | |||
| 127390ec3a | |||
| be772db3a8 | |||
| 4223096348 | |||
| d4672bd1cf | |||
| e5f7ef6de4 | |||
| 2541588494 | |||
| 2193224759 | |||
| 13b7392cd8 | |||
| 41d7adbe1d | |||
| c88d455a59 | |||
| 84e443b6e0 | |||
| c8cd829d53 | |||
| e9a254191c | |||
| 01266bd064 | |||
| 1fa7b3782b | |||
| 6dcb0a3cae | |||
| b53395a360 | |||
| 44dd189359 | |||
| a96d89c493 | |||
| a033fb435c | |||
| d6d0241a22 | |||
| 50953a681d | |||
| ef716d63a6 | |||
| 03585df85b | |||
| 18d4b5cec4 | |||
| b172e74f65 | |||
| 51379e0ade | |||
| 0c29a4d761 | |||
| 01712751b1 | |||
| 3f98e72b7c | |||
| eb72238cbf | |||
| ba1681bc9a | |||
| 8efedde1c9 | |||
| 64653d444d | |||
| 27db3474ce | |||
| 2b284370bf | |||
| 1161ccb54d | |||
| a3b05ed8bd | |||
| a328df3264 | |||
| cc37c283cc | |||
| 242d6f6ed9 | |||
| e4a1ab4c17 | |||
| 799737642b | |||
| 72b6ebe517 | |||
| 698c73cabc | |||
| b22c0b8315 | |||
| 14dd577596 | |||
| 22ae08fbae | |||
| f070f97a01 | |||
| cf08b69467 | |||
| 1d556f4508 | |||
| 3322aeeb7d | |||
| b0fea1eb8b | |||
| 25c9b6a4b0 | |||
| b68ea0cb76 | |||
| 5b94d99749 | |||
| 707a342626 | |||
| 7a14abda47 | |||
| a557a50d2d | |||
| 5c435151b8 | |||
| 4fd0d50828 | |||
| e6cdacf815 | |||
| f960678eb5 | |||
| 388cbafad8 | |||
| 32eee3dde5 | |||
| be5c95cd2a | |||
| 6f72e280dc | |||
| 841294ccb6 | |||
| 5d047215f4 | |||
| 7e774e4b82 | |||
| c79aaeae9a | |||
| 45d8d36350 | |||
| 0e184c99ce | |||
| 2d69123d47 | |||
| 70330e0aa5 | |||
| 6742dd0dd1 | |||
| 91a21667e3 | |||
| ab6d84c089 | |||
| 4fb0eff9ee | |||
| 61852a112b |
@@ -0,0 +1,6 @@
|
||||
osx_image: xcode8
|
||||
language: objective-c
|
||||
|
||||
xcode_project: CircleMenu.xcodeproj
|
||||
xcode_scheme: CircleMenu
|
||||
xcode_sdk: iphonesimulator
|
||||
@@ -0,0 +1,45 @@
|
||||
# Change Log
|
||||
|
||||
## [1.0.0](https://github.com/Ramotion/circle-menu/tree/1.0.0) (2016-03-24)
|
||||
[Full Changelog](https://github.com/Ramotion/circle-menu/compare/0.0.7...1.0.0)
|
||||
|
||||
**Closed issues:**
|
||||
|
||||
- Add tap gesture recognizer on view to close the menu [\#9](https://github.com/Ramotion/circle-menu/issues/9)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
- fixed swift 2.2 deprecated warnings in circlemenu.swift [\#10](https://github.com/Ramotion/circle-menu/pull/10) ([sairamkotha](https://github.com/sairamkotha))
|
||||
|
||||
## [0.0.7](https://github.com/Ramotion/circle-menu/tree/0.0.7) (2016-03-16)
|
||||
[Full Changelog](https://github.com/Ramotion/circle-menu/compare/0.0.6...0.0.7)
|
||||
|
||||
## [0.0.6](https://github.com/Ramotion/circle-menu/tree/0.0.6) (2016-03-14)
|
||||
[Full Changelog](https://github.com/Ramotion/circle-menu/compare/0.0.5...0.0.6)
|
||||
|
||||
**Closed issues:**
|
||||
|
||||
- Problem! [\#7](https://github.com/Ramotion/circle-menu/issues/7)
|
||||
- Menu icon position [\#6](https://github.com/Ramotion/circle-menu/issues/6)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
- Fix crash in example [\#3](https://github.com/Ramotion/circle-menu/pull/3) ([skywinder](https://github.com/skywinder))
|
||||
- Cleaning and docking [\#2](https://github.com/Ramotion/circle-menu/pull/2) ([Skogetroll](https://github.com/Skogetroll))
|
||||
|
||||
## [0.0.5](https://github.com/Ramotion/circle-menu/tree/0.0.5) (2016-02-10)
|
||||
[Full Changelog](https://github.com/Ramotion/circle-menu/compare/0.0.4...0.0.5)
|
||||
|
||||
## [0.0.4](https://github.com/Ramotion/circle-menu/tree/0.0.4) (2016-02-09)
|
||||
[Full Changelog](https://github.com/Ramotion/circle-menu/compare/0.0.3...0.0.4)
|
||||
|
||||
## [0.0.3](https://github.com/Ramotion/circle-menu/tree/0.0.3) (2016-02-04)
|
||||
[Full Changelog](https://github.com/Ramotion/circle-menu/compare/0.0.2...0.0.3)
|
||||
|
||||
## [0.0.2](https://github.com/Ramotion/circle-menu/tree/0.0.2) (2016-02-03)
|
||||
[Full Changelog](https://github.com/Ramotion/circle-menu/compare/0.0.1...0.0.2)
|
||||
|
||||
## [0.0.1](https://github.com/Ramotion/circle-menu/tree/0.0.1) (2016-02-03)
|
||||
|
||||
|
||||
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
|
||||
@@ -0,0 +1,33 @@
|
||||
# Contributing to a Project
|
||||
Now that you’ve found the material for understanding the project, here is how you can take action.
|
||||
|
||||
### Create an Issue
|
||||
|
||||
If you find a bug in a project you’re using (and you don’t know how to fix it), have trouble following the documentation or have a question about the project – create an issue! There’s nothing to it and whatever issue you’re having, you’re likely not the only one, so others will find your issue helpful, too. For more information on how issues work, check out our Issues guide.
|
||||
|
||||
#### Issues Pro Tips
|
||||
|
||||
Check existing issues for your issue. Duplicating an issue is slower for both parties so search through open and closed issues to see if what you’re running into has been addressed already.
|
||||
Be clear about what your problem is: what was the expected outcome, what happened instead? Detail how someone else can recreate the problem.
|
||||
Link to demos recreating the problem on things like JSFiddle or CodePen.
|
||||
Include system details like what the browser, library or operating system you’re using and its version.
|
||||
Paste error output or logs in your issue or in a Gist. If pasting them in the issue, wrap it in three backticks: ``` so that it renders nicely.
|
||||
|
||||
### Pull Request
|
||||
|
||||
If you’re able to patch the bug or add the feature yourself – fantastic, make a pull request with the code! Be sure you’ve read any documents on contributing, understand the license and have signed a CLA if required. Once you’ve submitted a pull request the maintainer(s) can compare your branch to the existing one and decide whether or not to incorporate (pull in) your changes.
|
||||
|
||||
#### Pull Request Pro Tips
|
||||
|
||||
Fork the repository and clone it locally. Connect your local to the original ‘upstream’ repository by adding it as a remote. Pull in changes from ‘upstream’ often so that you stay up to date so that when you submit your pull request, merge conflicts will be less likely. See more detailed instructions here.
|
||||
Create a branch for your edits.
|
||||
Be clear about what problem is occurring and how someone can recreate that problem or why your feature will help. Then be equally as clear about the steps you took to make your changes.
|
||||
It’s best to test. Run your changes against any existing tests if they exist and create new ones when needed. Whether tests exist or not, make sure your changes don’t break the existing project.
|
||||
Include screenshots of the before and after if your changes include differences in HTML/CSS. Drag and drop the images into the body of your pull request.
|
||||
Contribute in the style of the project to the best of your abilities. This may mean using indents, semi colons or comments differently than you would in your own repository, but makes it easier for the maintainer to merge, others to understand and maintain in the future.
|
||||
|
||||
#### Open Pull Requests
|
||||
|
||||
Once you’ve opened a pull request a discussion will start around your proposed changes. Other contributors and users may chime in, but ultimately the decision is made by the maintainer(s). You may be asked to make some changes to your pull request, if so, add more commits to your branch and push them – they’ll automatically go into the existing pull request.
|
||||
|
||||
If your pull request is merged – great! If it is not, no sweat, it may not be what the project maintainer had in mind, or they were already working on it. This happens, so our recommendation is to take any feedback you’ve received and go forth and pull request again – or create your own open source project.
|
||||
@@ -1,12 +1,11 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'CircleMenu'
|
||||
s.version = '0.0.1'
|
||||
s.version = '2.0.1'
|
||||
s.summary = 'Amazing animation with buttons'
|
||||
s.homepage = 'https://github.com/Ramotion/circle-menu'
|
||||
s.license = 'MIT'
|
||||
s.authors = { 'Juri Vasylenko' => 'juri.v@ramotion.com' }
|
||||
s.ios.deployment_target = '8.0'
|
||||
s.ios.deployment_target = '9.0'
|
||||
s.source = { :git => 'https://github.com/Ramotion/circle-menu.git', :tag => s.version.to_s }
|
||||
s.source_files = 'CircleMenuLib/**/*.swift'
|
||||
s.requires_arc = true
|
||||
end
|
||||
|
||||
@@ -7,9 +7,19 @@
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
8403F57C1CFF2C2E007D0BD1 /* CircleMenu.h in Headers */ = {isa = PBXBuildFile; fileRef = 8403F57B1CFF2C2E007D0BD1 /* CircleMenu.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
8403F5801CFF2C2E007D0BD1 /* CircleMenu.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8403F5791CFF2C2E007D0BD1 /* CircleMenu.framework */; };
|
||||
8403F5811CFF2C2E007D0BD1 /* CircleMenu.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 8403F5791CFF2C2E007D0BD1 /* CircleMenu.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
8403F5861CFF2C46007D0BD1 /* CircleMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 841EC58D1C58E898008872D5 /* CircleMenu.swift */; };
|
||||
8403F5871CFF2C4B007D0BD1 /* CircleMenuLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 841EC5931C58F3E2008872D5 /* CircleMenuLoader.swift */; };
|
||||
8403F5881CFF2C4F007D0BD1 /* CircleMenuButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 841EC58F1C58E898008872D5 /* CircleMenuButton.swift */; };
|
||||
841EC5901C58E898008872D5 /* CircleMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 841EC58D1C58E898008872D5 /* CircleMenu.swift */; };
|
||||
841EC5911C58E898008872D5 /* CircleMenuButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 841EC58F1C58E898008872D5 /* CircleMenuButton.swift */; };
|
||||
841EC5941C58F3E2008872D5 /* CircleMenuLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 841EC5931C58F3E2008872D5 /* CircleMenuLoader.swift */; };
|
||||
8497460C1C6A1C5D001E7184 /* CircleMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 841EC58D1C58E898008872D5 /* CircleMenu.swift */; };
|
||||
8497460D1C6A1C6D001E7184 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 84F248BD1C58E65F008F12C1 /* Assets.xcassets */; };
|
||||
8497460E1C6A1C9D001E7184 /* CircleMenuLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 841EC5931C58F3E2008872D5 /* CircleMenuLoader.swift */; };
|
||||
8497460F1C6A1CA0001E7184 /* CircleMenuButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 841EC58F1C58E898008872D5 /* CircleMenuButton.swift */; };
|
||||
84F248B71C58E65F008F12C1 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84F248B61C58E65F008F12C1 /* AppDelegate.swift */; };
|
||||
84F248B91C58E65F008F12C1 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84F248B81C58E65F008F12C1 /* ViewController.swift */; };
|
||||
84F248BC1C58E65F008F12C1 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 84F248BA1C58E65F008F12C1 /* Main.storyboard */; };
|
||||
@@ -19,6 +29,13 @@
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
8403F57E1CFF2C2E007D0BD1 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 84F248AB1C58E65F008F12C1 /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 8403F5781CFF2C2E007D0BD1;
|
||||
remoteInfo = CircleMenu;
|
||||
};
|
||||
84F248C81C58E65F008F12C1 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 84F248AB1C58E65F008F12C1 /* Project object */;
|
||||
@@ -28,11 +45,28 @@
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
8403F5851CFF2C2E007D0BD1 /* Embed Frameworks */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
8403F5811CFF2C2E007D0BD1 /* CircleMenu.framework in Embed Frameworks */,
|
||||
);
|
||||
name = "Embed Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
8403F5791CFF2C2E007D0BD1 /* CircleMenu.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CircleMenu.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
8403F57B1CFF2C2E007D0BD1 /* CircleMenu.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CircleMenu.h; sourceTree = "<group>"; };
|
||||
8403F57D1CFF2C2E007D0BD1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
841EC58D1C58E898008872D5 /* CircleMenu.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CircleMenu.swift; sourceTree = "<group>"; };
|
||||
841EC58F1C58E898008872D5 /* CircleMenuButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CircleMenuButton.swift; sourceTree = "<group>"; };
|
||||
841EC5931C58F3E2008872D5 /* CircleMenuLoader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CircleMenuLoader.swift; sourceTree = "<group>"; };
|
||||
84F248B31C58E65F008F12C1 /* CircleMenu.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CircleMenu.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
84F248B31C58E65F008F12C1 /* CircleMenuDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CircleMenuDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
84F248B61C58E65F008F12C1 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
84F248B81C58E65F008F12C1 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
|
||||
84F248BB1C58E65F008F12C1 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||
@@ -45,10 +79,18 @@
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
8403F5751CFF2C2E007D0BD1 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
84F248B01C58E65F008F12C1 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8403F5801CFF2C2E007D0BD1 /* CircleMenu.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -62,6 +104,15 @@
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
8403F57A1CFF2C2E007D0BD1 /* CircleMenu */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8403F57B1CFF2C2E007D0BD1 /* CircleMenu.h */,
|
||||
8403F57D1CFF2C2E007D0BD1 /* Info.plist */,
|
||||
);
|
||||
path = CircleMenu;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
841EC58C1C58E87F008872D5 /* CircleMenuLib */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -94,6 +145,7 @@
|
||||
841EC58C1C58E87F008872D5 /* CircleMenuLib */,
|
||||
84F248B51C58E65F008F12C1 /* CircleMenu */,
|
||||
84F248CA1C58E65F008F12C1 /* CircleMenuTests */,
|
||||
8403F57A1CFF2C2E007D0BD1 /* CircleMenu */,
|
||||
84F248B41C58E65F008F12C1 /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
@@ -101,8 +153,9 @@
|
||||
84F248B41C58E65F008F12C1 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
84F248B31C58E65F008F12C1 /* CircleMenu.app */,
|
||||
84F248B31C58E65F008F12C1 /* CircleMenuDemo.app */,
|
||||
84F248C71C58E65F008F12C1 /* CircleMenuTests.xctest */,
|
||||
8403F5791CFF2C2E007D0BD1 /* CircleMenu.framework */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@@ -131,15 +184,26 @@
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXHeadersBuildPhase section */
|
||||
8403F5761CFF2C2E007D0BD1 /* Headers */ = {
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8403F57C1CFF2C2E007D0BD1 /* CircleMenu.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXHeadersBuildPhase section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
84F248B21C58E65F008F12C1 /* CircleMenu */ = {
|
||||
8403F5781CFF2C2E007D0BD1 /* CircleMenu */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 84F248D01C58E65F008F12C1 /* Build configuration list for PBXNativeTarget "CircleMenu" */;
|
||||
buildConfigurationList = 8403F5821CFF2C2E007D0BD1 /* Build configuration list for PBXNativeTarget "CircleMenu" */;
|
||||
buildPhases = (
|
||||
84F248AF1C58E65F008F12C1 /* Sources */,
|
||||
84F248B01C58E65F008F12C1 /* Frameworks */,
|
||||
84F248B11C58E65F008F12C1 /* Resources */,
|
||||
846980FB1C59F398002D77BE /* swift lint */,
|
||||
8403F5741CFF2C2E007D0BD1 /* Sources */,
|
||||
8403F5751CFF2C2E007D0BD1 /* Frameworks */,
|
||||
8403F5761CFF2C2E007D0BD1 /* Headers */,
|
||||
8403F5771CFF2C2E007D0BD1 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -147,7 +211,27 @@
|
||||
);
|
||||
name = CircleMenu;
|
||||
productName = CircleMenu;
|
||||
productReference = 84F248B31C58E65F008F12C1 /* CircleMenu.app */;
|
||||
productReference = 8403F5791CFF2C2E007D0BD1 /* CircleMenu.framework */;
|
||||
productType = "com.apple.product-type.framework";
|
||||
};
|
||||
84F248B21C58E65F008F12C1 /* CircleMenuDemo */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 84F248D01C58E65F008F12C1 /* Build configuration list for PBXNativeTarget "CircleMenuDemo" */;
|
||||
buildPhases = (
|
||||
84F248AF1C58E65F008F12C1 /* Sources */,
|
||||
84F248B01C58E65F008F12C1 /* Frameworks */,
|
||||
84F248B11C58E65F008F12C1 /* Resources */,
|
||||
846980FB1C59F398002D77BE /* swift lint */,
|
||||
8403F5851CFF2C2E007D0BD1 /* Embed Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
8403F57F1CFF2C2E007D0BD1 /* PBXTargetDependency */,
|
||||
);
|
||||
name = CircleMenuDemo;
|
||||
productName = CircleMenu;
|
||||
productReference = 84F248B31C58E65F008F12C1 /* CircleMenuDemo.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
84F248C61C58E65F008F12C1 /* CircleMenuTests */ = {
|
||||
@@ -175,11 +259,17 @@
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftUpdateCheck = 0720;
|
||||
LastUpgradeCheck = 0720;
|
||||
LastUpgradeCheck = 0800;
|
||||
ORGANIZATIONNAME = "Alex K.";
|
||||
TargetAttributes = {
|
||||
8403F5781CFF2C2E007D0BD1 = {
|
||||
CreatedOnToolsVersion = 7.3.1;
|
||||
LastSwiftMigration = 0800;
|
||||
};
|
||||
84F248B21C58E65F008F12C1 = {
|
||||
CreatedOnToolsVersion = 7.2;
|
||||
DevelopmentTeam = 34MUF9YXTA;
|
||||
LastSwiftMigration = 0800;
|
||||
};
|
||||
84F248C61C58E65F008F12C1 = {
|
||||
CreatedOnToolsVersion = 7.2;
|
||||
@@ -200,13 +290,21 @@
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
84F248B21C58E65F008F12C1 /* CircleMenu */,
|
||||
84F248B21C58E65F008F12C1 /* CircleMenuDemo */,
|
||||
84F248C61C58E65F008F12C1 /* CircleMenuTests */,
|
||||
8403F5781CFF2C2E007D0BD1 /* CircleMenu */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
8403F5771CFF2C2E007D0BD1 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
84F248B11C58E65F008F12C1 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -221,6 +319,7 @@
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8497460D1C6A1C6D001E7184 /* Assets.xcassets in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -244,6 +343,16 @@
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
8403F5741CFF2C2E007D0BD1 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8403F5861CFF2C46007D0BD1 /* CircleMenu.swift in Sources */,
|
||||
8403F5881CFF2C4F007D0BD1 /* CircleMenuButton.swift in Sources */,
|
||||
8403F5871CFF2C4B007D0BD1 /* CircleMenuLoader.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
84F248AF1C58E65F008F12C1 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -260,16 +369,24 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8497460F1C6A1CA0001E7184 /* CircleMenuButton.swift in Sources */,
|
||||
8497460C1C6A1C5D001E7184 /* CircleMenu.swift in Sources */,
|
||||
84F248CC1C58E65F008F12C1 /* CircleMenuTests.swift in Sources */,
|
||||
8497460E1C6A1C9D001E7184 /* CircleMenuLoader.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
8403F57F1CFF2C2E007D0BD1 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 8403F5781CFF2C2E007D0BD1 /* CircleMenu */;
|
||||
targetProxy = 8403F57E1CFF2C2E007D0BD1 /* PBXContainerItemProxy */;
|
||||
};
|
||||
84F248C91C58E65F008F12C1 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 84F248B21C58E65F008F12C1 /* CircleMenu */;
|
||||
target = 84F248B21C58E65F008F12C1 /* CircleMenuDemo */;
|
||||
targetProxy = 84F248C81C58E65F008F12C1 /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
@@ -294,6 +411,54 @@
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
8403F5831CFF2C2E007D0BD1 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
INFOPLIST_FILE = CircleMenu/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.ramotion.CircleMenu;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_VERSION = 3.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
8403F5841CFF2C2E007D0BD1 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
INFOPLIST_FILE = CircleMenu/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.ramotion.CircleMenu;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_VERSION = 3.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
84F248CE1C58E65F008F12C1 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
@@ -307,8 +472,10 @@
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
@@ -330,7 +497,7 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.2;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
@@ -351,8 +518,10 @@
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
@@ -368,9 +537,10 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.2;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
@@ -378,26 +548,32 @@
|
||||
84F248D11C58E65F008F12C1 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
INFOPLIST_FILE = CircleMenu/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
OTHER_SWIFT_FLAGS = "";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.ramotion.CircleMenu;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.ramotion.dev;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 3.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
84F248D21C58E65F008F12C1 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
INFOPLIST_FILE = CircleMenu/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
OTHER_SWIFT_FLAGS = "";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.ramotion.CircleMenu;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.ramotion.dev;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 3.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
@@ -428,6 +604,15 @@
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
8403F5821CFF2C2E007D0BD1 /* Build configuration list for PBXNativeTarget "CircleMenu" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
8403F5831CFF2C2E007D0BD1 /* Debug */,
|
||||
8403F5841CFF2C2E007D0BD1 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
84F248AE1C58E65F008F12C1 /* Build configuration list for PBXProject "CircleMenu" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
@@ -437,7 +622,7 @@
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
84F248D01C58E65F008F12C1 /* Build configuration list for PBXNativeTarget "CircleMenu" */ = {
|
||||
84F248D01C58E65F008F12C1 /* Build configuration list for PBXNativeTarget "CircleMenuDemo" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
84F248D11C58E65F008F12C1 /* Debug */,
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0800"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "8403F5781CFF2C2E007D0BD1"
|
||||
BuildableName = "CircleMenu.framework"
|
||||
BlueprintName = "CircleMenu"
|
||||
ReferencedContainer = "container:CircleMenu.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "8403F5781CFF2C2E007D0BD1"
|
||||
BuildableName = "CircleMenu.framework"
|
||||
BlueprintName = "CircleMenu"
|
||||
ReferencedContainer = "container:CircleMenu.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "8403F5781CFF2C2E007D0BD1"
|
||||
BuildableName = "CircleMenu.framework"
|
||||
BlueprintName = "CircleMenu"
|
||||
ReferencedContainer = "container:CircleMenu.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
@@ -15,29 +15,29 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
|
||||
|
||||
func application(
|
||||
application: UIApplication,
|
||||
didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
|
||||
_ application: UIApplication,
|
||||
didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func applicationWillResignActive(application: UIApplication) {
|
||||
|
||||
func applicationWillResignActive(_ application: UIApplication) {
|
||||
|
||||
}
|
||||
|
||||
func applicationDidEnterBackground(application: UIApplication) {
|
||||
|
||||
func applicationDidEnterBackground(_ application: UIApplication) {
|
||||
|
||||
}
|
||||
|
||||
func applicationWillEnterForeground(application: UIApplication) {
|
||||
|
||||
func applicationWillEnterForeground(_ application: UIApplication) {
|
||||
|
||||
}
|
||||
|
||||
func applicationDidBecomeActive(application: UIApplication) {
|
||||
|
||||
func applicationDidBecomeActive(_ application: UIApplication) {
|
||||
|
||||
}
|
||||
|
||||
func applicationWillTerminate(application: UIApplication) {
|
||||
|
||||
func applicationWillTerminate(_ application: UIApplication) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "20x20",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "20x20",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "icon_close.pdf",
|
||||
"filename" : "close-btn2.pdf",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "icon_back.pdf",
|
||||
"filename" : "home-btn2-1.pdf",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
@@ -9,7 +9,7 @@
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "icon_menu.pdf",
|
||||
"filename" : "Menu-btn2.pdf",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "icon_play.pdf",
|
||||
"filename" : "search-btn2.pdf",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
@@ -1,15 +1,12 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "icon_replay.pdf",
|
||||
"filename" : "nearby-btn2.pdf",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "notifications-btn.pdf",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "settings-btn.pdf",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
@@ -1,25 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9531" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11201" systemVersion="15G1004" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11161"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--Delegate-->
|
||||
<scene sceneID="tne-QT-ifu">
|
||||
<objects>
|
||||
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="CircleMenu" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="CircleMenuDemo" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="eLo-Wn-oPF" customClass="CircleMenu" customModule="CircleMenu" customModuleProvider="target">
|
||||
<rect key="frame" x="270" y="270" width="60" height="60"/>
|
||||
<color key="backgroundColor" red="0.89803921568627454" green="0.36862745098039218" blue="0.29411764705882354" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="eLo-Wn-oPF" customClass="CircleMenu" customModule="CircleMenuDemo" customModuleProvider="target">
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="60" id="HWk-Xa-dX7"/>
|
||||
<constraint firstAttribute="height" constant="60" id="Xnk-f6-9Ej"/>
|
||||
@@ -31,7 +30,7 @@
|
||||
<integer key="value" value="30"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="buttonsCount">
|
||||
<integer key="value" value="4"/>
|
||||
<integer key="value" value="5"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="distance">
|
||||
<real key="value" value="120"/>
|
||||
@@ -39,25 +38,29 @@
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="duration">
|
||||
<real key="value" value="0.5"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="showDelay">
|
||||
<real key="value" value="0.0"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="BYZ-38-t0r" id="Rln-EX-2ni"/>
|
||||
<outlet property="delegate" destination="BYZ-38-t0r" id="mcN-5O-ZPf"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="0.15868747234344482" green="0.21822044253349304" blue="0.30320093035697937" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="backgroundColor" red="0.058823529411764705" green="0.078431372549019607" blue="0.15294117647058825" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstItem="eLo-Wn-oPF" firstAttribute="centerY" secondItem="8bC-Xf-vdC" secondAttribute="centerY" id="hwK-4W-0MQ"/>
|
||||
<constraint firstItem="eLo-Wn-oPF" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="tQC-3B-L2F"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<nil key="simulatedStatusBarMetrics"/>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
</scene>
|
||||
</scenes>
|
||||
<resources>
|
||||
<image name="icon_close" width="100" height="100"/>
|
||||
<image name="icon_menu" width="140" height="140"/>
|
||||
<image name="icon_close" width="120" height="120"/>
|
||||
<image name="icon_menu" width="120" height="120"/>
|
||||
</resources>
|
||||
</document>
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// CircleMenu.h
|
||||
// CircleMenu
|
||||
//
|
||||
// Created by Alex K. on 01/06/16.
|
||||
// Copyright © 2016 Alex K. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
//! Project version number for CircleMenu.
|
||||
FOUNDATION_EXPORT double CircleMenuVersionNumber;
|
||||
|
||||
//! Project version string for CircleMenu.
|
||||
FOUNDATION_EXPORT const unsigned char CircleMenuVersionString[];
|
||||
|
||||
// In this header, you should import all the public headers of your framework using statements like #import <CircleMenu/PublicHeader.h>
|
||||
|
||||
|
||||
@@ -13,28 +13,18 @@
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string></string>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIMainStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
@@ -9,61 +9,68 @@
|
||||
import UIKit
|
||||
|
||||
extension UIColor {
|
||||
static func color(red: Int, green: Int, blue: Int, alpha: Float) -> UIColor {
|
||||
return UIColor(
|
||||
colorLiteralRed: Float(1.0) / Float(255.0) * Float(red),
|
||||
green: Float(1.0) / Float(255.0) * Float(green),
|
||||
blue: Float(1.0) / Float(255.0) * Float(blue),
|
||||
alpha: alpha)
|
||||
}
|
||||
static func color(_ red: Int, green: Int, blue: Int, alpha: Float) -> UIColor {
|
||||
return UIColor(
|
||||
colorLiteralRed: Float(1.0) / Float(255.0) * Float(red),
|
||||
green: Float(1.0) / Float(255.0) * Float(green),
|
||||
blue: Float(1.0) / Float(255.0) * Float(blue),
|
||||
alpha: alpha)
|
||||
}
|
||||
}
|
||||
|
||||
class ViewController: UIViewController, CircleMenuDelegate {
|
||||
|
||||
// let colors = [UIColor.redColor(), UIColor.grayColor(), UIColor.greenColor(), UIColor.purpleColor()]
|
||||
let items: [(icon: String, color: UIColor)] = [
|
||||
("icon_back", UIColor.color(234, green: 183, blue: 84, alpha: 1)),
|
||||
("icon_play", UIColor.color(229, green: 94, blue: 75, alpha: 1)),
|
||||
("icon_replay", UIColor.color(99, green: 186, blue: 51, alpha: 1)),
|
||||
("icon_close", UIColor.color(32, green: 164, blue: 203, alpha: 1)),
|
||||
]
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
// add button
|
||||
|
||||
// let button = CircleMenu(
|
||||
// frame: CGRect(x: 200, y: 200, width: 50, height: 50),
|
||||
// normalIcon:"icon_menu",
|
||||
// selectedIcon:"icon_close",
|
||||
// buttonsCount: 4,
|
||||
// duration: 4,
|
||||
// distance: 120)
|
||||
// button.backgroundColor = UIColor.lightGrayColor()
|
||||
// button.delegate = self
|
||||
// button.layer.cornerRadius = button.frame.size.width / 2.0
|
||||
// view.addSubview(button)
|
||||
|
||||
}
|
||||
|
||||
override func didReceiveMemoryWarning() {
|
||||
super.didReceiveMemoryWarning()
|
||||
// Dispose of any resources that can be recreated.
|
||||
}
|
||||
|
||||
|
||||
// MARK: <CircleMenuDelegate>
|
||||
|
||||
// let colors = [UIColor.redColor(), UIColor.grayColor(), UIColor.greenColor(), UIColor.purpleColor()]
|
||||
let items: [(icon: String, color: UIColor)] = [
|
||||
("icon_home", UIColor(red:0.19, green:0.57, blue:1, alpha:1)),
|
||||
("icon_search", UIColor(red:0.22, green:0.74, blue:0, alpha:1)),
|
||||
("notifications-btn", UIColor(red:0.96, green:0.23, blue:0.21, alpha:1)),
|
||||
("settings-btn", UIColor(red:0.51, green:0.15, blue:1, alpha:1)),
|
||||
("nearby-btn", UIColor(red:1, green:0.39, blue:0, alpha:1)),
|
||||
]
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
func circleMenu(circleMenu: CircleMenu, willDisplay button: CircleMenuButton, atIndex: Int) {
|
||||
button.backgroundColor = items[atIndex].color
|
||||
button.setImage(UIImage(imageLiteral: items[atIndex].icon), forState: .Normal)
|
||||
}
|
||||
// add button
|
||||
|
||||
func circleMenu(circleMenu: CircleMenu, buttonWillSelected button: CircleMenuButton, atIndex: Int) {
|
||||
print("button will selected: \(atIndex)")
|
||||
}
|
||||
// let button = CircleMenu(
|
||||
// frame: CGRect(x: 200, y: 200, width: 50, height: 50),
|
||||
// normalIcon:"icon_menu",
|
||||
// selectedIcon:"icon_close",
|
||||
// buttonsCount: 4,
|
||||
// duration: 4,
|
||||
// distance: 120)
|
||||
// button.backgroundColor = UIColor.lightGrayColor()
|
||||
// button.delegate = self
|
||||
// button.layer.cornerRadius = button.frame.size.width / 2.0
|
||||
// view.addSubview(button)
|
||||
|
||||
func circleMenu(circleMenu: CircleMenu, buttonDidSelected button: CircleMenuButton, atIndex: Int) {
|
||||
print("button did selected: \(atIndex)")
|
||||
}
|
||||
}
|
||||
|
||||
override func didReceiveMemoryWarning() {
|
||||
super.didReceiveMemoryWarning()
|
||||
// Dispose of any resources that can be recreated.
|
||||
}
|
||||
|
||||
|
||||
// MARK: <CircleMenuDelegate>
|
||||
|
||||
func circleMenu(_ circleMenu: CircleMenu, willDisplay button: UIButton, atIndex: Int) {
|
||||
button.backgroundColor = items[atIndex].color
|
||||
|
||||
button.setImage(UIImage(named: items[atIndex].icon), for: .normal)
|
||||
|
||||
// set highlited image
|
||||
let highlightedImage = UIImage(named: items[atIndex].icon)?.withRenderingMode(.alwaysTemplate)
|
||||
button.setImage(highlightedImage, for: .highlighted)
|
||||
button.tintColor = UIColor.init(colorLiteralRed: 0, green: 0, blue: 0, alpha: 0.3)
|
||||
}
|
||||
|
||||
func circleMenu(_ circleMenu: CircleMenu, buttonWillSelected button: UIButton, atIndex: Int) {
|
||||
print("button will selected: \(atIndex)")
|
||||
}
|
||||
|
||||
func circleMenu(_ circleMenu: CircleMenu, buttonDidSelected button: UIButton, atIndex: Int) {
|
||||
print("button did selected: \(atIndex)")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,399 +26,467 @@ import UIKit
|
||||
|
||||
// MARK: helpers
|
||||
|
||||
@warn_unused_result
|
||||
public func Init<Type>(value: Type, @noescape block: (object: Type) -> Void) -> Type {
|
||||
block(object: value)
|
||||
return value
|
||||
|
||||
func Init<Type>(_ value: Type, block: (_ object: Type) -> Void) -> Type {
|
||||
block(value)
|
||||
return value
|
||||
}
|
||||
|
||||
// MARK: Protocol
|
||||
// MARK: Protocol
|
||||
|
||||
@objc protocol CircleMenuDelegate {
|
||||
|
||||
// don't change button.tag
|
||||
optional func circleMenu(circleMenu: CircleMenu, willDisplay button: CircleMenuButton, atIndex: Int)
|
||||
|
||||
// call before animation
|
||||
optional func circleMenu(circleMenu: CircleMenu, buttonWillSelected button: CircleMenuButton, atIndex: Int)
|
||||
|
||||
// call after animation
|
||||
optional func circleMenu(circleMenu: CircleMenu, buttonDidSelected button: CircleMenuButton, atIndex: Int)
|
||||
/**
|
||||
* CircleMenuDelegate
|
||||
*/
|
||||
@objc public protocol CircleMenuDelegate {
|
||||
|
||||
/**
|
||||
Tells the delegate the circle menu is about to draw a button for a particular index.
|
||||
|
||||
- parameter circleMenu: The circle menu object informing the delegate of this impending event.
|
||||
- parameter button: A circle menu button object that circle menu is going to use when drawing the row. Don't change button.tag
|
||||
- parameter atIndex: An button index.
|
||||
*/
|
||||
@objc optional func circleMenu(_ circleMenu: CircleMenu, willDisplay button: UIButton, atIndex: Int)
|
||||
|
||||
/**
|
||||
Tells the delegate that a specified index is about to be selected.
|
||||
|
||||
- parameter circleMenu: A circle menu object informing the delegate about the impending selection.
|
||||
- parameter button: A selected circle menu button. Don't change button.tag
|
||||
- parameter atIndex: Selected button index
|
||||
*/
|
||||
@objc optional func circleMenu(_ circleMenu: CircleMenu, buttonWillSelected button: UIButton, atIndex: Int)
|
||||
|
||||
/**
|
||||
Tells the delegate that the specified index is now selected.
|
||||
|
||||
- parameter circleMenu: A circle menu object informing the delegate about the new index selection.
|
||||
- parameter button: A selected circle menu button. Don't change button.tag
|
||||
- parameter atIndex: Selected button index
|
||||
*/
|
||||
@objc optional func circleMenu(_ circleMenu: CircleMenu, buttonDidSelected button: UIButton, atIndex: Int)
|
||||
|
||||
/**
|
||||
Tells the delegate that the menu was collapsed - the cancel action.
|
||||
|
||||
- parameter circleMenu: A circle menu object informing the delegate about the new index selection.
|
||||
*/
|
||||
@objc optional func menuCollapsed(_ circleMenu: CircleMenu)
|
||||
}
|
||||
|
||||
// MARK: CircleMenu
|
||||
public class CircleMenu: UIButton {
|
||||
|
||||
// MARK: properties
|
||||
|
||||
@IBInspectable var buttonsCount: Int = 3
|
||||
@IBInspectable var duration: Double = 2 // circle animation duration
|
||||
@IBInspectable var distance: Float = 100 // distance between center button and buttons
|
||||
|
||||
@IBOutlet weak var delegate: AnyObject? //CircleMenuDelegate
|
||||
|
||||
var buttons: [CircleMenuButton]?
|
||||
|
||||
private var customNormalIconView: UIImageView!
|
||||
private var customSelectedIconView: UIImageView!
|
||||
|
||||
// MARK: life cicle
|
||||
init(frame: CGRect,
|
||||
normalIcon: String?,
|
||||
selectedIcon: String?,
|
||||
buttonsCount: Int = 3,
|
||||
duration: Double = 2,
|
||||
distance: Float = 100) {
|
||||
super.init(frame: frame)
|
||||
|
||||
if let _ = normalIcon {
|
||||
setImage(UIImage(named: normalIcon!), forState: .Normal)
|
||||
}
|
||||
|
||||
if let _ = selectedIcon {
|
||||
setImage(UIImage(named: selectedIcon!), forState: .Selected)
|
||||
}
|
||||
|
||||
self.buttonsCount = buttonsCount
|
||||
self.duration = duration
|
||||
self.distance = distance
|
||||
|
||||
commonInit()
|
||||
}
|
||||
|
||||
required public init?(coder aDecoder: NSCoder) {
|
||||
super.init(coder: aDecoder)
|
||||
|
||||
commonInit()
|
||||
}
|
||||
/// A Button object with pop ups buttons
|
||||
open class CircleMenu: UIButton {
|
||||
|
||||
// MARK: properties
|
||||
|
||||
/// Buttons count
|
||||
@IBInspectable open var buttonsCount: Int = 3
|
||||
/// Circle animation duration
|
||||
@IBInspectable open var duration: Double = 2
|
||||
/// Distance between center button and buttons
|
||||
@IBInspectable open var distance: Float = 100
|
||||
/// Delay between show buttons
|
||||
@IBInspectable open var showDelay: Double = 0
|
||||
|
||||
/// The object that acts as the delegate of the circle menu.
|
||||
@IBOutlet weak open var delegate: AnyObject? //CircleMenuDelegate?
|
||||
|
||||
var buttons: [UIButton]?
|
||||
weak var platform: UIView?
|
||||
|
||||
fileprivate var customNormalIconView: UIImageView?
|
||||
fileprivate var customSelectedIconView: UIImageView?
|
||||
|
||||
/**
|
||||
Initializes and returns a circle menu object.
|
||||
|
||||
- parameter frame: A rectangle specifying the initial location and size of the circle menu in its superview’s coordinates.
|
||||
- parameter normalIcon: The image to use for the specified normal state.
|
||||
- parameter selectedIcon: The image to use for the specified selected state.
|
||||
- parameter buttonsCount: The number of buttons.
|
||||
- parameter duration: The duration, in seconds, of the animation.
|
||||
- parameter distance: Distance between center button and sub buttons.
|
||||
|
||||
- returns: A newly created circle menu.
|
||||
*/
|
||||
public init(frame: CGRect,
|
||||
normalIcon: String?,
|
||||
selectedIcon: String?,
|
||||
buttonsCount: Int = 3,
|
||||
duration: Double = 2,
|
||||
distance: Float = 100) {
|
||||
super.init(frame: frame)
|
||||
|
||||
private func commonInit() {
|
||||
addActions()
|
||||
|
||||
customNormalIconView = addCustomImageView(state: .Normal)
|
||||
|
||||
customSelectedIconView = addCustomImageView(state: .Selected)
|
||||
if customSelectedIconView != nil {
|
||||
customSelectedIconView.alpha = 0
|
||||
}
|
||||
setImage(UIImage(), forState: .Normal)
|
||||
setImage(UIImage(), forState: .Selected)
|
||||
if let icon = normalIcon {
|
||||
setImage(UIImage(named: icon), for: UIControlState())
|
||||
}
|
||||
|
||||
// MARK: create
|
||||
|
||||
private func createButtons() -> [CircleMenuButton] {
|
||||
|
||||
var buttons = [CircleMenuButton]()
|
||||
|
||||
let step: Float = 360.0 / Float(self.buttonsCount)
|
||||
for index in 0..<self.buttonsCount {
|
||||
|
||||
let angle: Float = Float(index) * step
|
||||
let button = Init(CircleMenuButton(
|
||||
size: self.bounds.size,
|
||||
circleMenu: self,
|
||||
distance:Float(self.bounds.size.height/2.0),
|
||||
angle: angle)) {
|
||||
|
||||
$0.tag = index
|
||||
$0.addTarget(self, action: "buttonHandler:", forControlEvents: UIControlEvents.TouchUpInside)
|
||||
$0.alpha = 0
|
||||
}
|
||||
buttons.append(button)
|
||||
}
|
||||
|
||||
return buttons
|
||||
if let icon = selectedIcon {
|
||||
setImage(UIImage(named: icon), for: .selected)
|
||||
}
|
||||
|
||||
private func addCustomImageView(state state: UIControlState) -> UIImageView? {
|
||||
|
||||
guard let image = imageForState(state) else {
|
||||
return nil
|
||||
}
|
||||
|
||||
let iconView = Init(UIImageView(image: image)) {
|
||||
$0.translatesAutoresizingMaskIntoConstraints = false
|
||||
$0.contentMode = .Center
|
||||
$0.userInteractionEnabled = false
|
||||
}
|
||||
addSubview(iconView)
|
||||
|
||||
// added constraints
|
||||
iconView.addConstraint(NSLayoutConstraint(item: iconView,
|
||||
attribute: .Height,
|
||||
relatedBy: .Equal,
|
||||
toItem: nil,
|
||||
attribute: .Height,
|
||||
multiplier: 1,
|
||||
constant: bounds.size.height))
|
||||
|
||||
iconView.addConstraint(NSLayoutConstraint(item: iconView,
|
||||
attribute: .Width,
|
||||
relatedBy: .Equal,
|
||||
toItem: nil,
|
||||
attribute: .Width,
|
||||
multiplier: 1,
|
||||
constant: bounds.size.width))
|
||||
|
||||
addConstraint(NSLayoutConstraint(item: self,
|
||||
attribute: .CenterX,
|
||||
relatedBy: .Equal,
|
||||
toItem: iconView,
|
||||
attribute: .CenterX,
|
||||
multiplier: 1,
|
||||
constant:0))
|
||||
|
||||
addConstraint(NSLayoutConstraint(item: self,
|
||||
attribute: .CenterY,
|
||||
relatedBy: .Equal,
|
||||
toItem: iconView,
|
||||
attribute: .CenterY,
|
||||
multiplier: 1,
|
||||
constant:0))
|
||||
|
||||
return iconView
|
||||
self.buttonsCount = buttonsCount
|
||||
self.duration = duration
|
||||
self.distance = distance
|
||||
|
||||
commonInit()
|
||||
}
|
||||
|
||||
required public init?(coder aDecoder: NSCoder) {
|
||||
super.init(coder: aDecoder)
|
||||
|
||||
commonInit()
|
||||
}
|
||||
|
||||
fileprivate func commonInit() {
|
||||
addActions()
|
||||
|
||||
customNormalIconView = addCustomImageView(state: UIControlState())
|
||||
|
||||
customSelectedIconView = addCustomImageView(state: .selected)
|
||||
if customSelectedIconView != nil {
|
||||
customSelectedIconView?.alpha = 0
|
||||
}
|
||||
setImage(UIImage(), for: UIControlState())
|
||||
setImage(UIImage(), for: .selected)
|
||||
|
||||
}
|
||||
|
||||
// MARK: methods
|
||||
|
||||
/**
|
||||
Hide button
|
||||
|
||||
- parameter duration: The duration, in seconds, of the animation.
|
||||
- parameter hideDelay: The time to delay, in seconds.
|
||||
*/
|
||||
open func hideButtons(_ duration: Double, hideDelay: Double = 0) {
|
||||
if buttons == nil {
|
||||
return
|
||||
}
|
||||
|
||||
// MARK: configure
|
||||
buttonsAnimationIsShow(isShow: false, duration: duration, hideDelay: hideDelay)
|
||||
|
||||
private func addActions() {
|
||||
self.addTarget(self, action: "onTap", forControlEvents: UIControlEvents.TouchUpInside)
|
||||
tapBounceAnimation()
|
||||
tapRotatedAnimation(0.3, isSelected: false)
|
||||
}
|
||||
|
||||
/**
|
||||
Check is sub buttons showed
|
||||
*/
|
||||
open func buttonsIsShown() -> Bool {
|
||||
guard let buttons = self.buttons else {
|
||||
return false
|
||||
}
|
||||
|
||||
// MARK: helpers
|
||||
|
||||
public func buttonsIsShown() -> Bool {
|
||||
guard buttons != nil else {
|
||||
return false
|
||||
}
|
||||
|
||||
for button in buttons! {
|
||||
if button.alpha == 0 {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
for button in buttons {
|
||||
if button.alpha == 0 {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// MARK: create
|
||||
fileprivate func createButtons(platform: UIView) -> [UIButton] {
|
||||
var buttons = [UIButton]()
|
||||
|
||||
// MARK: actions
|
||||
|
||||
func onTap() {
|
||||
if buttonsIsShown() == false {
|
||||
buttons = createButtons()
|
||||
}
|
||||
let isShow = !buttonsIsShown()
|
||||
let duration = isShow ? 0.5 : 0.2
|
||||
buttonsAnimationIsShow(isShow: isShow, duration: duration)
|
||||
let step: Float = 360.0 / Float(self.buttonsCount)
|
||||
for index in 0..<self.buttonsCount {
|
||||
|
||||
tapBounceAnimation()
|
||||
tapRotatedAnimation(0.3, isSelected: isShow)
|
||||
let angle: Float = Float(index) * step
|
||||
let distance = Float(self.bounds.size.height/2.0)
|
||||
let button = Init(CircleMenuButton(size: self.bounds.size, platform: platform, distance:distance, angle: angle)) {
|
||||
$0.tag = index
|
||||
$0.addTarget(self, action: #selector(CircleMenu.buttonHandler(_:)), for: UIControlEvents.touchUpInside)
|
||||
$0.alpha = 0
|
||||
}
|
||||
buttons.append(button)
|
||||
}
|
||||
return buttons
|
||||
}
|
||||
|
||||
fileprivate func addCustomImageView(state: UIControlState) -> UIImageView? {
|
||||
guard let image = image(for: state) else {
|
||||
return nil
|
||||
}
|
||||
|
||||
func buttonHandler(sender: CircleMenuButton) {
|
||||
delegate?.circleMenu?(self, buttonWillSelected: sender, atIndex: sender.tag)
|
||||
|
||||
let circle = CircleMenuLoader(
|
||||
radius: CGFloat(distance),
|
||||
strokeWidth: bounds.size.height,
|
||||
circleMenu: self,
|
||||
color: sender.backgroundColor!)
|
||||
|
||||
if let container = sender.container { // rotation animation
|
||||
sender.rotationLayerAnimation(container.angleZ + 360, duration: duration)
|
||||
container.superview?.bringSubviewToFront(container)
|
||||
}
|
||||
|
||||
if let aButtons = buttons {
|
||||
circle.fillAnimation(duration, startAngle: -90 + Float(360 / aButtons.count) * Float(sender.tag))
|
||||
circle.hideAnimation(0.3, delay: duration)
|
||||
|
||||
hideCenterButton(duration: 0.3)
|
||||
|
||||
buttonsAnimationIsShow(isShow: false, duration: 0, delay: duration)
|
||||
showCenterButton(duration: 0.3, delay: duration)
|
||||
|
||||
if customNormalIconView != nil && customSelectedIconView != nil {
|
||||
let dispatchTime: dispatch_time_t = dispatch_time(
|
||||
DISPATCH_TIME_NOW,
|
||||
Int64(duration * Double(NSEC_PER_SEC)))
|
||||
|
||||
dispatch_after(dispatchTime, dispatch_get_main_queue(), {
|
||||
// self.tapRotatedAnimation(0.01, isSelected: false)
|
||||
self.delegate?.circleMenu?(self, buttonDidSelected: sender, atIndex: sender.tag)
|
||||
})
|
||||
}
|
||||
}
|
||||
let iconView = Init(UIImageView(image: image)) {
|
||||
$0.translatesAutoresizingMaskIntoConstraints = false
|
||||
$0.contentMode = .center
|
||||
$0.isUserInteractionEnabled = false
|
||||
}
|
||||
addSubview(iconView)
|
||||
|
||||
// MARK: animations
|
||||
// added constraints
|
||||
iconView.addConstraint(NSLayoutConstraint(item: iconView, attribute: .height, relatedBy: .equal, toItem: nil,
|
||||
attribute: .height, multiplier: 1, constant: bounds.size.height))
|
||||
|
||||
private func buttonsAnimationIsShow(isShow isShow: Bool, duration: Double, delay: Double = 0) {
|
||||
guard buttons != nil else {
|
||||
return
|
||||
}
|
||||
|
||||
let step: Float = 360.0 / Float(self.buttonsCount)
|
||||
for index in 0..<self.buttonsCount {
|
||||
let button = buttons![index]
|
||||
let angle: Float = Float(index) * step
|
||||
if isShow == true {
|
||||
delegate?.circleMenu?(self, willDisplay: button, atIndex: index)
|
||||
|
||||
button.rotatedZ(angle: angle, animated: false, delay: delay)
|
||||
button.showAnimation(distance, duration: duration, delay: delay)
|
||||
} else {
|
||||
button.hideAnimation(duration, delay: delay)
|
||||
}
|
||||
}
|
||||
if isShow == false { // hide buttons and remove
|
||||
buttons = nil
|
||||
}
|
||||
iconView.addConstraint(NSLayoutConstraint(item: iconView, attribute: .width, relatedBy: .equal, toItem: nil,
|
||||
attribute: .width, multiplier: 1, constant: bounds.size.width))
|
||||
|
||||
addConstraint(NSLayoutConstraint(item: self, attribute: .centerX, relatedBy: .equal, toItem: iconView,
|
||||
attribute: .centerX, multiplier: 1, constant:0))
|
||||
|
||||
addConstraint(NSLayoutConstraint(item: self, attribute: .centerY, relatedBy: .equal, toItem: iconView,
|
||||
attribute: .centerY, multiplier: 1, constant:0))
|
||||
|
||||
return iconView
|
||||
}
|
||||
|
||||
fileprivate func createPlatform() -> UIView {
|
||||
let platform = Init(UIView(frame: .zero)) {
|
||||
$0.backgroundColor = .clear
|
||||
$0.translatesAutoresizingMaskIntoConstraints = false
|
||||
}
|
||||
superview?.insertSubview(platform, belowSubview: self)
|
||||
|
||||
private func tapBounceAnimation() {
|
||||
self.transform = CGAffineTransformMakeScale(0.9, 0.9)
|
||||
UIView.animateWithDuration(
|
||||
0.5,
|
||||
delay: 0,
|
||||
usingSpringWithDamping: 0.3,
|
||||
initialSpringVelocity: 5,
|
||||
options: UIViewAnimationOptions.CurveLinear,
|
||||
animations: { () -> Void in
|
||||
self.transform = CGAffineTransformMakeScale(1, 1)
|
||||
}, completion: { (success) -> Void in
|
||||
})
|
||||
// constraints
|
||||
let sizeConstraints = [NSLayoutAttribute.width, .height].map {
|
||||
NSLayoutConstraint(item: platform,
|
||||
attribute: $0,
|
||||
relatedBy: .equal,
|
||||
toItem: nil,
|
||||
attribute: $0,
|
||||
multiplier: 1,
|
||||
constant: CGFloat(distance * Float(2.0)))
|
||||
}
|
||||
platform.addConstraints(sizeConstraints)
|
||||
|
||||
private func tapRotatedAnimation(duration: Float, isSelected: Bool) {
|
||||
|
||||
let addAnimations: (view: UIImageView, isShow: Bool) -> () = { (view, isShow) in
|
||||
var toAngle: Float = 180.0
|
||||
var fromAngle: Float = 0
|
||||
var fromScale = 1.0
|
||||
var toScale = 0.2
|
||||
var fromOpacity = 1
|
||||
var toOpacity = 0
|
||||
if isShow == true {
|
||||
toAngle = 0
|
||||
fromAngle = -180
|
||||
fromScale = 0.2
|
||||
toScale = 1.0
|
||||
fromOpacity = 0
|
||||
toOpacity = 1
|
||||
}
|
||||
|
||||
let rotation = Init(CABasicAnimation(keyPath: "transform.rotation")) {
|
||||
$0.duration = NSTimeInterval(duration)
|
||||
$0.toValue = (toAngle.degrees)
|
||||
$0.fromValue = (fromAngle.degrees)
|
||||
$0.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
|
||||
}
|
||||
let fade = Init(CABasicAnimation(keyPath: "opacity")) {
|
||||
$0.duration = NSTimeInterval(duration)
|
||||
$0.fromValue = fromOpacity
|
||||
$0.toValue = toOpacity
|
||||
$0.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
|
||||
$0.fillMode = kCAFillModeForwards
|
||||
$0.removedOnCompletion = false
|
||||
}
|
||||
let scale = Init(CABasicAnimation(keyPath: "transform.scale")) {
|
||||
$0.duration = NSTimeInterval(duration)
|
||||
$0.toValue = toScale
|
||||
$0.fromValue = fromScale
|
||||
$0.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
|
||||
}
|
||||
|
||||
view.layer.addAnimation(rotation, forKey: nil)
|
||||
view.layer.addAnimation(fade, forKey: nil)
|
||||
view.layer.addAnimation(scale, forKey: nil)
|
||||
}
|
||||
|
||||
if customNormalIconView != nil && customSelectedIconView != nil {
|
||||
addAnimations(view: customNormalIconView, isShow: !isSelected)
|
||||
addAnimations(view: customSelectedIconView, isShow: isSelected)
|
||||
}
|
||||
selected = isSelected
|
||||
self.alpha = isSelected ? 0.5 : 1
|
||||
let centerConstraints = [NSLayoutAttribute.centerX, .centerY].map {
|
||||
NSLayoutConstraint(item: self,
|
||||
attribute: $0,
|
||||
relatedBy: .equal,
|
||||
toItem: platform,
|
||||
attribute: $0,
|
||||
multiplier: 1,
|
||||
constant:0)
|
||||
}
|
||||
superview?.addConstraints(centerConstraints)
|
||||
|
||||
private func hideCenterButton(duration duration: Double, delay: Double = 0) {
|
||||
|
||||
UIView.animateWithDuration(
|
||||
NSTimeInterval(duration),
|
||||
delay: NSTimeInterval(delay),
|
||||
options: UIViewAnimationOptions.CurveEaseOut,
|
||||
animations: { () -> Void in
|
||||
self.transform = CGAffineTransformMakeScale(0.001, 0.001)
|
||||
}, completion: { (success) -> Void in
|
||||
})
|
||||
return platform
|
||||
}
|
||||
|
||||
// MARK: configure
|
||||
fileprivate func addActions() {
|
||||
self.addTarget(self, action: #selector(CircleMenu.onTap), for: UIControlEvents.touchUpInside)
|
||||
}
|
||||
|
||||
// MARK: actions
|
||||
|
||||
func onTap() {
|
||||
if buttonsIsShown() == false {
|
||||
let platform = createPlatform()
|
||||
buttons = createButtons(platform: platform)
|
||||
self.platform = platform
|
||||
}
|
||||
let isShow = !buttonsIsShown()
|
||||
let duration = isShow ? 0.5 : 0.2
|
||||
buttonsAnimationIsShow(isShow: isShow, duration: duration)
|
||||
|
||||
tapBounceAnimation()
|
||||
tapRotatedAnimation(0.3, isSelected: isShow)
|
||||
}
|
||||
|
||||
func buttonHandler(_ sender: CircleMenuButton) {
|
||||
guard let platform = self.platform else { return }
|
||||
|
||||
delegate?.circleMenu?(self, buttonWillSelected: sender, atIndex: sender.tag)
|
||||
|
||||
let circle = CircleMenuLoader(radius: CGFloat(distance),
|
||||
strokeWidth: bounds.size.height,
|
||||
platform: platform,
|
||||
color: sender.backgroundColor)
|
||||
|
||||
if let container = sender.container { // rotation animation
|
||||
sender.rotationAnimation(container.angleZ + 360, duration: duration)
|
||||
container.superview?.bringSubview(toFront: container)
|
||||
}
|
||||
|
||||
private func showCenterButton(duration duration: Float, delay: Double) {
|
||||
UIView.animateWithDuration(
|
||||
NSTimeInterval(duration),
|
||||
delay: NSTimeInterval(delay),
|
||||
usingSpringWithDamping: 0.8,
|
||||
initialSpringVelocity: 18.0,
|
||||
options: UIViewAnimationOptions.CurveLinear,
|
||||
animations: { () -> Void in
|
||||
self.transform = CGAffineTransformMakeScale(1, 1)
|
||||
self.alpha = 1
|
||||
}, completion: { (success) -> Void in
|
||||
if let buttons = buttons {
|
||||
circle.fillAnimation(duration, startAngle: -90 + Float(360 / buttons.count) * Float(sender.tag)) { [weak self] _ in
|
||||
self?.buttons?.forEach { $0.alpha = 0 }
|
||||
}
|
||||
circle.hideAnimation(0.5, delay: duration) { [weak self] _ in
|
||||
if self?.platform?.superview != nil { self?.platform?.removeFromSuperview() }
|
||||
}
|
||||
|
||||
hideCenterButton(duration: 0.3)
|
||||
showCenterButton(duration: 0.525, delay: duration)
|
||||
|
||||
if customNormalIconView != nil && customSelectedIconView != nil {
|
||||
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + duration, execute: {
|
||||
self.delegate?.circleMenu?(self, buttonDidSelected: sender, atIndex: sender.tag)
|
||||
})
|
||||
|
||||
let rotation = Init(CABasicAnimation(keyPath: "transform.rotation")) {
|
||||
$0.duration = NSTimeInterval(duration)
|
||||
$0.toValue = (0)
|
||||
$0.fromValue = (Float(-180).degrees)
|
||||
$0.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseOut)
|
||||
$0.beginTime = CACurrentMediaTime() + delay
|
||||
}
|
||||
let fade = Init(CABasicAnimation(keyPath: "opacity")) {
|
||||
$0.duration = NSTimeInterval(0.01)
|
||||
$0.toValue = 0
|
||||
$0.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
|
||||
$0.fillMode = kCAFillModeForwards
|
||||
$0.removedOnCompletion = false
|
||||
$0.beginTime = CACurrentMediaTime() + delay
|
||||
}
|
||||
let show = Init(CABasicAnimation(keyPath: "opacity")) {
|
||||
$0.duration = NSTimeInterval(duration)
|
||||
$0.toValue = 1
|
||||
$0.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
|
||||
$0.fillMode = kCAFillModeForwards
|
||||
$0.removedOnCompletion = false
|
||||
$0.beginTime = CACurrentMediaTime() + delay
|
||||
}
|
||||
|
||||
if customNormalIconView != nil {
|
||||
customNormalIconView.layer.addAnimation(rotation, forKey: nil)
|
||||
customNormalIconView.layer.addAnimation(show, forKey: nil)
|
||||
}
|
||||
|
||||
if customSelectedIconView != nil {
|
||||
customSelectedIconView.layer.addAnimation(fade, forKey: nil)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: animations
|
||||
|
||||
fileprivate func buttonsAnimationIsShow(isShow: Bool, duration: Double, hideDelay: Double = 0) {
|
||||
guard let buttons = self.buttons else {
|
||||
return
|
||||
}
|
||||
|
||||
let step: Float = 360.0 / Float(self.buttonsCount)
|
||||
for index in 0..<self.buttonsCount {
|
||||
guard case let button as CircleMenuButton = buttons[index] else { continue }
|
||||
let angle: Float = Float(index) * step
|
||||
if isShow == true {
|
||||
delegate?.circleMenu?(self, willDisplay: button, atIndex: index)
|
||||
|
||||
button.rotatedZ(angle: angle, animated: false, delay: Double(index) * showDelay)
|
||||
button.showAnimation(distance: distance, duration: duration, delay: Double(index) * showDelay)
|
||||
} else {
|
||||
button.hideAnimation(
|
||||
distance: Float(self.bounds.size.height / 2.0),
|
||||
duration: duration, delay: hideDelay)
|
||||
self.delegate?.menuCollapsed?(self)
|
||||
}
|
||||
}
|
||||
if isShow == false { // hide buttons and remove
|
||||
self.buttons = nil
|
||||
|
||||
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + duration) {
|
||||
if self.platform?.superview != nil { self.platform?.removeFromSuperview() }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fileprivate func tapBounceAnimation() {
|
||||
self.transform = CGAffineTransform(scaleX: 0.9, y: 0.9)
|
||||
UIView.animate(withDuration: 0.5, delay: 0, usingSpringWithDamping: 0.3, initialSpringVelocity: 5,
|
||||
options: UIViewAnimationOptions.curveLinear,
|
||||
animations: { () -> Void in
|
||||
self.transform = CGAffineTransform(scaleX: 1, y: 1)
|
||||
},
|
||||
completion: nil)
|
||||
}
|
||||
|
||||
fileprivate func tapRotatedAnimation(_ duration: Float, isSelected: Bool) {
|
||||
|
||||
let addAnimations: (_ view: UIImageView, _ isShow: Bool) -> () = { (view, isShow) in
|
||||
var toAngle: Float = 180.0
|
||||
var fromAngle: Float = 0
|
||||
var fromScale = 1.0
|
||||
var toScale = 0.2
|
||||
var fromOpacity = 1
|
||||
var toOpacity = 0
|
||||
if isShow == true {
|
||||
toAngle = 0
|
||||
fromAngle = -180
|
||||
fromScale = 0.2
|
||||
toScale = 1.0
|
||||
fromOpacity = 0
|
||||
toOpacity = 1
|
||||
}
|
||||
|
||||
let rotation = Init(CABasicAnimation(keyPath: "transform.rotation")) {
|
||||
$0.duration = TimeInterval(duration)
|
||||
$0.toValue = (toAngle.degrees)
|
||||
$0.fromValue = (fromAngle.degrees)
|
||||
$0.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
|
||||
}
|
||||
let fade = Init(CABasicAnimation(keyPath: "opacity")) {
|
||||
$0.duration = TimeInterval(duration)
|
||||
$0.fromValue = fromOpacity
|
||||
$0.toValue = toOpacity
|
||||
$0.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
|
||||
$0.fillMode = kCAFillModeForwards
|
||||
$0.isRemovedOnCompletion = false
|
||||
}
|
||||
let scale = Init(CABasicAnimation(keyPath: "transform.scale")) {
|
||||
$0.duration = TimeInterval(duration)
|
||||
$0.toValue = toScale
|
||||
$0.fromValue = fromScale
|
||||
$0.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
|
||||
}
|
||||
|
||||
view.layer.add(rotation, forKey: nil)
|
||||
view.layer.add(fade, forKey: nil)
|
||||
view.layer.add(scale, forKey: nil)
|
||||
}
|
||||
|
||||
if let customNormalIconView = self.customNormalIconView {
|
||||
addAnimations(customNormalIconView, !isSelected)
|
||||
}
|
||||
if let customSelectedIconView = self.customSelectedIconView {
|
||||
addAnimations(customSelectedIconView, isSelected)
|
||||
}
|
||||
|
||||
self.isSelected = isSelected
|
||||
self.alpha = isSelected ? 0.3 : 1
|
||||
}
|
||||
|
||||
fileprivate func hideCenterButton(duration: Double, delay: Double = 0) {
|
||||
UIView.animate( withDuration: TimeInterval(duration), delay: TimeInterval(delay),
|
||||
options: UIViewAnimationOptions.curveEaseOut,
|
||||
animations: { () -> Void in
|
||||
self.transform = CGAffineTransform(scaleX: 0.001, y: 0.001)
|
||||
}, completion: nil)
|
||||
}
|
||||
|
||||
fileprivate func showCenterButton(duration: Float, delay: Double) {
|
||||
UIView.animate( withDuration: TimeInterval(duration), delay: TimeInterval(delay), usingSpringWithDamping: 0.78,
|
||||
initialSpringVelocity: 0, options: UIViewAnimationOptions.curveLinear,
|
||||
animations: { () -> Void in
|
||||
self.transform = CGAffineTransform(scaleX: 1, y: 1)
|
||||
self.alpha = 1
|
||||
},
|
||||
completion: nil)
|
||||
|
||||
let rotation = Init(CASpringAnimation(keyPath: "transform.rotation")) {
|
||||
$0.duration = TimeInterval(1.5)
|
||||
$0.toValue = (0)
|
||||
$0.fromValue = (Float(-180).degrees)
|
||||
$0.damping = 10
|
||||
$0.initialVelocity = 0
|
||||
$0.beginTime = CACurrentMediaTime() + delay
|
||||
}
|
||||
|
||||
let fade = Init(CABasicAnimation(keyPath: "opacity")) {
|
||||
$0.duration = TimeInterval(0.01)
|
||||
$0.toValue = 0
|
||||
$0.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
|
||||
$0.fillMode = kCAFillModeForwards
|
||||
$0.isRemovedOnCompletion = false
|
||||
$0.beginTime = CACurrentMediaTime() + delay
|
||||
}
|
||||
let show = Init(CABasicAnimation(keyPath: "opacity")) {
|
||||
$0.duration = TimeInterval(duration)
|
||||
$0.toValue = 1
|
||||
$0.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
|
||||
$0.fillMode = kCAFillModeForwards
|
||||
$0.isRemovedOnCompletion = false
|
||||
$0.beginTime = CACurrentMediaTime() + delay
|
||||
}
|
||||
|
||||
customNormalIconView?.layer.add(rotation, forKey: nil)
|
||||
customNormalIconView?.layer.add(show, forKey: nil)
|
||||
|
||||
customSelectedIconView?.layer.add(fade, forKey: nil)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: extension
|
||||
|
||||
extension Float {
|
||||
var radians: Float {
|
||||
return self * (Float(180) / Float(M_PI))
|
||||
}
|
||||
|
||||
var degrees: Float {
|
||||
return self * Float(M_PI) / 180.0
|
||||
}
|
||||
internal extension Float {
|
||||
var radians: Float {
|
||||
return self * (Float(180) / Float(M_PI))
|
||||
}
|
||||
|
||||
var degrees: Float {
|
||||
return self * Float(M_PI) / 180.0
|
||||
}
|
||||
}
|
||||
|
||||
extension UIView {
|
||||
|
||||
var angleZ: Float {
|
||||
let radians: Float = atan2(Float(self.transform.b), Float(self.transform.a))
|
||||
return radians.radians
|
||||
}
|
||||
internal extension UIView {
|
||||
|
||||
var angleZ: Float {
|
||||
return atan2(Float(self.transform.b), Float(self.transform.a)).radians
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,195 +23,187 @@
|
||||
|
||||
import UIKit
|
||||
|
||||
public class CircleMenuButton: UIButton {
|
||||
|
||||
// MARK: properties
|
||||
|
||||
public weak var container: UIView?
|
||||
|
||||
// MARK: life cicle
|
||||
|
||||
init(size: CGSize, circleMenu: CircleMenu, distance: Float, angle: Float = 0) {
|
||||
super.init(frame: CGRect(origin: CGPoint(x: 0, y: 0), size: size))
|
||||
|
||||
self.backgroundColor = UIColor(colorLiteralRed: 0.79, green: 0.24, blue: 0.27, alpha: 1)
|
||||
self.layer.cornerRadius = size.height / 2.0
|
||||
|
||||
let aContainer = createContainer(CGSize(width: size.width, height:CGFloat(distance)), circleMenu: circleMenu)
|
||||
internal class CircleMenuButton: UIButton {
|
||||
|
||||
// MARK: properties
|
||||
weak var container: UIView?
|
||||
|
||||
// hack view for rotate
|
||||
let view = UIView(frame: CGRect(x: 0, y: 0, width: self.bounds.width, height: self.bounds.height))
|
||||
view.backgroundColor = UIColor.clearColor()
|
||||
view.addSubview(self)
|
||||
//...
|
||||
|
||||
aContainer.addSubview(view)
|
||||
container = aContainer
|
||||
|
||||
view.layer.transform = CATransform3DMakeRotation(-CGFloat(angle.degrees), 0, 0, 1)
|
||||
|
||||
self.rotatedZ(angle: angle, animated: false)
|
||||
}
|
||||
|
||||
required public init?(coder aDecoder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
|
||||
// MARK: life cycle
|
||||
|
||||
init(size: CGSize, platform: UIView, distance: Float, angle: Float = 0) {
|
||||
super.init(frame: CGRect(origin: CGPoint(x: 0, y: 0), size: size))
|
||||
|
||||
self.backgroundColor = UIColor(colorLiteralRed: 0.79, green: 0.24, blue: 0.27, alpha: 1)
|
||||
self.layer.cornerRadius = size.height / 2.0
|
||||
|
||||
let aContainer = createContainer(CGSize(width: size.width, height:CGFloat(distance)), platform: platform)
|
||||
|
||||
// hack view for rotate
|
||||
let view = UIView(frame: CGRect(x: 0, y: 0, width: self.bounds.width, height: self.bounds.height))
|
||||
view.backgroundColor = UIColor.clear
|
||||
view.addSubview(self)
|
||||
//...
|
||||
|
||||
aContainer.addSubview(view)
|
||||
container = aContainer
|
||||
|
||||
view.layer.transform = CATransform3DMakeRotation(-CGFloat(angle.degrees), 0, 0, 1)
|
||||
|
||||
self.rotatedZ(angle: angle, animated: false)
|
||||
}
|
||||
|
||||
required internal init?(coder aDecoder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
// MARK: configure
|
||||
fileprivate func createContainer(_ size: CGSize, platform: UIView) -> UIView {
|
||||
let container = Init(UIView(frame: CGRect(origin: CGPoint(x: 0, y: 0), size: size))) {
|
||||
$0.backgroundColor = UIColor.clear
|
||||
$0.translatesAutoresizingMaskIntoConstraints = false
|
||||
$0.layer.anchorPoint = CGPoint(x: 0.5, y: 1)
|
||||
}
|
||||
platform.addSubview(container)
|
||||
|
||||
// MARK: configure
|
||||
|
||||
private func createContainer(size: CGSize, circleMenu: CircleMenu) -> UIView {
|
||||
|
||||
guard circleMenu.superview != nil else { fatalError("wront circle menu")}
|
||||
|
||||
let container = Init(UIView(frame: CGRect(origin: CGPoint(x: 0, y: 0), size: size))) {
|
||||
$0.backgroundColor = UIColor.clearColor()
|
||||
$0.translatesAutoresizingMaskIntoConstraints = false
|
||||
$0.layer.anchorPoint = CGPoint(x: 0.5, y: 1)
|
||||
}
|
||||
circleMenu.superview!.insertSubview(container, belowSubview: circleMenu)
|
||||
|
||||
// added constraints
|
||||
let height = NSLayoutConstraint(item: container,
|
||||
attribute: .Height,
|
||||
relatedBy: .Equal,
|
||||
toItem: nil,
|
||||
attribute: .Height,
|
||||
multiplier: 1,
|
||||
// added constraints
|
||||
let height = NSLayoutConstraint(item: container,
|
||||
attribute: .height,
|
||||
relatedBy: .equal,
|
||||
toItem: nil,
|
||||
attribute: .height,
|
||||
multiplier: 1,
|
||||
constant: size.height)
|
||||
height.identifier = "height"
|
||||
container.addConstraint(height)
|
||||
|
||||
container.addConstraint(NSLayoutConstraint(item: container,
|
||||
attribute: .Width,
|
||||
relatedBy: .Equal,
|
||||
toItem: nil,
|
||||
attribute: .Width,
|
||||
multiplier: 1,
|
||||
constant: size.width))
|
||||
|
||||
circleMenu.superview!.addConstraint(NSLayoutConstraint(item: circleMenu,
|
||||
attribute: .CenterX,
|
||||
relatedBy: .Equal,
|
||||
toItem: container,
|
||||
attribute: .CenterX,
|
||||
multiplier: 1,
|
||||
constant:0))
|
||||
|
||||
circleMenu.superview!.addConstraint(NSLayoutConstraint(item: circleMenu,
|
||||
attribute: .CenterY,
|
||||
relatedBy: .Equal,
|
||||
toItem: container,
|
||||
attribute: .CenterY,
|
||||
multiplier: 1,
|
||||
constant:0))
|
||||
height.identifier = "height"
|
||||
container.addConstraint(height)
|
||||
|
||||
return container
|
||||
container.addConstraint(NSLayoutConstraint(item: container,
|
||||
attribute: .width,
|
||||
relatedBy: .equal,
|
||||
toItem: nil,
|
||||
attribute: .width,
|
||||
multiplier: 1,
|
||||
constant: size.width))
|
||||
|
||||
platform.addConstraint(NSLayoutConstraint(item: platform,
|
||||
attribute: .centerX,
|
||||
relatedBy: .equal,
|
||||
toItem: container,
|
||||
attribute: .centerX,
|
||||
multiplier: 1,
|
||||
constant:0))
|
||||
|
||||
platform.addConstraint(NSLayoutConstraint(item: platform,
|
||||
attribute: .centerY,
|
||||
relatedBy: .equal,
|
||||
toItem: container,
|
||||
attribute: .centerY,
|
||||
multiplier: 1,
|
||||
constant:0))
|
||||
|
||||
return container
|
||||
}
|
||||
|
||||
// MARK: methods
|
||||
|
||||
internal func rotatedZ(angle: Float, animated: Bool, duration: Double = 0, delay: Double = 0) {
|
||||
guard let container = self.container else {
|
||||
fatalError("contaner don't create")
|
||||
}
|
||||
|
||||
// MARK: public
|
||||
|
||||
public func rotatedZ(angle angle: Float, animated: Bool, duration: Double = 0, delay: Double = 0) {
|
||||
guard container != nil else {fatalError("contaner don't create")}
|
||||
|
||||
let rotateTransform = CATransform3DMakeRotation(CGFloat(angle.degrees), 0, 0, 1)
|
||||
if animated {
|
||||
UIView.animateWithDuration(
|
||||
duration,
|
||||
delay: delay,
|
||||
options: UIViewAnimationOptions.CurveEaseInOut,
|
||||
animations: { () -> Void in
|
||||
self.container!.layer.transform = rotateTransform
|
||||
},
|
||||
completion: nil)
|
||||
} else {
|
||||
container!.layer.transform = rotateTransform
|
||||
}
|
||||
let rotateTransform = CATransform3DMakeRotation(CGFloat(angle.degrees), 0, 0, 1)
|
||||
if animated {
|
||||
UIView.animate(
|
||||
withDuration: duration,
|
||||
delay: delay,
|
||||
options: UIViewAnimationOptions(),
|
||||
animations: { () -> Void in
|
||||
container.layer.transform = rotateTransform
|
||||
},
|
||||
completion: nil)
|
||||
} else {
|
||||
container.layer.transform = rotateTransform
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Animations
|
||||
|
||||
extension CircleMenuButton {
|
||||
internal extension CircleMenuButton {
|
||||
|
||||
internal func showAnimation(distance: Float, duration: Double, delay: Double = 0) {
|
||||
guard let heightConstraint = (self.container?.constraints.filter {$0.identifier == "height"})?.first else {
|
||||
fatalError()
|
||||
}
|
||||
|
||||
public func showAnimation(distance: Float, duration: Double, delay: Double = 0) {
|
||||
let heightConstraint = self.container?.constraints.filter {$0.identifier == "height"}.first
|
||||
self.transform = CGAffineTransform(scaleX: 0, y: 0)
|
||||
self.container?.superview?.layoutIfNeeded()
|
||||
|
||||
guard heightConstraint != nil else {
|
||||
return
|
||||
}
|
||||
self.transform = CGAffineTransformMakeScale(0, 0)
|
||||
self.container?.layoutIfNeeded()
|
||||
|
||||
self.alpha = 0
|
||||
|
||||
heightConstraint.constant = CGFloat(distance)
|
||||
UIView.animate(
|
||||
withDuration: duration,
|
||||
delay: delay,
|
||||
usingSpringWithDamping: 0.7,
|
||||
initialSpringVelocity: 0,
|
||||
options: UIViewAnimationOptions.curveLinear,
|
||||
animations: { () -> Void in
|
||||
self.container?.superview?.layoutIfNeeded()
|
||||
self.transform = CGAffineTransform(scaleX: 1.0, y: 1.0)
|
||||
self.alpha = 1
|
||||
|
||||
heightConstraint?.constant = CGFloat(distance)
|
||||
UIView.animateWithDuration(
|
||||
duration,
|
||||
delay: delay,
|
||||
usingSpringWithDamping: 0.7,
|
||||
initialSpringVelocity: 0,
|
||||
options: UIViewAnimationOptions.CurveLinear,
|
||||
animations: { () -> Void in
|
||||
self.container!.layoutIfNeeded()
|
||||
self.transform = CGAffineTransformMakeScale(1, 1)
|
||||
}, completion: { (success) -> Void in
|
||||
})
|
||||
}
|
||||
|
||||
public func hideAnimation(duration: Double, delay: Double = 0) {
|
||||
|
||||
UIView.animateWithDuration(
|
||||
duration,
|
||||
delay: delay,
|
||||
options: UIViewAnimationOptions.CurveEaseIn,
|
||||
animations: { () -> Void in
|
||||
self.transform = CGAffineTransformMakeScale(0.01, 0.01)
|
||||
}, completion: { (success) -> Void in
|
||||
self.alpha = 0
|
||||
|
||||
if let _ = self.container {
|
||||
self.container!.removeFromSuperview() // remove container
|
||||
}
|
||||
})
|
||||
}, completion: { (success) -> Void in
|
||||
})
|
||||
}
|
||||
|
||||
internal func hideAnimation(distance: Float, duration: Double, delay: Double = 0) {
|
||||
guard let heightConstraint = (self.container?.constraints.filter {$0.identifier == "height"})?.first else {
|
||||
fatalError()
|
||||
}
|
||||
|
||||
public func changeDistance(distance: CGFloat, animated: Bool, duration: Double = 0, delay: Double = 0) {
|
||||
let heightConstraint = self.container?.constraints.filter {$0.identifier == "height"}.first
|
||||
heightConstraint.constant = CGFloat(distance)
|
||||
UIView.animate(
|
||||
withDuration: duration,
|
||||
delay: delay,
|
||||
options: UIViewAnimationOptions.curveEaseIn,
|
||||
animations: { () -> Void in
|
||||
self.container?.superview?.layoutIfNeeded()
|
||||
self.transform = CGAffineTransform(scaleX: 0.01, y: 0.01)
|
||||
}, completion: { (success) -> Void in
|
||||
self.alpha = 0
|
||||
|
||||
guard heightConstraint != nil else {
|
||||
return
|
||||
if let _ = self.container {
|
||||
self.container?.removeFromSuperview() // remove container
|
||||
}
|
||||
|
||||
heightConstraint?.constant = distance
|
||||
|
||||
UIView.animateWithDuration(
|
||||
duration,
|
||||
delay: delay,
|
||||
options: UIViewAnimationOptions.CurveEaseIn,
|
||||
animations: { () -> Void in
|
||||
self.container!.layoutIfNeeded()
|
||||
},
|
||||
completion: nil)
|
||||
})
|
||||
}
|
||||
|
||||
internal func changeDistance(_ distance: CGFloat, animated: Bool, duration: Double = 0, delay: Double = 0) {
|
||||
|
||||
guard let heightConstraint = (self.container?.constraints.filter {$0.identifier == "height"})?.first else {
|
||||
fatalError()
|
||||
}
|
||||
|
||||
// MARK: layer animation
|
||||
heightConstraint.constant = distance
|
||||
|
||||
public func rotationLayerAnimation(angle: Float, duration: Double) {
|
||||
if let aContainer = container {
|
||||
rotationLayerAnimation(aContainer, angle: angle, duration: duration)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension UIView {
|
||||
|
||||
public func rotationLayerAnimation(view: UIView, angle: Float, duration: Double) {
|
||||
|
||||
let rotation = Init(CABasicAnimation(keyPath: "transform.rotation")) {
|
||||
$0.duration = NSTimeInterval(duration)
|
||||
$0.toValue = (angle.degrees)
|
||||
$0.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
|
||||
}
|
||||
view.layer.addAnimation(rotation, forKey: "rotation")
|
||||
UIView.animate(
|
||||
withDuration: duration,
|
||||
delay: delay,
|
||||
options: UIViewAnimationOptions.curveEaseIn,
|
||||
animations: { () -> Void in
|
||||
self.container?.superview?.layoutIfNeeded()
|
||||
},
|
||||
completion: nil)
|
||||
}
|
||||
|
||||
// MARK: layer animation
|
||||
|
||||
internal func rotationAnimation(_ angle: Float, duration: Double) {
|
||||
let rotation = Init(CABasicAnimation(keyPath: "transform.rotation")) {
|
||||
$0.duration = TimeInterval(duration)
|
||||
$0.toValue = (angle.degrees)
|
||||
$0.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
|
||||
}
|
||||
container?.layer.add(rotation, forKey: "rotation")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,144 +25,135 @@
|
||||
import Foundation
|
||||
import UIKit
|
||||
|
||||
public class CircleMenuLoader: UIView {
|
||||
internal class CircleMenuLoader: UIView {
|
||||
|
||||
// MARK: properties
|
||||
var circle: CAShapeLayer?
|
||||
|
||||
// MARK: life cycle
|
||||
internal init(radius: CGFloat, strokeWidth: CGFloat, platform: UIView, color: UIColor?) {
|
||||
super.init(frame: CGRect(x: 0, y: 0, width: radius, height: radius))
|
||||
|
||||
// MARK: properties
|
||||
platform.addSubview(self)
|
||||
|
||||
var circle: CAShapeLayer?
|
||||
|
||||
// MARK: life cicle
|
||||
circle = createCircle(radius, strokeWidth: strokeWidth, color: color)
|
||||
createConstraints(platform: platform, radius: radius)
|
||||
|
||||
public init(radius: CGFloat, strokeWidth: CGFloat, circleMenu: CircleMenu, color: UIColor) {
|
||||
super.init(frame: CGRect(x: 0, y: 0, width: radius, height: radius))
|
||||
|
||||
if let aSuperView = circleMenu.superview {
|
||||
aSuperView.insertSubview(self, belowSubview: circleMenu)
|
||||
}
|
||||
|
||||
circle = createCircle(radius, strokeWidth: strokeWidth, color: color)
|
||||
createConstraints(circleMenu, radius: radius)
|
||||
|
||||
let circleFrame = CGRect(
|
||||
x: radius * 2 - strokeWidth,
|
||||
y: radius - strokeWidth / 2,
|
||||
width: strokeWidth,
|
||||
height: strokeWidth)
|
||||
createRoundView(circleFrame, color: color)
|
||||
|
||||
backgroundColor = UIColor.clearColor()
|
||||
}
|
||||
|
||||
required public init?(coder aDecoder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
let circleFrame = CGRect(
|
||||
x: radius * 2 - strokeWidth,
|
||||
y: radius - strokeWidth / 2,
|
||||
width: strokeWidth,
|
||||
height: strokeWidth)
|
||||
createRoundView(circleFrame, color: color)
|
||||
|
||||
backgroundColor = UIColor.clear
|
||||
}
|
||||
|
||||
required internal init?(coder aDecoder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
// MARK: create
|
||||
fileprivate func createCircle(_ radius: CGFloat, strokeWidth: CGFloat, color: UIColor?) -> CAShapeLayer {
|
||||
|
||||
let circlePath = UIBezierPath(
|
||||
arcCenter: CGPoint(x: radius, y: radius),
|
||||
radius: CGFloat(radius) - strokeWidth / 2.0,
|
||||
startAngle: CGFloat(0),
|
||||
endAngle:CGFloat(M_PI * 2),
|
||||
clockwise: true)
|
||||
|
||||
let circle = Init(CAShapeLayer()) {
|
||||
$0.path = circlePath.cgPath
|
||||
$0.fillColor = UIColor.clear.cgColor
|
||||
$0.strokeColor = color?.cgColor
|
||||
$0.lineWidth = strokeWidth
|
||||
}
|
||||
|
||||
// MARK: create
|
||||
self.layer.addSublayer(circle)
|
||||
return circle
|
||||
}
|
||||
|
||||
fileprivate func createConstraints(platform: UIView, radius: CGFloat) {
|
||||
|
||||
private func createCircle(radius: CGFloat, strokeWidth: CGFloat, color: UIColor) -> CAShapeLayer {
|
||||
|
||||
let circlePath = UIBezierPath(
|
||||
arcCenter: CGPoint(x: radius, y: radius),
|
||||
radius: CGFloat(radius) - strokeWidth / 2.0,
|
||||
startAngle: CGFloat(0),
|
||||
endAngle:CGFloat(M_PI * 2),
|
||||
clockwise: true)
|
||||
|
||||
let circle = Init(CAShapeLayer()) {
|
||||
$0.path = circlePath.CGPath
|
||||
$0.fillColor = UIColor.clearColor().CGColor
|
||||
$0.strokeColor = color.CGColor
|
||||
$0.lineWidth = strokeWidth
|
||||
}
|
||||
|
||||
self.layer.addSublayer(circle)
|
||||
return circle
|
||||
translatesAutoresizingMaskIntoConstraints = false
|
||||
// added constraints
|
||||
let sizeConstraints = [NSLayoutAttribute.width, .height].map {
|
||||
NSLayoutConstraint(item: self,
|
||||
attribute: $0,
|
||||
relatedBy: .equal,
|
||||
toItem: nil,
|
||||
attribute: $0,
|
||||
multiplier: 1,
|
||||
constant: radius * 2.0)
|
||||
}
|
||||
addConstraints(sizeConstraints)
|
||||
|
||||
let centerConstaraints = [NSLayoutAttribute.centerY, .centerX].map {
|
||||
NSLayoutConstraint(item: platform,
|
||||
attribute: $0,
|
||||
relatedBy: .equal,
|
||||
toItem: self,
|
||||
attribute: $0,
|
||||
multiplier: 1,
|
||||
constant:0)
|
||||
}
|
||||
platform.addConstraints(centerConstaraints)
|
||||
}
|
||||
|
||||
internal func createRoundView(_ rect: CGRect, color: UIColor?) {
|
||||
let roundView = Init(UIView(frame: rect)) {
|
||||
$0.backgroundColor = UIColor.black
|
||||
$0.layer.cornerRadius = rect.size.width / 2.0
|
||||
$0.backgroundColor = color
|
||||
}
|
||||
addSubview(roundView)
|
||||
}
|
||||
|
||||
// MARK: animations
|
||||
|
||||
internal func fillAnimation(_ duration: Double, startAngle: Float, completion: @escaping () -> Void) {
|
||||
guard circle != nil else {
|
||||
return
|
||||
}
|
||||
|
||||
private func createConstraints(circleMenu: CircleMenu, radius: CGFloat) {
|
||||
translatesAutoresizingMaskIntoConstraints = false
|
||||
// added constraints
|
||||
addConstraint(NSLayoutConstraint(item: self,
|
||||
attribute: .Height,
|
||||
relatedBy: .Equal,
|
||||
toItem: nil,
|
||||
attribute: .Height,
|
||||
multiplier: 1,
|
||||
constant: radius * 2.0))
|
||||
|
||||
addConstraint(NSLayoutConstraint(item: self,
|
||||
attribute: .Width,
|
||||
relatedBy: .Equal,
|
||||
toItem: nil,
|
||||
attribute: .Width,
|
||||
multiplier: 1,
|
||||
constant: radius * 2.0))
|
||||
|
||||
circleMenu.superview!.addConstraint(NSLayoutConstraint(item: circleMenu,
|
||||
attribute: .CenterX,
|
||||
relatedBy: .Equal,
|
||||
toItem: self,
|
||||
attribute: .CenterX,
|
||||
multiplier: 1,
|
||||
constant:0))
|
||||
|
||||
circleMenu.superview!.addConstraint(NSLayoutConstraint(item: circleMenu,
|
||||
attribute: .CenterY,
|
||||
relatedBy: .Equal,
|
||||
toItem: self,
|
||||
attribute: .CenterY,
|
||||
multiplier: 1,
|
||||
constant:0))
|
||||
}
|
||||
let rotateTransform = CATransform3DMakeRotation(CGFloat(startAngle.degrees), 0, 0, 1)
|
||||
layer.transform = rotateTransform
|
||||
|
||||
private func createRoundView(rect: CGRect, color: UIColor) {
|
||||
let roundView = Init(UIView(frame: rect)) {
|
||||
$0.backgroundColor = UIColor.blackColor()
|
||||
$0.layer.cornerRadius = rect.size.width / 2.0
|
||||
$0.backgroundColor = color
|
||||
}
|
||||
addSubview(roundView)
|
||||
CATransaction.begin()
|
||||
CATransaction.setCompletionBlock(completion)
|
||||
let animation = Init(CABasicAnimation(keyPath: "strokeEnd")) {
|
||||
$0.duration = CFTimeInterval(duration)
|
||||
$0.fromValue = (0)
|
||||
$0.toValue = (1)
|
||||
$0.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
|
||||
}
|
||||
circle?.add(animation, forKey: nil)
|
||||
CATransaction.commit()
|
||||
}
|
||||
|
||||
internal func hideAnimation(_ duration: CGFloat, delay: Double, completion: @escaping () -> Void) {
|
||||
|
||||
// MARK: animations
|
||||
|
||||
public func fillAnimation(duration: Double, startAngle: Float) {
|
||||
guard circle != nil else {
|
||||
return
|
||||
}
|
||||
|
||||
let rotateTransform = CATransform3DMakeRotation(CGFloat(startAngle.degrees), 0, 0, 1)
|
||||
layer.transform = rotateTransform
|
||||
|
||||
let animation = Init(CABasicAnimation(keyPath: "strokeEnd")) {
|
||||
$0.duration = CFTimeInterval(duration)
|
||||
$0.fromValue = (0)
|
||||
$0.toValue = (1)
|
||||
$0.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
|
||||
}
|
||||
circle?.addAnimation(animation, forKey: nil)
|
||||
let scale = Init(CABasicAnimation(keyPath: "transform.scale")) {
|
||||
$0.toValue = 1.2
|
||||
$0.duration = CFTimeInterval(duration)
|
||||
$0.fillMode = kCAFillModeForwards
|
||||
$0.isRemovedOnCompletion = false
|
||||
$0.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseOut)
|
||||
$0.beginTime = CACurrentMediaTime() + delay
|
||||
}
|
||||
layer.add(scale, forKey: nil)
|
||||
|
||||
public func hideAnimation(duration: CGFloat, delay: Double) {
|
||||
|
||||
let scale = Init(CABasicAnimation(keyPath: "transform.scale")) {
|
||||
$0.toValue = 1.2
|
||||
$0.duration = CFTimeInterval(duration)
|
||||
$0.fillMode = kCAFillModeForwards
|
||||
$0.removedOnCompletion = false
|
||||
$0.beginTime = CACurrentMediaTime() + delay
|
||||
}
|
||||
layer.addAnimation(scale, forKey: nil)
|
||||
|
||||
UIView.animateWithDuration(
|
||||
CFTimeInterval(duration),
|
||||
delay: delay,
|
||||
options: UIViewAnimationOptions.CurveEaseIn,
|
||||
animations: { () -> Void in
|
||||
self.alpha = 0
|
||||
},
|
||||
completion: { (success) -> Void in
|
||||
self.removeFromSuperview()
|
||||
})
|
||||
}
|
||||
UIView.animate(
|
||||
withDuration: CFTimeInterval(duration),
|
||||
delay: delay,
|
||||
options: UIViewAnimationOptions.curveEaseIn,
|
||||
animations: { () -> Void in
|
||||
self.alpha = 0
|
||||
},
|
||||
completion: { (success) -> Void in
|
||||
self.removeFromSuperview()
|
||||
completion()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,30 +7,67 @@
|
||||
//
|
||||
|
||||
import XCTest
|
||||
|
||||
@testable import CircleMenu
|
||||
|
||||
class CircleMenuTests: XCTestCase {
|
||||
|
||||
|
||||
let buttonsCount = 4
|
||||
|
||||
let circleMenu = CircleMenu(
|
||||
frame: CGRect(x: 200, y: 200, width: 50, height: 50),
|
||||
normalIcon:"icon_menu",
|
||||
selectedIcon:"icon_close",
|
||||
buttonsCount: 4,
|
||||
duration: 4,
|
||||
distance: 120)
|
||||
|
||||
let view = UIView()
|
||||
|
||||
|
||||
override func setUp() {
|
||||
super.setUp()
|
||||
// Put setup code here. This method is called before the invocation of each test method in the class.
|
||||
circleMenu.buttonsCount = buttonsCount
|
||||
view.addSubview(circleMenu)
|
||||
}
|
||||
|
||||
|
||||
override func tearDown() {
|
||||
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
||||
super.tearDown()
|
||||
|
||||
}
|
||||
|
||||
func testExample() {
|
||||
// This is an example of a functional test case.
|
||||
// Use XCTAssert and related functions to verify your tests produce the correct results.
|
||||
|
||||
func testCircleMenuShowButtons() {
|
||||
// given
|
||||
XCTAssertNil(circleMenu.buttons, "button doesn't create")
|
||||
|
||||
// when button tap
|
||||
circleMenu.onTap()
|
||||
|
||||
// then
|
||||
XCTAssertEqual(circleMenu.buttons?.count, buttonsCount, "button is created")
|
||||
}
|
||||
|
||||
func testPerformanceExample() {
|
||||
// This is an example of a performance test case.
|
||||
self.measureBlock {
|
||||
// Put the code you want to measure the time of here.
|
||||
}
|
||||
|
||||
|
||||
func testCircleMenuHideButtons() {
|
||||
// given
|
||||
circleMenu.onTap()
|
||||
|
||||
// when
|
||||
circleMenu.onTap()
|
||||
|
||||
// then
|
||||
XCTAssertNil(circleMenu.buttons, "button is removed")
|
||||
}
|
||||
|
||||
|
||||
func testCircleMenuHideButtonsAfterAnimation() {
|
||||
// given
|
||||
circleMenu.onTap()
|
||||
|
||||
// when
|
||||
circleMenu.buttonHandler((circleMenu.buttons?.first)!)
|
||||
|
||||
// then
|
||||
XCTAssertNil(circleMenu.buttons, "button is removed")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,21 +1,40 @@
|
||||
[](https://cocoapods.org/pods/CircleMenu)
|
||||
[](https://business.ramotion.com?utm_source=gthb&utm_medium=special&utm_campaign=circle-menu-logo)
|
||||
# CircleMenu
|
||||
[](http://twitter.com/Ramotion)
|
||||
<!--[](http://cocoapods.org/pods/CircleMenu)-->
|
||||
[](https://cocoapods.org/pods/CircleMenu)
|
||||
[](http://cocoapods.org/pods/CircleMenu)
|
||||
[](https://cdn.rawgit.com/Ramotion/circle-menu/master/docs/index.html)
|
||||
[](https://github.com/Ramotion/circle-menu)
|
||||
[](https://codebeat.co/projects/github-com-ramotion-circle-menu)
|
||||
[](https://travis-ci.org/Ramotion/circle-menu)
|
||||
|
||||
# circle-menu
|
||||
## About
|
||||
This project is maintained by Ramotion, Inc.<br>
|
||||
We specialize in the designing and coding of custom UI for Mobile Apps and Websites.<br><br>**Looking for developers for your project?** [[▶︎CONTACT OUR TEAM◀︎](http://business.ramotion.com?utm_source=gthb&utm_medium=special&utm_campaign=circle-menu-contact-us/#Get_in_Touch)]
|
||||
|
||||
[](https://dribbble.com/shots/2534780-Circle-Menu-Swift-Open-Source)
|
||||
|
||||
|
||||
The [iPhone mockup](https://store.ramotion.com/product/iphone-6-mockups?utm_source=gthb&utm_medium=special&utm_campaign=circle-menu) available [here](https://store.ramotion.com/product/iphone-6-mockups?utm_source=gthb&utm_medium=special&utm_campaign=circle-menu).
|
||||
|
||||
## Requirements
|
||||
|
||||
- iOS 8.0+
|
||||
- Xcode 7.2
|
||||
- Xcode 7.3
|
||||
|
||||
## Installation
|
||||
|
||||
Just add CircleMenuLib folder to your project.
|
||||
|
||||
or use [CocoaPods](https://cocoapods.org) with Podfile:
|
||||
``` ruby
|
||||
pod 'CircleMenu', '~> 0.0.1'
|
||||
|
||||
```ruby
|
||||
pod 'CircleMenu', '~> 2.0.1' swift 3
|
||||
pod 'CircleMenu', '~> 1.0.7' swift 2
|
||||
```
|
||||
or [Carthage](https://github.com/Carthage/Carthage) users can simply add to their `Cartfile`:
|
||||
```
|
||||
github "Ramotion/circle-menu"
|
||||
```
|
||||
|
||||
## Usage
|
||||
@@ -26,53 +45,57 @@ pod 'CircleMenu', '~> 0.0.1'
|
||||
|
||||
2) Add images for Normal and Selected state
|
||||
|
||||
3) Use delegate method to configure buttons
|
||||
``` swift
|
||||
func circleMenu(circleMenu: CircleMenu, willDisplay button: CircleMenuButton, atIndex: Int)
|
||||
3) Use delegate method to configure buttons
|
||||
|
||||
```swift
|
||||
func circleMenu(circleMenu: CircleMenu, willDisplay button: CircleMenuButton, atIndex: Int)
|
||||
```
|
||||
|
||||
4) Use properties to confiure CircleMenu
|
||||
``` swift
|
||||
@IBInspectable var buttonsCount: Int = 3
|
||||
@IBInspectable var duration: Double = 2 // circle animation duration
|
||||
@IBInspectable var distance: Float = 100 // distance between center button and buttons
|
||||
|
||||
```swift
|
||||
@IBInspectable var buttonsCount: Int = 3
|
||||
@IBInspectable var duration: Double = 2 // circle animation duration
|
||||
@IBInspectable var distance: Float = 100 // distance between center button and buttons
|
||||
```
|
||||
|
||||
##### programmatically
|
||||
|
||||
``` swift
|
||||
let button = CircleMenu(
|
||||
frame: CGRect(x: 200, y: 200, width: 50, height: 50),
|
||||
normalIcon:"icon_menu",
|
||||
selectedIcon:"icon_close",
|
||||
buttonsCount: 4,
|
||||
duration: 4,
|
||||
distance: 120)
|
||||
button.delegate = self
|
||||
button.layer.cornerRadius = button.frame.size.width / 2.0
|
||||
view.addSubview(button)
|
||||
```swift
|
||||
let button = CircleMenu(
|
||||
frame: CGRect(x: 200, y: 200, width: 50, height: 50),
|
||||
normalIcon:"icon_menu",
|
||||
selectedIcon:"icon_close",
|
||||
buttonsCount: 4,
|
||||
duration: 4,
|
||||
distance: 120)
|
||||
button.delegate = self
|
||||
button.layer.cornerRadius = button.frame.size.width / 2.0
|
||||
view.addSubview(button)
|
||||
```
|
||||
|
||||
##### delegate methods
|
||||
|
||||
``` swift
|
||||
// configure buttons
|
||||
optional func circleMenu(circleMenu: CircleMenu, willDisplay button: CircleMenuButton, atIndex: Int)
|
||||
```swift
|
||||
// configure buttons
|
||||
optional func circleMenu(circleMenu: CircleMenu, willDisplay button: CircleMenuButton, atIndex: Int)
|
||||
|
||||
// call before animation
|
||||
optional func circleMenu(circleMenu: CircleMenu, buttonWillSelected button: CircleMenuButton, atIndex: Int)
|
||||
// call before animation
|
||||
optional func circleMenu(circleMenu: CircleMenu, buttonWillSelected button: CircleMenuButton, atIndex: Int)
|
||||
|
||||
// call after animation
|
||||
optional func circleMenu(circleMenu: CircleMenu, buttonDidSelected button: CircleMenuButton, atIndex: Int)
|
||||
// call after animation
|
||||
optional func circleMenu(circleMenu: CircleMenu, buttonDidSelected button: CircleMenuButton, atIndex: Int)
|
||||
|
||||
// call upon cancel of the menu
|
||||
optional func menuCollapsed(circleMenu: CircleMenu)
|
||||
```
|
||||
|
||||
## Licence
|
||||
|
||||
Adaptive tab bar is released under the MIT license.
|
||||
Circle menu is released under the MIT license.
|
||||
See [LICENSE](./LICENSE) for details.
|
||||
|
||||
## About
|
||||
The project maintained by [app development agency](https://ramotion.com?utm_source=gthb&utm_medium=special&utm_campaign=circle-menu) [Ramotion Inc.](https://ramotion.com?utm_source=gthb&utm_medium=special&utm_campaign=circle-menu)
|
||||
See our other [open-source projects](https://github.com/ramotion) or [hire](https://ramotion.com?utm_source=gthb&utm_medium=special&utm_campaign=circle-menu) us to design, develop, and grow your product.
|
||||
## Folow us
|
||||
|
||||
[](https://twitter.com/intent/tweet?text=https://github.com/ramotion/circle-menu)
|
||||
[](https://twitter.com/ramotion)
|
||||
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Classes Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="js/jquery.min.js" defer></script>
|
||||
<script src="js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a title="Classes Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="index.html">CircleMenuDemo Docs</a> (87% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="index.html">CircleMenuDemo Reference</a>
|
||||
<img id="carat" src="img/carat.png" />
|
||||
Classes Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/CircleMenu.html">CircleMenu</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="Protocols.html">Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Protocols/CircleMenuDelegate.html">CircleMenuDelegate</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>Classes</h1>
|
||||
<p>The following classes are available globally.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<div class="task-name-container">
|
||||
<a name="/CircleMenu"></a>
|
||||
<a name="//apple_ref/swift/Section/CircleMenu" class="dashAnchor"></a>
|
||||
<a href="#/CircleMenu">
|
||||
<h3 class="section-name">CircleMenu</h3>
|
||||
</a>
|
||||
</div>
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:C14CircleMenuDemo10CircleMenu"></a>
|
||||
<a name="//apple_ref/swift/Class/CircleMenu" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:C14CircleMenuDemo10CircleMenu">CircleMenu</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>A Button object with pop ups buttons</p>
|
||||
|
||||
<a href="Classes/CircleMenu.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">CircleMenu</span><span class="p">:</span> <span class="kt">UIButton</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/Ramotion/circle-menu" target="_blank" rel="external">AlexKalinkin</a>. All rights reserved. (Last updated: 2016-06-27)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -0,0 +1,445 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>CircleMenu Class Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Class/CircleMenu" class="dashAnchor"></a>
|
||||
<a title="CircleMenu Class Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../index.html">CircleMenuDemo Docs</a> (87% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../index.html">CircleMenuDemo Reference</a>
|
||||
<img id="carat" src="../img/carat.png" />
|
||||
CircleMenu Class Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CircleMenu.html">CircleMenu</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../Protocols.html">Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Protocols/CircleMenuDelegate.html">CircleMenuDelegate</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>CircleMenu</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">CircleMenu</span><span class="p">:</span> <span class="kt">UIButton</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>A Button object with pop ups buttons</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<div class="task-name-container">
|
||||
<a name="/properties"></a>
|
||||
<a name="//apple_ref/swift/Section/properties" class="dashAnchor"></a>
|
||||
<a href="#/properties">
|
||||
<h3 class="section-name">properties</h3>
|
||||
</a>
|
||||
</div>
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC14CircleMenuDemo10CircleMenu12buttonsCountSi"></a>
|
||||
<a name="//apple_ref/swift/Property/buttonsCount" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC14CircleMenuDemo10CircleMenu12buttonsCountSi">buttonsCount</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Buttons count</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">@IBInspectable</span> <span class="kd">public</span> <span class="k">var</span> <span class="nv">buttonsCount</span><span class="p">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="mi">3</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC14CircleMenuDemo10CircleMenu8durationSd"></a>
|
||||
<a name="//apple_ref/swift/Property/duration" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC14CircleMenuDemo10CircleMenu8durationSd">duration</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Circle animation duration</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">@IBInspectable</span> <span class="kd">public</span> <span class="k">var</span> <span class="nv">duration</span><span class="p">:</span> <span class="kt">Double</span> <span class="o">=</span> <span class="mi">2</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC14CircleMenuDemo10CircleMenu8distanceSf"></a>
|
||||
<a name="//apple_ref/swift/Property/distance" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC14CircleMenuDemo10CircleMenu8distanceSf">distance</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Distance between center button and buttons</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">@IBInspectable</span> <span class="kd">public</span> <span class="k">var</span> <span class="nv">distance</span><span class="p">:</span> <span class="kt">Float</span> <span class="o">=</span> <span class="mi">100</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC14CircleMenuDemo10CircleMenu9showDelaySd"></a>
|
||||
<a name="//apple_ref/swift/Property/showDelay" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC14CircleMenuDemo10CircleMenu9showDelaySd">showDelay</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Delay between show buttons</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">@IBInspectable</span> <span class="kd">public</span> <span class="k">var</span> <span class="nv">showDelay</span><span class="p">:</span> <span class="kt">Double</span> <span class="o">=</span> <span class="mi">0</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC14CircleMenuDemo10CircleMenu8delegateXwGSqPs9AnyObject__"></a>
|
||||
<a name="//apple_ref/swift/Property/delegate" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC14CircleMenuDemo10CircleMenu8delegateXwGSqPs9AnyObject__">delegate</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The object that acts as the delegate of the circle menu.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">@IBOutlet</span> <span class="k">weak</span> <span class="kd">public</span> <span class="k">var</span> <span class="nv">delegate</span><span class="p">:</span> <span class="kt">AnyObject</span><span class="p">?</span> <span class="c1">//CircleMenuDelegate?</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<div class="task-name-container">
|
||||
<a name="/life%20cycle"></a>
|
||||
<a name="//apple_ref/swift/Section/life cycle" class="dashAnchor"></a>
|
||||
<a href="#/life%20cycle">
|
||||
<h3 class="section-name">life cycle</h3>
|
||||
</a>
|
||||
</div>
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FC14CircleMenuDemo10CircleMenucFT5frameVSC6CGRect10normalIconGSqSS_12selectedIconGSqSS_12buttonsCountSi8durationSd8distanceSf_S0_"></a>
|
||||
<a name="//apple_ref/swift/Method/init(frame:normalIcon:selectedIcon:buttonsCount:duration:distance:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FC14CircleMenuDemo10CircleMenucFT5frameVSC6CGRect10normalIconGSqSS_12selectedIconGSqSS_12buttonsCountSi8durationSd8distanceSf_S0_">init(frame:normalIcon:selectedIcon:buttonsCount:duration:distance:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Initializes and returns a circle menu object.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">frame</span><span class="p">:</span> <span class="kt">CGRect</span><span class="p">,</span> <span class="nv">normalIcon</span><span class="p">:</span> <span class="kt">String</span><span class="p">?,</span> <span class="nv">selectedIcon</span><span class="p">:</span> <span class="kt">String</span><span class="p">?,</span> <span class="nv">buttonsCount</span><span class="p">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="mi">3</span><span class="p">,</span> <span class="nv">duration</span><span class="p">:</span> <span class="kt">Double</span> <span class="o">=</span> <span class="mi">2</span><span class="p">,</span>
|
||||
<span class="nv">distance</span><span class="p">:</span> <span class="kt">Float</span> <span class="o">=</span> <span class="mi">100</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>frame</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>A rectangle specifying the initial location and size of the circle menu in its superview’s coordinates.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>normalIcon</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The image to use for the specified normal state.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>selectedIcon</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The image to use for the specified selected state.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>buttonsCount</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The number of buttons.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>duration</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The duration, in seconds, of the animation.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>distance</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>Distance between center button and sub buttons.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>A newly created circle menu.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<div class="task-name-container">
|
||||
<a name="/methods"></a>
|
||||
<a name="//apple_ref/swift/Section/methods" class="dashAnchor"></a>
|
||||
<a href="#/methods">
|
||||
<h3 class="section-name">methods</h3>
|
||||
</a>
|
||||
</div>
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FC14CircleMenuDemo10CircleMenu11hideButtonsFTSd9hideDelaySd_T_"></a>
|
||||
<a name="//apple_ref/swift/Method/hideButtons(_:hideDelay:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FC14CircleMenuDemo10CircleMenu11hideButtonsFTSd9hideDelaySd_T_">hideButtons(_:hideDelay:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Hide button</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">hideButtons</span><span class="p">(</span><span class="nv">duration</span><span class="p">:</span> <span class="kt">Double</span><span class="p">,</span> <span class="nv">hideDelay</span><span class="p">:</span> <span class="kt">Double</span> <span class="o">=</span> <span class="mi">0</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>duration</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The duration, in seconds, of the animation.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>hideDelay</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The time to delay, in seconds.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FC14CircleMenuDemo10CircleMenu14buttonsIsShownFT_Sb"></a>
|
||||
<a name="//apple_ref/swift/Method/buttonsIsShown()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FC14CircleMenuDemo10CircleMenu14buttonsIsShownFT_Sb">buttonsIsShown()</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Check is sub buttons showed</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">buttonsIsShown</span><span class="p">()</span> <span class="o">-></span> <span class="kt">Bool</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/Ramotion/circle-menu" target="_blank" rel="external">AlexKalinkin</a>. All rights reserved. (Last updated: 2016-06-27)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -0,0 +1,104 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Protocols Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="js/jquery.min.js" defer></script>
|
||||
<script src="js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a title="Protocols Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="index.html">CircleMenuDemo Docs</a> (87% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="index.html">CircleMenuDemo Reference</a>
|
||||
<img id="carat" src="img/carat.png" />
|
||||
Protocols Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/CircleMenu.html">CircleMenu</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="Protocols.html">Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Protocols/CircleMenuDelegate.html">CircleMenuDelegate</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>Protocols</h1>
|
||||
<p>The following protocols are available globally.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<div class="task-name-container">
|
||||
<a name="/Protocol"></a>
|
||||
<a name="//apple_ref/swift/Section/Protocol" class="dashAnchor"></a>
|
||||
<a href="#/Protocol">
|
||||
<h3 class="section-name">Protocol</h3>
|
||||
</a>
|
||||
</div>
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:P14CircleMenuDemo18CircleMenuDelegate"></a>
|
||||
<a name="//apple_ref/swift/Protocol/CircleMenuDelegate" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:P14CircleMenuDemo18CircleMenuDelegate">CircleMenuDelegate</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>CircleMenuDelegate</p>
|
||||
|
||||
<a href="Protocols/CircleMenuDelegate.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">@objc</span> <span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">CircleMenuDelegate</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/Ramotion/circle-menu" target="_blank" rel="external">AlexKalinkin</a>. All rights reserved. (Last updated: 2016-06-27)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -0,0 +1,342 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>CircleMenuDelegate Protocol Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Protocol/CircleMenuDelegate" class="dashAnchor"></a>
|
||||
<a title="CircleMenuDelegate Protocol Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../index.html">CircleMenuDemo Docs</a> (87% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../index.html">CircleMenuDemo Reference</a>
|
||||
<img id="carat" src="../img/carat.png" />
|
||||
CircleMenuDelegate Protocol Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CircleMenu.html">CircleMenu</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../Protocols.html">Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Protocols/CircleMenuDelegate.html">CircleMenuDelegate</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>CircleMenuDelegate</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">@objc</span> <span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">CircleMenuDelegate</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>CircleMenuDelegate</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FP14CircleMenuDemo18CircleMenuDelegate10circleMenuFTCS_10CircleMenu11willDisplayCSo8UIButton7atIndexSi_T_"></a>
|
||||
<a name="//apple_ref/swift/Method/circleMenu(_:willDisplay:atIndex:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FP14CircleMenuDemo18CircleMenuDelegate10circleMenuFTCS_10CircleMenu11willDisplayCSo8UIButton7atIndexSi_T_">circleMenu(_:willDisplay:atIndex:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Tells the delegate the circle menu is about to draw a button for a particular index.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">optional</span> <span class="kd">func</span> <span class="nf">circleMenu</span><span class="p">(</span><span class="nv">circleMenu</span><span class="p">:</span> <span class="kt">CircleMenu</span><span class="p">,</span> <span class="n">willDisplay</span> <span class="nv">button</span><span class="p">:</span> <span class="kt">UIButton</span><span class="p">,</span> <span class="nv">atIndex</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>circleMenu</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The circle menu object informing the delegate of this impending event.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>button</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>A circle menu button object that circle menu is going to use when drawing the row. Don’t change button.tag</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>atIndex</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>An button index.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FP14CircleMenuDemo18CircleMenuDelegate10circleMenuFTCS_10CircleMenu18buttonWillSelectedCSo8UIButton7atIndexSi_T_"></a>
|
||||
<a name="//apple_ref/swift/Method/circleMenu(_:buttonWillSelected:atIndex:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FP14CircleMenuDemo18CircleMenuDelegate10circleMenuFTCS_10CircleMenu18buttonWillSelectedCSo8UIButton7atIndexSi_T_">circleMenu(_:buttonWillSelected:atIndex:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Tells the delegate that a specified index is about to be selected.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">optional</span> <span class="kd">func</span> <span class="nf">circleMenu</span><span class="p">(</span><span class="nv">circleMenu</span><span class="p">:</span> <span class="kt">CircleMenu</span><span class="p">,</span> <span class="n">buttonWillSelected</span> <span class="nv">button</span><span class="p">:</span> <span class="kt">UIButton</span><span class="p">,</span> <span class="nv">atIndex</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>circleMenu</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>A circle menu object informing the delegate about the impending selection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>button</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>A selected circle menu button. Don’t change button.tag</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>atIndex</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>Selected button index</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FP14CircleMenuDemo18CircleMenuDelegate10circleMenuFTCS_10CircleMenu17buttonDidSelectedCSo8UIButton7atIndexSi_T_"></a>
|
||||
<a name="//apple_ref/swift/Method/circleMenu(_:buttonDidSelected:atIndex:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FP14CircleMenuDemo18CircleMenuDelegate10circleMenuFTCS_10CircleMenu17buttonDidSelectedCSo8UIButton7atIndexSi_T_">circleMenu(_:buttonDidSelected:atIndex:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Tells the delegate that the specified index is now selected.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">optional</span> <span class="kd">func</span> <span class="nf">circleMenu</span><span class="p">(</span><span class="nv">circleMenu</span><span class="p">:</span> <span class="kt">CircleMenu</span><span class="p">,</span> <span class="n">buttonDidSelected</span> <span class="nv">button</span><span class="p">:</span> <span class="kt">UIButton</span><span class="p">,</span> <span class="nv">atIndex</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>circleMenu</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>A circle menu object informing the delegate about the new index selection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>button</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>A selected circle menu button. Don’t change button.tag</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>atIndex</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>Selected button index</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FP14CircleMenuDemo18CircleMenuDelegate13menuCollapsedFCS_10CircleMenuT_"></a>
|
||||
<a name="//apple_ref/swift/Method/menuCollapsed(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FP14CircleMenuDemo18CircleMenuDelegate13menuCollapsedFCS_10CircleMenuT_">menuCollapsed(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Tells the delegate that the menu was collapsed - the cancel action.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">optional</span> <span class="kd">func</span> <span class="nf">menuCollapsed</span><span class="p">(</span><span class="nv">circleMenu</span><span class="p">:</span> <span class="kt">CircleMenu</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>circleMenu</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>A circle menu object informing the delegate about the new index selection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/Ramotion/circle-menu" target="_blank" rel="external">AlexKalinkin</a>. All rights reserved. (Last updated: 2016-06-27)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -0,0 +1,200 @@
|
||||
/* Credit to https://gist.github.com/wataru420/2048287 */
|
||||
.highlight {
|
||||
/* Comment */
|
||||
/* Error */
|
||||
/* Keyword */
|
||||
/* Operator */
|
||||
/* Comment.Multiline */
|
||||
/* Comment.Preproc */
|
||||
/* Comment.Single */
|
||||
/* Comment.Special */
|
||||
/* Generic.Deleted */
|
||||
/* Generic.Deleted.Specific */
|
||||
/* Generic.Emph */
|
||||
/* Generic.Error */
|
||||
/* Generic.Heading */
|
||||
/* Generic.Inserted */
|
||||
/* Generic.Inserted.Specific */
|
||||
/* Generic.Output */
|
||||
/* Generic.Prompt */
|
||||
/* Generic.Strong */
|
||||
/* Generic.Subheading */
|
||||
/* Generic.Traceback */
|
||||
/* Keyword.Constant */
|
||||
/* Keyword.Declaration */
|
||||
/* Keyword.Pseudo */
|
||||
/* Keyword.Reserved */
|
||||
/* Keyword.Type */
|
||||
/* Literal.Number */
|
||||
/* Literal.String */
|
||||
/* Name.Attribute */
|
||||
/* Name.Builtin */
|
||||
/* Name.Class */
|
||||
/* Name.Constant */
|
||||
/* Name.Entity */
|
||||
/* Name.Exception */
|
||||
/* Name.Function */
|
||||
/* Name.Namespace */
|
||||
/* Name.Tag */
|
||||
/* Name.Variable */
|
||||
/* Operator.Word */
|
||||
/* Text.Whitespace */
|
||||
/* Literal.Number.Float */
|
||||
/* Literal.Number.Hex */
|
||||
/* Literal.Number.Integer */
|
||||
/* Literal.Number.Oct */
|
||||
/* Literal.String.Backtick */
|
||||
/* Literal.String.Char */
|
||||
/* Literal.String.Doc */
|
||||
/* Literal.String.Double */
|
||||
/* Literal.String.Escape */
|
||||
/* Literal.String.Heredoc */
|
||||
/* Literal.String.Interpol */
|
||||
/* Literal.String.Other */
|
||||
/* Literal.String.Regex */
|
||||
/* Literal.String.Single */
|
||||
/* Literal.String.Symbol */
|
||||
/* Name.Builtin.Pseudo */
|
||||
/* Name.Variable.Class */
|
||||
/* Name.Variable.Global */
|
||||
/* Name.Variable.Instance */
|
||||
/* Literal.Number.Integer.Long */ }
|
||||
.highlight .c {
|
||||
color: #999988;
|
||||
font-style: italic; }
|
||||
.highlight .err {
|
||||
color: #a61717;
|
||||
background-color: #e3d2d2; }
|
||||
.highlight .k {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .o {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .cm {
|
||||
color: #999988;
|
||||
font-style: italic; }
|
||||
.highlight .cp {
|
||||
color: #999999;
|
||||
font-weight: bold; }
|
||||
.highlight .c1 {
|
||||
color: #999988;
|
||||
font-style: italic; }
|
||||
.highlight .cs {
|
||||
color: #999999;
|
||||
font-weight: bold;
|
||||
font-style: italic; }
|
||||
.highlight .gd {
|
||||
color: #000000;
|
||||
background-color: #ffdddd; }
|
||||
.highlight .gd .x {
|
||||
color: #000000;
|
||||
background-color: #ffaaaa; }
|
||||
.highlight .ge {
|
||||
color: #000000;
|
||||
font-style: italic; }
|
||||
.highlight .gr {
|
||||
color: #aa0000; }
|
||||
.highlight .gh {
|
||||
color: #999999; }
|
||||
.highlight .gi {
|
||||
color: #000000;
|
||||
background-color: #ddffdd; }
|
||||
.highlight .gi .x {
|
||||
color: #000000;
|
||||
background-color: #aaffaa; }
|
||||
.highlight .go {
|
||||
color: #888888; }
|
||||
.highlight .gp {
|
||||
color: #555555; }
|
||||
.highlight .gs {
|
||||
font-weight: bold; }
|
||||
.highlight .gu {
|
||||
color: #aaaaaa; }
|
||||
.highlight .gt {
|
||||
color: #aa0000; }
|
||||
.highlight .kc {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .kd {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .kp {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .kr {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .kt {
|
||||
color: #445588; }
|
||||
.highlight .m {
|
||||
color: #009999; }
|
||||
.highlight .s {
|
||||
color: #d14; }
|
||||
.highlight .na {
|
||||
color: #008080; }
|
||||
.highlight .nb {
|
||||
color: #0086B3; }
|
||||
.highlight .nc {
|
||||
color: #445588;
|
||||
font-weight: bold; }
|
||||
.highlight .no {
|
||||
color: #008080; }
|
||||
.highlight .ni {
|
||||
color: #800080; }
|
||||
.highlight .ne {
|
||||
color: #990000;
|
||||
font-weight: bold; }
|
||||
.highlight .nf {
|
||||
color: #990000; }
|
||||
.highlight .nn {
|
||||
color: #555555; }
|
||||
.highlight .nt {
|
||||
color: #000080; }
|
||||
.highlight .nv {
|
||||
color: #008080; }
|
||||
.highlight .ow {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .w {
|
||||
color: #bbbbbb; }
|
||||
.highlight .mf {
|
||||
color: #009999; }
|
||||
.highlight .mh {
|
||||
color: #009999; }
|
||||
.highlight .mi {
|
||||
color: #009999; }
|
||||
.highlight .mo {
|
||||
color: #009999; }
|
||||
.highlight .sb {
|
||||
color: #d14; }
|
||||
.highlight .sc {
|
||||
color: #d14; }
|
||||
.highlight .sd {
|
||||
color: #d14; }
|
||||
.highlight .s2 {
|
||||
color: #d14; }
|
||||
.highlight .se {
|
||||
color: #d14; }
|
||||
.highlight .sh {
|
||||
color: #d14; }
|
||||
.highlight .si {
|
||||
color: #d14; }
|
||||
.highlight .sx {
|
||||
color: #d14; }
|
||||
.highlight .sr {
|
||||
color: #009926; }
|
||||
.highlight .s1 {
|
||||
color: #d14; }
|
||||
.highlight .ss {
|
||||
color: #990073; }
|
||||
.highlight .bp {
|
||||
color: #999999; }
|
||||
.highlight .vc {
|
||||
color: #008080; }
|
||||
.highlight .vg {
|
||||
color: #008080; }
|
||||
.highlight .vi {
|
||||
color: #008080; }
|
||||
.highlight .il {
|
||||
color: #009999; }
|
||||
@@ -0,0 +1,331 @@
|
||||
html, body, div, span, h1, h3, h4, p, a, code, em, img, ul, li, table, tbody, tr, td {
|
||||
background: transparent;
|
||||
border: 0;
|
||||
margin: 0;
|
||||
outline: 0;
|
||||
padding: 0;
|
||||
vertical-align: baseline; }
|
||||
|
||||
body {
|
||||
background-color: #f2f2f2;
|
||||
font-family: Helvetica, freesans, Arial, sans-serif;
|
||||
font-size: 14px;
|
||||
-webkit-font-smoothing: subpixel-antialiased;
|
||||
word-wrap: break-word; }
|
||||
|
||||
h1, h2, h3 {
|
||||
margin-top: 0.8em;
|
||||
margin-bottom: 0.3em;
|
||||
font-weight: 100;
|
||||
color: black; }
|
||||
|
||||
h1 {
|
||||
font-size: 2.5em; }
|
||||
|
||||
h2 {
|
||||
font-size: 2em;
|
||||
border-bottom: 1px solid #e2e2e2; }
|
||||
|
||||
h4 {
|
||||
font-size: 13px;
|
||||
line-height: 1.5;
|
||||
margin-top: 21px; }
|
||||
|
||||
h5 {
|
||||
font-size: 1.1em; }
|
||||
|
||||
h6 {
|
||||
font-size: 1.1em;
|
||||
color: #777; }
|
||||
|
||||
.section-name {
|
||||
color: gray;
|
||||
display: block;
|
||||
font-family: Helvetica;
|
||||
font-size: 22px;
|
||||
font-weight: 100;
|
||||
margin-bottom: 15px; }
|
||||
|
||||
pre, code {
|
||||
font: 0.95em Menlo, monospace;
|
||||
color: #777;
|
||||
word-wrap: normal; }
|
||||
|
||||
p code, li code {
|
||||
background-color: #eee;
|
||||
padding: 2px 4px;
|
||||
border-radius: 4px; }
|
||||
|
||||
a {
|
||||
color: #0088cc;
|
||||
text-decoration: none; }
|
||||
|
||||
ul {
|
||||
padding-left: 15px; }
|
||||
|
||||
li {
|
||||
line-height: 1.8em; }
|
||||
|
||||
img {
|
||||
max-width: 100%; }
|
||||
|
||||
blockquote {
|
||||
margin-left: 0;
|
||||
padding: 0 10px;
|
||||
border-left: 4px solid #ccc; }
|
||||
|
||||
.content-wrapper {
|
||||
margin: 0 auto;
|
||||
width: 980px; }
|
||||
|
||||
header {
|
||||
font-size: 0.85em;
|
||||
line-height: 26px;
|
||||
background-color: #414141;
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
z-index: 1; }
|
||||
header img {
|
||||
padding-right: 6px;
|
||||
vertical-align: -4px;
|
||||
height: 16px; }
|
||||
header a {
|
||||
color: #fff; }
|
||||
header p {
|
||||
float: left;
|
||||
color: #999; }
|
||||
header .header-right {
|
||||
float: right;
|
||||
margin-left: 16px; }
|
||||
|
||||
#breadcrumbs {
|
||||
background-color: #f2f2f2;
|
||||
height: 27px;
|
||||
padding-top: 17px;
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
z-index: 1;
|
||||
margin-top: 26px; }
|
||||
#breadcrumbs #carat {
|
||||
height: 10px;
|
||||
margin: 0 5px; }
|
||||
|
||||
.sidebar {
|
||||
background-color: #f9f9f9;
|
||||
border: 1px solid #e2e2e2;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
position: fixed;
|
||||
top: 70px;
|
||||
bottom: 0;
|
||||
width: 230px;
|
||||
word-wrap: normal; }
|
||||
|
||||
.nav-groups {
|
||||
list-style-type: none;
|
||||
background: #fff;
|
||||
padding-left: 0; }
|
||||
|
||||
.nav-group-name {
|
||||
border-bottom: 1px solid #e2e2e2;
|
||||
font-size: 1.1em;
|
||||
font-weight: 100;
|
||||
padding: 15px 0 15px 20px; }
|
||||
.nav-group-name > a {
|
||||
color: #333; }
|
||||
|
||||
.nav-group-tasks {
|
||||
margin-top: 5px; }
|
||||
|
||||
.nav-group-task {
|
||||
font-size: 0.9em;
|
||||
list-style-type: none; }
|
||||
.nav-group-task a {
|
||||
color: #888; }
|
||||
|
||||
.main-content {
|
||||
background-color: #fff;
|
||||
border: 1px solid #e2e2e2;
|
||||
margin-left: 246px;
|
||||
position: absolute;
|
||||
overflow: hidden;
|
||||
padding-bottom: 60px;
|
||||
top: 70px;
|
||||
width: 734px; }
|
||||
.main-content p, .main-content a, .main-content code, .main-content em, .main-content ul, .main-content table, .main-content blockquote {
|
||||
margin-bottom: 1em; }
|
||||
.main-content p {
|
||||
line-height: 1.8em; }
|
||||
.main-content section .section:first-child {
|
||||
margin-top: 0;
|
||||
padding-top: 0; }
|
||||
.main-content section .task-group-section .task-group:first-of-type {
|
||||
padding-top: 10px; }
|
||||
.main-content section .task-group-section .task-group:first-of-type .section-name {
|
||||
padding-top: 15px; }
|
||||
|
||||
.section {
|
||||
padding: 0 25px; }
|
||||
|
||||
.highlight {
|
||||
background-color: #eee;
|
||||
padding: 10px 12px;
|
||||
border: 1px solid #e2e2e2;
|
||||
border-radius: 4px;
|
||||
overflow-x: auto; }
|
||||
|
||||
.declaration .highlight {
|
||||
overflow-x: initial;
|
||||
padding: 0 40px 40px 0;
|
||||
margin-bottom: -25px;
|
||||
background-color: transparent;
|
||||
border: none; }
|
||||
|
||||
.section-name {
|
||||
margin: 0;
|
||||
margin-left: 18px; }
|
||||
|
||||
.task-group-section {
|
||||
padding-left: 6px;
|
||||
border-top: 1px solid #e2e2e2; }
|
||||
|
||||
.task-group {
|
||||
padding-top: 0px; }
|
||||
|
||||
.task-name-container a[name]:before {
|
||||
content: "";
|
||||
display: block;
|
||||
padding-top: 70px;
|
||||
margin: -70px 0 0; }
|
||||
|
||||
.item {
|
||||
padding-top: 8px;
|
||||
width: 100%;
|
||||
list-style-type: none; }
|
||||
.item a[name]:before {
|
||||
content: "";
|
||||
display: block;
|
||||
padding-top: 70px;
|
||||
margin: -70px 0 0; }
|
||||
.item code {
|
||||
background-color: transparent;
|
||||
padding: 0; }
|
||||
.item .token {
|
||||
padding-left: 3px;
|
||||
margin-left: 15px;
|
||||
font-size: 11.9px; }
|
||||
.item .declaration-note {
|
||||
font-size: .85em;
|
||||
color: gray;
|
||||
font-style: italic; }
|
||||
|
||||
.pointer-container {
|
||||
border-bottom: 1px solid #e2e2e2;
|
||||
left: -23px;
|
||||
padding-bottom: 13px;
|
||||
position: relative;
|
||||
width: 110%; }
|
||||
|
||||
.pointer {
|
||||
background: #f9f9f9;
|
||||
border-left: 1px solid #e2e2e2;
|
||||
border-top: 1px solid #e2e2e2;
|
||||
height: 12px;
|
||||
left: 21px;
|
||||
top: -7px;
|
||||
-webkit-transform: rotate(45deg);
|
||||
-moz-transform: rotate(45deg);
|
||||
-o-transform: rotate(45deg);
|
||||
transform: rotate(45deg);
|
||||
position: absolute;
|
||||
width: 12px; }
|
||||
|
||||
.height-container {
|
||||
display: none;
|
||||
left: -25px;
|
||||
padding: 0 25px;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
overflow: hidden; }
|
||||
.height-container .section {
|
||||
background: #f9f9f9;
|
||||
border-bottom: 1px solid #e2e2e2;
|
||||
left: -25px;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
padding-top: 10px;
|
||||
padding-bottom: 5px; }
|
||||
|
||||
.aside, .language {
|
||||
padding: 6px 12px;
|
||||
margin: 12px 0;
|
||||
border-left: 5px solid #dddddd;
|
||||
overflow-y: hidden; }
|
||||
.aside .aside-title, .language .aside-title {
|
||||
font-size: 9px;
|
||||
letter-spacing: 2px;
|
||||
text-transform: uppercase;
|
||||
padding-bottom: 0;
|
||||
margin: 0;
|
||||
color: #aaa;
|
||||
-webkit-user-select: none; }
|
||||
.aside p:last-child, .language p:last-child {
|
||||
margin-bottom: 0; }
|
||||
|
||||
.language {
|
||||
border-left: 5px solid #cde9f4; }
|
||||
.language .aside-title {
|
||||
color: #4b8afb; }
|
||||
|
||||
.aside-warning {
|
||||
border-left: 5px solid #ff6666; }
|
||||
.aside-warning .aside-title {
|
||||
color: #ff0000; }
|
||||
|
||||
.graybox {
|
||||
border-collapse: collapse;
|
||||
width: 100%; }
|
||||
.graybox p {
|
||||
margin: 0;
|
||||
word-break: break-word;
|
||||
min-width: 50px; }
|
||||
.graybox td {
|
||||
border: 1px solid #e2e2e2;
|
||||
padding: 5px 25px 5px 10px;
|
||||
vertical-align: middle; }
|
||||
.graybox tr td:first-of-type {
|
||||
text-align: right;
|
||||
padding: 7px;
|
||||
vertical-align: top;
|
||||
word-break: normal;
|
||||
width: 40px; }
|
||||
|
||||
.slightly-smaller {
|
||||
font-size: 0.9em; }
|
||||
|
||||
#footer {
|
||||
position: absolute;
|
||||
bottom: 10px;
|
||||
margin-left: 25px; }
|
||||
#footer p {
|
||||
margin: 0;
|
||||
color: #aaa;
|
||||
font-size: 0.8em; }
|
||||
|
||||
html.dash header, html.dash #breadcrumbs, html.dash .sidebar {
|
||||
display: none; }
|
||||
html.dash .main-content {
|
||||
width: 980px;
|
||||
margin-left: 0;
|
||||
border: none;
|
||||
width: 100%;
|
||||
top: 0;
|
||||
padding-bottom: 0; }
|
||||
html.dash .height-container {
|
||||
display: block; }
|
||||
html.dash .item .token {
|
||||
margin-left: 0; }
|
||||
html.dash .content-wrapper {
|
||||
width: auto; }
|
||||
html.dash #footer {
|
||||
position: static; }
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.jazzy.circlemenudemo</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>CircleMenuDemo</string>
|
||||
<key>DocSetPlatformFamily</key>
|
||||
<string>jazzy</string>
|
||||
<key>isDashDocset</key>
|
||||
<true/>
|
||||
<key>dashIndexFilePath</key>
|
||||
<string>index.html</string>
|
||||
<key>isJavaScriptEnabled</key>
|
||||
<true/>
|
||||
<key>DashDocSetFamily</key>
|
||||
<string>dashtoc</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,104 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Classes Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="js/jquery.min.js" defer></script>
|
||||
<script src="js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a title="Classes Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="index.html">CircleMenuDemo Docs</a> (87% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="index.html">CircleMenuDemo Reference</a>
|
||||
<img id="carat" src="img/carat.png" />
|
||||
Classes Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/CircleMenu.html">CircleMenu</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="Protocols.html">Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Protocols/CircleMenuDelegate.html">CircleMenuDelegate</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>Classes</h1>
|
||||
<p>The following classes are available globally.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<div class="task-name-container">
|
||||
<a name="/CircleMenu"></a>
|
||||
<a name="//apple_ref/swift/Section/CircleMenu" class="dashAnchor"></a>
|
||||
<a href="#/CircleMenu">
|
||||
<h3 class="section-name">CircleMenu</h3>
|
||||
</a>
|
||||
</div>
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:C14CircleMenuDemo10CircleMenu"></a>
|
||||
<a name="//apple_ref/swift/Class/CircleMenu" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:C14CircleMenuDemo10CircleMenu">CircleMenu</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>A Button object with pop ups buttons</p>
|
||||
|
||||
<a href="Classes/CircleMenu.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">CircleMenu</span><span class="p">:</span> <span class="kt">UIButton</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/Ramotion/circle-menu" target="_blank" rel="external">AlexKalinkin</a>. All rights reserved. (Last updated: 2016-06-27)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -0,0 +1,445 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>CircleMenu Class Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Class/CircleMenu" class="dashAnchor"></a>
|
||||
<a title="CircleMenu Class Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../index.html">CircleMenuDemo Docs</a> (87% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../index.html">CircleMenuDemo Reference</a>
|
||||
<img id="carat" src="../img/carat.png" />
|
||||
CircleMenu Class Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CircleMenu.html">CircleMenu</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../Protocols.html">Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Protocols/CircleMenuDelegate.html">CircleMenuDelegate</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>CircleMenu</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">CircleMenu</span><span class="p">:</span> <span class="kt">UIButton</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>A Button object with pop ups buttons</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<div class="task-name-container">
|
||||
<a name="/properties"></a>
|
||||
<a name="//apple_ref/swift/Section/properties" class="dashAnchor"></a>
|
||||
<a href="#/properties">
|
||||
<h3 class="section-name">properties</h3>
|
||||
</a>
|
||||
</div>
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC14CircleMenuDemo10CircleMenu12buttonsCountSi"></a>
|
||||
<a name="//apple_ref/swift/Property/buttonsCount" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC14CircleMenuDemo10CircleMenu12buttonsCountSi">buttonsCount</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Buttons count</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">@IBInspectable</span> <span class="kd">public</span> <span class="k">var</span> <span class="nv">buttonsCount</span><span class="p">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="mi">3</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC14CircleMenuDemo10CircleMenu8durationSd"></a>
|
||||
<a name="//apple_ref/swift/Property/duration" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC14CircleMenuDemo10CircleMenu8durationSd">duration</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Circle animation duration</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">@IBInspectable</span> <span class="kd">public</span> <span class="k">var</span> <span class="nv">duration</span><span class="p">:</span> <span class="kt">Double</span> <span class="o">=</span> <span class="mi">2</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC14CircleMenuDemo10CircleMenu8distanceSf"></a>
|
||||
<a name="//apple_ref/swift/Property/distance" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC14CircleMenuDemo10CircleMenu8distanceSf">distance</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Distance between center button and buttons</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">@IBInspectable</span> <span class="kd">public</span> <span class="k">var</span> <span class="nv">distance</span><span class="p">:</span> <span class="kt">Float</span> <span class="o">=</span> <span class="mi">100</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC14CircleMenuDemo10CircleMenu9showDelaySd"></a>
|
||||
<a name="//apple_ref/swift/Property/showDelay" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC14CircleMenuDemo10CircleMenu9showDelaySd">showDelay</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Delay between show buttons</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">@IBInspectable</span> <span class="kd">public</span> <span class="k">var</span> <span class="nv">showDelay</span><span class="p">:</span> <span class="kt">Double</span> <span class="o">=</span> <span class="mi">0</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC14CircleMenuDemo10CircleMenu8delegateXwGSqPs9AnyObject__"></a>
|
||||
<a name="//apple_ref/swift/Property/delegate" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC14CircleMenuDemo10CircleMenu8delegateXwGSqPs9AnyObject__">delegate</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The object that acts as the delegate of the circle menu.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">@IBOutlet</span> <span class="k">weak</span> <span class="kd">public</span> <span class="k">var</span> <span class="nv">delegate</span><span class="p">:</span> <span class="kt">AnyObject</span><span class="p">?</span> <span class="c1">//CircleMenuDelegate?</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<div class="task-name-container">
|
||||
<a name="/life%20cycle"></a>
|
||||
<a name="//apple_ref/swift/Section/life cycle" class="dashAnchor"></a>
|
||||
<a href="#/life%20cycle">
|
||||
<h3 class="section-name">life cycle</h3>
|
||||
</a>
|
||||
</div>
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FC14CircleMenuDemo10CircleMenucFT5frameVSC6CGRect10normalIconGSqSS_12selectedIconGSqSS_12buttonsCountSi8durationSd8distanceSf_S0_"></a>
|
||||
<a name="//apple_ref/swift/Method/init(frame:normalIcon:selectedIcon:buttonsCount:duration:distance:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FC14CircleMenuDemo10CircleMenucFT5frameVSC6CGRect10normalIconGSqSS_12selectedIconGSqSS_12buttonsCountSi8durationSd8distanceSf_S0_">init(frame:normalIcon:selectedIcon:buttonsCount:duration:distance:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Initializes and returns a circle menu object.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">frame</span><span class="p">:</span> <span class="kt">CGRect</span><span class="p">,</span> <span class="nv">normalIcon</span><span class="p">:</span> <span class="kt">String</span><span class="p">?,</span> <span class="nv">selectedIcon</span><span class="p">:</span> <span class="kt">String</span><span class="p">?,</span> <span class="nv">buttonsCount</span><span class="p">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="mi">3</span><span class="p">,</span> <span class="nv">duration</span><span class="p">:</span> <span class="kt">Double</span> <span class="o">=</span> <span class="mi">2</span><span class="p">,</span>
|
||||
<span class="nv">distance</span><span class="p">:</span> <span class="kt">Float</span> <span class="o">=</span> <span class="mi">100</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>frame</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>A rectangle specifying the initial location and size of the circle menu in its superview’s coordinates.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>normalIcon</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The image to use for the specified normal state.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>selectedIcon</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The image to use for the specified selected state.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>buttonsCount</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The number of buttons.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>duration</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The duration, in seconds, of the animation.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>distance</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>Distance between center button and sub buttons.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>A newly created circle menu.</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<div class="task-name-container">
|
||||
<a name="/methods"></a>
|
||||
<a name="//apple_ref/swift/Section/methods" class="dashAnchor"></a>
|
||||
<a href="#/methods">
|
||||
<h3 class="section-name">methods</h3>
|
||||
</a>
|
||||
</div>
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FC14CircleMenuDemo10CircleMenu11hideButtonsFTSd9hideDelaySd_T_"></a>
|
||||
<a name="//apple_ref/swift/Method/hideButtons(_:hideDelay:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FC14CircleMenuDemo10CircleMenu11hideButtonsFTSd9hideDelaySd_T_">hideButtons(_:hideDelay:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Hide button</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">hideButtons</span><span class="p">(</span><span class="nv">duration</span><span class="p">:</span> <span class="kt">Double</span><span class="p">,</span> <span class="nv">hideDelay</span><span class="p">:</span> <span class="kt">Double</span> <span class="o">=</span> <span class="mi">0</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>duration</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The duration, in seconds, of the animation.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>hideDelay</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The time to delay, in seconds.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FC14CircleMenuDemo10CircleMenu14buttonsIsShownFT_Sb"></a>
|
||||
<a name="//apple_ref/swift/Method/buttonsIsShown()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FC14CircleMenuDemo10CircleMenu14buttonsIsShownFT_Sb">buttonsIsShown()</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Check is sub buttons showed</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">buttonsIsShown</span><span class="p">()</span> <span class="o">-></span> <span class="kt">Bool</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/Ramotion/circle-menu" target="_blank" rel="external">AlexKalinkin</a>. All rights reserved. (Last updated: 2016-06-27)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -0,0 +1,104 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Protocols Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="js/jquery.min.js" defer></script>
|
||||
<script src="js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a title="Protocols Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="index.html">CircleMenuDemo Docs</a> (87% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="index.html">CircleMenuDemo Reference</a>
|
||||
<img id="carat" src="img/carat.png" />
|
||||
Protocols Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/CircleMenu.html">CircleMenu</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="Protocols.html">Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Protocols/CircleMenuDelegate.html">CircleMenuDelegate</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>Protocols</h1>
|
||||
<p>The following protocols are available globally.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<div class="task-name-container">
|
||||
<a name="/Protocol"></a>
|
||||
<a name="//apple_ref/swift/Section/Protocol" class="dashAnchor"></a>
|
||||
<a href="#/Protocol">
|
||||
<h3 class="section-name">Protocol</h3>
|
||||
</a>
|
||||
</div>
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:P14CircleMenuDemo18CircleMenuDelegate"></a>
|
||||
<a name="//apple_ref/swift/Protocol/CircleMenuDelegate" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:P14CircleMenuDemo18CircleMenuDelegate">CircleMenuDelegate</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>CircleMenuDelegate</p>
|
||||
|
||||
<a href="Protocols/CircleMenuDelegate.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">@objc</span> <span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">CircleMenuDelegate</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/Ramotion/circle-menu" target="_blank" rel="external">AlexKalinkin</a>. All rights reserved. (Last updated: 2016-06-27)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -0,0 +1,342 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>CircleMenuDelegate Protocol Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Protocol/CircleMenuDelegate" class="dashAnchor"></a>
|
||||
<a title="CircleMenuDelegate Protocol Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../index.html">CircleMenuDemo Docs</a> (87% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../index.html">CircleMenuDemo Reference</a>
|
||||
<img id="carat" src="../img/carat.png" />
|
||||
CircleMenuDelegate Protocol Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/CircleMenu.html">CircleMenu</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../Protocols.html">Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Protocols/CircleMenuDelegate.html">CircleMenuDelegate</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>CircleMenuDelegate</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">@objc</span> <span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">CircleMenuDelegate</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>CircleMenuDelegate</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FP14CircleMenuDemo18CircleMenuDelegate10circleMenuFTCS_10CircleMenu11willDisplayCSo8UIButton7atIndexSi_T_"></a>
|
||||
<a name="//apple_ref/swift/Method/circleMenu(_:willDisplay:atIndex:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FP14CircleMenuDemo18CircleMenuDelegate10circleMenuFTCS_10CircleMenu11willDisplayCSo8UIButton7atIndexSi_T_">circleMenu(_:willDisplay:atIndex:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Tells the delegate the circle menu is about to draw a button for a particular index.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">optional</span> <span class="kd">func</span> <span class="nf">circleMenu</span><span class="p">(</span><span class="nv">circleMenu</span><span class="p">:</span> <span class="kt">CircleMenu</span><span class="p">,</span> <span class="n">willDisplay</span> <span class="nv">button</span><span class="p">:</span> <span class="kt">UIButton</span><span class="p">,</span> <span class="nv">atIndex</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>circleMenu</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The circle menu object informing the delegate of this impending event.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>button</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>A circle menu button object that circle menu is going to use when drawing the row. Don’t change button.tag</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>atIndex</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>An button index.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FP14CircleMenuDemo18CircleMenuDelegate10circleMenuFTCS_10CircleMenu18buttonWillSelectedCSo8UIButton7atIndexSi_T_"></a>
|
||||
<a name="//apple_ref/swift/Method/circleMenu(_:buttonWillSelected:atIndex:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FP14CircleMenuDemo18CircleMenuDelegate10circleMenuFTCS_10CircleMenu18buttonWillSelectedCSo8UIButton7atIndexSi_T_">circleMenu(_:buttonWillSelected:atIndex:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Tells the delegate that a specified index is about to be selected.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">optional</span> <span class="kd">func</span> <span class="nf">circleMenu</span><span class="p">(</span><span class="nv">circleMenu</span><span class="p">:</span> <span class="kt">CircleMenu</span><span class="p">,</span> <span class="n">buttonWillSelected</span> <span class="nv">button</span><span class="p">:</span> <span class="kt">UIButton</span><span class="p">,</span> <span class="nv">atIndex</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>circleMenu</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>A circle menu object informing the delegate about the impending selection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>button</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>A selected circle menu button. Don’t change button.tag</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>atIndex</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>Selected button index</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FP14CircleMenuDemo18CircleMenuDelegate10circleMenuFTCS_10CircleMenu17buttonDidSelectedCSo8UIButton7atIndexSi_T_"></a>
|
||||
<a name="//apple_ref/swift/Method/circleMenu(_:buttonDidSelected:atIndex:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FP14CircleMenuDemo18CircleMenuDelegate10circleMenuFTCS_10CircleMenu17buttonDidSelectedCSo8UIButton7atIndexSi_T_">circleMenu(_:buttonDidSelected:atIndex:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Tells the delegate that the specified index is now selected.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">optional</span> <span class="kd">func</span> <span class="nf">circleMenu</span><span class="p">(</span><span class="nv">circleMenu</span><span class="p">:</span> <span class="kt">CircleMenu</span><span class="p">,</span> <span class="n">buttonDidSelected</span> <span class="nv">button</span><span class="p">:</span> <span class="kt">UIButton</span><span class="p">,</span> <span class="nv">atIndex</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>circleMenu</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>A circle menu object informing the delegate about the new index selection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>button</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>A selected circle menu button. Don’t change button.tag</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>atIndex</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>Selected button index</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FP14CircleMenuDemo18CircleMenuDelegate13menuCollapsedFCS_10CircleMenuT_"></a>
|
||||
<a name="//apple_ref/swift/Method/menuCollapsed(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FP14CircleMenuDemo18CircleMenuDelegate13menuCollapsedFCS_10CircleMenuT_">menuCollapsed(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Tells the delegate that the menu was collapsed - the cancel action.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">optional</span> <span class="kd">func</span> <span class="nf">menuCollapsed</span><span class="p">(</span><span class="nv">circleMenu</span><span class="p">:</span> <span class="kt">CircleMenu</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>circleMenu</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>A circle menu object informing the delegate about the new index selection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/Ramotion/circle-menu" target="_blank" rel="external">AlexKalinkin</a>. All rights reserved. (Last updated: 2016-06-27)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -0,0 +1,200 @@
|
||||
/* Credit to https://gist.github.com/wataru420/2048287 */
|
||||
.highlight {
|
||||
/* Comment */
|
||||
/* Error */
|
||||
/* Keyword */
|
||||
/* Operator */
|
||||
/* Comment.Multiline */
|
||||
/* Comment.Preproc */
|
||||
/* Comment.Single */
|
||||
/* Comment.Special */
|
||||
/* Generic.Deleted */
|
||||
/* Generic.Deleted.Specific */
|
||||
/* Generic.Emph */
|
||||
/* Generic.Error */
|
||||
/* Generic.Heading */
|
||||
/* Generic.Inserted */
|
||||
/* Generic.Inserted.Specific */
|
||||
/* Generic.Output */
|
||||
/* Generic.Prompt */
|
||||
/* Generic.Strong */
|
||||
/* Generic.Subheading */
|
||||
/* Generic.Traceback */
|
||||
/* Keyword.Constant */
|
||||
/* Keyword.Declaration */
|
||||
/* Keyword.Pseudo */
|
||||
/* Keyword.Reserved */
|
||||
/* Keyword.Type */
|
||||
/* Literal.Number */
|
||||
/* Literal.String */
|
||||
/* Name.Attribute */
|
||||
/* Name.Builtin */
|
||||
/* Name.Class */
|
||||
/* Name.Constant */
|
||||
/* Name.Entity */
|
||||
/* Name.Exception */
|
||||
/* Name.Function */
|
||||
/* Name.Namespace */
|
||||
/* Name.Tag */
|
||||
/* Name.Variable */
|
||||
/* Operator.Word */
|
||||
/* Text.Whitespace */
|
||||
/* Literal.Number.Float */
|
||||
/* Literal.Number.Hex */
|
||||
/* Literal.Number.Integer */
|
||||
/* Literal.Number.Oct */
|
||||
/* Literal.String.Backtick */
|
||||
/* Literal.String.Char */
|
||||
/* Literal.String.Doc */
|
||||
/* Literal.String.Double */
|
||||
/* Literal.String.Escape */
|
||||
/* Literal.String.Heredoc */
|
||||
/* Literal.String.Interpol */
|
||||
/* Literal.String.Other */
|
||||
/* Literal.String.Regex */
|
||||
/* Literal.String.Single */
|
||||
/* Literal.String.Symbol */
|
||||
/* Name.Builtin.Pseudo */
|
||||
/* Name.Variable.Class */
|
||||
/* Name.Variable.Global */
|
||||
/* Name.Variable.Instance */
|
||||
/* Literal.Number.Integer.Long */ }
|
||||
.highlight .c {
|
||||
color: #999988;
|
||||
font-style: italic; }
|
||||
.highlight .err {
|
||||
color: #a61717;
|
||||
background-color: #e3d2d2; }
|
||||
.highlight .k {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .o {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .cm {
|
||||
color: #999988;
|
||||
font-style: italic; }
|
||||
.highlight .cp {
|
||||
color: #999999;
|
||||
font-weight: bold; }
|
||||
.highlight .c1 {
|
||||
color: #999988;
|
||||
font-style: italic; }
|
||||
.highlight .cs {
|
||||
color: #999999;
|
||||
font-weight: bold;
|
||||
font-style: italic; }
|
||||
.highlight .gd {
|
||||
color: #000000;
|
||||
background-color: #ffdddd; }
|
||||
.highlight .gd .x {
|
||||
color: #000000;
|
||||
background-color: #ffaaaa; }
|
||||
.highlight .ge {
|
||||
color: #000000;
|
||||
font-style: italic; }
|
||||
.highlight .gr {
|
||||
color: #aa0000; }
|
||||
.highlight .gh {
|
||||
color: #999999; }
|
||||
.highlight .gi {
|
||||
color: #000000;
|
||||
background-color: #ddffdd; }
|
||||
.highlight .gi .x {
|
||||
color: #000000;
|
||||
background-color: #aaffaa; }
|
||||
.highlight .go {
|
||||
color: #888888; }
|
||||
.highlight .gp {
|
||||
color: #555555; }
|
||||
.highlight .gs {
|
||||
font-weight: bold; }
|
||||
.highlight .gu {
|
||||
color: #aaaaaa; }
|
||||
.highlight .gt {
|
||||
color: #aa0000; }
|
||||
.highlight .kc {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .kd {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .kp {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .kr {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .kt {
|
||||
color: #445588; }
|
||||
.highlight .m {
|
||||
color: #009999; }
|
||||
.highlight .s {
|
||||
color: #d14; }
|
||||
.highlight .na {
|
||||
color: #008080; }
|
||||
.highlight .nb {
|
||||
color: #0086B3; }
|
||||
.highlight .nc {
|
||||
color: #445588;
|
||||
font-weight: bold; }
|
||||
.highlight .no {
|
||||
color: #008080; }
|
||||
.highlight .ni {
|
||||
color: #800080; }
|
||||
.highlight .ne {
|
||||
color: #990000;
|
||||
font-weight: bold; }
|
||||
.highlight .nf {
|
||||
color: #990000; }
|
||||
.highlight .nn {
|
||||
color: #555555; }
|
||||
.highlight .nt {
|
||||
color: #000080; }
|
||||
.highlight .nv {
|
||||
color: #008080; }
|
||||
.highlight .ow {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .w {
|
||||
color: #bbbbbb; }
|
||||
.highlight .mf {
|
||||
color: #009999; }
|
||||
.highlight .mh {
|
||||
color: #009999; }
|
||||
.highlight .mi {
|
||||
color: #009999; }
|
||||
.highlight .mo {
|
||||
color: #009999; }
|
||||
.highlight .sb {
|
||||
color: #d14; }
|
||||
.highlight .sc {
|
||||
color: #d14; }
|
||||
.highlight .sd {
|
||||
color: #d14; }
|
||||
.highlight .s2 {
|
||||
color: #d14; }
|
||||
.highlight .se {
|
||||
color: #d14; }
|
||||
.highlight .sh {
|
||||
color: #d14; }
|
||||
.highlight .si {
|
||||
color: #d14; }
|
||||
.highlight .sx {
|
||||
color: #d14; }
|
||||
.highlight .sr {
|
||||
color: #009926; }
|
||||
.highlight .s1 {
|
||||
color: #d14; }
|
||||
.highlight .ss {
|
||||
color: #990073; }
|
||||
.highlight .bp {
|
||||
color: #999999; }
|
||||
.highlight .vc {
|
||||
color: #008080; }
|
||||
.highlight .vg {
|
||||
color: #008080; }
|
||||
.highlight .vi {
|
||||
color: #008080; }
|
||||
.highlight .il {
|
||||
color: #009999; }
|
||||
@@ -0,0 +1,331 @@
|
||||
html, body, div, span, h1, h3, h4, p, a, code, em, img, ul, li, table, tbody, tr, td {
|
||||
background: transparent;
|
||||
border: 0;
|
||||
margin: 0;
|
||||
outline: 0;
|
||||
padding: 0;
|
||||
vertical-align: baseline; }
|
||||
|
||||
body {
|
||||
background-color: #f2f2f2;
|
||||
font-family: Helvetica, freesans, Arial, sans-serif;
|
||||
font-size: 14px;
|
||||
-webkit-font-smoothing: subpixel-antialiased;
|
||||
word-wrap: break-word; }
|
||||
|
||||
h1, h2, h3 {
|
||||
margin-top: 0.8em;
|
||||
margin-bottom: 0.3em;
|
||||
font-weight: 100;
|
||||
color: black; }
|
||||
|
||||
h1 {
|
||||
font-size: 2.5em; }
|
||||
|
||||
h2 {
|
||||
font-size: 2em;
|
||||
border-bottom: 1px solid #e2e2e2; }
|
||||
|
||||
h4 {
|
||||
font-size: 13px;
|
||||
line-height: 1.5;
|
||||
margin-top: 21px; }
|
||||
|
||||
h5 {
|
||||
font-size: 1.1em; }
|
||||
|
||||
h6 {
|
||||
font-size: 1.1em;
|
||||
color: #777; }
|
||||
|
||||
.section-name {
|
||||
color: gray;
|
||||
display: block;
|
||||
font-family: Helvetica;
|
||||
font-size: 22px;
|
||||
font-weight: 100;
|
||||
margin-bottom: 15px; }
|
||||
|
||||
pre, code {
|
||||
font: 0.95em Menlo, monospace;
|
||||
color: #777;
|
||||
word-wrap: normal; }
|
||||
|
||||
p code, li code {
|
||||
background-color: #eee;
|
||||
padding: 2px 4px;
|
||||
border-radius: 4px; }
|
||||
|
||||
a {
|
||||
color: #0088cc;
|
||||
text-decoration: none; }
|
||||
|
||||
ul {
|
||||
padding-left: 15px; }
|
||||
|
||||
li {
|
||||
line-height: 1.8em; }
|
||||
|
||||
img {
|
||||
max-width: 100%; }
|
||||
|
||||
blockquote {
|
||||
margin-left: 0;
|
||||
padding: 0 10px;
|
||||
border-left: 4px solid #ccc; }
|
||||
|
||||
.content-wrapper {
|
||||
margin: 0 auto;
|
||||
width: 980px; }
|
||||
|
||||
header {
|
||||
font-size: 0.85em;
|
||||
line-height: 26px;
|
||||
background-color: #414141;
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
z-index: 1; }
|
||||
header img {
|
||||
padding-right: 6px;
|
||||
vertical-align: -4px;
|
||||
height: 16px; }
|
||||
header a {
|
||||
color: #fff; }
|
||||
header p {
|
||||
float: left;
|
||||
color: #999; }
|
||||
header .header-right {
|
||||
float: right;
|
||||
margin-left: 16px; }
|
||||
|
||||
#breadcrumbs {
|
||||
background-color: #f2f2f2;
|
||||
height: 27px;
|
||||
padding-top: 17px;
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
z-index: 1;
|
||||
margin-top: 26px; }
|
||||
#breadcrumbs #carat {
|
||||
height: 10px;
|
||||
margin: 0 5px; }
|
||||
|
||||
.sidebar {
|
||||
background-color: #f9f9f9;
|
||||
border: 1px solid #e2e2e2;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
position: fixed;
|
||||
top: 70px;
|
||||
bottom: 0;
|
||||
width: 230px;
|
||||
word-wrap: normal; }
|
||||
|
||||
.nav-groups {
|
||||
list-style-type: none;
|
||||
background: #fff;
|
||||
padding-left: 0; }
|
||||
|
||||
.nav-group-name {
|
||||
border-bottom: 1px solid #e2e2e2;
|
||||
font-size: 1.1em;
|
||||
font-weight: 100;
|
||||
padding: 15px 0 15px 20px; }
|
||||
.nav-group-name > a {
|
||||
color: #333; }
|
||||
|
||||
.nav-group-tasks {
|
||||
margin-top: 5px; }
|
||||
|
||||
.nav-group-task {
|
||||
font-size: 0.9em;
|
||||
list-style-type: none; }
|
||||
.nav-group-task a {
|
||||
color: #888; }
|
||||
|
||||
.main-content {
|
||||
background-color: #fff;
|
||||
border: 1px solid #e2e2e2;
|
||||
margin-left: 246px;
|
||||
position: absolute;
|
||||
overflow: hidden;
|
||||
padding-bottom: 60px;
|
||||
top: 70px;
|
||||
width: 734px; }
|
||||
.main-content p, .main-content a, .main-content code, .main-content em, .main-content ul, .main-content table, .main-content blockquote {
|
||||
margin-bottom: 1em; }
|
||||
.main-content p {
|
||||
line-height: 1.8em; }
|
||||
.main-content section .section:first-child {
|
||||
margin-top: 0;
|
||||
padding-top: 0; }
|
||||
.main-content section .task-group-section .task-group:first-of-type {
|
||||
padding-top: 10px; }
|
||||
.main-content section .task-group-section .task-group:first-of-type .section-name {
|
||||
padding-top: 15px; }
|
||||
|
||||
.section {
|
||||
padding: 0 25px; }
|
||||
|
||||
.highlight {
|
||||
background-color: #eee;
|
||||
padding: 10px 12px;
|
||||
border: 1px solid #e2e2e2;
|
||||
border-radius: 4px;
|
||||
overflow-x: auto; }
|
||||
|
||||
.declaration .highlight {
|
||||
overflow-x: initial;
|
||||
padding: 0 40px 40px 0;
|
||||
margin-bottom: -25px;
|
||||
background-color: transparent;
|
||||
border: none; }
|
||||
|
||||
.section-name {
|
||||
margin: 0;
|
||||
margin-left: 18px; }
|
||||
|
||||
.task-group-section {
|
||||
padding-left: 6px;
|
||||
border-top: 1px solid #e2e2e2; }
|
||||
|
||||
.task-group {
|
||||
padding-top: 0px; }
|
||||
|
||||
.task-name-container a[name]:before {
|
||||
content: "";
|
||||
display: block;
|
||||
padding-top: 70px;
|
||||
margin: -70px 0 0; }
|
||||
|
||||
.item {
|
||||
padding-top: 8px;
|
||||
width: 100%;
|
||||
list-style-type: none; }
|
||||
.item a[name]:before {
|
||||
content: "";
|
||||
display: block;
|
||||
padding-top: 70px;
|
||||
margin: -70px 0 0; }
|
||||
.item code {
|
||||
background-color: transparent;
|
||||
padding: 0; }
|
||||
.item .token {
|
||||
padding-left: 3px;
|
||||
margin-left: 15px;
|
||||
font-size: 11.9px; }
|
||||
.item .declaration-note {
|
||||
font-size: .85em;
|
||||
color: gray;
|
||||
font-style: italic; }
|
||||
|
||||
.pointer-container {
|
||||
border-bottom: 1px solid #e2e2e2;
|
||||
left: -23px;
|
||||
padding-bottom: 13px;
|
||||
position: relative;
|
||||
width: 110%; }
|
||||
|
||||
.pointer {
|
||||
background: #f9f9f9;
|
||||
border-left: 1px solid #e2e2e2;
|
||||
border-top: 1px solid #e2e2e2;
|
||||
height: 12px;
|
||||
left: 21px;
|
||||
top: -7px;
|
||||
-webkit-transform: rotate(45deg);
|
||||
-moz-transform: rotate(45deg);
|
||||
-o-transform: rotate(45deg);
|
||||
transform: rotate(45deg);
|
||||
position: absolute;
|
||||
width: 12px; }
|
||||
|
||||
.height-container {
|
||||
display: none;
|
||||
left: -25px;
|
||||
padding: 0 25px;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
overflow: hidden; }
|
||||
.height-container .section {
|
||||
background: #f9f9f9;
|
||||
border-bottom: 1px solid #e2e2e2;
|
||||
left: -25px;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
padding-top: 10px;
|
||||
padding-bottom: 5px; }
|
||||
|
||||
.aside, .language {
|
||||
padding: 6px 12px;
|
||||
margin: 12px 0;
|
||||
border-left: 5px solid #dddddd;
|
||||
overflow-y: hidden; }
|
||||
.aside .aside-title, .language .aside-title {
|
||||
font-size: 9px;
|
||||
letter-spacing: 2px;
|
||||
text-transform: uppercase;
|
||||
padding-bottom: 0;
|
||||
margin: 0;
|
||||
color: #aaa;
|
||||
-webkit-user-select: none; }
|
||||
.aside p:last-child, .language p:last-child {
|
||||
margin-bottom: 0; }
|
||||
|
||||
.language {
|
||||
border-left: 5px solid #cde9f4; }
|
||||
.language .aside-title {
|
||||
color: #4b8afb; }
|
||||
|
||||
.aside-warning {
|
||||
border-left: 5px solid #ff6666; }
|
||||
.aside-warning .aside-title {
|
||||
color: #ff0000; }
|
||||
|
||||
.graybox {
|
||||
border-collapse: collapse;
|
||||
width: 100%; }
|
||||
.graybox p {
|
||||
margin: 0;
|
||||
word-break: break-word;
|
||||
min-width: 50px; }
|
||||
.graybox td {
|
||||
border: 1px solid #e2e2e2;
|
||||
padding: 5px 25px 5px 10px;
|
||||
vertical-align: middle; }
|
||||
.graybox tr td:first-of-type {
|
||||
text-align: right;
|
||||
padding: 7px;
|
||||
vertical-align: top;
|
||||
word-break: normal;
|
||||
width: 40px; }
|
||||
|
||||
.slightly-smaller {
|
||||
font-size: 0.9em; }
|
||||
|
||||
#footer {
|
||||
position: absolute;
|
||||
bottom: 10px;
|
||||
margin-left: 25px; }
|
||||
#footer p {
|
||||
margin: 0;
|
||||
color: #aaa;
|
||||
font-size: 0.8em; }
|
||||
|
||||
html.dash header, html.dash #breadcrumbs, html.dash .sidebar {
|
||||
display: none; }
|
||||
html.dash .main-content {
|
||||
width: 980px;
|
||||
margin-left: 0;
|
||||
border: none;
|
||||
width: 100%;
|
||||
top: 0;
|
||||
padding-bottom: 0; }
|
||||
html.dash .height-container {
|
||||
display: block; }
|
||||
html.dash .item .token {
|
||||
margin-left: 0; }
|
||||
html.dash .content-wrapper {
|
||||
width: auto; }
|
||||
html.dash #footer {
|
||||
position: static; }
|
||||
|
After Width: | Height: | Size: 274 B |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
@@ -0,0 +1,147 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>CircleMenuDemo Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="js/jquery.min.js" defer></script>
|
||||
<script src="js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a title="CircleMenuDemo Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="index.html">CircleMenuDemo Docs</a> (87% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="index.html">CircleMenuDemo Reference</a>
|
||||
<img id="carat" src="img/carat.png" />
|
||||
CircleMenuDemo Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/CircleMenu.html">CircleMenu</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="Protocols.html">Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Protocols/CircleMenuDelegate.html">CircleMenuDelegate</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
|
||||
<p><img src="./header.png" alt="header"></p>
|
||||
<a href='#circlemenu' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='circlemenu'>CircleMenu</h1>
|
||||
|
||||
<p><a href="http://twitter.com/Ramotion"><img src="https://img.shields.io/badge/Twitter-@Ramotion-blue.svg?style=flat" alt="Twitter"></a>
|
||||
<a href="https://cocoapods.org/pods/CircleMenu"><img src="https://img.shields.io/cocoapods/p/CircleMenu.svg" alt="CocoaPods"></a>
|
||||
<a href="http://cocoapods.org/pods/CircleMenu"><img src="https://img.shields.io/cocoapods/v/CircleMenu.svg" alt="CocoaPods"></a>
|
||||
<a href="https://cdn.rawgit.com/Ramotion/circle-menu/master/docs/index.html"><img src="https://img.shields.io/cocoapods/metrics/doc-percent/CircleMenu.svg" alt="CocoaPods"></a>
|
||||
<a href="https://github.com/Ramotion/circle-menu"><img src="https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat" alt="Carthage compatible"></a>
|
||||
<a href="https://codebeat.co/projects/github-com-ramotion-circle-menu"><img src="https://codebeat.co/badges/6f67da5d-c416-4bac-9fb7-c2dc938feedc" alt="codebeat badge"></a>
|
||||
<a href="https://travis-ci.org/Ramotion/circle-menu"><img src="https://img.shields.io/travis/Ramotion/circle-menu.svg" alt="Travis"></a></p>
|
||||
|
||||
<p><a href="https://dribbble.com/shots/2534780-Circle-Menu-Swift-Open-Source">shot on dribbble:</a>
|
||||
<img src="./preview.gif" alt="preview"></p>
|
||||
|
||||
<p>The <a href="https://store.ramotion.com/product/iphone-6-mockups?utm_source=gthb&utm_medium=special&utm_campaign=circle-menu">iPhone mockup</a> available <a href="https://store.ramotion.com/product/iphone-6-mockups?utm_source=gthb&utm_medium=special&utm_campaign=circle-menu">here</a>.</p>
|
||||
<a href='#requirements' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h2 id='requirements'>Requirements</h2>
|
||||
|
||||
<ul>
|
||||
<li>iOS 8.0+</li>
|
||||
<li>Xcode 7.3</li>
|
||||
</ul>
|
||||
<a href='#installation' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h2 id='installation'>Installation</h2>
|
||||
|
||||
<p>Just add CircleMenuLib folder to your project.</p>
|
||||
|
||||
<p>or use <a href="https://cocoapods.org">CocoaPods</a> with Podfile:</p>
|
||||
<pre class="highlight ruby"><code><span class="n">pod</span> <span class="s1">'CircleMenu'</span><span class="p">,</span> <span class="s1">'~> 1.0.0'</span>
|
||||
</code></pre>
|
||||
|
||||
<p>or <a href="https://github.com/Carthage/Carthage">Carthage</a> users can simply add to their <code>Cartfile</code>:
|
||||
<code>
|
||||
github "Ramotion/circle-menu"
|
||||
</code></p>
|
||||
<a href='#usage' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h2 id='usage'>Usage</h2>
|
||||
<a href='#with_storyboard' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h5 id='with_storyboard'>with storyboard</h5>
|
||||
|
||||
<p>1) Create a new UIButton inheriting from <code>CircleMenu</code></p>
|
||||
|
||||
<p>2) Add images for Normal and Selected state</p>
|
||||
|
||||
<p>3) Use delegate method to configure buttons</p>
|
||||
<pre class="highlight swift"><code><span class="kd">func</span> <span class="nf">circleMenu</span><span class="p">(</span><span class="nv">circleMenu</span><span class="p">:</span> <span class="kt">CircleMenu</span><span class="p">,</span> <span class="n">willDisplay</span> <span class="nv">button</span><span class="p">:</span> <span class="kt">CircleMenuButton</span><span class="p">,</span> <span class="nv">atIndex</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span>
|
||||
</code></pre>
|
||||
|
||||
<p>4) Use properties to confiure CircleMenu</p>
|
||||
<pre class="highlight swift"><code><span class="kd">@IBInspectable</span> <span class="k">var</span> <span class="nv">buttonsCount</span><span class="p">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="mi">3</span>
|
||||
<span class="kd">@IBInspectable</span> <span class="k">var</span> <span class="nv">duration</span><span class="p">:</span> <span class="kt">Double</span> <span class="o">=</span> <span class="mi">2</span> <span class="c1">// circle animation duration</span>
|
||||
<span class="kd">@IBInspectable</span> <span class="k">var</span> <span class="nv">distance</span><span class="p">:</span> <span class="kt">Float</span> <span class="o">=</span> <span class="mi">100</span> <span class="c1">// distance between center button and buttons</span>
|
||||
</code></pre>
|
||||
<a href='#programmatically' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h5 id='programmatically'>programmatically</h5>
|
||||
<pre class="highlight swift"><code><span class="k">let</span> <span class="nv">button</span> <span class="o">=</span> <span class="kt">CircleMenu</span><span class="p">(</span>
|
||||
<span class="nv">frame</span><span class="p">:</span> <span class="kt">CGRect</span><span class="p">(</span><span class="nv">x</span><span class="p">:</span> <span class="mi">200</span><span class="p">,</span> <span class="nv">y</span><span class="p">:</span> <span class="mi">200</span><span class="p">,</span> <span class="nv">width</span><span class="p">:</span> <span class="mi">50</span><span class="p">,</span> <span class="nv">height</span><span class="p">:</span> <span class="mi">50</span><span class="p">),</span>
|
||||
<span class="nv">normalIcon</span><span class="p">:</span><span class="s">"icon_menu"</span><span class="p">,</span>
|
||||
<span class="nv">selectedIcon</span><span class="p">:</span><span class="s">"icon_close"</span><span class="p">,</span>
|
||||
<span class="nv">buttonsCount</span><span class="p">:</span> <span class="mi">4</span><span class="p">,</span>
|
||||
<span class="nv">duration</span><span class="p">:</span> <span class="mi">4</span><span class="p">,</span>
|
||||
<span class="nv">distance</span><span class="p">:</span> <span class="mi">120</span><span class="p">)</span>
|
||||
<span class="n">button</span><span class="o">.</span><span class="n">delegate</span> <span class="o">=</span> <span class="k">self</span>
|
||||
<span class="n">button</span><span class="o">.</span><span class="n">layer</span><span class="o">.</span><span class="n">cornerRadius</span> <span class="o">=</span> <span class="n">button</span><span class="o">.</span><span class="n">frame</span><span class="o">.</span><span class="n">size</span><span class="o">.</span><span class="n">width</span> <span class="o">/</span> <span class="mf">2.0</span>
|
||||
<span class="n">view</span><span class="o">.</span><span class="nf">addSubview</span><span class="p">(</span><span class="n">button</span><span class="p">)</span>
|
||||
</code></pre>
|
||||
<a href='#delegate_methods' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h5 id='delegate_methods'>delegate methods</h5>
|
||||
<pre class="highlight swift"><code><span class="c1">// configure buttons</span>
|
||||
<span class="kd">optional</span> <span class="kd">func</span> <span class="nf">circleMenu</span><span class="p">(</span><span class="nv">circleMenu</span><span class="p">:</span> <span class="kt">CircleMenu</span><span class="p">,</span> <span class="n">willDisplay</span> <span class="nv">button</span><span class="p">:</span> <span class="kt">CircleMenuButton</span><span class="p">,</span> <span class="nv">atIndex</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span>
|
||||
|
||||
<span class="c1">// call before animation</span>
|
||||
<span class="kd">optional</span> <span class="kd">func</span> <span class="nf">circleMenu</span><span class="p">(</span><span class="nv">circleMenu</span><span class="p">:</span> <span class="kt">CircleMenu</span><span class="p">,</span> <span class="n">buttonWillSelected</span> <span class="nv">button</span><span class="p">:</span> <span class="kt">CircleMenuButton</span><span class="p">,</span> <span class="nv">atIndex</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span>
|
||||
|
||||
<span class="c1">// call after animation</span>
|
||||
<span class="kd">optional</span> <span class="kd">func</span> <span class="nf">circleMenu</span><span class="p">(</span><span class="nv">circleMenu</span><span class="p">:</span> <span class="kt">CircleMenu</span><span class="p">,</span> <span class="n">buttonDidSelected</span> <span class="nv">button</span><span class="p">:</span> <span class="kt">CircleMenuButton</span><span class="p">,</span> <span class="nv">atIndex</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span>
|
||||
|
||||
<span class="c1">// call upon cancel of the menu</span>
|
||||
<span class="kd">optional</span> <span class="kd">func</span> <span class="nf">menuCollapsed</span><span class="p">(</span><span class="nv">circleMenu</span><span class="p">:</span> <span class="kt">CircleMenu</span><span class="p">)</span>
|
||||
</code></pre>
|
||||
<a href='#licence' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h2 id='licence'>Licence</h2>
|
||||
|
||||
<p>Circle menu is released under the MIT license.
|
||||
See <a href="./LICENSE">LICENSE</a> for details.</p>
|
||||
<a href='#about' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h2 id='about'>About</h2>
|
||||
|
||||
<p>The project maintained by <a href="https://ramotion.com?utm_source=gthb&utm_medium=special&utm_campaign=circle-menu">app development agency</a> <a href="https://ramotion.com?utm_source=gthb&utm_medium=special&utm_campaign=circle-menu">Ramotion Inc.</a>
|
||||
See our other <a href="https://github.com/ramotion">open-source projects</a> or <a href="https://ramotion.com?utm_source=gthb&utm_medium=special&utm_campaign=circle-menu">hire</a> us to design, develop, and grow your product.</p>
|
||||
|
||||
<p><a href="https://twitter.com/intent/tweet?text=https://github.com/ramotion/circle-menu"><img src="https://img.shields.io/twitter/url/http/shields.io.svg?style=social" alt="Twitter URL"></a>
|
||||
<a href="https://twitter.com/ramotion"><img src="https://img.shields.io/twitter/follow/ramotion.svg?style=social" alt="Twitter Follow"></a></p>
|
||||
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/Ramotion/circle-menu" target="_blank" rel="external">AlexKalinkin</a>. All rights reserved. (Last updated: 2016-06-27)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -0,0 +1,40 @@
|
||||
window.jazzy = {'docset': false}
|
||||
if (typeof window.dash != 'undefined') {
|
||||
document.documentElement.className += ' dash'
|
||||
window.jazzy.docset = true
|
||||
}
|
||||
if (navigator.userAgent.match(/xcode/i)) {
|
||||
document.documentElement.className += ' xcode'
|
||||
window.jazzy.docset = true
|
||||
}
|
||||
|
||||
// On doc load, toggle the URL hash discussion if present
|
||||
$(document).ready(function() {
|
||||
if (!window.jazzy.docset) {
|
||||
var linkToHash = $('a[href="' + window.location.hash +'"]');
|
||||
linkToHash.trigger("click");
|
||||
}
|
||||
});
|
||||
|
||||
// On token click, toggle its discussion and animate token.marginLeft
|
||||
$(".token").click(function(event) {
|
||||
if (window.jazzy.docset) {
|
||||
return;
|
||||
}
|
||||
var link = $(this);
|
||||
var animationDuration = 300;
|
||||
var tokenOffset = "15px";
|
||||
var original = link.css('marginLeft') == tokenOffset;
|
||||
link.animate({'margin-left':original ? "0px" : tokenOffset}, animationDuration);
|
||||
$content = link.parent().parent().next();
|
||||
$content.slideToggle(animationDuration);
|
||||
|
||||
// Keeps the document from jumping to the hash.
|
||||
var href = $(this).attr('href');
|
||||
if (history.pushState) {
|
||||
history.pushState({}, '', href);
|
||||
} else {
|
||||
location.hash = href;
|
||||
}
|
||||
event.preventDefault();
|
||||
});
|
||||
@@ -0,0 +1,4 @@
|
||||
CircleMenuButton.swift
|
||||
internal class CircleMenuButton : UIButton
|
||||
CircleMenu.swift
|
||||
required public init?(coder aDecoder: NSCoder)
|
||||
|
After Width: | Height: | Size: 274 B |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
@@ -0,0 +1,147 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>CircleMenuDemo Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="js/jquery.min.js" defer></script>
|
||||
<script src="js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a title="CircleMenuDemo Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="index.html">CircleMenuDemo Docs</a> (87% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="index.html">CircleMenuDemo Reference</a>
|
||||
<img id="carat" src="img/carat.png" />
|
||||
CircleMenuDemo Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/CircleMenu.html">CircleMenu</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="Protocols.html">Protocols</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Protocols/CircleMenuDelegate.html">CircleMenuDelegate</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
|
||||
<p><img src="./header.png" alt="header"></p>
|
||||
<a href='#circlemenu' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='circlemenu'>CircleMenu</h1>
|
||||
|
||||
<p><a href="http://twitter.com/Ramotion"><img src="https://img.shields.io/badge/Twitter-@Ramotion-blue.svg?style=flat" alt="Twitter"></a>
|
||||
<a href="https://cocoapods.org/pods/CircleMenu"><img src="https://img.shields.io/cocoapods/p/CircleMenu.svg" alt="CocoaPods"></a>
|
||||
<a href="http://cocoapods.org/pods/CircleMenu"><img src="https://img.shields.io/cocoapods/v/CircleMenu.svg" alt="CocoaPods"></a>
|
||||
<a href="https://cdn.rawgit.com/Ramotion/circle-menu/master/docs/index.html"><img src="https://img.shields.io/cocoapods/metrics/doc-percent/CircleMenu.svg" alt="CocoaPods"></a>
|
||||
<a href="https://github.com/Ramotion/circle-menu"><img src="https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat" alt="Carthage compatible"></a>
|
||||
<a href="https://codebeat.co/projects/github-com-ramotion-circle-menu"><img src="https://codebeat.co/badges/6f67da5d-c416-4bac-9fb7-c2dc938feedc" alt="codebeat badge"></a>
|
||||
<a href="https://travis-ci.org/Ramotion/circle-menu"><img src="https://img.shields.io/travis/Ramotion/circle-menu.svg" alt="Travis"></a></p>
|
||||
|
||||
<p><a href="https://dribbble.com/shots/2534780-Circle-Menu-Swift-Open-Source">shot on dribbble:</a>
|
||||
<img src="./preview.gif" alt="preview"></p>
|
||||
|
||||
<p>The <a href="https://store.ramotion.com/product/iphone-6-mockups?utm_source=gthb&utm_medium=special&utm_campaign=circle-menu">iPhone mockup</a> available <a href="https://store.ramotion.com/product/iphone-6-mockups?utm_source=gthb&utm_medium=special&utm_campaign=circle-menu">here</a>.</p>
|
||||
<a href='#requirements' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h2 id='requirements'>Requirements</h2>
|
||||
|
||||
<ul>
|
||||
<li>iOS 8.0+</li>
|
||||
<li>Xcode 7.3</li>
|
||||
</ul>
|
||||
<a href='#installation' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h2 id='installation'>Installation</h2>
|
||||
|
||||
<p>Just add CircleMenuLib folder to your project.</p>
|
||||
|
||||
<p>or use <a href="https://cocoapods.org">CocoaPods</a> with Podfile:</p>
|
||||
<pre class="highlight ruby"><code><span class="n">pod</span> <span class="s1">'CircleMenu'</span><span class="p">,</span> <span class="s1">'~> 1.0.0'</span>
|
||||
</code></pre>
|
||||
|
||||
<p>or <a href="https://github.com/Carthage/Carthage">Carthage</a> users can simply add to their <code>Cartfile</code>:
|
||||
<code>
|
||||
github "Ramotion/circle-menu"
|
||||
</code></p>
|
||||
<a href='#usage' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h2 id='usage'>Usage</h2>
|
||||
<a href='#with_storyboard' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h5 id='with_storyboard'>with storyboard</h5>
|
||||
|
||||
<p>1) Create a new UIButton inheriting from <code>CircleMenu</code></p>
|
||||
|
||||
<p>2) Add images for Normal and Selected state</p>
|
||||
|
||||
<p>3) Use delegate method to configure buttons</p>
|
||||
<pre class="highlight swift"><code><span class="kd">func</span> <span class="nf">circleMenu</span><span class="p">(</span><span class="nv">circleMenu</span><span class="p">:</span> <span class="kt">CircleMenu</span><span class="p">,</span> <span class="n">willDisplay</span> <span class="nv">button</span><span class="p">:</span> <span class="kt">CircleMenuButton</span><span class="p">,</span> <span class="nv">atIndex</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span>
|
||||
</code></pre>
|
||||
|
||||
<p>4) Use properties to confiure CircleMenu</p>
|
||||
<pre class="highlight swift"><code><span class="kd">@IBInspectable</span> <span class="k">var</span> <span class="nv">buttonsCount</span><span class="p">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="mi">3</span>
|
||||
<span class="kd">@IBInspectable</span> <span class="k">var</span> <span class="nv">duration</span><span class="p">:</span> <span class="kt">Double</span> <span class="o">=</span> <span class="mi">2</span> <span class="c1">// circle animation duration</span>
|
||||
<span class="kd">@IBInspectable</span> <span class="k">var</span> <span class="nv">distance</span><span class="p">:</span> <span class="kt">Float</span> <span class="o">=</span> <span class="mi">100</span> <span class="c1">// distance between center button and buttons</span>
|
||||
</code></pre>
|
||||
<a href='#programmatically' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h5 id='programmatically'>programmatically</h5>
|
||||
<pre class="highlight swift"><code><span class="k">let</span> <span class="nv">button</span> <span class="o">=</span> <span class="kt">CircleMenu</span><span class="p">(</span>
|
||||
<span class="nv">frame</span><span class="p">:</span> <span class="kt">CGRect</span><span class="p">(</span><span class="nv">x</span><span class="p">:</span> <span class="mi">200</span><span class="p">,</span> <span class="nv">y</span><span class="p">:</span> <span class="mi">200</span><span class="p">,</span> <span class="nv">width</span><span class="p">:</span> <span class="mi">50</span><span class="p">,</span> <span class="nv">height</span><span class="p">:</span> <span class="mi">50</span><span class="p">),</span>
|
||||
<span class="nv">normalIcon</span><span class="p">:</span><span class="s">"icon_menu"</span><span class="p">,</span>
|
||||
<span class="nv">selectedIcon</span><span class="p">:</span><span class="s">"icon_close"</span><span class="p">,</span>
|
||||
<span class="nv">buttonsCount</span><span class="p">:</span> <span class="mi">4</span><span class="p">,</span>
|
||||
<span class="nv">duration</span><span class="p">:</span> <span class="mi">4</span><span class="p">,</span>
|
||||
<span class="nv">distance</span><span class="p">:</span> <span class="mi">120</span><span class="p">)</span>
|
||||
<span class="n">button</span><span class="o">.</span><span class="n">delegate</span> <span class="o">=</span> <span class="k">self</span>
|
||||
<span class="n">button</span><span class="o">.</span><span class="n">layer</span><span class="o">.</span><span class="n">cornerRadius</span> <span class="o">=</span> <span class="n">button</span><span class="o">.</span><span class="n">frame</span><span class="o">.</span><span class="n">size</span><span class="o">.</span><span class="n">width</span> <span class="o">/</span> <span class="mf">2.0</span>
|
||||
<span class="n">view</span><span class="o">.</span><span class="nf">addSubview</span><span class="p">(</span><span class="n">button</span><span class="p">)</span>
|
||||
</code></pre>
|
||||
<a href='#delegate_methods' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h5 id='delegate_methods'>delegate methods</h5>
|
||||
<pre class="highlight swift"><code><span class="c1">// configure buttons</span>
|
||||
<span class="kd">optional</span> <span class="kd">func</span> <span class="nf">circleMenu</span><span class="p">(</span><span class="nv">circleMenu</span><span class="p">:</span> <span class="kt">CircleMenu</span><span class="p">,</span> <span class="n">willDisplay</span> <span class="nv">button</span><span class="p">:</span> <span class="kt">CircleMenuButton</span><span class="p">,</span> <span class="nv">atIndex</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span>
|
||||
|
||||
<span class="c1">// call before animation</span>
|
||||
<span class="kd">optional</span> <span class="kd">func</span> <span class="nf">circleMenu</span><span class="p">(</span><span class="nv">circleMenu</span><span class="p">:</span> <span class="kt">CircleMenu</span><span class="p">,</span> <span class="n">buttonWillSelected</span> <span class="nv">button</span><span class="p">:</span> <span class="kt">CircleMenuButton</span><span class="p">,</span> <span class="nv">atIndex</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span>
|
||||
|
||||
<span class="c1">// call after animation</span>
|
||||
<span class="kd">optional</span> <span class="kd">func</span> <span class="nf">circleMenu</span><span class="p">(</span><span class="nv">circleMenu</span><span class="p">:</span> <span class="kt">CircleMenu</span><span class="p">,</span> <span class="n">buttonDidSelected</span> <span class="nv">button</span><span class="p">:</span> <span class="kt">CircleMenuButton</span><span class="p">,</span> <span class="nv">atIndex</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span>
|
||||
|
||||
<span class="c1">// call upon cancel of the menu</span>
|
||||
<span class="kd">optional</span> <span class="kd">func</span> <span class="nf">menuCollapsed</span><span class="p">(</span><span class="nv">circleMenu</span><span class="p">:</span> <span class="kt">CircleMenu</span><span class="p">)</span>
|
||||
</code></pre>
|
||||
<a href='#licence' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h2 id='licence'>Licence</h2>
|
||||
|
||||
<p>Circle menu is released under the MIT license.
|
||||
See <a href="./LICENSE">LICENSE</a> for details.</p>
|
||||
<a href='#about' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h2 id='about'>About</h2>
|
||||
|
||||
<p>The project maintained by <a href="https://ramotion.com?utm_source=gthb&utm_medium=special&utm_campaign=circle-menu">app development agency</a> <a href="https://ramotion.com?utm_source=gthb&utm_medium=special&utm_campaign=circle-menu">Ramotion Inc.</a>
|
||||
See our other <a href="https://github.com/ramotion">open-source projects</a> or <a href="https://ramotion.com?utm_source=gthb&utm_medium=special&utm_campaign=circle-menu">hire</a> us to design, develop, and grow your product.</p>
|
||||
|
||||
<p><a href="https://twitter.com/intent/tweet?text=https://github.com/ramotion/circle-menu"><img src="https://img.shields.io/twitter/url/http/shields.io.svg?style=social" alt="Twitter URL"></a>
|
||||
<a href="https://twitter.com/ramotion"><img src="https://img.shields.io/twitter/follow/ramotion.svg?style=social" alt="Twitter Follow"></a></p>
|
||||
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="https://github.com/Ramotion/circle-menu" target="_blank" rel="external">AlexKalinkin</a>. All rights reserved. (Last updated: 2016-06-27)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
@@ -0,0 +1,40 @@
|
||||
window.jazzy = {'docset': false}
|
||||
if (typeof window.dash != 'undefined') {
|
||||
document.documentElement.className += ' dash'
|
||||
window.jazzy.docset = true
|
||||
}
|
||||
if (navigator.userAgent.match(/xcode/i)) {
|
||||
document.documentElement.className += ' xcode'
|
||||
window.jazzy.docset = true
|
||||
}
|
||||
|
||||
// On doc load, toggle the URL hash discussion if present
|
||||
$(document).ready(function() {
|
||||
if (!window.jazzy.docset) {
|
||||
var linkToHash = $('a[href="' + window.location.hash +'"]');
|
||||
linkToHash.trigger("click");
|
||||
}
|
||||
});
|
||||
|
||||
// On token click, toggle its discussion and animate token.marginLeft
|
||||
$(".token").click(function(event) {
|
||||
if (window.jazzy.docset) {
|
||||
return;
|
||||
}
|
||||
var link = $(this);
|
||||
var animationDuration = 300;
|
||||
var tokenOffset = "15px";
|
||||
var original = link.css('marginLeft') == tokenOffset;
|
||||
link.animate({'margin-left':original ? "0px" : tokenOffset}, animationDuration);
|
||||
$content = link.parent().parent().next();
|
||||
$content.slideToggle(animationDuration);
|
||||
|
||||
// Keeps the document from jumping to the hash.
|
||||
var href = $(this).attr('href');
|
||||
if (history.pushState) {
|
||||
history.pushState({}, '', href);
|
||||
} else {
|
||||
location.hash = href;
|
||||
}
|
||||
event.preventDefault();
|
||||
});
|
||||
@@ -0,0 +1,4 @@
|
||||
CircleMenuButton.swift
|
||||
internal class CircleMenuButton : UIButton
|
||||
CircleMenu.swift
|
||||
required public init?(coder aDecoder: NSCoder)
|
||||
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 1.3 MiB |