Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
SwiftTweaks
Search
Sho Ikeda
May 25, 2016
Programming
680
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
SwiftTweaks
関西モバイルアプリ研究会 #14での発表資料です #関モバ
http://kanmoba.connpass.com/event/31750/
Sho Ikeda
May 25, 2016
More Decks by Sho Ikeda
See All by Sho Ikeda
大規模アプリにおけるXcode Previews実用化までの道のり
ikesyo
0
31k
Package Traits
ikesyo
2
1.7k
Open Source Swift Workshop - Foundation and first party libraries
ikesyo
0
3.4k
Renovateで実現するライブラリの自動更新生活 / Automated Library Updates with Renovate
ikesyo
3
750
XcodeのDevelopment Assets探訪
ikesyo
1
1.5k
RenovateによるiOSライブラリーの自動更新
ikesyo
2
4.2k
2019年のSwiftモック事情
ikesyo
3
8.7k
5分でわかる!Xcode 11から使えるXCFrameworks
ikesyo
2
4.1k
Travis CIのBuild Matrixを活用して、Swift製ライブラリをLinux対応させる
ikesyo
3
2.7k
Other Decks in Programming
See All in Programming
UnityでSystem.Net.WebSocketsなWebSocketサーバが動かないのでUnity Monoのコードを覗いてみた / about implementing websocket server with unity mono
drumath2237
1
580
設計次第でAIコードの読む量は減らせる / designing-for-code-reading
minodriven
34
16k
Findy - エンジニア向け会社紹介/Findy Company Deck
findyinc
6
400k
phperだってパンチカードでコーディングしたい
o0h
PRO
0
280
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
5
5.1k
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
22
22k
コードレビューのボトルネックを"する側"と"される側"の両面から解消する
yub0n
2
1.6k
Jetpack Compose Mechanisms
skydoves
2
720
AI時代のコードレビューは人に向けるな、仕組みに向けろ
texmeijin
5
3.6k
Starting & Sustaining Code-Based E2E Testing for Non-Coding QA Teams( #jasstniigata )
teyamagu
PRO
1
970
When benchmarks go bad - what I learned from measuring performance wrong
hollycummins
0
200
KiroのSpecで「五目並べ」を作ってみる
satoshi256kbyte
1
370
Featured
See All Featured
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
How to train your dragon (web standard)
notwaldorf
96
6.9k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
530
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
270
sira's awesome portfolio website redesign presentation
elsirapls
0
450
Believing is Seeing
oripsolob
1
240
Amusing Abliteration
ianozsvald
1
340
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
560
Skip the Path - Find Your Career Trail
mkilby
1
250
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
450
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Transcript
SwiftTweaks @ikesyo ؔϞόΠϧΞϓϦݚڀձ #14, 2016-05-25 Wed #ؔϞό
@ikesyo • ͍͚͠ΐʔʗా ᠳ • ͯͳ@ژ • https://twitter.com/ikesyo • https://github.com/ikesyo
✨ Contributions ✨ • ReactiveCocoa • Carthage (Commandant, ReactiveTask) •
Result • Himotoki • APIKit
Tweaking
Why? • Parameters adjustment • Animation (location, duration, ...) •
Color • Layout • ... • Debug mode • Clear settings • Change API environment • Toggle experimental features • ... • And what you want
Facebook/Tweaks
Tweaks An easy way to fine-tune, and adjust parameters for
iOS apps in development.
Objective-C // Value CGFloat animationDuration = FBTweakValue(@"Category", @"Group", @"Duration", 0.5);
// Bind FBTweakBind(self.headerView, alpha, @"Main Screen", @"Header", @"Alpha", 0.85); FBTweakBind(webView.scrollView, scrollEnabled, @"Browser", @"Scrolling", @"Enabled", YES); // Action FBTweakAction(@"Player", @"Audio", @"Volume", ^{ NSLog(@"Action selected."); });
Swift // FBTweak~~ are macro, so those can't be used
in Swift let tweak = FBTweak(identifier: "com.tweaks.example.advanced") tweak.name = "Advanced settings" tweak.defaultValue = false let collection = FBTweakCollection(name: "Enable"); collection.addTweak(tweak) let category = FBTweakCategory(name: "Settings") category.addTweakCollection(collection) let store = FBTweakStore.sharedInstance() store.addTweakCategory(category) tweak.addObserver(self) func tweakDidChange(tweak: FBTweak!) { self.advancedSettingsEnabled = tweak.currentValue as Bool }
!!!
Khan/SwiftTweaks
SwiftTweaks Tweak your iOS app without recompiling! • Supported types
• Bool • Int • CGFloat • Double • UIColor • Group template • Floating window
Steps 1. Create a TweakLibraryType. 2. Reference that TweakLibraryType in
your code to use a Tweak. 3. Use the TweakWindow in your AppDelegate.
Make your TweakLibrary public struct ExampleTweaks: TweakLibraryType { public static
let colorTint = Tweak( "General", "Colors", "Tint", UIColor.blueColor()) public static let marginHorizontal = Tweak<CGFloat>( "General", "Layout", "H. Margins", defaultValue: 15, min: 0) public static let marginVertical = Tweak<CGFloat>( "General", "Layout", "V. Margins", defaultValue: 10, min: 0) public static let featureFlagMainScreenHelperText = Tweak( "Feature Flags", "Main Screen", "Show Body Text", true) public static let buttonAnimation = SpringAnimationTweakTemplate( "Animation", "Button Animation") ... }
Make your TweakLibrary public struct ExampleTweaks: TweakLibraryType { ... public
static let defaultStore: TweakStore = { let allTweaks: [TweakClusterType] = [colorTint, marginHorizontal, marginVertical, featureFlagMainScreenHelperText, buttonAnimation ] #if DEBUG let tweaksEnabled: Bool = true #else let tweaksEnabled: Bool = false #endif return TweakStore( tweaks: allTweaks, enabled: tweaksEnabled ) }() }
Using Your TweakLibrary // Assign button.tintColor = ExampleTweaks.assign(ExampleTweaks.colorTint) // Bind
ExampleTweaks.bind(ExampleTweaks.colorTint) { button.tintColor = $0 } // Bind multiple 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) }
Roadmaps Let's contribute! ✨ • "Backups" feature • Support String
as a TweakViewDataType • Add a "closure" Tweak Type • Design & Build tvOS UI • Design & Build iPad UI
☺☺☺
!" Happy Tweaking!! "!
Thank you❗"