Compare commits

...

32 Commits

Author SHA1 Message Date
Ivan Vorobei c36078cda2 Update to 1.2
- After tap parrent controller auto dismiss
- Update example
2018-12-17 21:47:26 +03:00
Ivan Vorobei b78c82194f Update README.md 2018-12-17 20:02:13 +03:00
Ivan Vorobei a112473a04 Update Readme.md 2018-12-17 13:40:22 +03:00
Ivan Vorobei c1b135a30a Add example of TableView for SPStorkController
- Upadte example
- Update readme
- Add example table view for SPStorkController
2018-12-14 12:46:33 +03:00
Ivan Vorobei c1a7622a26 Update README.md 2018-12-13 23:29:42 +03:00
Ivan Vorobei c3421432b0 Update README.md 2018-12-13 19:58:12 +03:00
Ivan Vorobei 99353d3610 Update README.md 2018-12-12 17:01:17 +03:00
Ivan Vorobei 3bee6898e0 Update README.md 2018-12-12 16:54:24 +03:00
Ivan Vorobei 587790b1db Merge pull request #11 from jobinsjohn/patch-3
Updated ReadMe
2018-12-12 16:53:21 +03:00
Ivan Vorobei 2698cfe23d Merge pull request #12 from jobinsjohn/patch-4
Updated ReadMe
2018-12-12 16:52:48 +03:00
Jobins John 42b82886ca Updated ReadMe
Fixed typo in read me file
2018-12-12 17:44:46 +04:00
Jobins John 7af77b2596 Updated ReadMe file
Fixed typos
2018-12-12 17:43:36 +04:00
Ivan Vorobei 7c663e7760 Update README.md 2018-12-12 16:36:08 +03:00
Ivan Vorobei f561e94110 Update README.md 2018-12-12 16:35:47 +03:00
Ivan Vorobei 3bf06ae2b3 Update README.md 2018-12-12 16:35:27 +03:00
Ivan Vorobei a6d5e6f97d Merge pull request #10 from jobinsjohn/patch-2
Updated ReadMe
2018-12-12 16:34:35 +03:00
Ivan Vorobei 0f20afb87c Merge pull request #9 from jobinsjohn/patch-1
Updated ReadMe
2018-12-12 16:34:13 +03:00
Jobins John 2368747150 Updated Readme File
Added shields in read me for platform
2018-12-12 17:29:21 +04:00
Jobins John 32a010e1ca Updated ReadMe file
fixed typos and grammar mistakes
2018-12-12 17:23:49 +04:00
Ivan Vorobei fce0efaffa Update example 2018-12-12 16:10:45 +03:00
Ivan Vorobei 1500c272b1 Update to 1.1.8 version
- Fix bugs with paramtrs
- Add paramtr custom height
- Update Readme
2018-12-12 16:04:25 +03:00
Ivan Vorobei ba859e3646 Update README.md 2018-12-12 12:47:52 +03:00
Ivan Vorobei 01b8702c4a Update README.md 2018-12-12 12:46:22 +03:00
Ivan Vorobei ec809ee1c5 Update Readme.md 2018-12-12 12:28:53 +03:00
Ivan Vorobei a5f41ab3d6 Update gif 2018-12-12 12:27:47 +03:00
Ivan Vorobei 58554f1449 Update README.md 2018-12-12 11:43:18 +03:00
Ivan Vorobei 8c1b6e2c8d Add custom height 2018-12-10 21:39:48 +03:00
Ivan Vorobei 724635e387 Update README.md 2018-12-10 21:36:35 +03:00
Ivan Vorobei dfc0fb8e52 Update gif 2018-12-10 21:34:47 +03:00
Ivan Vorobei 50c9ab4104 Create gif-mockup.gif 2018-12-10 21:33:23 +03:00
Ivan Vorobei bb0821d2cc Update README.md 2018-12-07 13:45:03 +03:00
Ivan Vorobei ae29eba5b9 Update README.md 2018-12-07 13:44:30 +03:00
17 changed files with 357 additions and 149 deletions
@@ -8,16 +8,9 @@
/* Begin PBXBuildFile section */
F445CA8721AED92600184254 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F445CA8621AED92600184254 /* AppDelegate.swift */; };
F445CA8921AED92600184254 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F445CA8821AED92600184254 /* ViewController.swift */; };
F445CA8C21AED92600184254 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F445CA8A21AED92600184254 /* Main.storyboard */; };
F445CA8921AED92600184254 /* Controller.swift in Sources */ = {isa = PBXBuildFile; fileRef = F445CA8821AED92600184254 /* Controller.swift */; };
F445CA8E21AED92700184254 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F445CA8D21AED92700184254 /* Assets.xcassets */; };
F445CA9121AED92700184254 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F445CA8F21AED92700184254 /* LaunchScreen.storyboard */; };
F45182C821BA803400209FC4 /* SPStorkTransitioningDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F45182C221BA803400209FC4 /* SPStorkTransitioningDelegate.swift */; };
F45182C921BA803400209FC4 /* SPStorkPresentingAnimationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F45182C321BA803400209FC4 /* SPStorkPresentingAnimationController.swift */; };
F45182CA21BA803400209FC4 /* SPStorkPresentationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F45182C421BA803400209FC4 /* SPStorkPresentationController.swift */; };
F45182CB21BA803400209FC4 /* SPStorkController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F45182C521BA803400209FC4 /* SPStorkController.swift */; };
F45182CC21BA803400209FC4 /* SPStorkIndicatorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F45182C621BA803400209FC4 /* SPStorkIndicatorView.swift */; };
F45182CD21BA803400209FC4 /* SPStorkDismissingAnimationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F45182C721BA803400209FC4 /* SPStorkDismissingAnimationController.swift */; };
F451849521BA824C00209FC4 /* SPVibration.swift in Sources */ = {isa = PBXBuildFile; fileRef = F45183F021BA824C00209FC4 /* SPVibration.swift */; };
F451849621BA824C00209FC4 /* SPPlayCircleButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = F45183F321BA824C00209FC4 /* SPPlayCircleButton.swift */; };
F451849721BA824C00209FC4 /* SPSocialButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = F45183F421BA824C00209FC4 /* SPSocialButton.swift */; };
@@ -139,22 +132,23 @@
F451850B21BA824C00209FC4 /* SPBufer.swift in Sources */ = {isa = PBXBuildFile; fileRef = F451849021BA824C00209FC4 /* SPBufer.swift */; };
F451850C21BA824C00209FC4 /* SPShare.swift in Sources */ = {isa = PBXBuildFile; fileRef = F451849221BA824C00209FC4 /* SPShare.swift */; };
F451850D21BA824C00209FC4 /* SPBadge.swift in Sources */ = {isa = PBXBuildFile; fileRef = F451849421BA824C00209FC4 /* SPBadge.swift */; };
F459D75421C3AB4F00798524 /* SPStorkTransitioningDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F459D74E21C3AB4F00798524 /* SPStorkTransitioningDelegate.swift */; };
F459D75521C3AB4F00798524 /* SPStorkPresentingAnimationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F459D74F21C3AB4F00798524 /* SPStorkPresentingAnimationController.swift */; };
F459D75621C3AB4F00798524 /* SPStorkPresentationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F459D75021C3AB4F00798524 /* SPStorkPresentationController.swift */; };
F459D75721C3AB4F00798524 /* SPStorkController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F459D75121C3AB4F00798524 /* SPStorkController.swift */; };
F459D75821C3AB4F00798524 /* SPStorkIndicatorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F459D75221C3AB4F00798524 /* SPStorkIndicatorView.swift */; };
F459D75921C3AB4F00798524 /* SPStorkDismissingAnimationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F459D75321C3AB4F00798524 /* SPStorkDismissingAnimationController.swift */; };
F459D75B21C3AB9A00798524 /* ModalViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F459D75A21C3AB9A00798524 /* ModalViewController.swift */; };
F459D75D21C3ABBD00798524 /* ModalTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F459D75C21C3ABBD00798524 /* ModalTableViewController.swift */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
F445CA8321AED92600184254 /* stork-controller.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "stork-controller.app"; sourceTree = BUILT_PRODUCTS_DIR; };
F445CA8621AED92600184254 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
F445CA8821AED92600184254 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
F445CA8B21AED92600184254 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
F445CA8821AED92600184254 /* Controller.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Controller.swift; sourceTree = "<group>"; };
F445CA8D21AED92700184254 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
F445CA9021AED92700184254 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
F445CA9221AED92700184254 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
F45182C221BA803400209FC4 /* SPStorkTransitioningDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPStorkTransitioningDelegate.swift; sourceTree = "<group>"; };
F45182C321BA803400209FC4 /* SPStorkPresentingAnimationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPStorkPresentingAnimationController.swift; sourceTree = "<group>"; };
F45182C421BA803400209FC4 /* SPStorkPresentationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPStorkPresentationController.swift; sourceTree = "<group>"; };
F45182C521BA803400209FC4 /* SPStorkController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPStorkController.swift; sourceTree = "<group>"; };
F45182C621BA803400209FC4 /* SPStorkIndicatorView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPStorkIndicatorView.swift; sourceTree = "<group>"; };
F45182C721BA803400209FC4 /* SPStorkDismissingAnimationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPStorkDismissingAnimationController.swift; sourceTree = "<group>"; };
F45183F021BA824C00209FC4 /* SPVibration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPVibration.swift; sourceTree = "<group>"; };
F45183F321BA824C00209FC4 /* SPPlayCircleButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPPlayCircleButton.swift; sourceTree = "<group>"; };
F45183F421BA824C00209FC4 /* SPSocialButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPSocialButton.swift; sourceTree = "<group>"; };
@@ -276,6 +270,14 @@
F451849021BA824C00209FC4 /* SPBufer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPBufer.swift; sourceTree = "<group>"; };
F451849221BA824C00209FC4 /* SPShare.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPShare.swift; sourceTree = "<group>"; };
F451849421BA824C00209FC4 /* SPBadge.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPBadge.swift; sourceTree = "<group>"; };
F459D74E21C3AB4F00798524 /* SPStorkTransitioningDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPStorkTransitioningDelegate.swift; sourceTree = "<group>"; };
F459D74F21C3AB4F00798524 /* SPStorkPresentingAnimationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPStorkPresentingAnimationController.swift; sourceTree = "<group>"; };
F459D75021C3AB4F00798524 /* SPStorkPresentationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPStorkPresentationController.swift; sourceTree = "<group>"; };
F459D75121C3AB4F00798524 /* SPStorkController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPStorkController.swift; sourceTree = "<group>"; };
F459D75221C3AB4F00798524 /* SPStorkIndicatorView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPStorkIndicatorView.swift; sourceTree = "<group>"; };
F459D75321C3AB4F00798524 /* SPStorkDismissingAnimationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPStorkDismissingAnimationController.swift; sourceTree = "<group>"; };
F459D75A21C3AB9A00798524 /* ModalViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModalViewController.swift; sourceTree = "<group>"; };
F459D75C21C3ABBD00798524 /* ModalTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModalTableViewController.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -293,7 +295,6 @@
isa = PBXGroup;
children = (
F445CA8521AED92600184254 /* stork-controller */,
F445CA8421AED92600184254 /* Products */,
);
sourceTree = "<group>";
};
@@ -303,6 +304,7 @@
F445CA8321AED92600184254 /* stork-controller.app */,
);
name = Products;
path = ..;
sourceTree = "<group>";
};
F445CA8521AED92600184254 /* stork-controller */ = {
@@ -310,11 +312,13 @@
children = (
F445CA9821AED98500184254 /* Frameworks */,
F445CA8621AED92600184254 /* AppDelegate.swift */,
F445CA8821AED92600184254 /* ViewController.swift */,
F445CA8A21AED92600184254 /* Main.storyboard */,
F445CA8821AED92600184254 /* Controller.swift */,
F459D75A21C3AB9A00798524 /* ModalViewController.swift */,
F459D75C21C3ABBD00798524 /* ModalTableViewController.swift */,
F445CA8D21AED92700184254 /* Assets.xcassets */,
F445CA8F21AED92700184254 /* LaunchScreen.storyboard */,
F445CA9221AED92700184254 /* Info.plist */,
F445CA8421AED92600184254 /* Products */,
);
path = "stork-controller";
sourceTree = "<group>";
@@ -322,25 +326,12 @@
F445CA9821AED98500184254 /* Frameworks */ = {
isa = PBXGroup;
children = (
F459D74D21C3AB4F00798524 /* SPStorkController */,
F45183EE21BA824C00209FC4 /* SparrowKit */,
F45182C121BA803400209FC4 /* SPStorkController */,
);
path = Frameworks;
sourceTree = "<group>";
};
F45182C121BA803400209FC4 /* SPStorkController */ = {
isa = PBXGroup;
children = (
F45182C221BA803400209FC4 /* SPStorkTransitioningDelegate.swift */,
F45182C321BA803400209FC4 /* SPStorkPresentingAnimationController.swift */,
F45182C421BA803400209FC4 /* SPStorkPresentationController.swift */,
F45182C521BA803400209FC4 /* SPStorkController.swift */,
F45182C621BA803400209FC4 /* SPStorkIndicatorView.swift */,
F45182C721BA803400209FC4 /* SPStorkDismissingAnimationController.swift */,
);
path = SPStorkController;
sourceTree = "<group>";
};
F45183EE21BA824C00209FC4 /* SparrowKit */ = {
isa = PBXGroup;
children = (
@@ -829,6 +820,19 @@
path = Badge;
sourceTree = "<group>";
};
F459D74D21C3AB4F00798524 /* SPStorkController */ = {
isa = PBXGroup;
children = (
F459D74E21C3AB4F00798524 /* SPStorkTransitioningDelegate.swift */,
F459D74F21C3AB4F00798524 /* SPStorkPresentingAnimationController.swift */,
F459D75021C3AB4F00798524 /* SPStorkPresentationController.swift */,
F459D75121C3AB4F00798524 /* SPStorkController.swift */,
F459D75221C3AB4F00798524 /* SPStorkIndicatorView.swift */,
F459D75321C3AB4F00798524 /* SPStorkDismissingAnimationController.swift */,
);
path = SPStorkController;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -889,7 +893,6 @@
files = (
F445CA9121AED92700184254 /* LaunchScreen.storyboard in Resources */,
F445CA8E21AED92700184254 /* Assets.xcassets in Resources */,
F445CA8C21AED92600184254 /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -903,7 +906,6 @@
F45184B421BA824C00209FC4 /* SPTextField.swift in Sources */,
F451849B21BA824C00209FC4 /* SPDownloadingButton.swift in Sources */,
F45184B721BA824C00209FC4 /* SPView.swift in Sources */,
F45182CB21BA803400209FC4 /* SPStorkController.swift in Sources */,
F45184D121BA824C00209FC4 /* SPSpotlight.swift in Sources */,
F45184C521BA824C00209FC4 /* SPImageTableViewCell.swift in Sources */,
F451850D21BA824C00209FC4 /* SPBadge.swift in Sources */,
@@ -914,10 +916,10 @@
F45184F221BA824C00209FC4 /* SPLayout.swift in Sources */,
F45184F821BA824C00209FC4 /* SPAnimation.swift in Sources */,
F45184A821BA824C00209FC4 /* SPNativeLoginViewController.swift in Sources */,
F459D75721C3AB4F00798524 /* SPStorkController.swift in Sources */,
F45184CE21BA824C00209FC4 /* SPVideoPlayer.swift in Sources */,
F45184E821BA824C00209FC4 /* SPUIImageViewExtenshion.swift in Sources */,
F45184EF21BA824C00209FC4 /* SPLocalNotification.swift in Sources */,
F45182CD21BA803400209FC4 /* SPStorkDismissingAnimationController.swift in Sources */,
F451849F21BA824C00209FC4 /* SPProposeViewController.swift in Sources */,
F45184E621BA824C00209FC4 /* SPUILabelExtenshion.swift in Sources */,
F45184F621BA824C00209FC4 /* SPAnimationSpring.swift in Sources */,
@@ -928,7 +930,9 @@
F45184A521BA824C00209FC4 /* SPStatusBarManagerViewController.swift in Sources */,
F451850721BA824C00209FC4 /* SPGolubevGolubevIconPack.swift in Sources */,
F451850021BA824C00209FC4 /* SPAudio.swift in Sources */,
F459D75921C3AB4F00798524 /* SPStorkDismissingAnimationController.swift in Sources */,
F45184BE21BA824C00209FC4 /* SPFormMailTableViewCell.swift in Sources */,
F459D75421C3AB4F00798524 /* SPStorkTransitioningDelegate.swift in Sources */,
F45184FD21BA824C00209FC4 /* SPTelegram.swift in Sources */,
F45184D221BA824C00209FC4 /* SPTypes.swift in Sources */,
F45184B821BA824C00209FC4 /* SPGradientView.swift in Sources */,
@@ -937,22 +941,22 @@
F45184BD21BA824C00209FC4 /* SPFormButtonTableViewCell.swift in Sources */,
F45184BA21BA824C00209FC4 /* SPTableView.swift in Sources */,
F451850321BA824C00209FC4 /* SPCodeAudioIconPack.swift in Sources */,
F445CA8921AED92600184254 /* ViewController.swift in Sources */,
F445CA8921AED92600184254 /* Controller.swift in Sources */,
F451850521BA824C00209FC4 /* SPCodeSystemIconPack.swift in Sources */,
F451850A21BA824C00209FC4 /* SPDelay.swift in Sources */,
F45182C821BA803400209FC4 /* SPStorkTransitioningDelegate.swift in Sources */,
F45184A621BA824C00209FC4 /* SPNativeLoginCodeViewController.swift in Sources */,
F451849721BA824C00209FC4 /* SPSocialButton.swift in Sources */,
F45184FC21BA824C00209FC4 /* SPViber.swift in Sources */,
F459D75D21C3ABBD00798524 /* ModalTableViewController.swift in Sources */,
F45184A021BA824C00209FC4 /* SPBaseTableViewController.swift in Sources */,
F45184E721BA824C00209FC4 /* SPCGSizeExtenshion.swift in Sources */,
F45182CC21BA803400209FC4 /* SPStorkIndicatorView.swift in Sources */,
F45184B221BA824C00209FC4 /* SPImagesLineCollectionView.swift in Sources */,
F45184F421BA824C00209FC4 /* SPShadowDeep.swift in Sources */,
F45184C921BA824C00209FC4 /* SPCollectionImagesTableViewCell.swift in Sources */,
F45184E221BA824C00209FC4 /* SPTextFieldExtenshion.swift in Sources */,
F45184A921BA824C00209FC4 /* SPImageView.swift in Sources */,
F45184B621BA824C00209FC4 /* SPDownloadingUIImageView.swift in Sources */,
F459D75621C3AB4F00798524 /* SPStorkPresentationController.swift in Sources */,
F45184EE21BA824C00209FC4 /* SPAppStore.swift in Sources */,
F45184E921BA824C00209FC4 /* SPUIColorExtension.swift in Sources */,
F45184DA21BA824C00209FC4 /* SPUIViewExtenshion.swift in Sources */,
@@ -961,7 +965,6 @@
F45184BF21BA824C00209FC4 /* SPFormLabelTableViewCell.swift in Sources */,
F45184DF21BA824C00209FC4 /* SPStrideableExtension.swift in Sources */,
F45184CD21BA824C00209FC4 /* SPGolubevIconView.swift in Sources */,
F45182CA21BA803400209FC4 /* SPStorkPresentationController.swift in Sources */,
F45184ED21BA824C00209FC4 /* SPNativeStyleKit.swift in Sources */,
F45184D021BA824C00209FC4 /* SPBlurView.swift in Sources */,
F45184E321BA824C00209FC4 /* SPUITabBarControllerExtenshion.swift in Sources */,
@@ -986,6 +989,7 @@
F45184C321BA824C00209FC4 /* SPFormTextTableViewCell.swift in Sources */,
F451850921BA824C00209FC4 /* SPRandom.swift in Sources */,
F451850B21BA824C00209FC4 /* SPBufer.swift in Sources */,
F459D75521C3AB4F00798524 /* SPStorkPresentingAnimationController.swift in Sources */,
F451849921BA824C00209FC4 /* SPSystemIconButton.swift in Sources */,
F45184F721BA824C00209FC4 /* SPAnimationAlpha.swift in Sources */,
F45184FB21BA824C00209FC4 /* SPTwitter.swift in Sources */,
@@ -996,11 +1000,11 @@
F45184F321BA824C00209FC4 /* SPShadow.swift in Sources */,
F45184A421BA824C00209FC4 /* SPNativeTableViewController.swift in Sources */,
F451849A21BA824C00209FC4 /* SPNativeLargeButton.swift in Sources */,
F45182C921BA803400209FC4 /* SPStorkPresentingAnimationController.swift in Sources */,
F451849521BA824C00209FC4 /* SPVibration.swift in Sources */,
F45184D421BA824C00209FC4 /* SPUIAlertControllerExtenshion.swift in Sources */,
F45184EC21BA824C00209FC4 /* SPConstraints.swift in Sources */,
F451850821BA824C00209FC4 /* SPDevice.swift in Sources */,
F459D75821C3AB4F00798524 /* SPStorkIndicatorView.swift in Sources */,
F45184C821BA824C00209FC4 /* SPTableViewCell.swift in Sources */,
F45184E521BA824C00209FC4 /* SPCGRectExtension.swift in Sources */,
F451850621BA824C00209FC4 /* SPCodeDraw.swift in Sources */,
@@ -1026,6 +1030,7 @@
F45184E421BA824C00209FC4 /* SPUINavigationControllerExtenshion.swift in Sources */,
F45184F521BA824C00209FC4 /* SPAnimationUpward.swift in Sources */,
F45184F121BA824C00209FC4 /* SPLaunch.swift in Sources */,
F459D75B21C3AB9A00798524 /* ModalViewController.swift in Sources */,
F45184D721BA824C00209FC4 /* SPUIFontExtenshion.swift in Sources */,
F451850C21BA824C00209FC4 /* SPShare.swift in Sources */,
F45184AC21BA824C00209FC4 /* SPCollectionViewCell.swift in Sources */,
@@ -1035,14 +1040,6 @@
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
F445CA8A21AED92600184254 /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
F445CA8B21AED92600184254 /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
F445CA8F21AED92700184254 /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
@@ -1184,7 +1181,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "by.ivanvorobei.stork-controller";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = 1;
};
name = Debug;
};
@@ -1202,7 +1199,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "by.ivanvorobei.stork-controller";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = 1;
};
name = Release;
};
@@ -7,6 +7,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
self.launch(rootViewController: Controller())
return true
}
@@ -32,6 +33,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
func launch(rootViewController: UIViewController) {
let frame = UIScreen.main.bounds
self.window = UIWindow(frame: frame)
self.window!.rootViewController = rootViewController
self.window!.makeKeyAndVisible()
}
}
@@ -1,24 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
</document>
+43
View File
@@ -0,0 +1,43 @@
import UIKit
class Controller: UIViewController {
var presentControllerButton = UIButton.init(type: UIButton.ButtonType.system)
var presentTableControllerButton = UIButton.init(type: UIButton.ButtonType.system)
override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = UIColor.white
self.presentControllerButton.setTitle("Show ViewController", for: .normal)
self.presentControllerButton.addTarget(self, action: #selector(self.presentModalViewController), for: .touchUpInside)
self.presentControllerButton.sizeToFit()
self.presentControllerButton.center.x = self.view.frame.width / 2
self.presentControllerButton.center.y = self.view.frame.height / 4 * 3
self.view.addSubview(self.presentControllerButton)
self.presentTableControllerButton.setTitle("Show TableController", for: .normal)
self.presentTableControllerButton.addTarget(self, action: #selector(self.presentModalTableViewController), for: .touchUpInside)
self.presentTableControllerButton.sizeToFit()
self.presentTableControllerButton.center.x = self.view.frame.width / 2
self.presentTableControllerButton.frame.origin.y = self.presentControllerButton.frame.bottomYPosition + 10
self.view.addSubview(self.presentTableControllerButton)
}
@objc func presentModalViewController() {
let modal = ModalViewController()
let transitionDelegate = SPStorkTransitioningDelegate()
modal.transitioningDelegate = transitionDelegate
modal.modalPresentationStyle = .custom
present(modal, animated: true, completion: nil)
}
@objc func presentModalTableViewController() {
let modal = ModalTableViewController()
let transitionDelegate = SPStorkTransitioningDelegate()
modal.transitioningDelegate = transitionDelegate
modal.modalPresentationStyle = .custom
present(modal, animated: true, completion: nil)
}
}
@@ -41,6 +41,18 @@ public struct SPStorkController {
}
}
static public func updatePresentingController(parent controller: UIViewController) {
if let presentationController = controller.presentedViewController?.presentationController as? SPStorkPresentationController {
presentationController.updatePresentingController()
}
}
static public func updatePresentingController(modal controller: UIViewController) {
if let presentationController = controller.presentationController as? SPStorkPresentationController {
presentationController.updatePresentingController()
}
}
static private func controller(for view: UIView) -> UIViewController? {
var nextResponder = view.next
while nextResponder != nil && !(nextResponder! is UIViewController) {
@@ -24,9 +24,13 @@ import UIKit
class SPStorkPresentationController: UIPresentationController, UIGestureRecognizerDelegate {
var isSwipeToDismissEnabled: Bool = true
var isTapAroundToDismissEnabled: Bool = true
var showIndicator: Bool = true
var customHeight: CGFloat? = nil
var transitioningDelegate: SPStorkTransitioningDelegate?
var pan: UIPanGestureRecognizer?
var tap: UITapGestureRecognizer?
private var indicatorView = SPStorkIndicatorView()
private var gradeView: UIView = UIView()
@@ -55,13 +59,14 @@ class SPStorkPresentationController: UIPresentationController, UIGestureRecogniz
private var scaleForPresentingView: CGFloat {
guard let containerView = containerView else { return 0 }
let factor = 1 - (topSpace * 2 / containerView.frame.height)
let factor = 1 - (self.topSpace * 2 / containerView.frame.height)
return factor
}
override var frameOfPresentedViewInContainerView: CGRect {
guard let containerView = containerView else { return .zero }
let yOffset: CGFloat = topSpace + 13
let additionTranslate = containerView.bounds.height - (self.customHeight ?? containerView.bounds.height)
let yOffset: CGFloat = self.topSpace + 13 + additionTranslate
return CGRect(x: 0, y: yOffset, width: containerView.bounds.width, height: containerView.bounds.height - yOffset)
}
@@ -82,6 +87,7 @@ class SPStorkPresentationController: UIPresentationController, UIGestureRecogniz
containerView.insertSubview(self.snapshotViewContainer, belowSubview: presentedViewController.view)
self.snapshotViewContainer.frame = initialFrame
self.updateSnapshot()
self.snapshotView?.layer.cornerRadius = 0
self.backgroundView.backgroundColor = UIColor.black
self.backgroundView.translatesAutoresizingMaskIntoConstraints = false
containerView.insertSubview(self.backgroundView, belowSubview: self.snapshotViewContainer)
@@ -145,14 +151,21 @@ class SPStorkPresentationController: UIPresentationController, UIGestureRecogniz
override func presentationTransitionDidEnd(_ completed: Bool) {
super.presentationTransitionDidEnd(completed)
guard let containerView = containerView else { return }
self.updateSnapshot()
self.presentedViewController.view.frame = self.frameOfPresentedViewInContainerView
self.snapshotViewContainer.transform = .identity
self.snapshotViewContainer.translatesAutoresizingMaskIntoConstraints = false
self.snapshotViewContainer.centerXAnchor.constraint(equalTo: containerView.centerXAnchor).isActive = true
self.updateSnapshotAspectRatio()
if self.isTapAroundToDismissEnabled {
self.tap = UITapGestureRecognizer.init(target: self, action: #selector(self.handleTap))
self.tap?.cancelsTouchesInView = false
self.snapshotViewContainer.addGestureRecognizer(self.tap!)
}
if self.isSwipeToDismissEnabled {
self.pan = UIPanGestureRecognizer(target: self, action: #selector(handlePan))
self.pan = UIPanGestureRecognizer(target: self, action: #selector(self.handlePan))
self.pan!.delegate = self
self.pan!.maximumNumberOfTouches = 1
self.pan!.cancelsTouchesInView = false
@@ -160,6 +173,10 @@ class SPStorkPresentationController: UIPresentationController, UIGestureRecogniz
}
}
@objc func handleTap() {
self.presentedViewController.dismiss(animated: true, completion: nil)
}
override func dismissalTransitionWillBegin() {
super.dismissalTransitionWillBegin()
guard let containerView = containerView else { return }
@@ -284,12 +301,17 @@ extension SPStorkPresentationController {
}
}
func updatePresentingController() {
if self.startDismissing { return }
self.updateSnapshot()
}
private func updatePresentedViewForTranslation(inVerticalDirection translation: CGFloat) {
if self.startDismissing { return }
let elasticThreshold: CGFloat = 120
let translationFactor: CGFloat = 1 / 2
if translation >= 0 {
let translationForModal: CGFloat = {
if translation >= elasticThreshold {
@@ -348,6 +370,11 @@ extension SPStorkPresentationController {
self.snapshotViewContainer.addSubview(currentSnapshotView)
self.constraints(view: currentSnapshotView, to: self.snapshotViewContainer)
self.snapshotView = currentSnapshotView
self.snapshotView?.layer.cornerRadius = self.cornerRadius
self.snapshotView?.layer.masksToBounds = true
if #available(iOS 11.0, *) {
snapshotView?.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner]
}
self.gradeView.removeFromSuperview()
self.gradeView.backgroundColor = UIColor.black
self.snapshotView!.addSubview(self.gradeView)
@@ -24,10 +24,16 @@ import UIKit
public final class SPStorkTransitioningDelegate: NSObject, UIViewControllerTransitioningDelegate {
public var isSwipeToDismissEnabled: Bool = true
public var isTapAroundToDismissEnabled: Bool = true
public var showIndicator: Bool = true
public var customHeight: CGFloat? = nil
public func presentationController(forPresented presented: UIViewController, presenting: UIViewController?, source: UIViewController) -> UIPresentationController? {
let controller = SPStorkPresentationController(presentedViewController: presented, presenting: presenting)
controller.isSwipeToDismissEnabled = self.isSwipeToDismissEnabled
controller.isTapAroundToDismissEnabled = self.isTapAroundToDismissEnabled
controller.showIndicator = self.showIndicator
controller.customHeight = self.customHeight
controller.transitioningDelegate = self
return controller
}
+2 -2
View File
@@ -4,6 +4,8 @@
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>StorkController</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
@@ -22,8 +24,6 @@
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
@@ -0,0 +1,75 @@
import UIKit
class ModalTableViewController: UIViewController {
let navBar = SPFakeBarView(style: .stork)
let tableView = UITableView()
override var preferredStatusBarStyle: UIStatusBarStyle { return .lightContent }
private var data = ["Assembly", "C", "C++", "Java", "JavaScript", "Php", "Python", "Swift", "Kotlin", "Assembly", "C", "C++", "Java", "JavaScript", "Php", "Python", "Objective-C", "Swift", "Kotlin", "Assembly", "C", "C++", "Java", "JavaScript", "Php", "Python", "Objective-C"]
override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = UIColor.white
self.modalPresentationCapturesStatusBarAppearance = true
self.tableView.delegate = self
self.tableView.dataSource = self
self.tableView.register(UITableViewCell.self, forCellReuseIdentifier: "Cell")
self.tableView.contentInset.top = self.navBar.height
self.tableView.scrollIndicatorInsets.top = self.navBar.height
self.tableView.contentInset.bottom = self.safeArea.bottom
self.tableView.scrollIndicatorInsets.bottom = self.safeArea.bottom
self.view.addSubview(self.tableView)
self.navBar.titleLabel.text = "Table"
self.navBar.leftButton.setTitle("Cancel", for: .normal)
self.navBar.leftButton.addTarget(self, action: #selector(self.dismissAction), for: .touchUpInside)
self.view.addSubview(self.navBar)
self.updateLayout(with: self.view.frame.size)
}
override public func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
super.viewWillTransition(to: size, with: coordinator)
coordinator.animate(alongsideTransition: { (contex) in
self.updateLayout(with: size)
}, completion: nil)
}
@available(iOS 11.0, *)
override public func viewLayoutMarginsDidChange() {
super.viewLayoutMarginsDidChange()
self.updateLayout(with: self.view.frame.size)
}
func updateLayout(with size: CGSize) {
self.tableView.frame = CGRect.init(origin: CGPoint.zero, size: size)
}
@objc func dismissAction() {
self.dismiss()
}
}
extension ModalTableViewController: UITableViewDataSource {
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath)
cell.textLabel?.text = data[indexPath.row]
cell.transform = .identity
return cell
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return data.count
}
}
extension ModalTableViewController: UITableViewDelegate {
func scrollViewDidScroll(_ scrollView: UIScrollView) {
SPStorkController.scrollViewDidScroll(scrollView)
}
}
@@ -0,0 +1,23 @@
import UIKit
class ModalViewController: UIViewController {
let navBar = SPFakeBarView(style: .stork)
override var preferredStatusBarStyle: UIStatusBarStyle { return .lightContent }
override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = UIColor.white
self.modalPresentationCapturesStatusBarAppearance = true
self.navBar.titleLabel.text = "View"
self.navBar.leftButton.setTitle("Cancel", for: .normal)
self.navBar.leftButton.addTarget(self, action: #selector(self.dismissAction), for: .touchUpInside)
self.view.addSubview(self.navBar)
}
@objc func dismissAction() {
self.dismiss()
}
}
@@ -1,47 +0,0 @@
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let tap = UITapGestureRecognizer(target: self, action: #selector(self.viewWasTapped))
view.addGestureRecognizer(tap)
print("Tap anymore for present modal controller")
}
@objc func viewWasTapped() {
let modal = ModalViewController()
let transitionDelegate = SPStorkTransitioningDelegate()
modal.transitioningDelegate = transitionDelegate
modal.modalPresentationStyle = .custom
present(modal, animated: true, completion: nil)
}
}
class ModalViewController: UIViewController {
let navBar = SPFakeBarView(style: .stork)
override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = UIColor.white
self.modalPresentationCapturesStatusBarAppearance = true
let tap = UITapGestureRecognizer(target: self, action: #selector(self.dismissAction))
view.addGestureRecognizer(tap)
self.navBar.titleLabel.text = "Title"
self.navBar.leftButton.setTitle("Cancel", for: .normal)
self.navBar.leftButton.addTarget(self, action: #selector(self.dismissAction), for: .touchUpInside)
self.view.addSubview(self.navBar)
}
@objc func dismissAction() {
self.dismiss()
}
override var preferredStatusBarStyle: UIStatusBarStyle {
return .lightContent
}
}
+60 -16
View File
@@ -1,10 +1,12 @@
<img src="https://rawcdn.githack.com/IvanVorobei/SPStorkController/90c836ec5649e77fb44ff727d7dad96d2009f3d8/Resources/SPStorkController - Name.svg"/>
Modal controller as in mail or Apple music application. Similar animation and transition. I tried to repeat all the animations, corner radius and frames. The controller supports gestures and Navigation Bar & work with ScrollView.
Modal controller as in mail or Apple music application. Similar animation and transition. I tried to repeat all the animations, corner radius and frames. The controller supports gestures and Navigation Bar & work with ScrollView. You can see [how use pod tutorial](https://youtu.be/wOTNGswT2-0) on youtube
Preview GIF loading `3mb`. Please, wait
<img src="https://rawcdn.githack.com/IvanVorobei/SPStorkController/0acd51bbe76ef48611e1bdd408aebb9c7d9b0ae6/resources/gif-mockup.gif" width="500">
<img src="https://rawcdn.githack.com/IvanVorobei/SPStorkController/c66764082c0d9bf11d0bd46d5fa458edb62044fe/Resources/gif-mockup - 3.gif" width="500">
You can download example [in AppStore](https://itunes.apple.com/app/id1446635818). If you want buy code of app on gif, please, [contact me](#contact). Source code can be used for educational purposes only
<img src="https://rawcdn.githack.com/IvanVorobei/SPStorkController/4b1c91dacc4d3f901fcab5c7efdff256a40c4381/Resources/SPStorkController - Donate.svg"/>
@@ -23,11 +25,6 @@ Or via CocoaPods:
pod 'SPStorkController'
```
and import library in class:
```swift
import SPStorkController
```
## How to use
Create controller and set `transitioningDelegate` to `SPStorkTransitioningDelegate` object. Use `present` or `dismiss` functions:
@@ -49,29 +46,60 @@ class ViewController: UIViewController {
}
```
Please, not init `SPStorkTransitioningDelegate` like here:
Please, _not_ init `SPStorkTransitioningDelegate` like here:
```swift
controller.transitioningDelegate = SPStorkTransitioningDelegate()
```
You get error about weak property.
You will get error about weak property.
### Light StatusBar
For set `light` status bar for presented controller, user `preferredStatusBarStyle` propert. Also set `modalPresentationCapturesStatusBarAppearance`. See example:
```swift
import UIKit
class ModalViewController: UIViewController {
override var preferredStatusBarStyle: UIStatusBarStyle {
return .lightContent
}
override func viewDidLoad() {
super.viewDidLoad()
self.modalPresentationCapturesStatusBarAppearance = true
}
}
```
### Parametrs
- Parametr `isSwipeToDismissEnabled` enable dissmiss by swipe gester. Defualt is `true`:
- Parameter `isSwipeToDismissEnabled` enables dissmiss by swipe gester. Defualt is `true`:
```swift
transitionDelegate.isSwipeToDismissEnabled = true
```
- Parametr `showIndicator` show or hide top arrow indicator. Defualt is `true`:
- Parameter `isTapAroundToDismissEnabled` enables dissmiss by tap parrent controller. Defualt is `true`:
```swift
transitionDelegate.isTapAroundToDismissEnabled = true
```
- Parameter `showIndicator` shows or hides top arrow indicator. Defualt is `true`:
```swift
transitionDelegate.showIndicator = true
```
- Parameter `customHeight` sets custom height for modal controller. Defualt is `nil`:
```swift
transitionDelegate.customHeight = 350
```
### Add Navigation Bar
You may want to add a navigation bar to your modal controller. Since it became impossible to change or customize the native controller in swift 4 (I couldnt even find a way to change the height of bar), I completely create navigation bar. Visually, it looks real, but it doesnt execute the necessary functions:
You may want to add a navigation bar to your modal controller. Since it became impossible to change or customize the native controller in swift 4 (I couldnt even find a way to change the height of bar), I had to completely create navigation bar. Visually, it looks real, but it doesnt execute the necessary functions:
```swift
import UIKit
@@ -114,9 +142,25 @@ func scrollViewDidScroll(_ scrollView: UIScrollView) {
}
```
### Work with UITableView & UICollectionView
Working with a collections classes is not difficult. In the `Example` folder you can find the implementation, however I will give a couple of tips to help the table look better.
For fist, if you use `SPFakeBarView`, don't forget set top insets for content & scroll indicator. Also I am recomeded set bottom insets:
```swift
tableView.contentInset.top = self.navBar.height
tableView.scrollIndicatorInsets.top = self.navBar.height
tableView.contentInset.bottom = self.safeArea.bottom
tableView.scrollIndicatorInsets.bottom = self.safeArea.bottom
```
Please, use also `SPStorkController.scrollViewDidScroll()` function in delegate for more intaractive with your collection or table view
## My projects
Here I would like to offer you my other projects
Here I would like to offer you my other projects.
### SPPermission
Project [SPPermission](https://github.com/IvanVorobei/SPPermission) for managing permissions with the customizable visual effects. Beautiful dialog increases the chance of approval (which is important when we request notification). Simple control of this module saves you hours of development. You can start using project with just two lines of code and easy customization!
@@ -131,8 +175,8 @@ pod 'SparrowKit'
```
## License
`SPStorkController` is released under the MIT license. Check LICENSE.md for details
`SPStorkController` is released under the MIT license. Check `LICENSE.md` for details
## Contact
If you need develop application or UI, write me to hello@ivanvorobei.by. I am develop design and ios apps. I am use `swift`. For request more functionality, you should create a new issue.
My apps in AppStore: [first account](https://itunes.apple.com/us/developer/polina-zubarik/id1434528595) & [second account](https://itunes.apple.com/us/developer/mikalai-varabei/id1435792103)
If you have any requirements to develop any application or UI, write to me at hello@ivanvorobei.by. I am developing iOS apps and creates designs too. I use `swift` for developing projects. For requesting more functionality, you should create a new issue.
Here are my apps in AppStore: [first account](https://itunes.apple.com/us/developer/polina-zubarik/id1434528595) & [second account](https://itunes.apple.com/us/developer/mikalai-varabei/id1435792103)
+1 -1
View File
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "SPStorkController"
s.version = "1.1.6"
s.version = "1.2"
s.summary = "Modal controller as mail or Apple music application"
s.homepage = "https://github.com/IvanVorobei/SPStorkController"
s.source = { :git => "https://github.com/IvanVorobei/SPStorkController.git", :tag => s.version }
@@ -41,6 +41,18 @@ public struct SPStorkController {
}
}
static public func updatePresentingController(parent controller: UIViewController) {
if let presentationController = controller.presentedViewController?.presentationController as? SPStorkPresentationController {
presentationController.updatePresentingController()
}
}
static public func updatePresentingController(modal controller: UIViewController) {
if let presentationController = controller.presentationController as? SPStorkPresentationController {
presentationController.updatePresentingController()
}
}
static private func controller(for view: UIView) -> UIViewController? {
var nextResponder = view.next
while nextResponder != nil && !(nextResponder! is UIViewController) {
@@ -24,9 +24,13 @@ import UIKit
class SPStorkPresentationController: UIPresentationController, UIGestureRecognizerDelegate {
var isSwipeToDismissEnabled: Bool = true
var isTapAroundToDismissEnabled: Bool = true
var showIndicator: Bool = true
var customHeight: CGFloat? = nil
var transitioningDelegate: SPStorkTransitioningDelegate?
var pan: UIPanGestureRecognizer?
var tap: UITapGestureRecognizer?
private var indicatorView = SPStorkIndicatorView()
private var gradeView: UIView = UIView()
@@ -55,13 +59,14 @@ class SPStorkPresentationController: UIPresentationController, UIGestureRecogniz
private var scaleForPresentingView: CGFloat {
guard let containerView = containerView else { return 0 }
let factor = 1 - (topSpace * 2 / containerView.frame.height)
let factor = 1 - (self.topSpace * 2 / containerView.frame.height)
return factor
}
override var frameOfPresentedViewInContainerView: CGRect {
guard let containerView = containerView else { return .zero }
let yOffset: CGFloat = topSpace + 13
let additionTranslate = containerView.bounds.height - (self.customHeight ?? containerView.bounds.height)
let yOffset: CGFloat = self.topSpace + 13 + additionTranslate
return CGRect(x: 0, y: yOffset, width: containerView.bounds.width, height: containerView.bounds.height - yOffset)
}
@@ -82,6 +87,7 @@ class SPStorkPresentationController: UIPresentationController, UIGestureRecogniz
containerView.insertSubview(self.snapshotViewContainer, belowSubview: presentedViewController.view)
self.snapshotViewContainer.frame = initialFrame
self.updateSnapshot()
self.snapshotView?.layer.cornerRadius = 0
self.backgroundView.backgroundColor = UIColor.black
self.backgroundView.translatesAutoresizingMaskIntoConstraints = false
containerView.insertSubview(self.backgroundView, belowSubview: self.snapshotViewContainer)
@@ -145,14 +151,21 @@ class SPStorkPresentationController: UIPresentationController, UIGestureRecogniz
override func presentationTransitionDidEnd(_ completed: Bool) {
super.presentationTransitionDidEnd(completed)
guard let containerView = containerView else { return }
self.updateSnapshot()
self.presentedViewController.view.frame = self.frameOfPresentedViewInContainerView
self.snapshotViewContainer.transform = .identity
self.snapshotViewContainer.translatesAutoresizingMaskIntoConstraints = false
self.snapshotViewContainer.centerXAnchor.constraint(equalTo: containerView.centerXAnchor).isActive = true
self.updateSnapshotAspectRatio()
if self.isTapAroundToDismissEnabled {
self.tap = UITapGestureRecognizer.init(target: self, action: #selector(self.handleTap))
self.tap?.cancelsTouchesInView = false
self.snapshotViewContainer.addGestureRecognizer(self.tap!)
}
if self.isSwipeToDismissEnabled {
self.pan = UIPanGestureRecognizer(target: self, action: #selector(handlePan))
self.pan = UIPanGestureRecognizer(target: self, action: #selector(self.handlePan))
self.pan!.delegate = self
self.pan!.maximumNumberOfTouches = 1
self.pan!.cancelsTouchesInView = false
@@ -160,6 +173,10 @@ class SPStorkPresentationController: UIPresentationController, UIGestureRecogniz
}
}
@objc func handleTap() {
self.presentedViewController.dismiss(animated: true, completion: nil)
}
override func dismissalTransitionWillBegin() {
super.dismissalTransitionWillBegin()
guard let containerView = containerView else { return }
@@ -284,12 +301,17 @@ extension SPStorkPresentationController {
}
}
func updatePresentingController() {
if self.startDismissing { return }
self.updateSnapshot()
}
private func updatePresentedViewForTranslation(inVerticalDirection translation: CGFloat) {
if self.startDismissing { return }
let elasticThreshold: CGFloat = 120
let translationFactor: CGFloat = 1 / 2
if translation >= 0 {
let translationForModal: CGFloat = {
if translation >= elasticThreshold {
@@ -348,6 +370,11 @@ extension SPStorkPresentationController {
self.snapshotViewContainer.addSubview(currentSnapshotView)
self.constraints(view: currentSnapshotView, to: self.snapshotViewContainer)
self.snapshotView = currentSnapshotView
self.snapshotView?.layer.cornerRadius = self.cornerRadius
self.snapshotView?.layer.masksToBounds = true
if #available(iOS 11.0, *) {
snapshotView?.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner]
}
self.gradeView.removeFromSuperview()
self.gradeView.backgroundColor = UIColor.black
self.snapshotView!.addSubview(self.gradeView)
@@ -24,10 +24,16 @@ import UIKit
public final class SPStorkTransitioningDelegate: NSObject, UIViewControllerTransitioningDelegate {
public var isSwipeToDismissEnabled: Bool = true
public var isTapAroundToDismissEnabled: Bool = true
public var showIndicator: Bool = true
public var customHeight: CGFloat? = nil
public func presentationController(forPresented presented: UIViewController, presenting: UIViewController?, source: UIViewController) -> UIPresentationController? {
let controller = SPStorkPresentationController(presentedViewController: presented, presenting: presenting)
controller.isSwipeToDismissEnabled = self.isSwipeToDismissEnabled
controller.isTapAroundToDismissEnabled = self.isTapAroundToDismissEnabled
controller.showIndicator = self.showIndicator
controller.customHeight = self.customHeight
controller.transitioningDelegate = self
return controller
}