ivanvorobei / splarkcontroller Goto Github PK
View Code? Open in Web Editor NEWCustom transition between controllers. Settings controller for your iOS app.
Home Page: https://opensource.ivanvorobei.io
License: MIT License
Custom transition between controllers. Settings controller for your iOS app.
Home Page: https://opensource.ivanvorobei.io
License: MIT License
When using your code (which is great) with SwiftPackageManger, some Classes can not be accessed (like SPLarkPresentationController).
Think they need marked as public to be available in the package.
Is there a way to update the snapshot? I need to display the effects of selecting settings in Settings controller which is presented as lark
Although this is not part of the current implementation, would you have any suggestions on how to change the view controller's height after it has been presented?
An example use case for this behavior would be a settings view controller with a textfield which moves up when the keyboard appears.
hi sir
i go the lark controller with press a button
and in lark controller i type a text in text field and then i press a button
and i want send my text to parent controller
when i back to parent controller nothings changed
whats my problem ?
here is my code
thanks
`import UIKit
import SPLarkController
class ViewController: UIViewController {
@IBOutlet weak var labelResult: UILabel!
internal var labelText = ""
@IBAction func goToLarkController(_ sender: Any) {
let vc = storyboard?.instantiateViewController(withIdentifier: "ViewController2")
let transitionDelegate = SPLarkTransitioningDelegate()
vc?.transitioningDelegate = transitionDelegate
vc?.modalPresentationStyle = .custom
vc?.modalPresentationCapturesStatusBarAppearance = true
self.present(vc!, animated: true, completion: nil)
}
override func viewDidLoad() {
super.viewDidLoad()
labelResult.text = labelText
}}`
`import UIKit
import SPLarkController
class ViewController2: UIViewController {
@IBOutlet weak var t: UITextField!
@IBAction func act(_ sender: UIButton) {
let backToMainController = storyboard?.instantiateViewController(withIdentifier: "ViewController") as! ViewController
backToMainController.labelText = t.text!
let transitionDelegate = SPLarkTransitioningDelegate()
backToMainController.transitioningDelegate = transitionDelegate
dismiss(animated: true, completion: nil)
SPLarkController.updatePresentingController(modal: backToMainController)
}
override func viewDidLoad() {
super.viewDidLoad()
}
}`
Coming back to this library to give it another go in a project but I noticed a visual bug with the presentation as it briefly flashes the target view controller in front of the snapshot before the snapshot animates up to reveal the underlying view controller.
I've attached a video of the bug in the simulator when showing the destination view controller.
Note that it doesn't happen all the time and also happens on a physical device.
Here is the code that I'm using to present the view controller:
let transitionDelegate = SPLarkTransitioningDelegate()
transitionDelegate.customHeight = self.view.frame.height * 0.60
palleteVC.transitioningDelegate = transitionDelegate
palleteVC.modalPresentationStyle = .custom
palleteVC.modalPresentationCapturesStatusBarAppearance = true
self.present(palleteVC, animated: true, completion: nil)
This never happened when I tried out this library for another project back in 2019.
Not sure if its the UIHostingViewController that is being presented or if its something to do with iOS 15
Thanks!
Hi, been trying to use this library to present one of my own custom VCs but I can't work out why the height of the presented view controller using lark doesn't have the same height as the custom height provided to the transition delegate. For example, ive told the delegate to be half the screen size which works for the transition but the view controller that is presented is still the same height as the screen height. This means that any views pinned to the bottom of the safe area for example are missing when using Lark.
in this screen shot, you can see that the pink button is cut off even though it is constrained to be centre vertical and centre horizontal.
Is there anyway to force the presented view controller's frame to match the frame of the lark transition? I've tried messing with the code in the library and can't seem to get it to work. I've noticed that frameOfPresentedViewInContainerView method never gets called in the presentation controller.
override var frameOfPresentedViewInContainerView: CGRect { guard let containerView = containerView else { return .zero } print("frameOfPresentedViewInContainerView") return CGRect(x: 0, y: containerView.bounds.height - self.height, width: containerView.bounds.width, height: self.height) }
I know u have just created it, an it's amazing, so please, consider to add objective-c support
Hello, after i dismiss i want to refresh the parent controller. But it does not work.
let controller = UIViewAcknoledge() controller.modalPresentationStyle = .custom SPLarkController.updatePresentingController(modal: controller) self.presentAsLark(controller)
TestSwiftUIView.swift
Beside that:
let controller = viewCtrl
?!
self.button.addTarget(self, action: #selector(self.presentLarkController), for: .touchUpInside)
Selector calling iOS 13.0+ available method needs to be in #available check as well.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.