Giter VIP home page Giter VIP logo

swifttweaks's People

Contributors

albinekcom avatar andymatuschak avatar atom-wintermute avatar aymericio avatar bryanjclark avatar ejensen avatar ericbuehl avatar erikpoort avatar hfossli avatar hs-abekert avatar ignazioc avatar ikesyo avatar jaredly avatar johntmcintosh avatar mac-cain13 avatar marmelroy avatar msmollin avatar nachosoto avatar pendowski avatar pyckamil avatar richy486 avatar sendyhalim avatar shivahuang avatar warpling avatar yutailang0119 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  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

swifttweaks's Issues

Add a "closure" Tweak Type

public struct TweakClosure {
    public let collectionName: String
    public let groupName: String
    public let tweakName: String
    internal let closure: () -> ()
}

The idea here: when you want to perform an action in your app only in certain debug builds, you could put it in a TweakClosure, and then call something like this:

MyTweakLibrary.evaluate(MyTweakLibrary.someTweakClosure)

You'd also want to have that TweakClosure conform to AnyTweak, so that it can be included in a TweakGroup, and displayed in a table cell with a little [RUN] button (I'm thinking it'd look like a little App Store [BUY] button)

"Umbrella header 'SwiftTweaks.h' not found"

HI!
Downloaded SwiftTweaks from Github
make no alterations in the project
try to build framework and get "Umbrella header 'SwiftTweaks.h' not found"
Search in Stackoverflow and it says that
"This usually happens after a project rename or something like that. The problem is that the umbrella header is no longer listed as a Public header."
(http://stackoverflow.com/questions/30355133/swift-framework-umbrella-header-h-not-found)
but I checked and the headers SwiftTweaks.h is already on the "public" headers section
Thanks in advance for any help!

Swift 3 migration

Hi,

are there any plans to support swift-3? I see a stale PR #63 and it looks like @richy486 fork is deleted. Should I submit a PR?

thanks,

Daniel

Add a TwoFingerTripleTap as a default option for TweakWindow.GestureType

A two-finger triple-tap is a commonly-used gesture when the shake gesture's already used for something else - let's make it super-easy for devs to use that instead of the shake gesture!

(Of course, devs can always use whatever custom gesture they'd want.)

Instead of:

public enum GestureType {
        case Shake
        case Gesture(UIGestureRecognizer)
    }

We'd have:

public enum GestureType {
        case Shake
        case TwoFingerTripleTap
        case CustomGesture(UIGestureRecognizer)
    }

Feature: long-press on cell to view "hint"

Sometimes, the collection + group + tweak names aren't enough to really communicate the effect of a tweak.

Maybe it'd be neat to optionally allow a longer "hint" text, to be displayed on long-pressing in the cell?

Would need to design the affordance for the long press, because it'll be rarely used, but I think it'd be helpful.

The hint would be presented in a UIAlertController.Alert

TweakViewController misaligned layout when Personal Hotspot Blue Bar showing

Hi,

Firstly thanks so much for this project! As a user of FBTweaks I've been waiting for a swift replacement, and I look forward to contributing if possible :)

I have noticed that the Personal Hotspot Blue Bar pushes the TweakViewController beyond the bottom of the window bounds. Screenshot attached:
img_4319

Cheers,

Daniel

"TweakGroup" templates (e.g. for animations)

So you can more easily create templates (think: the parameters of a spring animation) rather than having to create 4 separate tweak values.

The idea would be, you could create a struct that conforms to TweakGroupType.

Manual Installation

CocoaPods and Carthage are awesome tools and make our life really easier, but there are some devs who still don't know how to use them.

It would be cool to add the Manual installation guide in your README.md. You can take a look at my iOS Readme Template to see how you can do it.

Are bound Tweaks leaking the observation blocks?

We're using SwiftTweaks in a project and while using bind for a few Tweaks I was wondering when those observer closures are released. I skimmed through the source code and it appears to me that the closure given to bind is saved in a dictionary where it is strongly references forever.

If I'm not mistaken these bindings dictionaries are never cleaned up neither there is any API to unregister the binding. So everytime my ViewController is started I bind a new closure that will be around forever, this looks like a memory leak to me.

Is there anything I'm missing that resolved this memory issue? Or is this an issue and do we need to add some kind of unbind call to remove the closure from the list.

BindMultiple: pass current value of tweaks into the closure

Currently, if you're using bindMultiple, you need to do something like this:

let tweaksToWatch: [TweakType] = [ExampleTweaks.marginHorizontal, ExampleTweaks.marginVertical]
ExampleTweaks.bindMultiple(tweaksToWatch) {
    let horizontal = ExampleTweaks.assign(ExampleTweaks.marginHorizontal)
    let vertical = ExampleTweaks.assign(ExampleTweaks.marginVertical)
    scrollView.contentInset = UIEdgeInsets(top: vertical, right: horizontal, bottom: vertical, left: horizontal)
 }

It'd be neat to be able to do something like this instead:

let tweaksToWatch: [TweakType] = [ExampleTweaks.marginHorizontal, ExampleTweaks.marginVertical]
ExampleTweaks.bindMultiple(tweaksToWatch) { horizontal, vertical in
    scrollView.contentInset = UIEdgeInsets(top: vertical, right: horizontal, bottom: vertical, left: horizontal)
 }

I've found this helpful in http://github.com/robb/Cartography/

Layout bug in TweaksRootViewController

The tableviews in TweaksRootViewController often don't get the topLayoutGuide update (so their content scrolls under the navigation bar)

Doesn't reproduce now that we don't have the segmented controller in the nav bar (because you can't switch the tab, there's not a path to reproduce the error) but the underlying bug in the layout logic is still there!

Consider making TweakWindow.tweaksViewController `public` accessible

I would like to present the TweaksViewController from a button press, which works well, however, the FloatingTweakGroupViewController does not then display (as TweaksViewController.floatingTweaksWindowPresenter == nil in this case)

Making TweakWindow.tweaksViewController public allows for all the benefits of using TweakWindow triggered from any application event.

You can see a simple example on this fork: https://github.com/DanielAsher/SwiftTweaks/commits/fix/floating-window-on-tweak-manual-present

cheers,

Daniel

Text

I would love to have custom text to show information like API URL.

Allow FloatingTweakGroupViewController to be vertically dragged

I love the FloatingTweakGroupViewController - but sometimes the very part of the current view I'm trying to tweak is obscured by the floating window. Enabling a drag gesture on the floating window would allow us to reposition it and expose the hidden parts of the underlying view.

Support String as a TweakViewDataType

We didn't need this for our initial use of SwiftTweaks, but it'd be helpful to have!

Things to consider:

  • How would this support NSLocalizedString?
  • Need to design & build out UI for it (with nice keyboard support, dismiss on scrolling the tableview, etc).

Write value for tweak programmatically for unit tests

I need the ability to test behavior when a tweak is enabled/disabled. We are using Tweaks for feature flagging, false turns off in-development features for production.

Because I am scared new development features may affect production in an unexpected way, I would like to be able to unit test various modules which use tweak. Is there not a way to write a different value programmatically?

Add a "list" TweakType

Sometimes, you want to have a feature flag that has multiple options - for example, you might have 3 environments to point against (e.g. test, stage, production) and want to switch between them.

A couple of ideas for implementing this:

  1. A protocol, TweakableEnum, that can be used in a tweak easily. The protocol would probably require a static var caseNames: [String] to list out the options in the Tweaks UI. We'd also probably want a failable-init that returns the correct enum case for a given String (so that the enum can "look up" a persisted stringly-typed value.) This might depend on us building #14 first (adding String as a TweakableType).
  2. Use a tweak template to support lists.
  3. Make a tweak that simply holds a [String] and optionally has a default value (asserting if the default value doesn't exist in the array, and if no default given, uses the first value in the array). Leave it to the implementer to switch on the current value of the string - they can always build a string-based enum and init with rawValue: to get away from stringly-based stuff.

Anyhow, I've not yet tried building this out yet, so I dunno what will be easy-to-understand-and-implemented here. One goal for SwiftTweaks is to keep tweak libraries simple and straightforward - so while I'm inclined to do the "most precise and Swifty thing", it's even more important that SwiftTweaks remains easy-to-use for new folks, so that'll be a big criteria in evaluating which one of these will work!

Make FloatingTweakGroupViewController public

Original discussion here: #44

Much like TweaksViewController is public, we could probably do some investigation and make FloatingTweakGroupViewController public as well, so developers can use that component (without mucking around in TweakWindow's child objects).

For developers who aren't using TweakWindow, let's make the floating UI publicly usable - and include an optional init Bool for TweakViewController that hides the (+) buttons when not in use.

Add Tweak.valueInStore(TweakLibraryType) in a protocol extension

Something like:

public extension Tweak {
    func currentValueInStore<S: TweakLibraryType.class>(store: S) -> T {
        return store.assign(self)
    }
}

This would simplify getting values from tweaks, from:

let value = TweakStore.assign(TweakStore.some.tweak)

to

let value = TweakStore.some.tweak.currentValueInStore(TweakStore.self)

Floating TweakGroup window

Any TweakGroup (that is, the sections of the tableview inside a TweakCollection) should be "floatable" - that is, you could tap the little (+) button, and get a floating, minimizable pane that still allows for interaction in the view controller:

screen shot 2016-04-04 at 8 00 23 pm

View Controller

I would love to be able to push on a custom view controller for Swift Tweaks.

"Backups" feature

Often, when I've dialed in an animation, I want to be able to create a "backup" so I can go experiment more, knowing that I have a save point if I want to go back.

It'd be neat if we had the ability to create/update/read Backups. I would like that they use the same visual format as the email template we use when sharing a set of tweaks.

One interesting bit that'll arise from this: what happens if the underlying TweakLibraryType changes? Do we need some kind of randomly-generated-from-a-deterministically-derived-seed thing (where TweakStore creates a "version name" to ensure that a Backup can only be restored if the underlying version name is the same?)

Consider changing TweaksViewController.delegate from `unowned` to `weak`

In order to integrate with RxSwift's DelegateProxy mechanism, TweaksViewController.delegate could be changed from unowned to weak.

This gist shows the required DelegateProxy implementation and an example call to rx_pressedDone.

No dependency on RxSwift is required of the SwiftTweaks project

The required change to SwiftTweaks can be seen in this commit.

Please let me know if you would like me to submit a pull request.

EXC_BAD_ACCESS in testHexToColor

Not sure what's going on in testHexToColor, but there's an EXC_BAD_ACCESS for this test case:

HexToColorTestCase(string: "Hello", expectedColor: nil),

Any ideas?

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.