Comments (7)
When you're using custom cells, you're responsible for storing the value in NSUserDefaults. In the sample app, this is done by -[MainViewController textViewDidChange:]
.
from inappsettingskit.
are you talking about in the mainViewController.m file in this #pragma mark UITextViewDelegate (for CustomViewCell)
- (void)textViewDidChange:(UITextView *)textView {
[[NSUserDefaults standardUserDefaults] setObject:textView.text forKey:@"customCell"];
[[NSNotificationCenter defaultCenter] postNotificationName:kIASKAppSettingChanged object:@"customCell"];
}
i am just stuck with how to determine which one has changed eg cusotmCell or customCelltwo
from inappsettingskit.
yep!
from inappsettingskit.
forgive me for being a noob at this but how can i determine which forKey to set? i am assuming it would be something like
if (key.title isEqualtoString:@"customCell"){
[[NSUserDefaults standardUserDefaults] setObject:textView.text forKey:@"customCell"];
[[NSNotificationCenter defaultCenter] postNotificationName:kIASKAppSettingChanged object:@"customCell"];
} else if (key.title isEqualtoString:@"customCellTwo"){
[[NSUserDefaults standardUserDefaults] setObject:textView.text forKey:@"customCellTwo"];
[[NSNotificationCenter defaultCenter] postNotificationName:kIASKAppSettingChanged object:@"customCellTwo"];
}
from inappsettingskit.
is there already a builtin function to determine this and i am just over looking it?
from inappsettingskit.
Oh, now I get what you mean. Indeed, you need a mechanism to differentiate the textViews. I recommend setting different tags in your -tableView:cellForSpecifier:
method. Like cell.textView.tag = 1
for your first textView and 2 for your second. Then, in your -textViewDidChange:
method, you can check for the tag and set your key depending on that. Be aware that tags are integer values so you can't directly use the key here.
from inappsettingskit.
thats great i didnt know you could use the tag like that. A++ for you my friend.
from inappsettingskit.
Related Issues (20)
- swift version HOT 1
- No entries is displayed on macOS HOT 1
- Done button did not work when following instructions HOT 2
- Does not compile on ios versions < 14 HOT 6
- Which object should be passed when posting a kIASKAppSettingChanged notification? HOT 3
- How to set TableView to "Grouped" style using Interface Builder. HOT 1
- Bad alignment for "compact" Date pickers HOT 4
- Migrate to Swift
- InAppSettingsKit broken for SPM integrations on XCode 13-beta3 HOT 3
- System Image Support HOT 5
- Date picker cell styling HOT 1
- Headers missing for Carthage framework HOT 1
- FooterText not wrapping HOT 15
- New
- Release the fix done for Carthage headers HOT 1
- Bb
- Cannot paste in text field HOT 2
- Disable Multiline Text view HOT 3
- When using IASKSegueIdentifier, the row is not deselected when closing the presented view controller
- How to show Large Navigation Title HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from inappsettingskit.