GithubHelp home page GithubHelp logo

ivanvorobei / splarkcontroller Goto Github PK

View Code? Open in Web Editor NEW
983.0 20.0 47.0 4.6 MB

Custom transition between controllers. Settings controller for your iOS app.

Home Page: https://opensource.ivanvorobei.io

License: MIT License

Swift 99.94% Ruby 0.06%
ui swift settings animation controller modal gester ux custom transition

splarkcontroller's Issues

Some classes need to be public to work in SPM

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.

Any way to change height after presenting?

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.

Issue with Swift Package Manager support

Big thanks for this beautiful library! Unfortunately I cannot get it to install via SPM, I get the error saying Source files for target SPLark should be located under 'Sources/SPLark', or a custom sources path can be set with the 'path' property in Package.swift

Zrzut ekranu 2020-06-4 o 21 54 52

update parent controller

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()

}

}`

iOS 15 - Presented view controller appears briefly in front of the snapshot before transition

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.

Simulator.Screen.Recording.-.iPhone.12.-.2022-05-14.at.17.22.19.mp4

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!

Round snapshot view corners

Hi, thanks for beautiful library!
Is there a way to round snapshot view corners for this case?
My main view consists of tab bar + scroll view.

image

Thanks in advance.

Custom height for Lark presenter doesn't actually make the sub VC same height as custom height

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.
IMG_1852

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) }

Objective-c support

I know u have just created it, an it's amazing, so please, consider to add objective-c support

refresh parent.

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)

Example project not compiling

  1. Build input file cannot be found:
    TestSwiftUIView.swift

Beside that:

  1. let controller = viewCtrl ?!

  2. 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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.