Coder Social home page Coder Social logo

vhesener / closures Goto Github PK

View Code? Open in Web Editor NEW
1.7K 1.7K 147.0 3.99 MB

Swifty closures for UIKit and Foundation

License: MIT License

Objective-C 0.07% Swift 99.84% Shell 0.08%
carthage closures cocoapods convenience-methods datasource delegation kvo swift uibutton uicollectionview uicontrol uigesturerecognizer uiimagepickercontroller uipickerview uiscrollview uitableview uitextfield uiview

closures's People

Contributors

alexamin avatar bartleby avatar eseay avatar vhesener avatar yoiang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

closures's Issues

App Store rejection for not including NSPhotoLibraryUsageDescription

I have no use of user's photo library into my app yet my app got rejected.
I created a build of my app and submitted it to iTunes Connect and got the following rejection a few minutes later in an automated email:
This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSPhotoLibraryUsageDescription key with a string value explaining to the user how the app uses this data.
I was able to track down the cause of the rejection to this method into UIImagePickerController.swift file:
public convenience init(source: UIImagePickerControllerSourceType = .photoLibrary, allow: UIImagePickerController.MediaFilter = .image, cameraOverlay: UIView? = nil, showsCameraControls: Bool = true, didCancel: @escaping ( _ picker: UIImagePickerController) -> Void = dismissFromPresenting, didPick: @escaping (_ result: UIImagePickerController.Result, _ picker: UIImagePickerController) -> Void) {...
I take it that an app that makes any UIImagePickerController call (even if it’s not actually requesting access to the user’s photo library) must include an entry for NSPhotoLibraryUsageDescription in its Info.plist.

UIView not release

addTapGesture or longGesture for UIView instance cause UIViewController not release when pop or dismiss

UITextView

Looks like you're tracking requests here - have you considered adding for UITextView?

Clear handler?

Example

button.onTap(handler:{
    // do stuff
})

How do I clear this handler to avoid a leak when my VC is deallocated?

i have a question ask you ,about xcode source extension

hi cat
Recently, I was developing an xcode extension, but during the development process, I found that I could not make a network request in the development. He would not identify the host name, and I would like to know if you have had this kind of problem. Or are there any good solutions? Looking forward to your reply

UIViewController

It would be reaaaaally nice to have life cycle methods:
viewDidLoad
will/did appear/disappear
etc.

Thanks for this nice kit!

Unit testing code coverage inside the closure

Is there any way to write Unit Test that can cover the code inside the closure block?

For example, here's a block of code I'd like to cover. How can I trigger the textField closure?

Screen Shot 2022-12-09 at 15 21 37

cocoapod 找不到 Closures 这个库

[!] CocoaPods could not find compatible versions for pod "Closures":
In Podfile:
Closures

Specs satisfying the Closures dependency were found, but they required a higher minimum deployment target.
chenshuodeMac-mini:SSJCMall chenshuo$ pod install
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "Closures":
In Podfile:
Closures

Specs satisfying the Closures dependency were found, but they required a higher minimum deployment target.

Memory leak

In Core.swift on line 130 there is self?.removeObserver(observer!) but I believe directly after this you should have:
observer = nil

You do this currently:

self?.removeObserver(observer!)
observer = nil

for lines 136-137 and 172-173 but I think its missing in the above scenario. I notice when I use Xcode Instruments > Leaks that I see memory leaks. Adding the above removes the leaks for me.

Dependency "Closures" has no shared framework schemes

When attempting to build Closures using Carthage I receive the error

Dependency "Closures" has no shared framework schemes

I haven't developed a framework before but it seems that that would also preclude Closures from supporting building for specific platforms (e.g., carthage update --platform iOS)

is Closures doesn't support custom-observed property in swift ?

i define an observed property, and use observe(_, until: _, changeHandler: _) to get value changed callback,
most of time it works fine, but in iOS 10.3.3, i receive a crash log!
crash description: " *** was deallocated while key value observers were still registered with it";

i declare property like this
class Person {
@objc dynamic var age: Int = 18
}

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.